Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Filename: roulette.py Also submit: A screenshot (or download) of your plots Data scientists often run simulations to better understand how a probability-based scenario is likely

image text in transcribed
Filename: roulette.py Also submit: A screenshot (or download) of your plots Data scientists often run simulations to better understand how a probability-based scenario is likely to play out. In this homework we'll run a simulation to see if Kayla or Laney has luck in the casino. Kayla and Laney head to the Encore casino one day after work to play roulette. In this game, the wheel is spun and randomly lands on a number from 0-36 (inclusive). Here are their strategies: - Kayla always bets on odd. She wins anytime the wheel lands on 1,3,5,,35. She has a good chance of winning each time, but the payout is only $5. - Laney always bets on 31 and 32. She wins only when the wheel lands on 31 or 32 . She has only a 2/37 chance of winning each time, but the payout is $50. They each start off with $0, and decide to play until one of them earns $50,000. (For this homework, don't worry about the money they need to pay to make the original bets; it's allll about the payouts today.) Use a while loop to run a simulation that plays roulette by randomly choosing a number 036 over and over again. For each spin, if the number is odd, Kayla wins $5. If the number is 31 or 32 , Laney wins $50. Note that they both win when the wheel lands on 31 ! End your simulation when Kayla or Laney gets up to $50,000. Keep track of the values you need to create two separate bar charts: - One shows number of Kayla wins vs number of Laney wins - The second shows amount of money Kayla wins vs amount of money Laney wins For full credit in communication, your plots must have: - Titles - Different colors for the two players - xlabels and ylabels (label their names along the x-axis as well! to put a string label underneath each bar, try something like plt.xticks([1, 2], ["Kayla", "Laney"])

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions