Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Playing the lottery a (1) Complete the following code of a function that simulates playing the lotto 6/49 with the same ticket until you win
Playing the lottery a (1) Complete the following code of a function that simulates playing the lotto 6/49 with the same ticket until you win the jackpot. You must insert code where it says HERE NOTE: If you copy past this chunk, you need to remove the text eval=FALSE, include=FALSE' from your version so that the code will display and run. (i) To test the code, first modify it so that it simulates the lotto 4/49 (sample of 4 numbers instead of 6). It should complete faster, and help you debug any problems you may have. Present this modified code and its result. (ii) Run the code for the lotto 6/49. The value returned by the function gives the number of times you had to play before winning the jackpot. The code will probably take several minutes to terminate, so be patient (do something else while it runs). (iv) Assuming you play once a week, how many years did it take before winning the jackpot? (V) Assuming each ticket cost $3, and that the jackpot is $16,000,000, what is your net earnings after playing this many times? Playing the lottery a (1) Complete the following code of a function that simulates playing the lotto 6/49 with the same ticket until you win the jackpot. You must insert code where it says HERE NOTE: If you copy past this chunk, you need to remove the text eval=FALSE, include=FALSE' from your version so that the code will display and run. (i) To test the code, first modify it so that it simulates the lotto 4/49 (sample of 4 numbers instead of 6). It should complete faster, and help you debug any problems you may have. Present this modified code and its result. (ii) Run the code for the lotto 6/49. The value returned by the function gives the number of times you had to play before winning the jackpot. The code will probably take several minutes to terminate, so be patient (do something else while it runs). (iv) Assuming you play once a week, how many years did it take before winning the jackpot? (V) Assuming each ticket cost $3, and that the jackpot is $16,000,000, what is your net earnings after playing this many times
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started