• 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

    #41
    Originally posted by MyUserName View Post
    This is my fall back position. I was hoping to learn a bit about probability and stats by solving it myself and when that failed asking someone to explain it to me. It is not relevant to anything I am doing, I would just like to know.

    I can write programs like this in my sleep, I will not learn anything by doing that so I will only do it like that if I run out of time.
    I disagree - writing programs that simulate probabilistic situations is a good way of understanding them. e.g. of the top of my head what if you had a function get_success(x) which gives you the expected successes (i.e. ones) in one throw of x dice (that's easy enough to calculate from the probability). call the function recursively with the result and so on. Don't know what your stopping condition would be. It may be that the probability converges to zero very fast.
    Last edited by sasguru; 5 December 2013, 17:51. Reason: fixed incorrect sentence
    Hard Brexit now!
    #prayfornodeal

    Comment


      #42
      Originally posted by MyUserName View Post
      Not sure why you think it is poorly explained. A success is a 1 or a 2 and rolling a 1 also allows another die to be rolled.
      Because you've introduced more than problem into a single question. Small moves. In one part of the question events are independent and the other dependent. They must be solved separately.

      Look because I'm such a nice guy, here's my lecture notes on introduction into probability, which may help.

      https://dl.dropboxusercontent.com/u/...robability.pdf
      Last edited by scooterscot; 5 December 2013, 17:48.
      "Never argue with stupid people, they will drag you down to their level and beat you with experience". Mark Twain

      Comment


        #43
        Originally posted by No2politics View Post
        Actually I think there might be a closed form!

        If u first assume you only have one roll and work out the expected number of successes for that, and then multiply by the number of die you actually have.
        That doesn't work - you can't simple multiply by the number of dice. The sample space changes combinatorially according to the number of dice you have. So for a single die you have a sample space of 6, two it becomes 36 (with three possibilities to get at least 1 one) and so on.
        Hard Brexit now!
        #prayfornodeal

        Comment


          #44
          Originally posted by sasguru View Post
          I disagree - writing programs that simulate probabilistic situations is a good way of understanding them. e.g. of the top of my head what if you had a function get_success(x) which gives you the expected successes (i.e. ones) in x throws of the dice (that's easy enough to calculate from the probability). call the function recursively with the result and so on. Don't know what your stopping condition would be. It may be that the probability converges to zero very fast.
          A closed form solution is much more elegant than solving it by brute force I'm sure you would agree!

          The formula for a sum of geometric progression is found here

          http://en.m.wikipedia.org/wiki/Geometric_series

          It gives the equation for the first n terms. You want to add together all terms so n is infinity. This means r to the power n is zero because r is less than 1.

          So the expected number of successes is given by

          A divided by (1-r)

          So the expected number of successes in one roll is 0.5.

          If your character has 8 die than the simply times that number by 0.5. Kaboom! I would check this by simulation though. Let me know
          "You can't climb the ladder of success, with your hands in the pockets"
          Arnold Schwarzenegger

          Comment


            #45
            Originally posted by sasguru View Post
            That doesn't work - you can't simple multiply by the number of dice. The sample space changes combinatorially according to the number of dice you have. So for a single die you have a sample space of 6, two it becomes 36 (with three possibilities to get at least 1 one) and so on.
            If you have one die and the expected number of successes is x.

            Then if you have two die the expected number of successes is 2x is it not?
            "You can't climb the ladder of success, with your hands in the pockets"
            Arnold Schwarzenegger

            Comment


              #46
              So my solution is this- would be interested to see if you get the same answer if you write the code.

              If you have one die then the expected number of 1,s and 2's (ie successes) is 0.5

              If you have two die then the expected number if successes is 1.

              If you have three its 1.5.

              The equation is expected successes is equal to 0.5 times the number of die
              "You can't climb the ladder of success, with your hands in the pockets"
              Arnold Schwarzenegger

              Comment


                #47
                Originally posted by No2politics View Post
                If you have one die and the expected number of successes is x.

                Then if you have two die the expected number of successes is 2x is it not?
                Er, no.
                For one die, you can get one success by rolling the die and getting a 2, also by rolling the die, getting a 1 then rolling the second die and getting 3 through 6.
                So, the odds are then:
                1/6 + (1/6 * 4/6)
                There are two combinations of events that can give you 1 success from 1 die, the first roll that results in a 2 but denies a second roll, the probablity of this is 1/6.
                Then there is also the possiblity of a roll that results in a 1 (prob=1/6) followed by a dependant event, that doesn't give you a success, prob=4/6. These are dependant and so the probabilities are multiplied.

                So two mutually exclusive events, one of which is the result of two dependant events gives the result above.
                So, increase the number of successes to two, or three, you get some long strings of fractions, increase the number of dice to two and it starts to get complex.

                Anyway, I'm off for a chinese and to buy some beer so I'll let someone else work that out.

                Comment


                  #48
                  Would you not turn it to base 6 and then it is .1 recurring?

                  Comment


                    #49
                    Anyone seen my quantum computer?

                    Comment


                      #50
                      I'd work out the answer when starting with a single die first. That's the vaguely complex bit as it's an infinite series summation or similar. I'll try and do that in a bit.

                      The general case is equivalent to considering each initial dice seperately, so just multiply that answer by the initial number of dice.
                      While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named 'Manual.'

                      Comment

                      Working...
                      X