You will find the exact probability of each sum of two dice by listing the 36 pairs, then roll two dice 3,600 times and compare. The program draws both side by side.
The idea. The exact probability counts equally likely pairs. A long simulation should land close to it, but not exactly on it.
Your tasks.
exact with the probability of each sum, from the 36 pairs.simulated with the share of the rolls that gave each sum.biggest_gap to the largest difference between the two, for any sum.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…