Focus vs Calculate

By ScruffyNerdHerder, in X-Wing

Hey everyone,

I decided to try and put numbers to how different a focus is from a calculate action. I'm not sure that I am approaching the math in the correct way and would like to hear from other people.

My process:

For attack calculate expected damage against 0 green dice for different numbers of attack dice with focus or with calculate. Honestly, rather than figure out the higher order probabilties I just used the calculator at xwing.gateofstorms.net. Once you have expected damage values for each situation just divide the expected damage (calculate) by expected damage (focus). The resulting number should (I think?) give you the percentage of the time that a focus token is identical to a calculate token.

My numbers fall out as follows:

ATK Dice 1 2 3 4 5
ED Focus 0.75 1.5 2.25 3 3.75
ED Calculate 0.75 1.438 2.078 2.684 3.263
ED Calc/ED Focus 0.958667 0.923556 0.894667 0.870133

Following a similar process for defense dice:

DEF Dice 1 2 3 4 5
EE Focus 0.625 1.25 1.875 2.5 3.125
EE Calculate 0.625 1.187 1.703 2.184 2.638
EE Calc/EE Focus 0.9496 0.908267 0.8736 0.84416

This obviously ignores ion/ calculate stacking shenanigans, but it seems to me that statistically they are usually pretty similar. Obviously this becomes less true as you start rolling more dice. Also, this tends to not be useful from a squad building perspective unless you are looking at some of the ships that have droid and non-droid pilots, or droid crew shenanigans.

Edit: As punkUser pointed out, my method is not quite correct. Using binomial distribution functions we can more closely approximate when a calculate is as good as a focus are as follows:

Dice Rolled 1 2 3 4 5 6
Focus = Calc 1 0.9375 0.84375 0.738281 0.632813 0.533936


For people wanting to do calculations similar to this, a really easy tool to use is the BINOM.DIST function in excel is perfect. Worth noting that the odds are identical for red and green dice since the odds of rolling an eyeball are 0.25 on each.

Edited by ScruffyNerdHerder
correcting math

That's very interesting that it is so close to the same expected damage. Mix that with the fact that there are several ways to obtain multiple calculate tokens, and they can be used across different attacks and it looks like calculate is pretty strong.

So close to the same expected damage unless you're fickle focus dice, maybe ?

1 hour ago, ficklegreendice said:

So close to the same expected damage unless you're fickle focus dice, maybe ?

Play rebels, don't roll (many) green dice. Honestly I definitely "feel" like I would roll multiple eyeballs more often. But perception bias yaddah yaddah. Given the fact that you can often get multiple calculates per turn, as well as spend multiple in the same go I'm wondering if you just end up getting to mitigate more dice over time and get a slight advantage.

Idk, I've throwed so many rolls with multifocus that it's kinda silly

But I do wanna see if I can sub my Perceptive Copilot for Ig-88D on mux, saving a few points

I think, regardless of the correctness of my math, that Perceptive is probably worth the points assuming you are running moldy crow

This is why IG-88D is so good, especially with Lando. Save the points and hate yourself later when you roll nothing but eyeballs.

I would say there are many times when you roll one eyeball and you sit there having to decide if you want to spend that focus or wait until you have a roll with a bunch of eyeballs only to roll no eyeballs next roll. Calculate is easy to play, you just spend it when you got it.

Next up, Evade vs Reinforce! ;)

9 hours ago, ScruffyNerdHerder said:

Once you have expected damage values for each situation just divide the expected damage (calculate) by expected damage (focus). The resulting number should (I think?) give you the percentage of the time that a focus token is identical to a calculate token.   

That doesn't quite work the way you think it does since it's conflating some scaling based on the general expected damage of N dice in the first place. This is also why your attack and defense dice calculations are not coming out to the same thing; they should be the same since both types of dice have 2/8 sides that are focus results.

Luckily it's fairly easy to compute by hand since the times when focus is better than calculate are precisely when you roll 2 or more eyeballs :) That in turn is easiest to compute by calculating the probability of rolling 0 or 1 eyeballs (using the binomial distribution - https://en.wikipedia.org/wiki/Binomial_distribution ) and subtracing that from 1.0. In the formula in the link, "k" is the number of eyeballs we are looking for, n is the number of dice and p is the probability of rolling an eyeball (i.e. 2/8 = 0.25).

The math comes out to:
For 2 dice you roll 2 focuses 6.25% of the time, so 93.75% of the time a single calculate is equivalent.
For 3 dice you roll 2 or more focuses 15.63% of the time, so 84.37% of the time a single calculate is equivalent.
For 4 dice you roll 2 or more focuses 26.17% of the time, so 73.83% of the time a single calculate is equivalent.


The takeaway is similar: a fairly high percentage of the time a calculate is equivalent to a focus. It also follows then that two calculates (ex. IG88's) is almost always quite a bit better than a single focus if you expect to be involved in multiple attacks.

Edited by punkUser

The calculate action is more critically paired with additional calculate tokens for use on other effects. C-3P0, Leebo and IGs all have the ability to get more than one calculate token in a round, so the actual efficiency of these ships taking the calculate action is extraordinary n comparison to the one-and-done focus.

Thank you for sharing your...

...calculations.

This thread has inspired me to run all robots in a Rebel list!

AP-5, Leebo, and Chopper actually fill out a list with no room for upgrades ? I’m more likely to ditch one of them in favor of ‘3-PO and R2 but it’s fun to consider flying. ?

Edited by SpiderMana
15 hours ago, ficklegreendice said:

B ut I do wanna see if I can sub my Perceptive Copilot for Ig-88D on mux, saving a few points

That's what I was planning to do

Dang I’m suddenly really missing K2-S0.

12 hours ago, punkUser said:

That doesn't quite work the way you think it does since it's conflating some scaling based on the general expected damage of N dice in the first place. This is also why your attack and defense dice calculations are not coming out to the same thing; they should be the same since both types of dice have 2/8 sides that are focus results.

Luckily it's fairly easy to compute by hand since the times when focus is better than calculate are precisely when you roll 2 or more eyeballs :) That in turn is easiest to compute by calculating the probability of rolling 0 or 1 eyeballs (using the binomial distribution - https://en.wikipedia.org/wiki/Binomial_distribution ) and subtracing that from 1.0. In the formula in the link, "k" is the number of eyeballs we are looking for, n is the number of dice and p is the probability of rolling an eyeball (i.e. 2/8 = 0.25).

The math comes out to:
For 2 dice you roll 2 focuses 6.25% of the time, so 93.75% of the time a single calculate is equivalent.
For 3 dice you roll 2 or more focuses 15.63% of the time, so 84.37% of the time a single calculate is equivalent.
For 4 dice you roll 2 or more focuses 26.17% of the time, so 73.83% of the time a single calculate is equivalent.


The takeaway is similar: a fairly high percentage of the time a calculate is equivalent to a focus. It also follows then that two calculates (ex. IG88's) is almost always quite a bit better than a single focus if you expect to be involved in multiple attacks.

Thanks! I thought I might be approaching it simplistically. I've updated the numbers above.

13 minutes ago, ScruffyNerdHerder said:

Thanks! I thought I might be approaching it simplistically. I've updated the numbers above.

Numbers still differ slight from what I posted... make sure you are including "0" as a possibility when you are doing the math.

In excel for instance you can do (0 or 1) for 3 dice:
= BINOM.DIST(0, 3, 0.25, FALSE) + BINOM.DIST(1, 3, 0.25, FALSE)
Or easier, use the "cumulative" distribution which includes anything less than your "number_s" value automatically:
= BINOM.DIST(1, 3, 0.25, TRUE)
= 0.84375

Simply change the "3" for other dice counts. I get:

2 3 4 5 6
0.9375 0.84375 0.738281 0.632813 0.533936
14 minutes ago, punkUser said:

Numbers still differ slight from what I posted... make sure you are including "0" as a possibility when you are doing the math.

In excel for instance you can do (0 or 1) for 3 dice:
= BINOM.DIST(0, 3, 0.25, FALSE) + BINOM.DIST(1, 3, 0.25, FALSE)
Or easier, use the "cumulative" distribution which includes anything less than your "number_s" value automatically:
= BINOM.DIST(1, 3, 0.25, TRUE)
= 0.84375

Simply change the "3" for other dice counts. I get:

2 3 4 5 6
0.9375 0.84375 0.738281 0.632813 0.533936

Fixed, wasn't using cumulative.

I would like to compare the difference between calculate and focus on full modded atacks (F/C+Lock).

The reason is that before you would reroll only blanks, but with calculate the expected value of rerrolling a blank shoukd go down if you already have rolled an eyeball.

I'll have to think for a little bit about how to make a meaningful comparison for this case.

I should mention that you can do this directly in the dice calculator as well by giving the attacker both focus and calculate.

Example with 3 dice:
http://xwing.gateofstorms.net/2/multi/?d=AAAAAAAAAAA&a1=MUgAAAAAAAA
Attacker ends up still having focus 0.84375 of the time, consistent with our paper math.

For the case where you have a lock the situation is more complicated since the optimal use of the lock depends on the roll in non-obvious ways. For instance, if you have 1 calculate+lock and roll blank/blank/focus, it's optimal to actually reroll *all three* dice:
http://xwing.gateofstorms.net/2/modify_attack/?a=AkAAAAAAAAA&r=EgAAAA

Thus you can't just do simple math based on the rolls themselves. You kind of have to ask a more specific question about the nature of a given attack with the two token situations. Generally in those cases it's best just to compare expected damage and/or the PDF of getting 1/2/3 hits or whatever instead of "probability of them being different".

Don't forget the cases where you only get to reroll 2 of x dice or just 1 of x dice. Have fun with that matrix.

34 minutes ago, punkUser said:

I should mention that you can do this directly in the dice calculator as well by giving the attacker both focus and calculate.

Example with 3 dice:
http://xwing.gateofstorms.net/2/multi/?d=AAAAAAAAAAA&a1=MUgAAAAAAAA
Attacker ends up still having focus 0.84375 of the time, consistent with our paper math.

For the case where you have a lock the situation is more complicated since the optimal use of the lock depends on the roll in non-obvious ways. For instance, if you have 1 calculate+lock and roll blank/blank/focus, it's optimal to actually reroll *all three* dice:
http://xwing.gateofstorms.net/2/modify_attack/?a=AkAAAAAAAAA&r=EgAAAA

Thus you can't just do simple math based on the rolls themselves. You kind of have to ask a more specific question about the nature of a given attack with the two token situations. Generally in those cases it's best just to compare expected damage and/or the PDF of getting 1/2/3 hits or whatever instead of "probability of them being different".

Glad you pointed out the non-obvious case. I was midway through writing a rudimentary roller in python to just brute force a "close enough" answer (hooray engineering) but I hadn't thought about those cases. I'm not really sure that I want to figure out programming that logic though.

actually, as long as you are rolling more than 2 dice it should be optimal to reroll all dice if you only get blanks and focuses right? That should be straightforward enough

40 minutes ago, Mep said:

Don't forget the cases where you only get to reroll 2 of x dice or just 1 of x dice. Have fun with that matrix.

Not touching that at all. I figure that the extreme cases are with and without target lock, and people can just interpolate the rest.

Haven't had time to test it because I have to run to X-wing night, but in case anyone is curious, here's what I have so far.

import random
from collections import Counter
atk_dice = 4
trys = 99999

#Used to log the number of times a focus token turns out superior to a calculate
focus_better = 0

for i in range(trys):
calc_tok = 1
calc_roll = []
calc_dmg = 0
focus_dmg = 0
#Generate Seed Roll

for j in range(atk_dice):
calc_roll.append(random.randint(0,7)
#0-3 are hits/crits 4-5 blanks and 6-7 focus
#Clone Seed Roll

focus_roll = calc_roll.copy()

#Edge case detection for calculate where expected value of rerolling first is higher
if atk_dice > 2 and sum(calc_roll) >= atk_dice*4:
for q in calc_roll:
if calc_roll[q] > 3:
calc_roll[q] = random.randint(0,7)

else:
#Spend Calculate if possible.
for k in calc_roll:
if calc_roll[k] > 5 and calc_tok > 0:
calc_tok[k] = 0
calc_tok = 0

#Spend Target lock on any blanks and remaining eyeballs
for m in calc_roll:
if calc_roll[m] > 3:
calc_roll[m] = random.randint(0,7)

#If I didn't spend my calculate earlier, spend it now if possible.
if calc_tok > 0:
for n in calc_roll:
if calc_roll[n] > 5 and calc_tok > 0:
calc_tok[k] = 0
calc_tok = 0

#Calculate (heh heh) damage
for o in calc_roll:
if calc_roll[o] < 4:
calc_dmg +=1

#Spend TL
for p in focus_roll:
if focus_roll[p] > 3 and focus_roll[p] < 6:
focus_roll[p] = random.randint(0,7)

#Spend Focus
for r in focus_roll:
if focus_roll[r} > 5:
focus_roll[r] = 0

for s in focus_roll:
if focus_roll < 4:
focus_dmg +=1

if focus_dmg > calc_dmg:
focus_better +=1

print focus_better