Tuesday, January 6, 2015

Math by Request: An Introduction to Combinatorics



Jon Glas has requested that I give a bit more background information on how I have been calculating probabilities.  This area of mathematics is known as combinatorics, and with its relation to 40k one of my favorite areas of mathematics.

In the first video I talk about how to set up a probability problem using combinatorics.  I spend quite a bit of time talking about how to find the number of combinations, and I give you four different ways of making that calculation.  Note I do not have any specific references in the video to Warhammer (I do want to reuse this video in my classroom), but the 1/12 probability is the chances of a space marine doing a wound to another space marine.




In the second video I go through a couple of different types of example problems.  The first problem is calculating the probability that four space marines will do exactly two wounds to another group of space marines.  The second problem is calculating the probability that the same group of four space marines will do two or more wounds.




If there is something that does not make sense in either one of the videos please let me know.  At some point these videos will be used for instruction with my classes, and if you all have questions them I'm sure my students will have the same questions.

15 comments:

  1. Excellent! Its cool to see the math beyond the hammer :)

    ReplyDelete
  2. WOW... I will watch this video soon....! TY :-)
    (I hope I will understand something...!!)

    ReplyDelete
  3. How does reroll of failures affect the calculations?

    ReplyDelete
    Replies
    1. It will just affect the chance to succeed and fail.

      The chance for a space marine to hit with a shooting attack is 2/3 but if the attack were twin linked it would be as follows:

      2/3 + (1/3)*(2/3) = 8/9 because there is a 2/3 chance of hitting the first time and a 1/3 chance you miss the first opportunity and then 2/3 chance again to hit the second opportunity.

      So with combinatorics. Lets say your space charges into combat to punch a chaos marine. You would have a 1/12 chance of success because (1/2)*(1/2)*(1/3) = (1/12).

      Now if you were able to re-roll your misses your calculation would be (3/4)*(1/2)*(1/3) = (1/8)

      So, if you were doing calculations with combinatorics you would use the 1/12 for regular situations and the 1/8 when you could re-roll your misses.

      Delete
  4. you have a mistake:
    the space marine have 2/3 probability to hit and not 1/2
    the chance of success is
    (2/3)*(1/2)*(1/3)=1/9 without reroll
    (8/9)*(1/2)*(1/3)=4/27 with reroll

    ReplyDelete
    Replies
    1. Sorry, I switched from talking about shooting attacks to talking about melee attacks, and I didn't really make that clear.

      Yes, you are correct with your numbers.

      Delete
  5. This comment has been removed by the author.

    ReplyDelete
  6. WOW, thank you!
    I have watched both video, but I guess I have to watch them some more times to remember something....
    One question: it would have been useful if the formula was = to something. I mean, reading it, it's difficult to understand/remember what we are looking for.
    And some practical example would have been helpful, at the beginning. I understand that you can not talk about WH (or any specific game) but,for instance, you could use dice...
    Thank you again!

    ReplyDelete
    Replies
    1. I will try to simplify a bit:

      We are always looking for the chance of success. Let's pretend we have 4 lascannons. If we want to know the probability of EXACTLY two of them hitting and two of them missing we would calculate this as follows.

      Combinations * (Chance that two hit) * (Chance that two miss)

      With the combinations:

      There are six ways to pick two objects from four. If we number the lascannons 1-4 we can look at the following combinations of hits.

      1 and 2
      1 and 3
      1 and 4
      2 and 3
      2 and 4
      3 and 4

      So, our number of combinations is six.

      With the successes and failures

      To find the probability of multiple events we multiply the probabilities of the individual events.

      Since a space marine has a 2/3 chance to hit the chances of two hits would be (2/3)*(2/3) = (2/3)^2 = (4/9)

      The chances that the other two space marines would miss would be as follows: (1/3) * (1/3) = (1/3)^2 = (1/9)

      So to find the overall probability that exactly two of the lascannons hit we would do:

      6 * (4/9) * (1/9) = (24/81) = 0.296

      This means that there is a 29.6% chance that four space marines shooting lascannons will hit exactly two times.

      Did this help clarify things?

      Delete
    2. Yes! Thank you!
      So.... the probability that 3 SM hit with 2 LC is...
      (2/3)^2*(1/3)*3=12/27= 0,44
      Wrong? Right?

      And...4 SM that hit exactly with 3 LC is
      6* (2/3)^3(1/3)=16/27 AAAAAHHhhhhhhhh! It's not possible! that was the other result! Cant'be the same....
      Were are my mistakes?

      Delete
    3. Ok it's not the same. But it is wrong. Why?

      Delete
    4. The first situation is correct.

      The second situation should be

      4 * (2/3)^3 * (1/3) = (32/81) = 0.395

      Delete
    5. THANK YOU. I should do some exercise

      Delete
  7. How would the formula change if you had a "roll 2 dice, take the highest" scenario, like with an ordanance hit against armor value.

    ReplyDelete
    Replies
    1. Once again it wouldn't change the formula, only the chances of success.

      With roll 2 pick the highest you have the following probabilities to roll the number

      1: 1/36
      2: 3/36
      3: 5/36
      4: 7/36
      5: 9/36
      6: 11/36

      Delete