Calculating odds of rolling a given total with a specified number of dice
|
06-15-2015, 03:25 PM
Post: #1
|
|||
|
|||
Calculating odds of rolling a given total with a specified number of dice
I could swear I had a direct formula for this at one point, but I'm totally drawing a blank.
Suppose I've got n standard 6-sided dice, numbered 1 through 6. Is there a formula for calculating the frequency (i.e. number of different permutations) of rolling a given total? For example, what are the odds of rolling a total of 22 on 9 dice? (It's about 1.45% in this case.) The brute-force approach is really simple on SQL Server (code below), and runs all ~10 million permutations in about 1-2 seconds on the server I've got access to, but my HP 48 probably won't be so quick. Code: WITH die AS ( And for extra fun, I'm also wondering if such a formula could be extended to rolling a pool of non-standard, mixed dice, e.g. maybe three of them numbered 0, 0, 0, 1, 2, 3, two numbered 0, 0, 1, 2, 2, 3, and one with 0, 0, 1, 2, 3, 4. The brute-force approach can be adapted for this trivially. The motivation behind this would be in case I'm playing a board game and want to quickly math out my odds of success before diving into a potentially pivotal move. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)