Dice throw - simulating a game of chance
What are the chances of getting 7 or 11 when rolling dice?
The total possible outcomes will be 36. Pairs with sum 7 or 11 are
1, 6
2, 5
3, 4
4, 3
5, 2
6, 1
6,5
The probability a 7 or 11 on two dice is 8/36 = 2/9, or about 22.22 percent.
Write a program that simulates n number of throws of the dice and calculates the percentage of throws resulting in 7 or 11.
n must be configurable
Test using 10, 20, and 50 throws
For each set of throws, print the calculated percentage
If wins represents number of throws resulting in 7 or 11
And max represents the total throws
Then wins / max represents the percentage resulting in 7 or 11
Test and debug your code, and submit it to this assignment.
Can anyone solve this? python 3