ESC 251 Midterm Project Due: Nov. 17

You may not discuss this assignment with anyone but me. You must email me a copy of your program and answers to the questions posed prior to 5:00pm on the due date. I will run your program, so do not copy it into a Word document.

The most common type of bet made in a craps game is the pass line bet. The pass line rules are given by the algorithm below:

```   IF      come-out roll = 2, 3, 12 -> Shooter Loses
ELSE IF come-out roll = 7, 11    -> Shooter Wins
ELSE
point = come-out roll value
Shooter rolls until the point is rolled (Shooter Wins)
or a 7 is rolled (Shooter Loses)
```
The shooter controls the dice for as long as they win. Once they lose, the dice pass to the next shooter.

On the course website, there is a data file that contains a long list of random dice rolls where each roll is the result of 2 6-sided dice. For simplicity, the last number in the list is a 7.

In this assignment, you will perform a Monte-Carlo simulation of pass line betting in a craps game. In particular, you should write a program that does the following:

a)
Determines the number of dice rolls,
b)
Determines the number of come out rolls,
c)
Determines the number of shooters,
d)
Determines the probability of the shooter winning,
e)
Determines the probability of the shooter loosing,
f)
Determines the probability of the shooter hitting a point, (i.e., the number of times a point is hit divided by the number of times a point is established).
For items d) and e), compute these probabilities relative to the entire pool of dice rolls (i.e., don't compute the probabilities of the individual shooters).

1)
Why is it convenient for the last number in the data file to be a 7?
2)
How large is the house's advantage over the shooter (i.e., what is the difference between items d) and e) above)?
3)
How does this advantage compare with the exact value? You can look up this value online.
4)
Does a Monte-Carlo simulation reasonably replicate the probabilities involved?
5)
Use the house advantage you computed above to determine the casino's annual profit from pass line betting. Assume that the casino has 40 tables and \$1,000,000 is bet at each table per month.

HINTS:

• Don't try and write the entire program all at once. Build it in stages and add new features gradually. Use WRITE statements to monitor the variables in your program.
• The data file is quite large and your program will take about 5 minutes to process it. You should design your own small set of 20-30 dice rolls and use this to test your program. Make sure you comment out any WRITE statements in your loops before running the large data file.