The homework is requiring us to find out the probabilities of 2 to 12 as the sum by experiment. We want to roll two dices 1000 times and count the number of times the sum is 2, 3, …, and 12. I have this as my code so far, but im unable to get the output that the professor is asking for.
What I have so far:
import random as r
die_1 = r.randint(1,6)
die_2 = r.randint(1,6)
print('For-Loop')
for i in range(2,13):
r.seed(1)
counter = 0
for j in range(1000):
if i == r.randint(2,12):
counter = counter + 1
print("sum = ", i, " count = ", counter)
11 * 1000
times. It's no big deal, but your description says differently.