• 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

    #21
    Originally posted by Ticktock View Post
    I'm trying to think back to my GCSE Maths, as I think this is actually quite simple.

    You want the probability of rolling a 1 or a 2 on x number of dice, when throwing y number of dice in total?
    Yes, where y >= x

    It feels like it should be a simple series solution but I cannot quite nail it down!
    "He's actually ripped" - Jared Padalecki

    https://youtu.be/l-PUnsCL590?list=PL...dNeCyi9a&t=615

    Comment


      #22
      Originally posted by MyUserName View Post
      Yes, where y >= x

      It feels like it should be a simple series solution but I cannot quite nail it down!
      Much simpler then. I got confused because you kept implying that everytime you get a 1 you roll another die, whereas in your examples you said that you use the stats to decide how many dice to roll, and that number is then fixed, no matter what the results are.
      Last edited by Ticktock; 5 December 2013, 17:02.

      Comment


        #23
        Originally posted by Ticktock View Post
        Much simpler then. I got confused because you kept implying that everytime you get a 1 you roll another die, whereas in your examples you said that you use the stats to decide how many dice to roll, and that number is then fixed, no matter what the results are.
        I think I misunderstood your example:

        You do get to roll another die everytime you roll a 1. Hence y (the number of dice you actually roll is greater than or equal to x the number of dice you initially roll)

        You use the stats to determine how many initial dice you start with (in your example x).

        e.g.
        If you stats give you a 6 dice total the roll might go like this:

        If you roll 6 dice and get 111256 you have 4 successes

        You roll 3 more dice as you have 3 1s and get 123 you now have 4+2 successes.

        You roll 1 more die as you had 1 1 and get a 2 you now have 4+2+1 = 7 successes and your rolling stops.
        Last edited by MyUserName; 5 December 2013, 16:57.
        "He's actually ripped" - Jared Padalecki

        https://youtu.be/l-PUnsCL590?list=PL...dNeCyi9a&t=615

        Comment


          #24
          Originally posted by Ticktock View Post
          I'm trying to think back to my GCSE Maths, as I think this is actually quite simple. ...
          Some problems like this are deceptive and can actually be hideously complicated, although that's not to say there isn't some simple aha! solution in this case.

          edit: If I've understood the rules correctly, I still think it is best to think of this problem as a sequence of individual throws as I sketched in a previous comment.

          edit #2: Must dash, as I'm leaving clientco for the day, but will leave a tip that may help (not being rhetorical or smart-assed, as I haven't solved the problem).

          Bearing in mind the first edit, i.e. thinking of the problem as a sequence of single throws, to find the probability of any given number of dice throws >= 8, it helps to know the number of monotonic (rightward or downward, but not leftward or upward) lattice paths of that length in the following diagram, starting from the top left and ending on a zero node, and in which the nodes represent the number of remaining dice, a vertical path segment is the result of throwing 1 and a horizontal path segment is the result of throwing 2 to 6 :

          Code:
            8 --- 7 --- 6 -   - 0
            |     |     |       |
            |     |     |  :::  |
            8 --- 7 --- 6 -   - 0
            |     |     |       |
            |     |     |  :::  |
            8 --- 7 --- 6 -   - 0
            |     |     |       |
          
                  :::::
          c.f. Number of paths in a rectangular grid

          Search terms that may be relevant include "monotonic path", "rectangular grid", "Catalan numbers". Also there's more work involved than just one path length - I think you'll have to average over lots of path lengths!

          Good luck ..
          Last edited by OwlHoot; 5 December 2013, 17:41.
          Work in the public sector? Read the IR35 FAQ here

          Comment


            #25
            If it cannot be explained simply enough, the problem is poorly understood. That's where I'm at.

            Sounds like you're talking about permutations & combinations.

            A cut & paste from some old lecture notes....




            Permutations
            Suppose we want to find the number of ways to arrange the three letters in the word CAT in different two-letter groups where CA is different from AC and there are no repeated letters?
            Because order matters, we're finding the number of permutations of size 2 that can be taken from a set of size 3. This is often written 3_P_2. We can list them as:
            CA CT AC AT TC TA
            Now let's suppose we have 10 letters and want to make groupings of 4 letters. It's harder to list all those permutations. To find the number of four-letter permutations that we can make from 10 letters without repeated letters (10_P_4), we'd like to have a formula because there are 5040 such permutations and we don't want to write them all out!
            For four-letter permutations, there are 10 possibilities for the first letter, 9 for the second, 8 for the third, and 7 for the last letter. We can find the total number of different four-letter permutations by multiplying 10 x 9 x 8 x 7 = 5040. This is part of a factorial (see note).
            To arrive at 10 x 9 x 8 x 7, we need to divide 10 factorial (10 because there are ten objects) by (10-4) factorial (subtracting from the total number of objects from which we're choosing the number of objects in each permutation). You can see below that we can divide the numerator by 6 x 5 x 4 x 3 x 2 x 1:
            10! 10! 10 x 9 x 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1
            10_P_4 = ------- = ---- = --------------------------------------
            (10 - 4)! 6! 6 x 5 x 4 x 3 x 2 x 1

            = 10 x 9 x 8 x 7 = 5040
            From this we can see that the more general formula for finding the number of permutations of size k taken from n objects is:
            n!
            n_P_k = --------
            (n - k)!
            For our CAT example, we have:
            3! 3 x 2 x 1
            3_P_2 = ---- = ----------- = 6
            1! 1
            We can use any one of the three letters in CAT as the first member of a permutation. There are three choices for the first letter: C, A, or T. After we've chosen one of these, only two choices remain for the second letter. To find the number of permutations we multiply: 3 x 2 = 6.
            Note: What's a factorial? A factorial is written using an exclamation point - for example, 10 factorial is written 10! - and means multiply 10 times 9 times 8 times 7... all the way down to 1.
            ________________________________________

            Combinations
            When we want to find the number of combinations of size 2 without repeated letters that can be made from the three letters in the word CAT, order doesn't matter; AT is the same as TA. We can write out the three combinations of size two that can be taken from this set of size three:
            CA CT AT
            We say '3 choose 2' and write 3_C_2. But now let's imagine that we have 10 letters from which we wish to choose 4. To calculate 10_C_4, which is 210, we don't want to have to write all the combinations out!
            Since we already know that 10_P_4 = 5040, we can use this information to find 10_C_4. Let's think about how we got that answer of 5040. We found all the possible combinations of 4 that can be taken from 10 (10_C_4). Then we found all the ways that four letters in those groups of size 4 can be arranged: 4 x 3 x 2 x 1 = 4! = 24. Thus the total number of permutations of size 4 taken from a set of size 10 is equal to 4! times the total number of combinations of size 4 taken from a set of size 10: 10_P_4 = 4! x 10_C_4.
            When we divide both sides of this equation by 4! we see that the total number of combinations of size 4 taken from a set of size 10 is equal to the number of permutations of size 4 taken from a set of size 10 divided by 4!. This makes it possible to write a formula for finding 10_C_4:
            10_P_4 10! 10!
            10_C_4 = -------- = ------- = ----------
            4! 4! x 6! 4!(10-4)!


            10 x 9 x 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1
            = --------------------------------------
            4 x 3 x 2 x 1 (6 x 5 x 4 x 3 x 2 x 1)


            10 x 9 x 8 x 7 5040
            = -------------- = ------ = 210
            4 x 3 x 2 x 1 24

            More generally, the formula for finding the number of combinations of k objects you can choose from a set of n objects is:
            n!
            n_C_k = ----------
            k!(n - k)!
            For our CAT example, we do the following:
            3! 3 x 2 x 1 6
            3_C_2 = ------ = ----------- = --- = 3
            2!(1!) 2 x 1 (1) 2
            "Never argue with stupid people, they will drag you down to their level and beat you with experience". Mark Twain

            Comment


              #26
              This is not relevant as it misses the complicating factor of there being an unknown number of dice involved after the initial allocation.

              Each dice has a 1/6 chance of bringing in another die and repeat. Logically this causes some kind of series to form of 1/6^X or something but I cannot nail it.
              "He's actually ripped" - Jared Padalecki

              https://youtu.be/l-PUnsCL590?list=PL...dNeCyi9a&t=615

              Comment


                #27
                Originally posted by scooterscot View Post
                some completely irrelevant gumph
                I always knew you were a fraud. You've just proved it. What is it you sell those poor Germans? Just repeated Weibulls?
                Hard Brexit now!
                #prayfornodeal

                Comment


                  #28
                  Originally posted by MyUserName View Post
                  Fair enough, maybe I am not explaining things very clearly!

                  If a character has, say archery skill at level 3 that would mean he gets to roll 6 dice on archery tests.
                  If he has a magic bow he gets an extra 2 dice.

                  He wants to hit a target very far away, the GM has allocated it at difficulty level 5.

                  Hence the archer rolls 6+2 = 8 dice hoping to end up with 5 successes (where a success is a 1 or a 2 being rolled).

                  The other scenario is if Sir KillsALot meets a humble peasant

                  Sir Kills has fight skill of 4, sword 2D and armour 3D so rolls 9 dice when he fights.
                  Peasant has fight skill of 1, a spear 1D and no armour so rolls 3 dice when he fights.

                  If they fight each other they both roll and whomever gets the most successes wins.

                  In order to correctly calibrate task difficulty etc. I would like the equations so I can calculate probabilities.
                  I've already given you the equation for computing binomial probabilities. I think the problem you're having is expressing this in the right format. Most of the difficulty with maths is analysis of the problem. My analysis of what you've written is that you have 12 1:1 fights (trials) and the first fighter is weighted to the tune of 9/12 in winning these fights. In that case, p=0.75 (9/12), n=12 and k= 7 successes or more from the 12 trials. You then need the cumulative distribution function for the binomial distribution with these parameter values (remember the cdf is <=, whereas the probability mass function is for a specific number of successes). In other words, the stronger fighter has a roughly 94.5% chance of winning.

                  Comment


                    #29
                    One way to do this (and quite possibly the only way as my first impression is there isn't a closed form solution- ie no equation can describe it) is by simulation.

                    You would need a random number generator and a set of rules/code to do this. The random number is between 0 and 1. You would say if random number < (1/6) then dice roll=1. You would keep a count of the number of success etc, and write the code to cover all outcomes. Run the simulation 10000 times and calculate the average number of successes.
                    "You can't climb the ladder of success, with your hands in the pockets"
                    Arnold Schwarzenegger

                    Comment


                      #30
                      Originally posted by jamesbrown View Post
                      I've already given you the equation for computing binomial probabilities. I think the problem you're having is expressing this in the right format. Most of the difficulty with maths is analysis of the problem. My analysis of what you've written is that you have 12 1:1 fights (trials) and the first fighter is weighted to the tune of 9/12 in winning these fights. In that case, p=0.75 (9/12), n=12 and k= 7 successes or more from the 12 trials. You then need the cumulative distribution function for the binomial distribution with these parameter values (remember the cdf is <=, whereas the probability mass function is for a specific number of successes). In other words, the stronger fighter has a roughly 94.5% chance of winning.
                      The problem with this approach is the number of trials is not fixed. In theory there are an infinite number of trials if he keeps rolling a 1
                      "You can't climb the ladder of success, with your hands in the pockets"
                      Arnold Schwarzenegger

                      Comment

                      Working...
                      X