Login

Contact Us
Homework
Homework Questions? Ask a Tutor for Answers ASAP
Not a Homework Question?
How JustAnswer Works:
Ask an Expert
Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
Get a Professional Answer
Via email, text message, or notification as you wait on our site.
Ask follow up questions if you need to.
100% Satisfaction Guarantee
Rate the answer you receive.
Ask Scott Your Own Question
Scott
,
MIT Graduate
Category:
Homework
Satisfied Customers:
3040
Experience:
MIT Graduate (Math, Programming, Science, and Music)
3546829
Type Your Homework Question Here...
Scott is online now
Your assignment is to use a random number generator to explore
Customer Question
Your assignment is to use a random number generator to explore the game of roulette. A Eurpean roulette wheel has the following numbers: using pascal
Single zero wheel: 0321519421225173462713361130823105241633120143192218297281235326
Despite the true mathematics of the matter, “0” is considered neither “odd” nor “even” when someone bets on the ball landing in an odd or even slot. (This is another way in which the house always wins in gambling.)
Many movies and stories have people making outlandish amounts of money by placing a bet on a single number, winning, and then leaving the winnings on that same number and, miraculously, winning again. Let’s assume that each of the 37 numbers is equally likely to come up on any spin of the wheel. How unlikely is that any number comes up twice in a row? And how unlikely is it for the fabled, lucky bettor to win twice in a row by betting the same number? (Be careful… these are two different answers!)
It is relatively straightforward to answer both of these questions using logic and statistics. However, you are to do it using simulations. (Such simulations are called “Monte Carlo simulations.” Really!) Use your random number generator as if it were a roulette wheel. Throw a random integer between 0 and 36 inclusive. Each random number generated will represent one spin of the wheel, with the small ball landing in the slot with that number. Answer the following questions empirically using the results of your simulation:
A. On average, how often does a number come up two times in a row? On average, how often does a number come up three times in a row?
B. If you pick a PARTICULAR number, how long does it take for that number to come up twice in a row? Let’s make the number 13, just for fun.
C. What is the longest run of evens in a row in your simulation? What is the longest run of odds in a row? (Remember that 0 is classified as neither odd nor even.)
You must do at least the following simulations. You may do more, but not less:
1. Do 10,000 spins of the wheel and answer the questions above.
2. Do 1,000,000 spins, and answer the questions above.
3. Do 100,000,000 spins, and answer the questions above.
4. Do 10,000,000,000 spins and answer the questions above. (It may take a long time to run this.)
Be careful to use qword instead of int variables for the appropriate declarations since some of these numbers will be way over 32,767 (the limit of a Pascal int).
Also, while you are debugging your program, it is wise to print out to the screen frequently so you can see what’s going on (and perhaps what’s going wrong!). But once you start running programs that do LOTS of calculations, then do input and output sparingly; input and output require FAR more time than other calculations, and you want simulations doing millions of trials to go quickly, not slowly.
Submitted:
1 year ago.
Category:
Homework
Share this conversation
Expert:
Mr. Gregory White
replied 1 year ago.
Hello, my name is Greg.
I see this might be time sensitive.
Do you still need this answered?
Ask Your Own Homework Question
Share this conversation
Related Homework Questions
Question
Date Submitted
I have a column that divides j/s. This sometimes results in
1/16/2017
1/16/2017
HomeworkPete
Translate the sentence below into English. Pienso que nunca
1/8/2017
1/8/2017
Lane
I need help with my preexam for Penn high school this is
12/30/2016
1/4/2017
Wiz of All
NOT GLENN NOR F. NAZ PLEASE In the story titled "Macbeth" by
12/29/2016
12/29/2016
Manal Elkhoshkhany
Exam Number: 986159RR
12/26/2016
1/15/2017
GLENN
Need help with a couple assignment questions
12/24/2016
12/24/2016
StructuralEng
FOR LogicPro Only, I have another database question. Its a
12/19/2016
12/20/2016
LogicPro
Convert any of your earlier programs that use message boxes
12/15/2016
1/13/2017
LogicPro
Read the Funeral Oration of Pericles in the Ancient History
12/14/2016
12/16/2016
Donna Kakonge
Ineed help with chemstry exams, i have a few exams that i
12/14/2016
12/14/2016
GLENN
X
Ask a Tutor
Get a Professional Answer. 100% Satisfaction Guaranteed.
62 Tutors are Online Now
Type Your Homework Question Here...
characters left: