# Probability question...

60 replies [Last post]
Taern
Offline
Joined: 12/31/1969

While developing the mechanics for a game in the works, I'm trying to make everything as mathematically even as possible. However, I need help with a problem I can't seem to figure out.

Obviously the chances of rolling a 4 on a 4-sided die is 25%. My question is, what is the chance of rolling at LEAST, for example, one 4 on two 4-sided dice, or three 4-sided dice, etc. The way I'm doing skills is the NUMBER of dice you roll. Quick example... say one guy is good at climbing, and another one is not so good, and both are trying to climb a cliff. Both have a target number of 4. The first guy has a 5 in climbing, while the second guy has a 1. How much better are the first guys chances of rolling at least one 4 (on five dice), than the individual who just has one die to roll a 4? I'm sure there's a formula out there... and it's not limited to just 4 siders, either. I just used them for simplicity's sake in the examples. Any help would be MUCH appreciated! Thanks!

Zzzzz Offline
Joined: 06/20/2008
Re: Probability question...

Taern wrote:
How much better are the first guys chances of rolling at least one 4 (on five dice), than the individual who just has one die to roll a 4?

Ok here goes my attempt to answer:

The intrusion of absolute probability into sequential probability does not allow you to gain an advantage. If anything, the 'law of unequal distribution' will be on your side, in theory.

Ok now what I am getting at with that statement, each different roll as the same exact % chance and does not alter the previous or succeeding rolls chance of outcome.

So just because you have 5 dice, the chance of getting a four is still the same as having 1 die.

This same issue is talked about heavily with respect to the game of Roulette(as a side note, one of my favorite casino games)

Maybe the following note that I found on the web will shed a little better light onto the subject:

You and your wife decide you want to have nine children. Pretend for the purpose of this example that the number of male births equals the number of female births and no genetic predispositions exist. You want to have all boys. What are the odds of having nine boys and no girls? Astronomical. That's sequential probability.

Now your wife has had eight boys. She finds out that she's pregnant. What are the odds that it will be a boy? 50:50, right? This is absolute probability.

Hope this helps a little, believe me, I understand that it might not make sense, but this is a mathematically reality.

ensor
Offline
Joined: 08/23/2008
Probability question...

I think it's easiest to think about it like this.

Probability of AT LEAST one 4 is the same as 1 - Probability of NO 4 on any dice. So for one die, it is 1 - .75, or .25, two dice, it is 1 - (.75 * .75), or .4375. For three dice, it is 1 - (.75 * .75 * .75) or .578125.

[edited to remove incorrect formula, see Oracle's message below for the right formula]

Mark

sedjtroll Offline
Joined: 07/21/2008
Probability question...

Count up all the possible outcomes. The percent chance of success is equal to the number of outcomes that are defined as successful divided by the total number of outcomes possible.

So for example, rolling a 4 on 1d6 vs rolling it on 2d6:
1d6: outcomes are 1, 2, 3, 4. One of those is a success, so 1/4 or 25%.

2d6: outcomes are:
1,1 1,2 1,3 1,4 2,1 2,2 2,3 2,4 3,1 3,2 3,3 3,4 4,1 4,2 4,3 4,4
That's 16 combinations, 7 of which are a success, so 7/16 or 43.75%

The chances of rolling at least one 4 on 5d4 are probably rediculously good compared to 1d4.

[EDIT: There's a mathematical formula to do this quickly and easily for any number of any sided dice, and I'm glad to see that someone posted it while I was writing this 'cause I always forget that stuff.]

Zzzzz Offline
Joined: 06/20/2008
Probability question...

ensor is that really so?

Where did you find the info you posted? It has been proven maytime that the outcome of each die roll has no influence on any previous roll or future roll. So I am not sure what angle yo uare coming from with this statement.

I guess I am still confused about this whole area.... But it has been a long time since I used my mathematics skills (BS in math, but the BS in computer science won out and I now program at a place that needs little if any mathematics).

Zzzzz Offline
Joined: 06/20/2008
Probability question...

Well I just look up some other stuff and I feel really dumb now, I guess I dont understand how throwing a dice with 4 or 6 values is any different then rolling on a roulette table of 38 numbers......

now I am confused and feeling dumb..

sedjtroll Offline
Joined: 07/21/2008
Probability question...

Zzzzz wrote:
It has been proven maytime that the outcome of each die roll has no influence on any previous roll or future roll. So I am not sure what angle yo uare coming from with this statement.

The outcome of any one die roll has no effect on the next, that's true. However we're not looking at the outcome of a single roll.

The chances of rolling a 4 on at least 1 of X dice is not the same as the chances of rolling a 4 on exactly 1 of 5 dice, nor the same as rolling a 4 on any particular die. In statistics there are things called Unions and Intersections which is what we're talking about here.

I think my previous post might illustrate it better since I listed the different outcomes of rolling 2d4. Does that help any?

I mean, obviously if you roll 3,000 dice your chances of at least 1 of them being a 4 are better than if you only roll 1 die, right?

For the record, 1-(3000*((4-1)/4)) = -2249, so I suspect that equation is wrong... I believe ensor meant to say 1-((s-1)/s)^n). By the way, 1-[((4-1)/4)^3000] = 1-1.5268...E-375 which is basically 1. So if you roll 3000 d4's it's pretty safe to say you're guaranteed at least one 4.

sedjtroll Offline
Joined: 07/21/2008
Probability question...

Zzzzz wrote:
Well I just look up some other stuff and I feel really dumb now, I guess I dont understand how throwing a dice with 4 or 6 values is any different then rolling on a roulette table of 38 numbers......

now I am confused and feeling dumb..
It's not. But in Roulette you're not trying to get at least 1 X out of Y spins, you are trying to get a particular number (maybe out of a subset of numbers) on one particular spin. That's the difference.

ensor
Offline
Joined: 08/23/2008
Probability question...

Zzzzz,

The info I posted came out of my head, I don't really have a reference, but here's a cool page about Dice from Mathworld, http://mathworld.wolfram.com/Dice.html.

If you look at it as if you want to know the probability that THIS die roll will be a 4, then you're absolutely right, it will always be .25. But if you want to know if at least one of the 7 die rolls was a 4, you multiply the independent probabilities together. As in sedjtroll's post with listing out all the possibilities.

I think we're both right, we're just answering different questions.

Oracle
Offline
Joined: 06/22/2010
Probability question...

The formula you're looking for is 1 - (1 - 1/S)^N

where S is the number of sides and N is the number of rolls.

EDIT: My formula mathematically the same as Seth's. [1 - 1/S] is the probability of not rolling the highest side and [(S - 1)/S] is the probability of rolling one of the non-highest sides.

Also before you ask, I don't have a reference but I do have a Math degree :)

Jason

Offline
Joined: 04/23/2013
Yep

I think Seth is right...

It should be:

1-((1/S)^R)

Where S=The number of sides and R = the number of rolls.

The more times you roll, the smaller (1/S)^R gets, which, when substracted from the certain probability of 1, yields a higher percentage with each roll. Way to go Seth and Ensor.

ZZZ, I think you were confusing the probability of rolling a certain # two times in a row. In that respect, you are correct. I.E. With regards to a roullete wheel, you have the same chance of spinning 17, even if you had just spun 17 on the previous spin.

-Darke

ensor
Offline
Joined: 08/23/2008
Probability question...

You're right, it's an exponent, not muliplied by N as in my formula. Sorry for the error, thinking and typing too quickly, should double check my work. (Also a math major in college, now CS grad student..)

Mark

Zzzzz Offline
Joined: 06/20/2008
Re: Yep

Darkehorse wrote:

ZZZ, I think you were confusing the probability of rolling a certain # two times in a row. In that respect, you are correct. I.E. With regards to a roullete wheel, you have the same chance of spinning 17, even if you had just spun 17 on the previous spin.

Yeah I think this might be my problem. But again all of my math skills are rusty... and to think I spent hours and hours doing proofs on this type of stuff, advance calc, abstract geometry..... I hate when something I learned goes bye-bye! What a waste!

Ah well thanks to those of you who helped me realized my loss of another college subject! ;)

Anonymous
Probability question...

I can't remember it but I do know there is a proven mathematical forumla for this. If I think of it I will let you know.

Fos
Offline
Joined: 12/31/1969
Probability question...

Whenever I see probability questions like this, my first reaction is to just build 1000 test cases in c++ and then derive the formula from there. Which gets me in all sorts of trouble... :)

For instance, for 2dS: 1/S + ((1 - 1/S) * 1/S).

And for 3dS: 1/S + ((1 - 1/S) * 1/S) + (1 - ((1 - 1/S) * 1/S) * 1/S).

Which is a lot easier to work out in for loops...

... and now I have a wonderful dice rolling probability sim with absolutely no use.... I suppose I'll just tuck it away next to my Let's Make A Deal hack.

Zzzzz Offline
Joined: 06/20/2008
Probability question...

snipy3 wrote:
I can't remember it but I do know there is a proven mathematical forumla for this. If I think of it I will let you know.

Offline
Joined: 04/23/2013
Crap!

I think we all got it wrong..

It should be:

1-((S-1)/S)^R)

Again where S = the number of sides and R is the number of Rolls.

Where as before I said:

Quote:
1-((1/S)^R)

and Oracle said:

Quote:
The formula you're looking for is 1 - (1 - 1/S)^N

HTH,
Darke

(Too many cooks in the kitchen)

sedjtroll Offline
Joined: 07/21/2008
Re: Crap!

Darkehorse wrote:
1-((S-1)/S)^R)

Oracle wrote:
1 - (1 - 1/S)^N

These are exactly the same.
(S-1)/S = 1-(1/S)

- Seth

Oracle
Offline
Joined: 06/22/2010
Re: Crap!

Darkehorse wrote:

1-((S-1)/S)^R)

Consider the (S-1)/S portion of that equation:

(S - 1) / S =
S/S - 1/S =
1 - 1/S

Now sub this back into your equation in place of of (S - 1) / S and we get:

1 - (1 - 1/S) ^ R

replace the R with an N because it doesn't matter what letter we us to represent the number of dice rolled:

1 - (1 - 1/S) ^ N

Darkehorse wrote:

and Oracle said:

Quote:
The formula you're looking for is 1 - (1 - 1/S)^N

QED

Offline
Joined: 04/23/2013
Re: Crap!

Oracle wrote:
Darkehorse wrote:

1-((S-1)/S)^R)

Consider the (S-1)/S portion of that equation:

(S - 1) / S =
S/S - 1/S =
1 - 1/S

Now sub this back into your equation in place of of (S - 1) / S and we get:

1 - (1 - 1/S) ^ R

replace the R with an N because it doesn't matter what letter we us to represent the number of dice rolled:

1 - (1 - 1/S) ^ N

Darkehorse wrote:

and Oracle said:

Quote:
The formula you're looking for is 1 - (1 - 1/S)^N

QED

Yep you win.. Forgot my order of operations..

-Darke

Taern
Offline
Joined: 12/31/1969
Probability question...

You guys are great... thanks for all the help. God I love this stuff... I need to get out more.

FastLearner
Offline
Joined: 12/31/1969
Probability question...

One thing throws me about all this, and maybe one of you math whizzes can help me figure it out.

With the formula 1 - (1 - 1/S)^N

Number of sides = 4
Number of rolls = 4

1 - (1 - 1/4)^4

= 1 - (1 - .25)^4

= 1 - (.75)^4

= 1 - 0.31640625

= 0.68359375

= 68.4%

Right?

So there's a 68% chance if you roll 4d4 that at least one of them will be a 4? How does that make sense? I mean, statistically over an infinite number of rolls, any given 4 rolls will contain one each of 1, 2, 3, and 4, so how is it 68%? Did I screw up the math or do I just not understand?

-- Matthew

Zzzzz Offline
Joined: 06/20/2008
Probability question...

Heheheh another one in my boat!

Now hiring crewman for a voyage to Mathville! Openings still available, everyone is welcome because we want a merry bunch of lads and lassies!!!!

Oracle
Offline
Joined: 06/22/2010
Probability question...

FastLearner wrote:

With the formula 1 - (1 - 1/S)^N

Number of sides = 4
Number of rolls = 4

....

= 68.4%

Right?

So there's a 68% chance if you roll 4d4 that at least one of them will be a 4? How does that make sense? I mean, statistically over an infinite number of rolls, any given 4 rolls will contain one each of 1, 2, 3, and 4, so how is it 68%? Did I screw up the math or do I just not understand?

That's right. If you roll 4d4, there's a 68% chance of having at least 1 show a 4.

Over an infinite number, "any given 4 rolls" need not contain one each, you can get the same number coming up a million times in a row. Overall, you should get each number showing up 25% of the time in the long term, but this doesn't have to be true in the short term. That's actually the key point of the 2d6 vs deck of dice issue.

Infinities are a bit hard to understand without a lot of practice

Consider this thought experiment. You're standing in the middle of a road with a fair coin to flip. Every time in lands heads, you step one foot to the left, and every time it lands tails you step one foot to the right.

Obviously since it's a fair coin, after a large number of flips, you average position will always be right where you started. What is the farthest you will ever get from the starting point? In other words what will be the greatest difference between the number of heads and tails.

Jason

Oracle
Offline
Joined: 06/22/2010
Probability question...

Here's a better way of looking at the 4d4 example.

Roll the dice one at a time. As soon as you roll the first 4, you can stop because regardless of what the rest of the dice show, you still have at least one 4.

After 1 die, you have a 25% chance of having rolled a 4 so far.

That means there's a 75% chance you'll need to roll a second die, and if you do, there's a 25% chance it will show a 4, so there's a 75% * 25% = 18.75% chance of getting a 4 on the second die Add this to the 25% above, and the chances of getting a 4 on the first 2 dice are 43.75%

That leaves a 100% - 43.75 = 56.25% chance you'll need to roll a third die, with a 25% chance. 56.25% * 25% is 14.0625%. Add this to the previous 43.75, and the chances of getting a 4 on the first 3 dice is 57.8125%

Repeat it once more for the 4th die: 100% - 57.8125% = 42.1875%. 42.1875% * 25% = 10.5469%. Add this to the 57.8125% above and get 68.36%.

The equation 1 - (1 - 1/S)^N is a closed-form expression for the finite geometric series I've just started.

Jason

sedjtroll Offline
Joined: 07/21/2008
Probability question...

FastLearner wrote:
statistically over an infinite number of rolls, any given 4 rolls will contain one each of 1, 2, 3, and 4, so how is it 68%? Did I screw up the math or do I just not understand?

Oracle did a great job of answering this, but in case his response wasn't clear maybe this will help. Think of it like this (which is not necessarily strictly correct, just a point of view)

If you roll 4d4, that's not "any given 4 rolls' out of an infinite number- it's 4 particular rolls. As Oracle said, out of infinity rolls there could be a million 2's in a row.

- Seth

Trickydicky
Offline
Joined: 12/31/1969
Probability question...

Man, I thought I was good at math, but this whole thread made me feel dumb.

There should be a disclosure at the beginning of any such thread: "May cause migraine from thinking to hard".

OOOOUUCH!

sedjtroll Offline
Joined: 07/21/2008
Probability question...

Trickydicky wrote:
There should be a disclosure at the beginning of any such thread: "May cause migraine from thinking to hard".

I think this thread has made the whole probabbility thing look a little more complicated than it is.

As I described before, it's just a matter of counting up all the desireable outcomes and dividing by all the possible outcomes.

All these equations (p.s. the equations in this thread have all been either equivalent or wrong) are just a mathematical way to add up the possibilities more quickly. There are 16 possible outcomes of rolling 2d4, so it wasn't too much work for me to write them all down. If you are looking for odds on 3d6 for example, then there are 216 possibilities, and you're crazy if you think I'm going to write all those down.

Lucky for me there's this thread that I can referece to find that equation :) Now if I need to know how likely it is I'll roll at least 1 6 on 3d6, I can do the math:

1 - (1 - 1/6) ^3 = 42%

And because math is cool, if I want to know how likely it is I'll get at least a 5 on 3d6 (a 5 or a 6 on any of the dice) the answer is (hope I'm not wrong lest I get flamed):

1- (1 - 2/6) ^3 = 70%

- Seth

FastLearner
Offline
Joined: 12/31/1969
Probability question...

Oracle wrote:
Here's a better way of looking at the 4d4 example.

Roll the dice one at a time. As soon as you roll the first 4, you can stop because regardless of what the rest of the dice show, you still have at least one 4.

After 1 die, you have a 25% chance of having rolled a 4 so far.

That means there's a 75% chance you'll need to roll a second die, and if you do, there's a 25% chance it will show a 4, so there's a 75% * 25% = 18.75% chance of getting a 4 on the second die Add this to the 25% above, and the chances of getting a 4 on the first 2 dice are 43.75%

That leaves a 100% - 43.75 = 56.25% chance you'll need to roll a third die, with a 25% chance. 56.25% * 25% is 14.0625%. Add this to the previous 43.75, and the chances of getting a 4 on the first 3 dice is 57.8125%

Repeat it once more for the 4th die: 100% - 57.8125% = 42.1875%. 42.1875% * 25% = 10.5469%. Add this to the 57.8125% above and get 68.36%.

The equation 1 - (1 - 1/S)^N is a closed-form expression for the finite geometric series I've just started.
Ah, indeed, I remember now having understood it that way in the past.

On the "any given 4," I really meant "average 4." Which is sort-of more true, but still not really.

Thanks!

Anonymous
Probability question...

Zzzzz wrote:
I guess I am still confused about this whole area.... But it has been a long time since I used my mathematics skills (BS in math, but the BS in computer science won out and I now program at a place that needs little if any mathematics).

Yeah, statistics is one of those areas that makes my head swim. When someone explains it well (as has been done here), I always hit my head and go "duh, of course that's what happens." But when I try to reason it out, my logic always fails somewhere.

Zzzzz Offline
Joined: 06/20/2008
Probability question...

Again...

Quote:

As Oracle said, out of infinity rolls there could be a million 2's in a row.

This is the main reason why I head down the wrong road when it comes to this topic. Because there is no guarantee that the 5 rolls of a d4 will produce a sequence that contains a 4. Mind you this is an incorrect assumption, thus my confusion. Since over an infinite number of rolls a 4 should occur within the sequence (of infinite rolls) an equal number of times (as compared to all other outcomes) and since you are increasing the number of rolls from 1 to 5, you are increasing the likelyhood of producing a sequence that contains a 4 as one of the outcomes.

WOW, who would have guessed such a large thread on something that is actually very trival! 