In: Math
Math 473: R Homework #4 Name: Due: Thursday, November 7th at the beginning of class; if your homework is submitted at the end of class or later, it will be considered late. Please print this sheet and staple it to the front of your homework. You will not receive any credit for your program if it does not run, if you did not call the program from the R Console window, you call your program more than once from the R Console window, or your program is not done 100% in R. If you write your program line by line at the R prompt, or copy and paste it into the R prompt or submit more than one R program you will not receive any credit. You will not receive any credit for your program if your font is too small (less than 8) to be readable. You will not receive any credit if you do not use the “list” command or a command that performs the same function as “list”. See previous templates for examples. Write one R program to answer the following questions: 1. 48% of men consider themselves professional baseball fans. You randomly select 10 men and ask each if he considers himself a professional baseball fan. Determine the probability that the number of men who consider themselves baseball fans is exactly eight. 2. Fifty-five percent of households say they would feel secure if they had $50,000 in savings. You randomly select 8 households and ask them if they would feel secure if they had $50,000 in savings. Determine the probability that the number of households that say they would feel secure is more than five. 3. 32% of adults say cashews are their favorite kind of nut. You randomly select 12 adults and ask each to name his or her favorite nut. Determine the probability that the number of adults who say cashews are their favorite nut is at most two. 4. 29% of college students say they use credit cards because of the rewards program. You randomly select 10 college students and ask each to name the reason he or she uses credit cards. Determine the probability that the number of college students who say they uses credit cards because of the rewards program is between two and five inclusive. 5. Sixty-six percent of pet owners say they consider their pet to be their best friend. You randomly select 11 pet owners and ask them if they consider their pet to be their best friend. Determine the probability that the number of pet owners who say their pet is their best friend is at least eight. Type a comment next to each line in the R program. The comments should describe what each line does. Hint: See the Probability Distributions handout on Blackboard. Hint: Use the “list” command at the end of the program (see the dice template); assign your answers to variables. Submit a printed version of the following: 1. R program 2. Program output: answers to each of the 5 questions Grade distribution: 15 points: function comments 10 points: R Console window (need to show that you compiled the function using the source command, and need to show that you called the function) 75 points: function output (print R Console screen; 15 points for the correct answer to each problem; print R Console screen).
Please i need full R program not only the out put i need the program line by line from the syntax to the out put.. thank you