Math 473: R Homework #4 Name: Due: Thursday, November 7th at thebeginning of class; if your homework is submitted at the end ofclass or later, it will be considered late. Please print this sheetand staple it to the front of your homework. You will not receiveany credit for your program if it does not run, if you did not callthe program from the R Console window, you call your program morethan once from the R Console window, or your program is not done100% 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 Rprogram you will not receive any credit. You will not receive anycredit for your program if your font is too small (less than 8) tobe 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 toanswer the following questions: 1. 48% of men consider themselvesprofessional baseball fans. You randomly select 10 men and ask eachif he considers himself a professional baseball fan. Determine theprobability that the number of men who consider themselves baseballfans is exactly eight. 2. Fifty-five percent of households say theywould feel secure if they had $50,000 in savings. You randomlyselect 8 households and ask them if they would feel secure if theyhad $50,000 in savings. Determine the probability that the numberof households that say they would feel secure is more than five. 3.32% of adults say cashews are their favorite kind of nut. Yourandomly select 12 adults and ask each to name his or her favoritenut. Determine the probability that the number of adults who saycashews are their favorite nut is at most two. 4. 29% of collegestudents say they use credit cards because of the rewards program.You randomly select 10 college students and ask each to name thereason he or she uses credit cards. Determine the probability thatthe number of college students who say they uses credit cardsbecause of the rewards program is between two and five inclusive.5. Sixty-six percent of pet owners say they consider their pet tobe their best friend. You randomly select 11 pet owners and askthem if they consider their pet to be their best friend. Determinethe probability that the number of pet owners who say their pet istheir best friend is at least eight. Type a comment next to eachline in the R program. The comments should describe what each linedoes. Hint: See the Probability Distributions handout onBlackboard. Hint: Use the “list†command at the end of the program(see the dice template); assign your answers to variables. Submit aprinted 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 thatyou compiled the function using the source command, and need toshow that you called the function) 75 points: function output(print R Console screen; 15 points for the correct answer to eachproblem; print R Console screen).
Please i need full R program not only the out put i need theprogram line by line from the syntax to the out put.. thank you