• 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!
Collapse

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

  • You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
  • You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
  • If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Previously on "Dice roll probability"

Collapse

  • doodab
    replied
    Originally posted by MyUserName View Post
    Okay so average number of successes (where success is rolling a 1 or a 2 on a D6) via the following system:

    Roll a set number of dice (do not add them up, they are calculated individually).
    For every dice which has rolled 1 roll an additional dice
    Count all 1s and 2s

    Can be partially solved by a negative binomial distribution but this seems to give the probability of rolling 1s and does not factor in 2s. Is this simple to factor in?


    Also, for compiling tables of probabilities I would like to know the odds of rolling m successes with n initial dice.

    This will be use to calculate the difficulty of tasks in the game. Someone can have a skill ranging from 0 - 5 (where each level of skill gains 2 dice). A level of 5 would be awesome, a world champion of a highly competitive sport for example.

    If someone is aiming to fire an arrow into the gold at 100 yards what should the difficulty level be set at? Should it need 4 successes, 10, 15? This is what the probabilities will be used to configure.


    I have knocked up a program which calculates averages over many throws. It looks like that being as every dice roll is independent I can calculate the probability of the result from 1 dice and then just multiply it by the number of dice. Is this right?
    I've posted the formula for n successes with a single initial dice up above somewhere. you can use that to work out the multiple die cases as follows.

    For more than one initial dice you need to add up the probabilities for all the ways N successees could happen. E.g with two dice and 3 successes you need to work out the probability of getting 3,0 2,1 1,2 and 3,0 from your initial dice and add them all together.

    The odds of e.g. 3,0 can be worked out by mutiplying the odds of getting 3 successes from 1 die by the odds of getting none (this latter is 4/6, the formula is only valid for > 0)

    For 3 dice you need to consider e.g. 3,0,0 2,1,0 2,0,1 1,1,1 and so on. Each term worked out by multiplying the 3 individual ones together, then add them all at the end.

    I will try and write this down and simplify to a single formula in terms of D and N later but I am struggling a bit today.

    Oh yes average number of successes is 2D/5 with D initial dice.
    Last edited by doodab; 10 December 2013, 10:08.

    Leave a comment:


  • MyUserName
    replied
    Okay so average number of successes (where success is rolling a 1 or a 2 on a D6) via the following system:

    Roll a set number of dice (do not add them up, they are calculated individually).
    For every dice which has rolled 1 roll an additional dice
    Count all 1s and 2s

    Can be partially solved by a negative binomial distribution but this seems to give the probability of rolling 1s and does not factor in 2s. Is this simple to factor in?


    Also, for compiling tables of probabilities I would like to know the odds of rolling m successes with n initial dice.

    This will be use to calculate the difficulty of tasks in the game. Someone can have a skill ranging from 0 - 5 (where each level of skill gains 2 dice). A level of 5 would be awesome, a world champion of a highly competitive sport for example.

    If someone is aiming to fire an arrow into the gold at 100 yards what should the difficulty level be set at? Should it need 4 successes, 10, 15? This is what the probabilities will be used to configure.


    I have knocked up a program which calculates averages over many throws. It looks like that being as every dice roll is independent I can calculate the probability of the result from 1 dice and then just multiply it by the number of dice. Is this right?

    Leave a comment:


  • shaunbhoy
    replied
    Originally posted by sasguru View Post
    Better than my lunch.
    Missus is at her mum's, taking the sprog because I have to work this w/e.
    So I made myself a very boring and dry cheese sandwich.
    A sandwich that might have been custom-made for your demographic.

    Leave a comment:


  • sasguru
    replied
    Originally posted by doodab View Post
    Turkey. Not too bad.
    Better than my lunch.
    Missus is at her mum's, taking the sprog because I have to work this w/e.
    So I made myself a very boring and dry cheese sandwich.

    Leave a comment:


  • mudskipper
    replied
    Originally posted by doodab View Post
    Turkey. Not too bad.
    Cold turkey for the liver ward?

    Leave a comment:


  • doodab
    replied
    Originally posted by sasguru View Post
    .

    What you having for lunch?
    Turkey. Not too bad.

    Leave a comment:


  • doodab
    replied
    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.

    Leave a comment:


  • OwlHoot
    replied
    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

    Leave a comment:


  • doodab
    replied
    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.

    Leave a comment:


  • sasguru
    replied
    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?

    Leave a comment:


  • doodab
    replied
    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.

    Leave a comment:


  • doodab
    replied
    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))

    Leave a comment:


  • doodab
    replied
    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.

    Leave a comment:


  • sasguru
    replied
    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.

    Leave a comment:


  • doodab
    replied
    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.

    Leave a comment:

Working...
X