-->

The Thrill of the Spreadsheet: Crazy LnL Procs

This is part of a series in which we take a technical, more in depth look at huntering and hunter abilities.  If numbers aren't your thing,  you'll likely want to skip this one.  
Lock and Load
If you've played survival much this tier,  you surely are familiar with the giddy feeling all Survival Hunters get when you have that magical moment of getting 10-12 Explosive shots in a row, then when LnL falls off, it procs immediately again.

Well I was curious what the math was behind those crazy long chains.  Unfortunately,  since I don't have a background in statistics or probabilities, it was a bit harder than I had imagined.   On the upside, it was incredibly easy to create a little Python program using a random number generator and simulate a few hundred thousand results, so I at least had a little something to tell me if I was heading in the right direction.

My goal was to come up with the probability that you would get x number of Explosive Shots from Lock and Load.  Note that from this point forward, I'll be ignoring the extra shot you get from LnL resetting the explosive shot CD.  Though it's easy to add 1 to the number of Explosive Shots if that's what you're interested in; for our purposes it will be more helpful to just look at the "free" Explosive Shots you get from Lock and Load.

Also I should note, if there are any non-hunters who for some reason are interested in reading this,  I'm going to be using LnL to mean Lock and Load, and I will be using ES to mean Explosive Shot.   If you're unfamiliar with the mechanic,  the tier 16 4-piece set bonus states: "Explosive Shot casts have a 40% chance to not consume a charge of Lock and Load."  And for anyone, I'll be using the common notation "P(x)" to mean the probability of x.

Now,  click the link for the break, and go open a spreadsheet, we've got some maths to do.

Flipping Tables


The first thing I do when trying to come up with a probability is just figure out if I can think of it off the top of my head.  The probability of something happening is always (possible ways to succeed) / (total possible ways it could happen).   Sometimes I can just figure it out,  in this case I couldn't.   So I went with the old "make a table" method.   And to simplify things, I made the 40% chance to not consume into "chance to roll 2 or 1 on a perfect 5 sided die".

To start off,  because we have two charges,  the results of the first die roll don't have any affect on whether or not we get a second die roll.  So we have a 100% chance to get at least two rolls.

As for getting at least 3 rolls, we would need one of the first two to land 1 or 2.  Because we vaguely remember from some math class that chance to succeed = 1-(outcomes which fail / total outcomes), if we make a chart lining up 1-5 2 times in all possible ways,  we see that there are only 9 ways out of 25 to fail,  which gives us a 64% chance to succeed at getting at least 3 rolls.   Another way to come up with that would be P(x)=1-(.6^x), that is, 1 minus chance to fail to the x, with x being the number of rolls.

However, if we try that formula for our chances to get at least 4 rolls we run into a problem.   That's because it doesn't account for the roll order.  Because of how LnL works,  we'll need to make our Dice rolling so that if you get a 3 and a 5 then you stop, it doesn't matter what you get after that.   In our dice tables, to call it a successful string,  we'll have to have have 1 or 0 rolls of 3 or higher to determine "at least x number of rolls" or we'll have to have exactly 1 roll of three or higher in the rolls which aren't the Xth roll, and have the Xth roll be 3 or higher to determine "exactly X rolls".

Ok, so we're making progress here,  narrowing down our possible results.   If we keep going up, making our tables,  we'll get these results:

To get at least 4 Rolls:
44 outcomes which succeed
125 possible outcomes
35.20% chance to get at least 4 rolls

To get at least 5 Rolls:
112 outcomes which succeed
625 total outcomes
17.92% chance to get at least 5 rolls

To get at least 6 Rolls:
272 outcomes which succeed
3125 total outcomes
8.70% chance to get at least 6 rolls

Now,  you may be thinking "wait a minute, Delirium,  you really wrote down and counted out all three thousand one hundred twenty five different possibilities?"   Well,  I didn't.  I started to notice a pattern as I was copy and pasting my way down my spreadsheet.   The pattern was this:  the total outcomes which succeed is equal to 2*(previous outcomes which succeed) + 3 times 2^(x-1).   If you're as crazy as I am and you are now opening up a spreadsheet to try for the same, you'll notice why this is true when you start to create your tables of possible outcomes.

Surely that's not the only pattern you've noticed though; we've also got the total outcomes, which you can probably just look at and tell you're seeing the powers of five.   To be more specific, 5^(x-2) where x is the number of rolls.

Recursion's Not Pretty Enough
Now, we can successfully use this to find the chance of getting as many as 12 Shots (the total you can get from one LnL proc, because the proc only lasts 12 seconds), which happens to be about .0734%;  however, it's not very elegant.  That is, because it's relying on this recursive function, using the total possibilities from formula before it,  it's not easily expressible as a formula.  This is because we are looking at "at least" x many Explosive Shots.   And the use of "at least" means you would have to know the chances of it not being the number of rolls before it.

So let's take another tactic.   For me, my next step was to call some friends who were better at math than I, which included my Raid Leader, and two IRL friends who I just new to be good at these kind of things.   It turns out that each of them had a different formula to try.   Fortunately, since I was now equipped with my possibility tables as well as the results from the program I had written, I could test the formulas, and with just a little bit of finagling, I've got a working result.

The Return of the Function
So here's the one that ended up working:

The Probability of getting exactly X number of rolls is equal to 1 less than x, multiplied by the chance for one ES to consume a charge of LnL, multiplied by the chance for one ES to not consume a charge raised to the power of 2 less than the number of rolls, multiplied again by the chance for one ES to consume a charge. Or:

P(x)= (x-1)*(.6^2)*(.4^(x-2))

And there we have it,  an elegant-ish way of determining your chance to get x Explosive Shots in 1 LnL proc.   If we want to know instead of the chance to get exactly x, the chance to get at least x,  we can just do some simple arithmetic.  

Explosive Shots % chance for exactly: % chance for at least
1 0.00% 100.00%
2 36.00% 100.00%
3 28.80% 64.00%
4 17.28% 35.20%
5 9.22% 17.92%
6 4.61% 8.70%
7 2.21% 4.10%
8 1.03% 1.88%
9 0.47% 0.85%
10 0.21% 0.38%
11 0.09% 0.17%
12 0.04% 0.07%

But Wait, There's More!
While this is the formula for x number of ES so long as X is less than 12,  we also have a chance of proccing another LnL chain before the first LnL is over.   Since these are independent events,  to know that chance, all we'll have to do is multiply the chance to proc another chain by the chance to get that far with just explosive shots.  
We know that LnL has a 10 second internal cool down and has a 20% chance to proc from each tick of Black Arrow, which occur every two seconds.   We'll ignore the forced procs from traps,  because while that might be a good idea in certain situations, that would mean interrupting our ES chains,  and so it would be less fun since we wouldn't be looking at total ES in a row.  
Because the ticks are 2 seconds apart, they could only proc an additional LnL chain on the 10th or 12th second.  This means with a .3801% chance of getting at least 9 ES from the first LnL,  we have .076% chance of getting 9 ES in a row and then proccing an additional LnL on the 10th GCD.  Less than one in a hundred,  but still,  that's a significant amount of times over a night of raiding.  

There's a lot more we could do with these numbers, especially if we get into multiple chains of LnL, but I'll leave it here for now.  In the next Thrill of the Spreadsheet I'm hoping to use these same numbers to look at reapplying serpent sting in the middle of an LnL proc vs letting it fall off.

No comments:

Post a Comment