[Probabilities] Want to math this out with me?

By Dokasamurp, in X-Wing

I've been working on calculating some probabilities in Excel 2010. I'm not the greatest with probabilities, and so I hope someone is willing to double check my results (I was surprised to see that focus and target lock turned out exactly the same.

I hope I formatted it well enough to read.. in case it's not apparent: going down the table means increases the number of dice you roll, while going across to the right is increasing the number of 'successes.' I've defined a success as either a hit or a crit, or in the case of the focus table, a hit, crit or focus.

I made use of binomial distribution for the good stuff.

The whole target lock table rests on the shoulders of the 1 die with 1 reroll calculation:

P+(1-P)*P

where P is the probability of rolling a success on a single die, so you have there the event that you roll a success, plus the event that you fail the first roll, and get a success on the reroll.

I was just surprised to see that because of the number of hits/crits/eyes on the dice, that a focus yields the same chances.

Expectation Values sheet is sort of a long-term goal, but for now I'm curious about my target lock and focus tables.

X Wing Probabilities.xlsx

Thanks for reading!

Hello, just took an exam in probability and measure theory and ready to help!

I've worked out the formula for the event "at least one hit goes through" (which is the same as "number of hits>number of evades") using 'n' attack dice 'm' defence dice with successful hit probability of 'p' and successful evade probability of 'q' if you're interested.

My main problem is that I don't have the game yet and don't know the dice distribution!

Also I am not sure I understand what are those probabilities, are you considering attack dice only? Also in the second row first column is that 50% the probability to score exactly 1 hit throwing 2 dice?

Edited by lucmobz

Hi, what a quick response! I have a small chart of the distribution on the Constants sheet for you (attack die has 2 blank, 2 eyes, 3 hits and 1 crit)

Yes, attack dice only on that first sheet. I began playing with attack dice vs evade dice on the Expectation Values sheet. I have put that sheet aside for now, but I am very much interested in your formula!

Another yes for the last question; I should probably label that; The left half of the tables are for exact numbers of success, and you are correct on rows and columns: Rows for #dice and Columns for #successes.

Edit: Also, evade die has 3 blank, 3 evade, 2 eyes

Edited by Dokasamurp

Ok this is the formula I sketched (think it's correct but might be wrong) I'll take a look at the whole problem during the week-end when my game arrives (hopefully).

2hi4epc.jpg

Edit: if you need the event "at least 2 (or 1<k<=n) hits go through" (which is the same as "#hits>#evades+(k-1)") which means: number of hits has to be greater than number of evades plus one, or with other words, the difference between hits and evades has to be strictly greater than 1, and being integers it means that difference has to be at least 2; if you need that event you have to change the index to which you calculate the minimum, which is i-1, to (i-1)-(k-1), with the convention that a reverse sum equals zero. Double check it because I am not 100% sure.

Edited by lucmobz

*looks at maths and blows his motivator*

I made use of binomial distribution for the good stuff.

The whole target lock table rests on the shoulders of the 1 die with 1 reroll calculation:

P+(1-P)*P

where P is the probability of rolling a success on a single die, so you have there the event that you roll a success, plus the event that you fail the first roll, and get a success on the reroll.

I was just surprised to see that because of the number of hits/crits/eyes on the dice, that a focus yields the same chances.

You can use the binomial distribution + convolution to successively determine the Probability Density Function for any number of dice. I can't recall if Excel has convolution built in. I use it in Matlab though.

For N dice you have N+1 results (0 hits, through all hits).

With Focus, P = 0.75. Without focus, P = 0.5.

The pseudo-code in Matlab anyway, for using convolution is:

PDF = [1]

for i= 1:N

PDF = conv ( [1-P P], PDF)

end

Expected number of hits rolled is then:

PDF * transpose( [0:N] )

You can do a similar result with the evade dice, except that P = 3/8 and 5/8 without and with focus respectively.

With the two resulting PDFs you can then calculate the total damage PDF.

My main problem is that I don't have the game yet and don't know the dice distribution!

Attack dice:

1 critical hit

3 hits

2 eyeballs

2 blanks

Defense dice:

3 evades

2 eyeballs

3 blanks

Edited by MajorJuggler

Or just what this guy did:

http://www.xwingdice.com/

Great link, Thank you! I have done some comparisons to the link provided and we appear to agree on the probabilities, though my expectation values appear to need more work (as can be expected).

lucmobz & MajorJuggler: I love the maths you've given me; I cannot wait to play with those formulas, especially in light of Forensicus' link.

Edit: Also, as that link states, he uses an iterative process, so I am basically treating his work as empirical (and painstaking). That just adds to how happy I am that we agree, while using entirely different methods.

Edited by Dokasamurp

You can use the binomial distribution + convolution to successively determine the Probability Density Function for any number of dice.

:huh:

This must be how I sound when I start using computer/networking terms...

Edited by VanorDM

You can use the binomial distribution + convolution to successively determine the Probability Density Function for any number of dice.

:huh:

This must be how I sound when I start using computer/networking terms...

:D

It sounds worse than it is.

In layman's terms, it works like this:

  1. Roll 1 dice. What's the probability of having 0 hits, and 1 hit? This is easy, with focus for example it is [1/4 3/4]
  2. OK, now roll one a second dice. What's the probability of now having 0, 1, and 2 hits? You can do this the long way by calculating the probability of every possibility. In this case it is [1/16 3/8 9/16]. Totally doable by hand.
  3. OK, now add a third dice. What's the probability of now having 0, 1, 2, and 3 hits? Same deal as above, but calculating by hand gets tedious. So instead we can use the mathematical function "convolution" which calculates the same thing for you. For example, conv ([1/16 3/8 9/16] , [1/4 3/4]) = [1/64 9/64 27/64 27/64].
  4. Repeat for as many dice as you want.

I used this for an Axis and Allies script to determine the exact hit probability of two armies fighting each other. No Monte Carlo simulation necessary. Infantry, Tanks, Bombers, whatever, they all get mashed together to make one giant hit probability curve (Probability Density Function). The fun part was then iterating to figure out the probability of either side winning, and with how many forces remaining. You get some pretty cool curves, and you can get exact numbers even if it's 100 infantry v 50 tanks, for example.