COSC 1315 - Fundamentals of Programming
Allan Kochis

Homework Assignment 10


Dice simulation


Simulate the roll of a pair of dice 10,000 times and produce the following table from your simulation. Note the actual occurred count can be different for your simulation.

Number Occurred   Odds       Histogram
--------------------------------------------------------
    2      250   1 in 40 | XXX
    3      546   1 in 18 | XXXXXX
    4      780   1 in 12 | XXXXXXXX
    5     1117   1 in  8 | XXXXXXXXXXXX
    6     1468   1 in  6 | XXXXXXXXXXXXXXX
    7     1677   1 in  5 | XXXXXXXXXXXXXXXXX
    8     1330   1 in  7 | XXXXXXXXXXXXXX
    9     1167   1 in  8 | XXXXXXXXXXXX
   10      844   1 in 11 | XXXXXXXXX
   11      551   1 in 18 | XXXXXX
   12      270   1 in 37 | XXX
--------------------------------------------------------
Press any key to continue . . .