Project 16: Getting Out of Jail Monopoly

To “Get out of Jail” in Monopoly a player has to roll doubles on a pair of dice, which means both dice result in the same number.

 

Estimate the probability that you would have to roll at least 7 times before you obtain doubles.


Project 16: Simulate MANY trials and determine the proportion of trials in which you would have to roll at least 7 times to obtain doubles.  Appropriately assign the variable 'probability' to represent the probability that a person would have to roll at least 7 times to obtain doubles.


Note: There are two working randomization methods to use.


random() returns a random number from [0,1)


Example: r = random();  //r holds a value between 0 and 1 (not including 1).


randomInt(lower, upper) returns a random integer between lower and upper inclusive


Example: i = randomInt(2,7); //i holds one of the values: 2, 3, 4, 5, 6, 7 and they are all equally likely

**If your code works for 5 test cases in a row, you can enter your e-mail address.