Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Costing

Authors: Terry Lucey

6th Edition

0826455107, 9780826455109

More Books

Students also viewed these Accounting questions

Question

What do you think is the objective of financial statements?

Answered: 1 week ago

Question

=+interactive online components, out-of-home messages, print ads,

Answered: 1 week ago

Question

=+Why does the brand want to advertise?

Answered: 1 week ago

Question

=+12. Did your concept illustrate the brand's personality?

Answered: 1 week ago