[MATH] OAX, MultiAttack, And You 

[MATH] OAX, MultiAttack, and You
Multiattack and "Occasionally Attacks X times" are commonly debated subjects and people frequently seem to have trouble dealing with the mathematical reality behind them. It's easy to make assumptions like "You can't sub /WAR when wielding a Kraken Club because the DA interferes with the club too much" or "Double Attack gear interferes with my OA2 polearm so I shouldn't wear any," but a lot of these statements are erroneous and are based in a poor understanding of the mathematics behind this relatively simple system. I've taken somewhat of a groundup analytical approach to building the mathematics you'll need to understand multiattack and OAX, and how they interact. I'll also provide some mathematical tools you can use to "plug and play," so to speak, but the goal here is to provide a guide that will hopefully quell, or at least provide a direct information source to, some of the debates that end up happening on these forums that stem in poor mathematical understanding. Part 1: The Basics, and Formula Derivation
Usually the value in which we are interested for this sort of calculation is the Average Attacks Per Round. Basically, this is the average number of times you attack when taking one "turn" with a single weapon (e.g. if you double attack, you attack twice in that turn). Quote: Definition 1.1: Average Attacks Per Round" Let N be an arbitrary number of attacks you would make based on weapon delay alone over an arbitrary period of time (t>0), and P be the additional attacks you receive based on any multiattack rate you posess. Then, A, the average attacks per round can be calculated as follows: A = (N + P) / N Note that this value cannot fall below one. If you have 100% Double Attack, your average attacks per round (for a single weapon) will be 2. If you have 10% Double attack, then your average will be 1.1. These values are relatively easy at which to arrive, but through more close examination of how we get there mathematically, we can get a better understanding of how to deal with other values of multiattack, multiple hands, and interaction with "occasionally attacks X times" weapons. Let's lay down some conventions: Let A be our Average number of attacks per round. Let D be our Double Attack Rate. We'll express it as a decimal, so if we have 10% Double Attack, we'll use D=0.10 Let's examine intuitively how Double Attack works. We'll use hipster dogs to represent single attacks with a weapon. Say, we have a 10 attack sample. We have 0% Double Attack (D=0.0). Obviously, we'll attack 10 times: 10 attacks in 10 rounds (A = 10/10 = 1.0) is our baseline. Let's push our double attack rate up to 10% (D=0.1). In our 10 hits, statistically, we'll double attack once: + (one Double Attack) We end up with 11 attacks in 10 rounds (A = 11/10 = 1.1) Now, let's push it up to 50% double attack (D=0.5): + (5 Double Attacks) Now we attack 15 times, where we would have attacked 10 times with 0% Double Attack (A=1.5) 100% Double Attack D=1.00): +(10 Double Attacks) Now we double attack every time, so we end up with 20 attacks in 10 turns (A=2). This is an importantish value, we'll call the value of A when a particular multiattack rate is 100% the order of multiattack (So the order of Double Attack is 2  this may seem intuitive, but we're just giving it an explicit mathematical definition). Quote: Definition 1.2: Order of MultiAttack For a specific type of multiattack (Double, Triple, etc.), let R, the multiattack rate be 100% (R=1.0). The order of multiattack is defined as the average attacks per round when R is set to this value. We can also call multiattack "Otuple" attack, where O is the order. Not bad! This is fun, let's add more! ...except not. We can't double attack more than 100% of the time, so adding additional double attack will do absolutely nothing. Quote: Thm. 1.1: Limitations on MultiAttack Let R be the rate of Ntuple multiattack with N arbitrary. The maximum rate of multiattack which affects the average number of hits per round is 100% (R=1.0). Proof: Follows from the http://en.wikipedia.org/wiki/Pigeonhole_principle and the fact that multiattack can proc a maximum of once per round with a single weapon. It's pretty easy to see an emerging pattern here. When we're just dealing with double attack, it's easy to calcualte our average attacks per round. X% double attack adds a single additional attack X% of the time, so if we express the percentage (D) as a decimal, then Quote: Formula 1.1: Average Hits Per Round Considering Double Attack Only[/b] A = 1 + D Where D is the rate of double attack. This is really great and all, but it's superelementary. I don't mean to insult anyone's intelligence, I just figure it's better if we start at the bottom and work our way up. Most often, we're dealing with more than just double attack, and it's when we start adding in Triple Attack, Quadruple Attack, and the like into the mix that the formulas start to get messy and harder to understand. I'll cover that next. Part 2: Advanced Formulas for Multiple MultiAttack Values
The tricky part about these formulas is that Quadruple Attack, Triple Attack, and Double attack are checked in a specific order in the game's programming. Higherorder multiattacks are checked first, so the priority goes like this: Quadruple > Triple > Double Anyway, first let's look at what happens when Quadruple Attack or Triple Attack procs, and then we'll do some formulas: One Attack: Quadruple Attack procs: + We end up with 4 attacks, in other words we add three. This a common mistake people make, as they'll see quadruple and add four attacks. Notice that the order of quadruple attack is four, so we're adding one less than the order. Similarly, triple attack adds two attacks (once again, one less than the order), and as we already know, double attack adds one. Since we would have attacked once anyway, we don't count that in the "additional attacks." This doesn't change. If we had multiattack of order 100, we'd be adding 99 attacks. It's always one less than the order of the multiattack rating. Quote: Thm. 2.1: Additional Attacks from NOrder Multi Attack Let N be the order of a multiattack. When the multiattack occurs in a round, it adds N1 additional attacks to that round. We'll use the same conventions for A and D as above, but now we need to define some additional variables: Let Q be our Quadruple Attack rate, expressed as a decimal. Let T be our Triple Attack rate, expressed as a decimal. Since the game does Quadruple Attack first, it's the easiest to get this part of the formula. If we have Quadruple attack, and no Triple or Double Attack, we can express our average attacks per round similarly to how we did double attack, except instead of adding a single attack, we add 3 (which we know to do from Thm. 2.1). A = 1 + 3Q In other words, we add 3 attacks at a rate of Q. What happens if we add triple attack? A common mistake is to do this: This is wrong said: A = 1 + 3Q + 2T The problem with this is that we're not using the full "initial" sample of attacks when we calculate the triple attacks. For example, if we have a 10% quadruple attack rate, and a 100 attack round sample, we'll Quadruple Attack on 10 of those attacks. Triple attack won't be checked on those attacks, so when we check for triple attack, we're only starting with 90 attacks in our sample. The formula ends up working like this: A = 1 + 3Q + 2(1Q)T The (1Q) term corrects the number of times we check for triple attack based on how many quadruple attacks will proc. Now we just need to add double attack into the mix! The number of times we check on Double Attack depends on the number of times both Quadruple and Triple attack proc'd. So, we have to subtract both of the terms to get the scaling factor: 1  Q (correcting for quadruple)  (1Q)T = 1  Q  T + QT = 1  (Q+T  QT) I rearranged it that way because it puts it in the form of the Principle of Inclusion and Exclusion (PIE). In other words, since Quadruple and Triple attack are mutually exclusive (they can't happen at the same time), to find out how many times they proc when both are checked, we need to include the number of times they would proc if checked indivudually (Q+T) and exclude the number of times we "overlapped," in other words, where they happened at the same time (minus Q*T). Quote: Thm 2.2: Corrected Quadruple, Triple, and Double Attack Rates Let Q_o be our base Quadruple attack rate and Q be our "actual" rate. Let T_o be our Triple attack rate and T be our "actual" rate corrected for other multiattacks. Let D_o be our base Double Attack rate and D be our actual rate corrected for other multi attacks. Multiattacks are checked with priority of decreasing Order, so Q = Q_o T = (1Q) * T_o D = (1(Q+TQT)) * D_o These values follow from the multiplication rule of probability and the PIE. We end up with the following formula for Quadruple, Triple, and Double Attack combined: A = 1 + 3Q + 2(1Q)T + (1(Q+TQT))D I'll leave it at that, since we don't really have any Quintuple Attack of which to speak, and the formulas start to get really, really messy if we go any further due to the nature of PIE. Rate of Single Attacks Sometimes we need to calculate the rate at which we only attack once! By definition, we can simply subtract the combined rate at which we perform all orders of multiattack. Quote: Formula 2.2: Exclusion Definition of SingleAttack Rate Let Q, T, and D be our base Quadruple, Double, and Single attack rates with priority checking by decreasing order of multiattack. Using the formulas from Thm 2.2, we can see that our total rate of multiattack, R_m is R_m = Q + (1Q)T + (1(Q+TQT))D So our rate of single attack, R_s is 1  R_m = 1  (Q + (1Q)T + (1(Q+TQT))D) But, we can find an easier way to calculate this through some simple probability theory. The rate at which we don't quadruple attack is (1Q). So basically, if we have Q=0.01, we'll hit four times 1% of the time, and 99% of the time it won't happen. Similarly, the rate at which tripleattack doesn't proc is (1T) and the rate at which double attack doesn't proc is (1D). The Multiplication Rule allows us to multiply these rates to find the rate at which none of them occurred. (It's the same idea where the chance of getting heads twice in a row when flipping a coin is 1/2 * 1/2 = 1/4) Quote: Formula 2.3: Multiplicative Definition of SingleAttack Rate Let Q, T, and D be our Quadruple, Triple, and Double Attack rates with priority checking by decreasing order of multiattack and let R_s be the rate at which none of these events occurs. From the multiplication rule of probability, we have that R_s = (1Q)(1D)(1T) Since we restrict multiattack rates from 0 to 1, we can see that our single attack rate is also restricted from 0 to 1. But now we have two formulas that are supposedly calculating the same thing? Well, that brings us to the following: Quote: Thm 2.3: Equivalence of Formulas 2.2 and 2.3 Formulas 2.2 and 2.3 correctly calculate the probability of the same event are thus equivalent. Proof: The proof is algebraic manipulation. Skipping the funny business, just check here. What happens if we're dual wielding? Well, as long as you're not using any "Occasionally attacks X times" weapons, you can just multiply A by 2 and get your attacks per round. If you're using OAX weapons, things get more tricky, so that's next. Part 3: Occasionally Attacks X Times
It's likely that OAX weapons are calculated ingame the same way that multiattacks are; that is, giving priority to higher orders of OAX. That said, we don't have "given" distributions of OAX weapons, we only have observed distributions  and these would already account for any interaction between orders based on priority. When we deal with OAX weapons, we use the observed distributions, so we don't have to worry about correcting for priority. In other words, if X, Y and Z are the OA4,OA3, and OA2 rates of an OA24 weapon, then the average hits per round is A = 1 + 3X + 2Y + Z The same as the intuitively wrong way to do double/triple attack, etc.! But since our distribution already takes priority (if it exists) into account, we don't have to worry about it. Sometimes the distributions are fuzzy for OAX weapons and it's easier to just use precalculated average hits per round. Here are some averages and/or estimates for common weapons: Joyeuse 1.45 Ridill ~1.9 Magian OAT 1.4 Magian OA24 ~1.87  2.02 Kraken Club 3.82 The problem with OAX is that multiattack takes priority over it, so we have to deal with that when they're forced to interact! Part 4: OAX and MultiAttack interaction
We can still use our previous formulas for multiattack in this section, but now we're going to assume we have a weapon with OAX and we have multiattack gear. If multiattack procs on a swing, then the game will not check OAX, so we reduce the potency of OAX when we involve multiattack. It's not always a bad thing though. As long as you're adding a multiattack with order (4,3,2 etc.) greater than the average hits per round of the OAX weapon, you will still increase A. So for example, adding double attack (order 2) to a magian OAT (A=1.4) still increases your average attacks per round. Quote: Thm 4.1 Sylow's Interaction Theorem Let A be our average attacks per round, R>0 be the multiattack rate of order O and A_w be the average hits per round of an OAX weapon. If O > A_w, then increasing the Oorder multiattack rate by R will result in an increase in A and if O < A_w then it will result in a decrease. Proof: Left as Exercise. To get our average hits per round when we have an OAX weapon and multiattack, we pretty much just take the formula for multiattack, and add the additional attacks from OAX, scaled for how many times multiattack would proc. Probability theory lets us calculate this easily. We want to know the rate at which Quadruple Attack, Double Attack, and Triple attack didn't proc (R_s)? We just use Formula 2.3 (1Q) is the number of times Quadruple Attack doesn't proc. (1T) is the number of times Triple Attack doesn't proc. (1D) is the number of times Double Attack doesn't proc. R_s = (1Q)(1T)(1D) And we end up with this formula: Quote: Formula 4.1 Average Hits per Round of an OAX weapon considering MultiAttack Rates 1 + 3Q + 2(1Q)T + (1(Q+TQT))D + (1Q)(1T)(1D)(3X + 2Y + Z) Here we only consider up to OA24 weapons. Where: Q,T, and D are Quadruple, Triple, and Double Attack rates and X,Y, and Z are OA4, OA3, and OA2 rates. Notice we didn't keep the 1 in the OAX formula, because we already have it in the front. If you're dual wielding and using only one OAX weapon, you can't just multiply by 2 now. You can, however, multiply the initial portion (the multiattack part) by 2, and add on the OAX portion. That formula looks like this: Quote: Formula 4.2: Average Hits per Round when DualWielding an OAX weapon considering MultiAttack Rates 2(1 + 3Q + 2(1Q)T + (1(Q+TQT))D) + (1Q)(1T)(1D)(3X + 2Y + Z) Using the same variable definitions as above. They may look a little bit daunting, but it's just plugging in numbers at this point :) Part 5: Kraken Club The Kraken Club has a very awkward distribution, and we won't bother going into it in detail because the math is ... tedious. The important thing to remember is that we can just use the average attacks per round in place of the (3X+2Y+Z) term in the previous formulas. So, let A_k be the average attacks per round of the Kraken Club. Then, when wielding the Kraken Club: Quote: Formula 5.1 Average Attacks Per Round of the Kraken Club A = 1 + 3Q + 2(1Q)T + (1(Q+TQT))D + (A_k1)(1Q)(1T)(1D) Where Q,T, and D are Quadruple, Triple, and Double Attack rates, respectively and A_k is the average hits per round from the Kraken Club, 3.82. Notice that we subtracted 1 from A_k. That's because we're interested in the additional attacks during that portion of the formula. Since A_k = 3.82, then the kraken club is getting 2.82 additional attacks per round. The first hit is already accounted for in the first "1" in the formula. Dual Wielding the Kraken Club It's much more difficult to calculate distributions for dualwielding the kraken club because we pretty much always end up having to exclude hits due to the 8 attacks per round cap. Example: Quadruple attack procs on main hand, OA5 procs on Kraken club. Normal formulas would count this as 9 attacks, but we can only have 8 attacks in a single round. So, we'd have one less attack than the formula would count normally. To correct for this, we'd subtract Q*R(5) where Q is our quadruple attack rate as normal and R(5) is the rate at which the Kraken Club attacks 5 times. Quote: Definition 5.1 Kraken Club Hit Distribution Let R(X) be the rate at which the Kraken Club attacks X times then: R(1) = 0.05 R(2) = 0.15 R(3) = 0.25 R(4) = 0.25 R(5) = 0.15 R(6) = 0.1 R(7) = 0.03 R(8) = 0.02 Resulting in a 3.82 hits per round average. If Quadruple Attack procs on the mainhand, we're worried about R(5), R(6), R(7) and R(8) which add 1, 2, 3 and 4 too many attacks, respectively. So, we can correct for these by subtracting Q( 4R(8) + 3R(7) + 2R(6) + R(5) ) If Triple Attack procs on the mainhand, we're worried about R(6), R(7), and R(8) which add 1, 2, and 3 too many attacks, respectively. From earlier examples, we know that our triple attack rate corrected for Quadruple attack priority is (1Q)T, so we can correct for this by subtracting (1Q)T( 3R(8) + 2R(7) + R(6)) If Double Attack procs on the mainhand, we're worried about R(7) and R(8), which add 1 and 2 too many attacks, respecively. Our double attack rate after quadruple / triple attack is (1(Q+TQT))D (through PIE), so we can correct for this by subtracting (1(Q+TQT))D*(2R(8) + R(7)) If no multiattack procs on the mainhand, we're worried only about R(8) which adds a single attack beyond the cap. We can correct for this by subtracting R(8) multiplied by our single attack rate, so R(8)*(1Q)(1T)(1D). Combining these, and substituting the values from Definition 5.1, we can derive that subtracting the following expression will correct for the 8attack cap: (0.52Q + 0.22(1Q)T + 0.07(1(Q+TQT))D + 0.02) And we get the final expression for average attacks per round when dual wielding with a Kraken Club: Quote: Formula 5.2 Average Attacks Per Round when Dual Wielding with a Kraken Club Offhand A = 2(1 + 3Q + 2(1Q)T + (1(Q+TQT))D) + (1Q)(1T)(1D)[2.82  (0.52Q + 0.22(1Q)T + 0.07(1(Q+TQT))D + 0.02(1Q)(1T)(1D))]] It's a little terrifying. Kraken Case Study #1: /WAR What is the effect of /WAR on a singlewielded Kraken Club? Well, /WAR gives 10% double attack. Since the order of Double Attack is 2 (and 2<3.82), then we know by the interaction theorem that adding any amount of it will actually decrease A. But by how much? Well, let's calculate? Let's pretend we don't have any other multiattack, and as such, Q=0, T=0, and D=0.1. Plugging in: A = 1 + = 1+0.1 + (2.82)(0.9) = 3.638 In other words, 10% double attack decreased A by 0.182 (4.76% decrease). You may be getting other benefits from subbing Warrior, such as Fencer and Berserk which combined are highly likely to outweigh this slight decrease. (This particular case only really applies to Ranger) Need to rework case study 2 This case is of particular interest to Mjollnir WHMs, but can be applied to anyone who wishes to offhand a Kraken Club for TP gain. In this case we'll use the WHM/NIN as a model since it won't have any double attack to begin with. We're trying to decide on an earring slot, is it beneficial to use Brutal Earring (+5% Double Attack) or not? Well, let's see. In this case, we'll have to calculate the two hands separately. Without brutal, we can just add the two hands together, and A = 4.82. When we add brutal, we take D = 0.05 so using our Dual Wield formula from the previous post and modifying it for Kraken calculations: A = 2(1 + 3Q + 2(1Q)T + (1(Q+TQT))D) + (A_k1)(1Q)(1T)(1D) = 2(1+3(0) + 2(10)0 + (1(0+00*0))0.05) + (3.821)(10)(10)(10.05) =2(1.05) + (2.82)(0.95) = 4.779 We end up with a miniscule (0.85%) decrease in attacks per round. In this case, the massive damage of the mainhand weapon might make it come ahead, but it's hard to be sure. We can sort of "adlib" some math to see why it comes ahead, let's say, compared to Ghillie Earring+1. Let's multiply by weapon damage assuming capped fSTR: Mjollnir 99: 93 +18 Damage Kraken Club: 11 + 9 Damage A*D=(93+18+11+9)(1 + 3Q + 2(1Q)T + (1(Q+TQT))D) + (11+9)((A_k1)(1Q)(1T)(1D) With no multiattack: A*D = (93+18+11+9) + 2.82(11+9) = 187.4 With Brutal Earring: A*D = (93+18+11+9)*1.05 + 2.82(0.95)(11+9) = 191.13 So we can "estimate" that (before considering attack and WS frequency), the Brutal Earring is going to come slightly in the lead during the TP phase. Unfortunately this is where more difficult calculations come into play. It'll vary by target, but estimating something with 436 defense, the +9 attack and slightly increased WS frequency is going to end up pulling ahead "at least on paper." Results: Probably too close to call. Part 6: Quick Calculation
Now that you know the justification behind all this stuff, and how it works ... well, you don't want to sit there and calculate it out by hand every time you want to add 1% DA. I was originally going to provide Wolfram Alpha links for quick online calculation, but! Wolfram Alpha can't handle the complexity of the Kraken Club formula, so I made this quick spreadsheet to do every formula in this thread for you! (You'll need to download to input your own values). Spreadsheet incorporating all the formulae in this thread. Happy multiattacking, Adventurers! :o I can't wait to read!
Lost me on the first post right after the Triple attack formula. lol >_>;
Asym is now a Montessori Teacher.
P.S. I think this is one of the most helpful things I've seen posted on here. The guides are great and every step toward making this "ffxi common knowledge" is one less flame war or one less headache. Can I have the dog in the picture? Or all the dogs?
I love the [MATH] tag.
GraddHelian said: » Can I have the dog in the picture? Or all the dogs? I want to see 3.82 hipster dogs, now, just so I can understand Kclub better. :p Hopefully the 0.82 doggy is ok, though. Fenrir.Sylow said: » Notice that the order of triple attack is four, so we're adding one less than the order. Obvious from context, but I believe you should correct this to say "the order of a quadruple attack is four." This is an awesome thread, and hopefully very useful to everyone. I'm lost on one statement, though:
Fenrir.Sylow said: » We end up with a miniscule (0.85%) decrease in attacks per round. In this case, the massive damage of the mainhand weapon almost definitely makes the brutal earring come ahead. Wouldn't you have a brutal set that attacks fewer times per round, and say, a ghillie set that attacks more and adds some accuracy and attack  but all else is equal? Thanks yo! Edit: Oh wait, is it because the main, high damage weapon would be the one double attacking, instead of the low damage one OAXing? That's gotta be it... I'm about to get to that, I had to go to the store though :P
You're awesome for doing this Sylow. So on behalf of everybody who hasn't thanked you yet, thank you :D
Funny you are doing this, I just calculated the affect of /war on kraken club the other day because someone yelled at me about rng/waring... dat nub.
And I'm intrested in knowing how double/triple/quad attack works on multi hit ws.
Common theory is that only the first hit will be able to be doubled/tripled etc. What about mythic weapon and aftermath? mythic weapon and AM, the AM OaT 23 can only proc one time on WS
Math class in english. Next I'll be taking biology in french. What has this game done to me?!
That was two different questions, sorry for confusion.
Wanted to know how am3 mythic works, and how da etc works on multi hit ws's. Fenrir.Sylow said: » I'm about to get to that, I had to go to the store though :P Yeah the next question was going to be how to calculate overall damage in such a setup, given two different weapons. I'll just wait, and savor it. Great post! I enjoyed your examples and the hipster dog. I can't wait until I get a little down time to calculate my hits! Thanx Sylow!
Not to be nitpicky over such a small number difference, but your kraken club dual wielding numbers are slighty off. No other multiattack involved should be 4.8 not 4.82, and with 5% DA should be 4.758(4.757625), not 4.779. You are not accounting for the 8 attacks per round limit.
I think so? Jailer weapons are weird.
If I were Kalilla this thread would be pettier.


All FFXI content and images © 20022020 SQUARE ENIX CO., LTD. FINAL
FANTASY is a registered trademark of Square Enix Co., Ltd.
