Probability of Doubles. In the mid-1600s, a French nobleman (Antoine Gombaud, Chevalier de Méré) frequently gambled using six-sided dice.

computer science

Description

Probability of Doubles. In the mid-1600s, a French nobleman (Antoine Gombaud, Chevalier de Méré) frequently gambled using six-sided dice. One of his favorite games of chance involved an attempt to roll at least one “double six” within 24 attempts (or rolls of the 2 dice). He knew the probability to roll a double six on any given roll of two dice is 1/36 (6 possible outcomes for each die; 2 dice; 6 * 6 = 36). He falsely assumed that the probability of rolling double sixes in 24 attempts would be 1/36 * 24 or approximately 67%. Due to the financial losses he experienced over time, he determined his probability logic must be false. He subsequently sought expertise from Blaise Pascal (a contemporary mathematician) to assist him in determining the correct probability as closer to 49%.1 

 Write a “simulation” program that repeats the 24 rolls 10,000 times. Check to see if your simulated data provides supporting evidence of the 49% probability of rolling double sixes at least once in 24 rolls of 2 dice. Create two separate data files from your simulation. Your program should:

a.       Use a main function to control overall program flow

b.      Store the outcome of each pair of dice roll as a .csv file (add text delimiters as necessary). At a minimum, fields should include:

i. Round (1 to 10,000)

ii. Roll (1 to 24)

iii. Die-1 (roll of one die 1 to 6)

iv. Die-2 (roll of second die 1 to 6)

v. Doubles (1 if result of roll is doubles or 0 if the result is not doubles)

vi. Double sixes (1 if result is double sixes or 0 if the result is not double sixes)

c.       Store the outcome of each round of 24 rolls as a .csv file (add text delimiters as necessary). At a minimum, fields should include:

i. Round (1 to 10,000)

ii. Double sixes (True if double sixes occurred at least once during 24 rolls; otherwise False)

iii. Winner (House or Gambler). The gambler wins if double sixes are rolled at least one out of 24 rolls.  iv. Number of Double Sixes Rolled (count of the number of double sixes in the 24 rolls)

d.      Conduct an analysis of your simulation results and report to the user what you learned. For this part of the problem, you should use the data files you created in parts (a) and (b) as input data for your analysis. You should display the results of your analysis on the screen and save the same output to a .txt file. Some suggestions include:

i.                     Check to see if your data supports the 49% probability as described above

ii. Validation checks to ensure that the dice are “fair” (i.e., each number 1 to 6 has equal chance of occurring)

 iii. Summary statistics such as the number of times double sixes occurred in 24 rolls, number of doubles rolled in 24 rolls

iv. Other interesting statistics

v. Use your creativity here!  


Related Questions in computer science category


Disclaimer
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.