Question: Craps. The following are the rules for a pass bet in the game of craps. Roll two six-sided dice, and let (x) be their sum.

Craps. The following are the rules for a pass bet in the game of craps. Roll two six-sided dice, and let \(x\) be their sum.

- If \(x\) is 7 or 11 , you win.

- If \(x\) is 2,3 , or 12 , you lose.

Otherwise, repeatedly roll the two dice until their sum is either \(x\) or 7 .

- If their sum is \(x\), you win.

- If their sum is 7, you lose.

Write a modular program to estimate the probability of winning a pass bet. Modify your program to handle loaded dice, where the probability of a die landing on 1 is taken from the command line, the probability of landing on 6 is \(1 / 6\) minus that probability, and 2-5 are assumed equally likely. Hint: Use StdRandom . di screte().

Step by Step Solution

3.30 Rating (150 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres the Python program to estimate the probability of winning a pass bet in Craps considering loaded dice Python import random def crapspassbetp1 Si... 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 Algorithm Design Questions!