Statistical probability in JavaScript


Ad

Advertisements

Joined
Mar 3, 2021
Messages
243
Reaction score
29
I need more context. Is the "multiple event win" reducing the possibilities, e.g., removing a marble from a bag, or are the odds the same each time, e.g., spinning a slot machine (which would be zero decay)? What result are you looking for? The total odds of winning if it was soun multiple times?
 
Joined
Dec 28, 2021
Messages
4
Reaction score
0
I need more context. Is the "multiple event win" reducing the possibilities, e.g., removing a marble from a bag, or are the odds the same each time, e.g., spinning a slot machine (which would be zero decay)? What result are you looking for? The total odds of winning if it was soun multiple times?
Total odds i.e 1/5000 spun four times vs, 1/1250
 
Joined
Mar 3, 2021
Messages
243
Reaction score
29
To combine all four spins into a total probability that at least one win, you use the "at least one rule." First, find the probability that all of them will _fail_. Then, subtract it from one.

Code:
P(all) = (1 - 1/5000) * (1 - 1/4000) * (1 - 1/3000) * (1 - 1/2000)
P(at least one) = 1 - P(all) 
P(at least one) = 1 - (0.9998 * 0.99975 * 0.999666 * 0.9995)
P(at least one) = 1 - 0.998717 = 0.00128 = 0.128%

For four spins of 1/1250, it's the same process, but a little more simplified.

Code:
P(fail) = 1 - 1/1250 = 1 - 0.0008 = 0.9992
P(at least one) = 1 - 0.9992^4 = 1 - 0.9976 = 0.0024 = 0.24%
 
Ad

Advertisements

Joined
Dec 28, 2021
Messages
4
Reaction score
0
To combine all four spins into a total probability that at least one win, you use the "at least one rule." First, find the probability that all of them will _fail_. Then, subtract it from one.

Code:
P(all) = (1 - 1/5000) * (1 - 1/4000) * (1 - 1/3000) * (1 - 1/2000)
P(at least one) = 1 - P(all)
P(at least one) = 1 - (0.9998 * 0.99975 * 0.999666 * 0.9995)
P(at least one) = 1 - 0.998717 = 0.00128 = 0.128%

For four spins of 1/1250, it's the same process, but a little more simplified.

Code:
P(fail) = 1 - 1/1250 = 1 - 0.0008 = 0.9992
P(at least one) = 1 - 0.9992^4 = 1 - 0.9976 = 0.0024 = 0.24%
Thanks so much for the explanation!
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top