Results 1 to 16 of 16
-
2019-11-01, 03:58 PM (ISO 8601)
- Join Date
- Aug 2018
Is there a mathematic formula for this?
So I'm wondering if there is a shortcut for something I'm trying to figure out. Let me try to explain. You have 6 sided die. Any number from 1-6 has an equal chance of being the outcome. How do I calculate finding the outcome for each sum if I roll two 6 sided dice? Like rolling a getting the sum 2 and 12 is 1/36. But how do I can I calculate the other results without actually listing them all? Long story short I have to do this but for each possible sum if I roll SIX 6 sided dice (so the outcomes are 6-36).
Thanks!
-
2019-11-01, 04:10 PM (ISO 8601)
- Join Date
- Sep 2016
Re: Is there a mathematic formula for this?
I'm pretty sure we've done it before, with various complications.
It's a basicish combination problem (in that there is a nice general solution, not so basic that I can remember it)
For the 2 dice it looks like a triangle (centred on 7)
For 6 The mean is 6*3.5, and it's a very spikey graph.Last edited by jayem; 2019-11-01 at 04:11 PM.
-
2019-11-01, 04:23 PM (ISO 8601)
- Join Date
- Aug 2018
-
2019-11-01, 04:23 PM (ISO 8601)
- Join Date
- Feb 2015
Re: Is there a mathematic formula for this?
For the probability function p(x) for the probability of the sum of 6 dice being x, I think the exact solution is probably a piecewise polynomial with 6 pieces and degree 5 on each piece. The discrete analog of integration should give the formulas. If you just want a table of numbers, it is probably more practical to iteratively compute the table P(N) for N dice from the table P(N-1) for N-1 dice as: P(N)(x) = sum over y = 1 to 6 of (1/6) * P(N-1)(x-y), taking care to keep track of for which values x P(N-1)(x) was zero.
And there are approximation schemes where you just match up the average values and the standard deviations and call it a day.
I'd be more explicit, but I have to run.
-
2019-11-01, 04:51 PM (ISO 8601)
- Join Date
- Sep 2016
Re: Is there a mathematic formula for this?
I was going to come back (I was having a brain fart with the integration).
For one die there is one way of getting each result.
For two die, the combinations are P(2)=1, P(3)=2 P(4)=3 P(5)=4 P(6)=5 P(7)=6 P(8)=5 P(9)=4 etc... If you plot it on a graph you get a triangle.
As you add more die the graph at the bottom gets a bit wider but it looks almost like a spike.
For 6 die, the combinations start P(6)=1, 6, 35 (any die can be the first 2, any die can be the second but if it's the same)
As Davidsh suggest. Iterative computation is probably the nicest way. You can 'easily' modify it to deal with compounding issues.
It saves having to deal with the vast majority of identical cases (in the 6 die case you do with something like 200 simple sums rather that 46656). If you feel clever you can even build it up exponentially.
-
2019-11-01, 05:49 PM (ISO 8601)
- Join Date
- Sep 2014
Re: Is there a mathematic formula for this?
If you just want to look at dice probabilities as part of something else you're figuring out, https://anydice.com/ is going to be much easier than doing math yourself.
-
2019-11-01, 08:52 PM (ISO 8601)
- Join Date
- Sep 2011
- Location
- Calgary, AB
- Gender
Re: Is there a mathematic formula for this?
I had a discussion with my friend earlier this year about just this. Let me see if I can dig up my old notes...
Short version is, if you roll an n-sided die and an m-sided die (n can equal m) you multiply the polynomials (x1+x2+x3...+xn) and (x1+x2+x3...+xm). The exponents of the terms in the resulting polynomial are the potential sums; the coefficients of each term (remember the implied 1 in front of certain terms) are the number of ways to get that particular sum. So in this case, you'd be multiplying (x1+x2+x3+x4+x5+x6) by itself a few times. If I can find my old notes (we specifically looked at that exact circumstance a while back) I'll post what that looks like, but until then, try to enjoy the multiplication you've got to do.
-
2019-11-01, 08:54 PM (ISO 8601)
- Join Date
- Jan 2009
Re: Is there a mathematic formula for this?
Not sure about the formula, but this gives the probabilities for various xd6.
http://gurpsland.no-ip.org/articles/d6chance.htm
-
2019-11-01, 10:14 PM (ISO 8601)
- Join Date
- Dec 2007
- Location
- San Antonio, Texas
- Gender
Re: Is there a mathematic formula for this?
And https://anydice.com/ will show you the outcome for a variety of different die combinations.
The Cranky Gamer
*It isn't realism, it's verisimilitude; the appearance of truth within the framework of the game.
*Picard management tip: Debate honestly. The goal is to arrive at the truth, not at your preconception.
*Mutant Dawn for Savage Worlds!
*The One Deck Engine: Gaming on a budget
Written by Me on DriveThru RPG
There are almost 400,000 threads on this site. If you need me to address a thread as a moderator, include a link.
-
2019-11-01, 10:42 PM (ISO 8601)
- Join Date
- Oct 2006
- Gender
Re: Is there a mathematic formula for this?
For general calculations I like to use https://www.wolframalpha.com/
It can easily do dice, and it will give you the statistical distribution as well. It handled 3d8+4d6 just fine as a random test.
It is also really good for unit conversions and all sorts of other things.
While there are formulas for calculating dice rolls, a more simplified chart is probably a lot more useful for understanding the probability and distribution, with distribution being more important to most cases where you're using dice.
-
2019-11-01, 11:05 PM (ISO 8601)
- Join Date
- Jul 2011
Re: Is there a mathematic formula for this?
This method is known as using generating functions, and it's equivalent to performing a Discrete Convolution on the distributions. In general, you can't get a nice closed form where you can just plug in the number of dice and get the function you want, you have to use an algorithm to do it. As someone said above, for our purposes as roleplayers just using anydice is more than sufficient.
-
2019-11-02, 12:46 AM (ISO 8601)
- Join Date
- Aug 2019
Re: Is there a mathematic formula for this?
Yep, its a convolution. Much repeated addition. The vids in the link help you to find a feeling for how it works. The distributions 'pass by' each other to define the outcome at that point.
If you want a shortcut for several dice (four or more), you can use the Cental Limit Theorem (https://en.m.wikipedia.org/wiki/Central_limit_theorem). That is, they approximately behave like a bell curve. It even holds for different sorts of dice, since dice distributions are generally well behaved.Last edited by Rydiro; 2019-11-02 at 12:50 AM.
-
2019-11-02, 09:02 AM (ISO 8601)
- Join Date
- Aug 2013
Re: Is there a mathematic formula for this?
As Craft mentioned, there is no nice closed formula for an arbitrary number n of dice. However, this is a nice article that breaks down the math for deriving the formulas of the distributions for n=2,3,4.
Inuit avatar withcherrybanana on top by Yanisa
-
2019-11-03, 07:09 AM (ISO 8601)
- Join Date
- Jan 2019
Re: Is there a mathematic formula for this?
While exact solutions are not always available, the Central_limit_theorem tells us that the more dice you add the closer to a normal distribution you get. Once you are looking at more than a couple of dice the normal approximation is pretty good.
-
2019-11-08, 12:10 AM (ISO 8601)
- Join Date
- Aug 2008
Re: Is there a mathematic formula for this?
For 2d6 specifically: P(n)=(6-|n-7|)/36
Beyond 2d6 it starts getting a lot messier (though you can fit a polynomial to any of them, at the very least through some sort of brute force fit of a whole bunch of individual points, though at that point tabular data is so much easier).I would really like to see a game made by Obryn, Kurald Galain, and Knaight from these forums.
I'm not joking one bit. I would buy the hell out of that. -- ChubbyRain
Current Design Project: Legacy, a game of masters and apprentices for two players and a GM.
-
2019-11-08, 12:21 AM (ISO 8601)
- Join Date
- Nov 2008
Re: Is there a mathematic formula for this?
You can recursively generate the formula for n dice from the formula for n-1 dice:
p(x, n): probability of rolling an x on nd6
p(0, 0) = 1; p(x, 0) = 0 where x≠0
p(x, n) = (p(x-1, n-1) + p(x-2, n-1) + p(x-3, n-1) + p(x-4, n-1) + p(x-5, n-1) + p(x-6, n-1)) / 6
And you can calculate the formula for any x and n by repeated substitution. Needless to say, it gets really complicated for large values of n.Last edited by Bucky; 2019-11-08 at 12:22 AM.
The gnomes once had many mines, but now they have gnome ore.