Probability problem

SLAM: debunk creationism, pseudoscience, and superstitions. Discuss logic and morality.

Moderator: Alyrium Denryle

Post Reply
User avatar
Korto
Jedi Master
Posts: 1196
Joined: 2007-12-19 07:31am
Location: Newcastle, Aus

Probability problem

Post by Korto »

I'm trying to work out how to get the probability of rolling a certain specific number on a minimum number of dice when rolling a pool of dice larger than that number.
For example, if you need to roll at least three "1's" when rolling 6d6; or roll 10d10 and get at least four "7+'s"
I could do it with brute force, write up a program to roll 10,000 times and average or something, but I would prefer a general equation / mathematical method.
I'm reasonably capable of probability maths. Give me a percentage chance over a day, and I can tell you the chance per second or per week, for example, but this has me stumped.
“I am the King of Rome, and above grammar”
Sigismund, Holy Roman Emperor
Grandmaster Jogurt
Jedi Council Member
Posts: 1725
Joined: 2004-12-16 04:01am

Re: Probability problem

Post by Grandmaster Jogurt »

This page goes over a similar example and goes into detail about it afterwards. The basic idea is to find what results wouldn't achieve your results (in your first case, exactly 0, 1, or 2 threes; in your second, exactly 0, 1, 2, or 3 rolls of seven or above) and then subtract all the probabilities from one.

Assuming I did it correctly, for 6d6, 3+ ones, the probability is 1 minus (5/6)^6, (5/6)^5*6(1/6), and (5/6)^4*(6*5/1*2)*1/6^2, or 1-(.335+.402+.201)= 6.2%. For your second example, it would be 1 minus (6/10)^10, (6/10)^9*10(4/10), (6/10)^8*(10*9/1*2)*(4/10)^2, and (6/10)^7*(10*9*8/1*2*3)*(4/10)^3, or 61.8%.
User avatar
Spoonist
Jedi Council Member
Posts: 2405
Joined: 2002-09-20 11:15am

Re: Probability problem

Post by Spoonist »

I asked the same type of question a long time ago and got linked to an excellent pdf.
*goes digging*
Here is the topic
http://bbs.stardestroyer.net/viewtopic. ... 0#p3626800
and the pdf link works.

It covers everything and is continuously updated - it i s simply fantastic.
User avatar
Korto
Jedi Master
Posts: 1196
Joined: 2007-12-19 07:31am
Location: Newcastle, Aus

Re: Probability problem

Post by Korto »

Thanks for that. The method seems to work well.

And same kind of reason, Spoonist; role-playing game mechanics. Working on an idea for a magic system.
“I am the King of Rome, and above grammar”
Sigismund, Holy Roman Emperor
User avatar
Surlethe
HATES GRADING
Posts: 12267
Joined: 2004-12-29 03:41pm

Re: Probability problem

Post by Surlethe »

You could treat it as a Bernoulli process. This is an experiment with two outcomes (success, probability p, and failure, probability q = 1 - p) repeated n times. The probability of a total of exactly k successes over those n experiments (without any notion of order) is

C(n,k) * p^{k} * q^{n-k}

that is

C( total experiments, number of successes ) * (probability of success)^{number of successes} * (probability of failure)^{number of failures}

So in your case, for example, if you want to roll at least three 1s out of 6d6, then you want to treat this as 6 6-sided dice rolled in a row, that is, a Bernoulli process with 6 trials, where success is rolling a 1 and failure is rolling anything else. The probability of success is 1/6, the probability of failure is 5/6, so the probability of at least three 1s out of 6 rolls is the sum of the probabilities of three 1s, four 1s, five 1s, and six 1s. Alternatively, it's 1 - (prob. no 1s + prob. one 1s + prob. two 1s).
A Government founded upon justice, and recognizing the equal rights of all men; claiming higher authority for existence, or sanction for its laws, that nature, reason, and the regularly ascertained will of the people; steadily refusing to put its sword and purse in the service of any religious creed or family is a standing offense to most of the Governments of the world, and to some narrow and bigoted people among ourselves.
F. Douglass
Post Reply