Question: (i) Complete the following code of a function that simulates playing the lotto 6/49 with the same ticket until you win the jackpot. You

(i) Complete the following code of a function that simulates playing the lotto 6/49 with the same ticket until you win the ja (i) Complete the following code of a function that simulates playing the 

(i) Complete the following code of a function that simulates playing the lotto 6/49 with the same ticket until you win the jackpot. You have to insert code where it says HERE. play_lotto (i) 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 that the code will display and run. version so (ii) 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. (iii) 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

3.52 Rating (149 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Note The Sample run for 649 Lotto run is runing for more than an hour So fo... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!