.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Space Empires: IV & V (http://forum.shrapnelgames.com/forumdisplay.php?f=20)
-   -   OT: Home Sick for the Holidays, or Probability and Yahtzee (http://forum.shrapnelgames.com/showthread.php?t=10976)

Krsqk December 24th, 2003 09:16 PM

OT: Home Sick for the Holidays, or Probability and Yahtzee
 
As my family has all gone out shopping, I am left alone to ponder the mysteries of life. My family are Yahtzee fanatics, and I find myself struggling to calculate probabilities for this game. For basic probability, I know the formula is

Chosen Outcome
-----------------------------------
# of Possible Outcomes

For example, on a standard d6, there is a 1 out of 6 chance that any number will come up. If I have a 2,3,4,5 and am rolling for a large straight, I should have a 2/6 or 1/3 chance to get it in one roll (since either a 1 or a 6 will work).

IIRC, the odds for multiple dice with separate outcomes for each are calculated by multiplying the individual odds; i.e., the odds for rolling a Yahtzee (all 5 d6 on same number) in a single roll would be 1/6^5, or 1/7776. However, it's been quite some time since I've studied probability, so I don't remember if that's correct.

My dilemma comes when you factor in multiple dice and multiple rolls for a single outcome. Rolling 6 d6 does not guarantee a roll of any particular number. Likewise, rolling 1 d6 six times does not guarantee a roll of any particular number. Obviously, simple experimentation shows there is something more to this than a simple formula such as:

Chosen Outcomes * Rolls
--------------------------------------
Possible Outcomes

What, then is the formula? Using the large straight example, given a 2,3,4,5 and 2 rolls of a single die, what is the probability that I will roll a large straight?

I impatiently await your elucid answers to these vital and perplexing questions about life's meaning (at least while my in-laws are here, so I can finally beat them http://forum.shrapnelgames.com/images/icons/icon10.gif )!

Fyron December 24th, 2003 09:20 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
Quote:

IIRC, the odds for multiple dice with separate outcomes for each are calculated by multiplying the individual odds; i.e., the odds for rolling a Yahtzee (all 5 d6 on same number) in a single roll would be 1/6^5, or 1/7776. However, it's been quite some time since I've studied probability, so I don't remember if that's correct.
<font size="2" face="sans-serif, arial, verdana">That is correct.

Rolling 6 dice at once or 1 die at a time six times makes 0 difference.

There will never be a guarantee of getting that 1 or 6.

Fyron December 24th, 2003 09:26 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
I forget if you want to use permutations or combinations here... it will be one over one of the following formulae:

n is the total number of items, r is the number of those items you want.

Combination (order does not matter):
n! / [ ( n - r )! * r! ]

Permutation (order matters):
n! / (n - r)!

So for probability, you have either

[ ( n - r )! * r! ] / n!

or

(n - r)! / n!

Depending on which is the one you want. http://forum.shrapnelgames.com/images/icons/icon12.gif

se5a December 24th, 2003 09:38 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
the meaning of life?
42 isint it?

David E. Gervais December 24th, 2003 09:54 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
Yahtzee has absolutely nothing to do with 'odds' or probabilities.. It's pure luck. I know. When I play and my friend Claude is also in the group playing he regularly gets 4-5 Yahtzee's per game. I don't remember a game where he did not get at least 1 Yahtzee. (And he rolls an unusually high number of Six's)

Luck, that's the only thing that matters in Yahtzee.

So, each time you roll the dice, just say a simple prayer... "Thy will be done." and see just how well that works. (oh, ans you don't have to say this prayer out loud, so you can keep the secret.)

Cheers! http://forum.shrapnelgames.com/images/icons/icon10.gif

[ December 24, 2003, 19:56: Message edited by: David E. Gervais ]

gregebowman December 24th, 2003 10:01 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
There was a dice game I used to play with my D&D friends when I was in Korea. Forgot now all of the rules, but IIRC we threw 6 dice also. But that's all the similarities to Yahtzee there was. Dang, I wish I could remember how that game went now. I got 6 brass six-sided dice I got from Korea I call my "Dice of Death". They made quite a racket when I rolled them (they're quite heavy compared to regular dice).

se5a December 24th, 2003 10:09 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
there is no such thing as luck...

Krsqk December 25th, 2003 06:46 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
Quote:

Originally posted by Imperator Fyron:
I forget if you want to use permutations or combinations here... it will be one over one of the following formulae:

n is the total number of items, r is the number of those items you want.

Combination (order does not matter):
n! / [ ( n - r )! * r! ]

Permutation (order matters):
n! / (n - r)!

So for probability, you have either

[ ( n - r )! * r! ] / n!

or

(n - r)! / n!

Depending on which is the one you want.

<font size="2" face="sans-serif, arial, verdana">These formulae work when r=1, but don't seem to work when r>1. http://forum.shrapnelgames.com/images/icons/icon9.gif

</font><blockquote><font size="1" face="sans-serif, arial, verdana">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">[ ( 6 - 1 )! * 1! ] / 6!
[ 5! * 1 ] / 720
[ 120 * 1 ] / 720
120 / 720
1/6, or 16 1/6%</pre><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">but,

</font><blockquote><font size="1" face="sans-serif, arial, verdana">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">[ ( 6 - 5 }! * 5! ] / 6!
[ 1! * 120 ] / 720
120 / 720
1/6, or 16 1/6% (should be 83 1/3%)</pre><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">http://forum.shrapnelgames.com/image...s/confused.gif

Obviously, the odds that I will roll a 6 and the odds that I will roll less than 6 are not both 1/6 (at least on a standard d6 http://forum.shrapnelgames.com/images/icons/icon12.gif ).

It's worse with the permutation formula:

</font><blockquote><font size="1" face="sans-serif, arial, verdana">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">( 6 - 1 )! / 6!
5! / 720
120 / 720
1/6, or 16 1/6%</pre><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">but,

</font><blockquote><font size="1" face="sans-serif, arial, verdana">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">( 6 - 5 )! / 6!
1! / 720
1/720, or ~.1389%</pre><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">http://forum.shrapnelgames.com/image...s/confused.gif

Things are even more exciting when you factor in more dice, such as the odds to roll at least one six with five d6:

</font><blockquote><font size="1" face="sans-serif, arial, verdana">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">[ ( 30 - 5 }! * 5! ] / 30!
[ 25! * 120 ] / 2.6525285981219105863630848e+32
[ 15,511,210,043,330,985,984,000,000 * 120 ] / 2.6525285981219105863630848e+32
1,861,345,205,199,718,318,080,000,000 / 2.6525285981219105863630848e+32
7.0172483965587413863275932241449e-6
.0000070172483965587413863275932241449, or ~.0007%</pre><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">http://forum.shrapnelgames.com/image...s/confused.gif

I'd have thought my chances of rolling a six would have been slightly better than that! That's pretty close to 1/6^4. http://forum.shrapnelgames.com/images/icons/shock.gif

Offhand, I'd guess there's a problem with the denominator in this formula--could it be n!/r, which would make the formula:

</font><blockquote><font size="1" face="sans-serif, arial, verdana">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">r [ ( n - r )! * r! ] / n!
5 [ ( 6 - 5 }! * 5! ] / 6!
5 [ 1! * 120 ] / 720
5 [ 120 ] / 720
600 / 720
5/6, or 83 1/3%</pre><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">but, then again:

</font><blockquote><font size="1" face="sans-serif, arial, verdana">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">3 [ ( 6 - 3 )! * 3! ] / 6!
3 [ 3! * 3! ] / 720
3 [ 6 * 6 ] / 720
3 * 36 / 720
108 / 720
3/20, or 15% (should be 50%)</pre><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">http://forum.shrapnelgames.com/image...s/confused.gif

Any insight here?

[ December 25, 2003, 16:48: Message edited by: Krsqk ]

Fyron December 26th, 2003 03:11 AM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
Those formulae are correct for combinations and permuations. In truth, I was hoping someone would come along and fill in the blanks... http://forum.shrapnelgames.com/images/icons/icon12.gif Try google...

Ed Kolis December 26th, 2003 08:22 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
Quote:

Originally posted by Krsqk:
IIRC, the odds for multiple dice with separate outcomes for each are calculated by multiplying the individual odds; i.e., the odds for rolling a Yahtzee (all 5 d6 on same number) in a single roll would be 1/6^5, or 1/7776. However, it's been quite some time since I've studied probability, so I don't remember if that's correct.
<font size="2" face="sans-serif, arial, verdana">Wouldn't it be 6/7776, or 1/1296, since there are six mutually exclusive ways to score a Yahtzee (five ones, five twos, five threes, etc.)?

If you want, you could always write a program to run through all the permutations and check whether they match any of the scoring combos... I've written two Yahtzee programs myself so I could always borrow something from one of those and just run all the permutations through a loop instead of generating them randomly... http://forum.shrapnelgames.com/images/icons/tongue.gif

David E. Gervais December 27th, 2003 04:14 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
Who said there is no such thing as luck?

Yesterday, I had my friend Claude over and told him about this discussion. I then asked if he would like to join me in a test, he said sure, it'd be fun.

This is the test we preformed. We each rolled 5 dice 20 times, we took note of how many 6's turned up. We then repeated this test 10 times to see what kind of averages we came up with.

</font><blockquote><font size="1" face="sans-serif, arial, verdana">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">David / Claude
14 / 34
12 / 32
17 / 35
20 / 37
17 / 28
16 / 31
21 / 36
32 / 27 (wow I beat him! :eek: )
18 / 33
15 / 33
---------------
18.2 / 32.6</pre><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">Now if those numbers don't show some degree of luck I don't know how else to explain the results.

Would someone here like to roll this test and see how their results compare? (It would be nice to see how an outside 'neutral' person did with this simple test.)

Oh, now you can understand why I hate playing RISK against him, he always wins. (his best battle win against me in RISK was when I attacked him with 37 armies and he only had 5. He won. (and still had 3 of his 5 armies left after the battle.)

Cheers! http://forum.shrapnelgames.com/images/icons/icon10.gif

geoschmo December 27th, 2003 05:15 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
It's not luck David, but probability you have demonstrated there. Your sample is too small to be meaningfull. If you and your friend rolled 100 times, or a thousand, or ten thousand, the scores would get much closer together. Eventually within percentage points of one another. On the other hand if you and your friend sat down and rolled 10 times each again he would be just as likely to have a better score then you the second time around.

Krsqk December 27th, 2003 07:58 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
I'd start checking your friend's dice, David. http://forum.shrapnelgames.com/images/icons/icon12.gif http://forum.shrapnelgames.com/images/icons/tongue.gif

Actually, Geo is absolutely right, with one clarification. The difference in percentage points will likely decrease, eventually dropping near the break even point; the numerical difference will likely increase. There is no guarantee that actual results will even out over time (the usual misapplication of the law of averages).

Put another way, the odds of rolling a six with a single die are 1/6 every time, whether the "score" is 75 to 5 or 40 to 40. Previous results do not affect future results.

=========

In a separate thought, I found one page (granted, one which wasn't a strictly mathematical approach) which said probabilities which are mutually independent (such as rolling two separate dice) should be added; i.e., the odds of rolling at least one six with two dice is 1/6+1/6, or 1/3. If that's true, though, the odds of rolling at least one six with twelve dice would be 12/6, or 200%. That obviously isn't correct.

As I'm having much trouble finding any helpful information on the web, such as an intro to probability site or the like, I'd appreciate any links y'all can pass along.

David E. Gervais December 27th, 2003 07:58 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
geo, as I said, we rolled 5 dice 20 times (100 die rolls) and did this test 10 times. (10x100 = 1000 die rolls)

It took us about a half hour to make all the rolls. If you mean that we should have rolled this full test 10 more times to get 10,000 die rolls, that is a bit much. It wasn't my aim to prove the law of averages, but to see how in one quick session Claude always seems to out-six me.

Besides rolling 10,000 or 100,000 dice is unrealistic and does not reflect real life applications. Life does not work like that. Averages and probabilities are at best a global "best guess" and no matter what the 'odds' are or how many million tests are used to achieve those 'averages' it does not guarantee your imediate results.

Think of it this way, according to 'averages' if you roll a dice you have a 1/6 chance to hit a 6, but if you miss, your odds on the second throw don't improve, they stay exactly the same.

Cheers! http://forum.shrapnelgames.com/images/icons/icon10.gif

P.S...
so, anyone want to try my test and share the results?

Kamog December 27th, 2003 09:14 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
Wow, Claude should go to Las Vegas and get rich gambling! http://forum.shrapnelgames.com/images/icons/icon12.gif

Out of 100 dice rolls, the average number of 6's that should appear is 100/6 = 16.667 times. David's results are close to this. Claude's getting almost twice as much.

I want to calculate what the odds are of getting Claude's results, but all my statistics and probability textbooks are at work so I can't refer to them...

Kamog December 27th, 2003 09:52 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
This math problem is a cumulative binomial distribution.

Let's look at binomial distribution.

Each die toss is an event with two mutually exclusive possible outcomes: either you roll a 6 (success), or you roll 1 -5 (failure). If we have N events, then the binomial distribution can be used to determine the probability of getting exactly r successes in N outcomes. The formula is:

P(r) = (N! / (r!(N - r)!)) ( p^r) (1 - p)^(N-r)

where N = number of trials,
P(r) = probability of getting exactly r successes in the N outcomes
p = probability of success on any one trial.

So, in our situation, N = 1000 dice rolls, p = 1/6.

David got 182 successes out of 1000 trials and Claude got 326 out of 1000.

So, the probability of David getting exactly 182 out of 1000, by using the above formula, is
P(182) = (1000! / (182!(1000-182)!))((1/6)^182)(1-1/6)^(1000-182)

And the probability of Claude getting 326 out of 100 is:
P(326) = (1000! / (326!(1000-326)!))((1/6)^326)(1-1/6)^(1000-326)

But so far we are talking about the probability of getting exactly the number we got. I think we're more interested in the cumulative case, where we ask, what is the probability of getting at least 182 successes out of 1000, or at least 326 out of 1000?

Well, then we have to add them up, i.e.

P(182 or more) = P(182) + P(183) + P(184) + .... + P(1000)

and
P(326 or more) = P(326) + P(327) + P(328) + ... + P(1000)

I thought, no problem, I'll do this on Excel, but I immediately found that Excel can't handle 1000! because it's too big a number. http://forum.shrapnelgames.com/images/icons/icon9.gif

spoon December 27th, 2003 10:26 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
Quote:

Originally posted by David E. Gervais:
(his best battle win against me in RISK was when I attacked him with 37 armies and he only had 5. He won. (and still had 3 of his 5 armies left after the battle.)
<font size="2" face="sans-serif, arial, verdana">I plugged those numbers into a RISK calculator... odds of you winning were 0.99999978. That's some streak of luck!

Kamog December 27th, 2003 10:28 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
OK, I did some more searching around and discovered that Excel can, in fact, do this calculation.

There is a handy pre-built function called BINOMDIST(number_s, trials, probability, cumulative).
Now this is easy.

The probability of getting 182 or more 6's in 1000 rolls is:
P = 1 - BINOMDIST(181, 1000, 1/6, TRUE)
P = 0.105008

I needed to subtract from 1 because the cumulative function adds from 0 to 181. To get the portion for 182 and above, we subtract from the whole (1) the part we don't want, the stuff at 181 and below.

OK, so there's about a 10.5% chance of getting 182 or more.

The probability of getting 326 or more 6's in 1000 rolls is:

P = 1 - BINOMDIST(325, 1000, 1/6, TRUE)
P = -0.5.08482E-14

Obviously there's something wrong. The answer can't be negative. I think Excel still can't handle this kind of big / small number.

Does anybody have a better program and/or calculation method that can do this? Or am I doing something wrong?

David E. Gervais December 27th, 2003 10:56 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
Quote:

Originally posted by spoon:
I plugged those numbers into a RISK calculator... odds of you winning were 0.99999978. That's some streak of luck!
<font size="2" face="sans-serif, arial, verdana">I remember he was defending with 2 dice and I was attacking with 3. I vividly remember when I rolled 3 six's and expected certain victory but he rolled boxcars to counter my attack. I really don't want to know the odds on that happening.

When people say there is no such thing as luck, I don't believe them. I have faced luck and lost too many times playing RISK. LOL

Cheers! http://forum.shrapnelgames.com/images/icons/icon10.gif

Krsqk December 27th, 2003 11:11 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
Quote:

Obviously there's something wrong. The answer can't be negative. I think Excel still can't handle this kind of big / small number.
<font size="2" face="sans-serif, arial, verdana">I think that's because 1000! comes out to...

4.02387260077093773543702433923e+2567 http://forum.shrapnelgames.com/images/icons/shock.gif

Anyone want to put a name to that number? http://forum.shrapnelgames.com/images/icons/icon10.gif

The BINOMDIST function (with the TRUE parameter) gave me values steadily approaching 1 all the way up to 167, at which point Excel decided they were close enough to round to 1 (when I subtracted them from 1, the values were things like .1E-77 and the like). The odds of having no more than 167 sixes when rolling 1000 dice shouldn't be ~100%, should it?

The problem apparently occurs at 260 successes. The function calculates that the probability of having no more than 260 successes is slightly more than 1. This may be due to the rounding limitations of this function.

[ December 27, 2003, 21:46: Message edited by: Krsqk ]

Kamog December 27th, 2003 11:37 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
Since Excel can't handle 1000 events in the calculations, I have settled for something less ambitious.
I calculated the probability for each of the results for the 100 dice rolls for David and Claude.

The numbers are cumulative, so for example the first entry means that there's a 80% chance of getting 14 or more 6's out of 100 dice rolls.

</font><blockquote><font size="1" face="sans-serif, arial, verdana">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">David Probability Odds Claude Probability Odds
14 0.7999947521 1 in 1.25 34 0.0000190716 1 in 52434
12 0.9222807788 1 in 1.1 32 0.0001238040 1 in 8077
17 0.5058410243 1 in 2.0 35 0.0000070251 1 in 142347
20 0.2197498431 1 in 4.6 37 0.0000008412 1 in 1188738
17 0.5058410243 1 in 2.0 28 0.0031013887 1 in 322
16 0.6123424483 1 in 1.6 31 0.0002957849 1 in 3381
21 0.1518878479 1 in 6.6 36 0.0000024818 1 in 402926
32 0.0001238040 1 in 8077 27 0.0062087189 1 in 161
18 0.4005925583 1 in 2.5 33 0.0000496373 1 in 20146
15 0.7125790826 1 in 1.4 33 0.0000496373 1 in 20146</pre><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">From this, it appears that what Claude did is very, very, improbable!

Gryphin December 27th, 2003 11:39 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
I had a friend who played miniatures who said:
"I rather be lucky than good any day"

Kamog December 27th, 2003 11:49 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
Claude should play SE4. He'll beat your fleet of 50 dreadnaughts using 3 escorts armed with DUC's. http://forum.shrapnelgames.com/images/icons/icon12.gif

David E. Gervais December 28th, 2003 04:01 AM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
I just think my friend Claude's karma is dice based while mine is pixel based. This would explain why I'm good at computers and he is good at dice.

with this anaolgy, what kind of karma would you all say you have? (you must all be good at something. http://forum.shrapnelgames.com/images/icons/icon12.gif )

Cheers! http://forum.shrapnelgames.com/images/icons/icon10.gif

Wardad December 28th, 2003 07:59 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
I was incredibly lucky at Backgammon and Yahtzee until they made me use the cups.
I'm not sure just how my hands could make such a difference....

narf poit chez BOOM December 29th, 2003 04:29 PM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
Quote:

I was incredibly lucky at Backgammon and Yahtzee until they made me use the cups.
I'm not sure just how my hands could make such a difference....
<font size="2" face="sans-serif, arial, verdana">it's possible your subconcious was choosing which side would come up. the subconcious is possibly capable of the calculations.

David E. Gervais December 30th, 2003 02:08 AM

Re: OT: Home Sick for the Holidays, or Probability and Yahtzee
 
Quote:

Originally posted by Wardad:
I was incredibly lucky at Backgammon and Yahtzee until they made me use the cups.
I'm not sure just how my hands could make such a difference....

<font size="2" face="sans-serif, arial, verdana">It's not the hands so much as your 'opposable thumbs' that makes the difference. http://forum.shrapnelgames.com/images/icons/icon12.gif

Sorry, I couldn't resist http://forum.shrapnelgames.com/images/icons/tongue.gif

Cheers! http://forum.shrapnelgames.com/images/icons/icon10.gif


All times are GMT -4. The time now is 02:27 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.