New OOTS products from CafePress
New OOTS t-shirts, ornaments, mugs, bags, and more
Results 1 to 16 of 16
  1. - Top - End - #1
    Barbarian in the Playground
    Join Date
    Aug 2018

    Default 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!

  2. - Top - End - #2
    Barbarian in the Playground
     
    PaladinGuy

    Join Date
    Sep 2016

    Default Re: Is there a mathematic formula for this?

    Quote Originally Posted by Magic_Hat View Post
    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!
    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.

  3. - Top - End - #3
    Barbarian in the Playground
    Join Date
    Aug 2018

    Default Re: Is there a mathematic formula for this?

    Quote Originally Posted by jayem View Post
    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.
    Huh?

  4. - Top - End - #4
    Bugbear in the Playground
     
    MindFlayer

    Join Date
    Feb 2015

    Default 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.

  5. - Top - End - #5
    Barbarian in the Playground
     
    PaladinGuy

    Join Date
    Sep 2016

    Default Re: Is there a mathematic formula for this?

    Quote Originally Posted by Magic_Hat View Post
    Huh?
    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.

  6. - Top - End - #6
    Bugbear in the Playground
    Join Date
    Sep 2014

    Default 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.

  7. - Top - End - #7
    Ettin in the Playground
     
    georgie_leech's Avatar

    Join Date
    Sep 2011
    Location
    Calgary, AB
    Gender
    Male

    Default 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.
    Last edited by georgie_leech; 2019-11-01 at 08:52 PM.
    Quote Originally Posted by Grod_The_Giant View Post
    We should try to make that a thing; I think it might help civility. Hey, GitP, let's try to make this a thing: when you're arguing optimization strategies, RAW-logic, and similar such things that you'd never actually use in a game, tag your post [THEORETICAL] and/or use green text

  8. - Top - End - #8
    Ettin in the Playground
     
    BardGuy

    Join Date
    Jan 2009

    Default 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

  9. - Top - End - #9
    Librarian in the Playground Moderator
     
    LibraryOgre's Avatar

    Join Date
    Dec 2007
    Location
    San Antonio, Texas
    Gender
    Male

    Default 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.

  10. - Top - End - #10
    Ettin in the Playground
     
    Erloas's Avatar

    Join Date
    Oct 2006
    Gender
    Male

    Default 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.

  11. - Top - End - #11
    Ogre in the Playground
    Join Date
    Jul 2011

    Default Re: Is there a mathematic formula for this?

    Quote Originally Posted by georgie_leech View Post
    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.
    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.

  12. - Top - End - #12
    Orc in the Playground
     
    Kobold

    Join Date
    Aug 2019

    Default Re: Is there a mathematic formula for this?

    Quote Originally Posted by Craft (Cheese) View Post
    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.
    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.

  13. - Top - End - #13
    Barbarian in the Playground
     
    aspi's Avatar

    Join Date
    Aug 2013

    Default 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 with cherry banana on top by Yanisa

  14. - Top - End - #14
    Dwarf in the Playground
     
    Imp

    Join Date
    Jan 2019

    Default 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.

  15. - Top - End - #15
    Titan in the Playground
     
    Knaight's Avatar

    Join Date
    Aug 2008

    Default 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.

  16. - Top - End - #16
    Ogre in the Playground
    Join Date
    Nov 2008

    Default 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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •