If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

### Course: AP®︎/College Statistics>Unit 7

Lesson 1: Estimating probabilities using simulation

# Random numbers for experimental probability

Using a list of random number to calculate an experimental probability.

## Want to join the conversation?

• How would you do a mathematical calculation of the probability of winning this game?
• Just bit of logic, Maximum roll is 18 minimum roll is 3. This means we have total of 16 outcomes. Rolling below 10 has 7 values (3,4,5,6,7,8,9) and rolling 10 or more has 9 values. (10,11,12,13,14,15,16,17,18).
So you will have 43.75% chance to roll below 10 and 56.25% chance to roll above 10.

Maths
7/16 = 0.4375
9/16 = 0.5625
• Why not run RANDOM numbers from 1 to 6?
• Well he doesn't really control the random number generator, I think he just rang up a website that did a string of numbers a lot.
• Based on 10 000 000 simulations my probability settled at approximately 62%.
• Based on the possible combinations the probability is 135/216 = 62.5%
• those are not random your last tutorial used the same numbers
• The sequence might be the same, but it was presumably constructed randomly.
• how can we calculate the theoretical probability in this and the previous examples?
• As for me, in this particular example it is easier (for those who want to decide whether to participate in the game) to come up with the concept of expected value from theoretical probability.
If the 6-sided die is fair, then every result from 1 to 6 has a 1/6 probability. If in this case we take an expected value ('mean value' / 'average' for probability) of every toss - then we have 3,5 (we find this by multiplying each value (1,2,3,4,5,6) by 1/6 probability and summing them up).
As we have 3 tosses in this game - we multiply 3,5 by 3 and have 10,5. What does this value of 10,5 tell us? It tells that on average we are likely to win this game (remember the necessity of getting 10 as the sum of 3 rolls to win).
Correct me if I am wrong, please.
• I am confused. Why would we calculate experimental probability here when we can theoretically calculate the probability of getting a sum of 10 or more as 62.5%. I thought we use experimental probability only when it is impossible to calculate theoretical probability like the number of points scored in a football game in the previous example.
• You always have both options. Maybe you know how to calculate the theoretical probability here, but there may be others who do not. In cases where it is very difficult or you just do not know how to do it, it is nice to have an alternative to be able to approximate the answer.
• Is there a formula to determine # of experiments per # of variables, or whatever other variables are present, to predict accurately when(# of experiments) one could expect the experimental results to match up to theoretical?
• The Law of Large Numbers says a sample size greater than 30 would suffice, but there is more research where 1000 is the right amount on return. It depends how easy it is to get up to 1000 samples
(1 vote)
• Can anyone solve it theoretically
(1 vote)
• Using generating functions
(x + x^2 + ... + x^6)^3 = Poly(n) = sum(coef_n * x^n)
plop into your favorite algebra expander
x^3 + 3 x^4 + 6 x^5 + 10 x^6 + 15 x^7 + 21 x^8 + 25 x^9 + 27 x^10 + 27 x^11 + 25 x^12 + 21 x^13 + 15 x^14 + 10 x^15 + 6 x^16 + 3 x^17 + x^18
10 and over = sum(coef_n from n=10 to 18)
= 27 + 27 + 25 + 21 + 15 + 10 + 6 + 3 + 1 = 135
`import itertools as iterdie=list(range(1,7))count=0#We need to create a catesian product, with 3 repetationsfor x in list(iter.product(die,repeat=3)): eof = '\n' if count%10==0 else ',' if sum(x)>=10: print(x, end=eof); count+=1print('\nPossible combos of 10 or more=',count)print('Probability=',count/(len(die)**3))`