Dice Probabilities

[Home]   [Puzzles & Projects]    [Delphi Techniques]   [Math Topics]   [Library]   [Utilities]

Search

 

Search DelphiForFun.org only

Support DFF

 If you benefit from the website,  in terms of knowledge, entertainment value, or something otherwise useful, consider making a donation via PayPal  to help defray the costs.  (No PayPal account necessary to donate via credit card.)  Transaction is secure.

 

If you shop at Amazon anyway,  consider using this link. We receive a few cents from each purchase.   Thanks.

In Association with Amazon.com

 

Contact

Feedback:  Send an e-mail with your comments about this program (or anything else).

 

Search DelphiForFun.org only

 

 

 

 

Problem Description

Here's a program to estimate the probability of  matched sets of dice or specified sum of dots for all dice when multiple dice are thrown.    

Background & Techniques

A project to develop a strategy for a dice game led to this program to understand the odds of throwing for example 3 of a kind when 6 dice are thrown.   The first  (un-posted) version included  analytical solutions and used the simulated results to confirm the calculated probabilities.  The only problem is, I realized that I'm not a good enough mathematician to to figure the analytical results.  So this version only shows probabilities determined by simulating 1,000,000 trials at a time and counting outcomes.  (By definition, the probability of a random event is the number of successful outcomes of the event divided by the total number of possible outcomes.)   Perhaps some kind viewer will help me out and allow this page (and program) to be completed.

Calculating the theoretical probability of throwing a pair when 3 dice are rolled seems straightforward.  There are 3 ways to throw a specific value (say 1) .  (11x, 1x1, x11).  So there are 18 ways for a pair with any value to occur (6x3).  And, for each of these, the other die may be one of the 5 unused numbers so there are 18x5 or 90 successful outcomes out of the 216 possible outcomes (6X6X6).  So the probability of throwing a pair when 3 dice are thrown is 90/216 or 0.417.

Now try the same analysis for rolling exactly three matching dice when 6 are rolled.  The ways to select the triplet is easy, it's 6 times the  number of ways to select 3 of 6 items which is Combo(6,3)=6!/(3!*3!)=6x5x4x3x2/(3x2x3x2)=20. Therefore there should be 6x20 pr 120 ways to select the triplet.   Now the problem is, how to count the other three.  They cannot be the same value as the triplet, so we might think there are 5X5x5 choices.  But wait, these last three  cannot all of the same value or we would have a second triplet and we are trying to calculate the probability of a single triplet.  So how about 5x5x5-5=120.  And  6x20x120=14400 out of 46656  = 0.308.  Hey!  That agrees pretty well with the program results!  

Maybe this is not so hard after all.  How about a single pair when 6 dice are thrown?  Or exactly two pair out of 6 dice?  Oops, now it seems a lot harder to make sure the leftover dice do not form another pair.   I'll leave these as an exercise for the viewer.  When you get it, let me know.   :>)  

Addendum July 17, 2009:  I revisited the analytical solution in V3.0 of the program posted today.   I also added support for dice with fewer than 6 sides.   I think that it produces correct results for dice with 2 to 6 sides and 2 to 6 dice rolled per trial.  

   Running/Exploring the Program 

Suggestions for Further Explorations

(Mostly done) July  2009: ,Add theoretical calculated probabilities for both type of rolls, "matched sets': and 'number of dots".

 

Original Date: December 18, 2005 

Modified: July 17, 2009

 

  [Feedback]   [Newsletters (subscribe/view)] [About me]
Copyright © 2000-2010, Gary Darby    All rights reserved.