• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Dice roll probability

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    So, anyone solved the probability problem yet, which I think is what MUN wanted?:
    i.e. What is the pmf of S(N), the number of successes for N dice, where a success is 1 or 2 and a 1 leads to a further throw of a dice?
    The fact that he want this in closed form is challenging.
    From deep dark memory there are things called probability generating functions and moment generating functions which might or might not be relevant to this problem, but I can't remember how they're used.

    It's lucky we have cowboydave with his brilliant mathematical knowledge, I'm sure he'll be along with the solution shortly.
    Hard Brexit now!
    #prayfornodeal

    Comment


      Originally posted by sasguru View Post
      So, anyone solved the probability problem yet, which I think is what MUN wanted?:
      i.e. What is the pmf of S(N), the number of successes for N dice, where a success is 1 or 2 and a 1 leads to a further throw of a dice?
      The fact that he want this in closed form is challenging.
      From deep dark memory there are things called probability generating functions and moment generating functions which might or might not be relevant to this problem, but I can't remember how they're used.

      It's lucky we have cowboydave with his brilliant mathematical knowledge, I'm sure he'll be along with the solution shortly.
      I'm hoping it's just a counting argument that's complicated by the fiddly rules. The main issue is the number of permutations that give more than N successes is hard to tie down, I've a feeling that might actually scupper it.

      If I could get a formula for # of successes being < N then that would give the answer. I think I can get that, as the chance of more than N can be easily counted if you don't care about the exact value.
      Last edited by doodab; 8 December 2013, 10:29.
      While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named 'Manual.'

      Comment


        Originally posted by doodab View Post
        . The main issue is the number of permutations that give more than N successes is hard to tie down, .
        Aye, that's why I think a programmatic simulation would be useful.
        Hard Brexit now!
        #prayfornodeal

        Comment


          Originally posted by sasguru View Post
          Aye, that's why I think a programmatic simulation would be useful.
          Well, we know with a single die the chance of at least one success is 1/3, at least 2 is 1/18 and so on, but those are worked out by hand at the moment. Once I have a formula for that, the answer for a given N is just the difference between two successive terms.

          Then that needs to be added up over all the permutations with D dice to get the final answer. That I suspect will be a complicated sum, might get the missus to bring my laptop in so I can use mathematica to work out the answer for me.
          While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named 'Manual.'

          Comment


            I've been working that out the hard way as well. Odds for more than n successes from a single die is 2/(6^(n+1))
            While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named 'Manual.'

            Comment


              Ok I've got probability of n successes from a single die as

              10 / (6 ^ (n + 1))

              For n > 0

              I'll think about the multi die case later, nearly lunch time now.
              While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named 'Manual.'

              Comment


                Originally posted by doodab View Post
                Ok I've got probability of n successes from a single die as

                10 / (6 ^ (n + 1))

                For n > 0

                I'll think about the multi die case later, nearly lunch time now.
                Bear in mind the increasing complexity of the sample space as n gets larger. Unlike the expected value, I don't think you can calculate the value for one die and multiply by n.

                What you having for lunch?
                Hard Brexit now!
                #prayfornodeal

                Comment


                  Originally posted by sasguru View Post
                  Bear in mind the increasing complexity of the sample space as n gets larger. Unlike the expected value, I don't think you can calculate the value for one die and multiply by n.

                  What you having for lunch?
                  Yeah, you need to sum the odds of the different permutations of getting N over the D dice. I.e. for 2 dice, N = 1 you could have 1,0 + 0,1, for N = 2 you have 2,0 + 1,1 + 0,2 etc. So you can use the single dice odds to work it out but it's not a simple multiply by D.
                  While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named 'Manual.'

                  Comment


                    Originally posted by doodab
                    The main issue is the number of permutations that give more than N successes is hard to tie down ..
                    Yes, it has an infinite tail. So for an exact formula you'd want to express p(greater than n 1's) arse about face as 1 - p(1 1) - p(2 1s) - ... - p (n 1s) where each p(r 1s) is the probability of exactly r 1s and therefore they are independent.

                    Generally, if one starts with an allowance of m rolls of a dice, and roll n 1s there will be m rolls which are not 1s. Any other value is equally likely for each such roll, so the probability that the number of 2s (say) is some given value k <= m is given by the Binomial Distribution as (m! / (m-k)! k!) * r^k * (1 - r)^(m - k) where r = 1/5 is the probability of throwing any given value other than 1. (In this, the first bracketed term is usually said "m choose k".)

                    The number of 1s rolled, as I mentioned earlier, is given by the Negative Binomial distribution, with a success being rolling a 1, and a failure is any other roll, and we want the number k of successes before m failures. So the probability that k 1s are rolled is "m+k−1 choose k" * (1−s)^m s^k, where s = 1/6 is the probability of rolling a 1 on any given roll.

                    However, there's yet another twist to this fiendish problem: It isn't exactly equivalent to a sequence of throws, as assumed in the above and I thought earlier, because if you throw the allocated number of dice together, and then rethrow all the 1s, and so on until no 1s remain, then you could end up with k 1s and k non-1s in the same throw (which couldn't happen if throwing one dice sequentially). To deal with this, I think it's enough to tweak the final probabilities as follows:

                    Denote P as the probability of one outcome (such as throwing k 1s), and Q the probability of another outcome, then the probability of the first outcome occurring first, i.e. not after the second is, I think P (1 - Q) / (P (1 - Q) + (1 - P) Q), and similarly the probability of Q occurring not after P is (1 - P) Q / (P (1 - Q) + (1 - P) Q)

                    HTH
                    Work in the public sector? Read the IR35 FAQ here

                    Comment


                      Originally posted by OwlHoot View Post
                      Yes, it has an infinite tail. So for an exact formula you'd want to express p(greater than n 1's) arse about face as 1 - p(1 1) - p(2 1s) - ... - p (n 1s) where each p(r 1s) is the probability of exactly r 1s and therefore they are independent.

                      Generally, if one starts with an allowance of m rolls of a dice, and roll n 1s there will be m rolls which are not 1s. Any other value is equally likely for each such roll, so the probability that the number of 2s (say) is some given value k <= m is given by the Binomial Distribution as (m! / (m-k)! k!) * r^k * (1 - r)^(m - k) where r = 1/5 is the probability of throwing any given value other than 1. (In this, the first bracketed term is usually said "m choose k".)

                      The number of 1s rolled, as I mentioned earlier, is given by the Negative Binomial distribution, with a success being rolling a 1, and a failure is any other roll, and we want the number k of successes before m failures. So the probability that k 1s are rolled is "m+k−1 choose k" * (1−s)^m s^k, where s = 1/6 is the probability of rolling a 1 on any given roll.

                      However, there's yet another twist to this fiendish problem: It isn't exactly equivalent to a sequence of throws, as assumed in the above and I thought earlier, because if you throw the allocated number of dice together, and then rethrow all the 1s, and so on until no 1s remain, then you could end up with k 1s and k non-1s in the same throw (which couldn't happen if throwing one dice sequentially). To deal with this, I think it's enough to tweak the final probabilities as follows:

                      Denote P as the probability of one outcome (such as throwing k 1s), and Q the probability of another outcome, then the probability of the first outcome occurring first, i.e. not after the second is, I think P (1 - Q) / (P (1 - Q) + (1 - P) Q), and similarly the probability of Q occurring not after P is (1 - P) Q / (P (1 - Q) + (1 - P) Q)

                      HTH
                      Yeah it turned out that odds of at least N successes from a single starting die is simple to calculate, you just need to consider that you have at least a certain number of ones in a row followed by a 1 or 2. Obviously this takes in to account all the extra dice that need to be thrown as well. So N successes is a simple difference between two successive terms and the resulting series sums to 1, as you would expect of a probability. So I'm confident of that being correct.

                      The rest is simply summing those probabilities over various permutations when you have more than one dice.
                      Last edited by doodab; 8 December 2013, 12:52.
                      While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named 'Manual.'

                      Comment

                      Working...
                      X