Showing posts with label sekkanoki. Show all posts
Showing posts with label sekkanoki. Show all posts

Monday, June 14, 2010

Probability distributions associated with WS spam

(Correction: 06/15/2010. I thought Sekkanoki lasted one minute but after reading up on it, it lasts either for one minute or until the next weapon skill, whichever comes first. So, my discussion of the consequences of TP overflow elimination now refers to a hypothetical "Sekkanoki 2.0," which would reduce the TP cost of all weapon skills to 100 TP.)

Who cares about "TP overflow"?

"TP overflow" seems to be the de rigueur term referring to any landed hits that don't contribute to spamming weapons every time 100+ TP is accumulated. TP overflow is inevitable when more than one landed hit per attack round is possible, so it's not like anyone can do much about it except attempt to minimize it by spamming WS. This absolutely does not mean it is harder to "cope" with TP overflow using a multi-hit weapon (when weapon delay is the same as a non-multi-hit alternative). Rather, slack effort means squandering the benefit of the more rapid TP gain of the multi-hit weapon.

So why care about TP overflow? One argument is that it should be "accounted for" when doing item comparisons pertaining to damage efficiency, possibly to be more accurate.

Consider, for example, Soboro Sukehiro, which is considered to average 1.9 attacks per attack round, with the probability of two attacks being .5 and that for three, .2. Given 100% hit rate and 0% DA rate, it takes 3.46553 attack rounds, on average, to be able to execute a weapon skill in six hits, with the actual average number of hits being 6.584507 (note that 6.584507/3.46533 = 1.9 attacks per round), so almost 9% of the hits occur in excess of the target number of hits.

What if somehow there was a way to allocate the TP from those excess hits toward additional weapon skills? Well, Samurai has a level 60 job ability called Sekkanoki, which limits the cost of the next weapon skill to 100 TP. This seems analogous to job abilities like Elemental Seal or Divine Seal, which lasts for 1 minute or until a spell is used, whichever comes first. But what if Sekkanoki limited the cost of all weapon skills to 100 TP while active, say, one minute? This would effectively cause a re-allocation of TP toward future weapon skills. Let's call this "Sekkanoki 2.0."

If one were under the effect of "Sekkanoki 2.0" over a very long time interval, effectively all of the TP would go toward weapon skills, and so the average number of hits approaches 6. Since the average number of attacks per round is 1.9, then the average number of attack rounds approaches 3.157894737, which seems like a fairly significant reduction in average attack rounds until you realize that the concomitant "loss" of TP damage that results from TP overflow (which is eliminated under Sekkanoki 2.0 over an infinite period of time), along with the slight loss of WS damage, offsets the benefit of increased WS frequency. (Also, the proposed Sekkanoki 2.0 lasts for 1 minute out of 5, which means that some TP overflow is inevitable for finite time periods, so it's not like Sekkanoki 2.0 has this tremendous effect.) So, the argument about accounting for TP overflow is a bit overblown (not that you shouldn't, however).

So why care about TP overflow? Since there is no Sekkanoki 2.0, which itself would be a limited tool, you can't do anything about it, so why worry about it? Maybe it's more about players wanting to appear to be "clever" about a not-very-subtle consequence of multi-hit weapons, like asserting that the probability of TP overflow for a given WS is high. (One could easily retort that for Soboro, the fraction of excess hits over total hits would be around 9%.)

But, you know, I'm all about meaningless stuff, so let's finally get into how to define the probability distribution of excess hits (that contribute to TP overflow) associated with WS spam (this would be the same as the probability distribution of the number of hits you end up with under the condition that you spam weapon skills).

Excess hits contributing to TP overflow and the corresponding probability distribution

Let E denote the number of hits in excess of those that contribute to the 100+ TP (in six hits) required to spam a WS. Let's continue with the example of Soboro. For any given attack round, the probability of n landed hits is πn, where n = 0, 1, 2, 3. These probabilities are straightforward to calculate. Not as straightforward to calculate is the probability mass function for E. An extremely tedious approach is to list all the possible combinations of attack rounds that result in 6 or more hits—the possibilities being 6, 7, or 8, which correspond to E = 0, 1, and 2, respectively. This approach requires knowing what to count (all the possible ways to get E = 0, 1, and 2), how to count (combinatorics), and knowing the closed-form expression for the sum of an infinite series, as the possibility of missing hits with non-100% hit rate means there are an infinite number of possible outcomes. (For a given combination of attack rounds leading to 100 TP, there could possibly be zero attack rounds that yield zero landed hits, one attack round that yields zero landed hits, two attack rounds that yield zero landed hits, and so on. These attack rounds are independent of those that yield hits.)

After spending more time than I care to admit, I obtained the p.m.f. of E, which is


This expression is quite unsightly, and rather useless. Not only is it useless merely because knowing the probability of TP overflow is useless, it also is useless because it refers only to the case where 6 hits are required to attain 100 TP. It requires no imagination to see that an expression for a dual-wield situation would be ghastly. It also is useless because you don't even need to knowledge of this p.m.f. to obtain the average number of hits in the process of getting to 100 TP (as I have shown repeatedly in the past). But there it is...

Again, using the Soboro example, P(E = 0) = 0.522579, P(E = 1) = 0.370335, and P(E = 2) = 0.107086, and thank goodness the probabilities sum to 1. The probability of "TP overflow" for a given WS with Soboro is almost 50%... not that you can really do anything about it. The correct response is, "who gives a shit?"

Even worse: the probability distribution of the number of attack rounds

Let R denote the (total) number of attack rounds that results in 100 TP. Again, with the Soboro example, R = 2, 3, 4, ..., and there is not much hope for an elegant formula for the probability distribution, because to obtain such a formula "by hand," one needs again to enumerate all the possible outcomes associated with each event. I only got as far as R =3 before I quit.


Again, using the Soboro example, P(R = 2) = .04, and P(R = 3) = .519. This is consistent with the average number of attack rounds being ~3, but if you already had the average number of attack rounds, why do you need the corresponding probability distribution. Useless!

A better approach for calculating these probability distributions: Markov chains

Perhaps I'll discuss this in a future entry. Aside from the fact that knowing the above probabiltiy distributions is quite useless—average weapon skill TP, average number of rounds, and average number of hits, among other things, are all easily obtained without any knowledge of these probability distributions—the Markov chain approach to obtaining these is much faster and far superior when no symbolic formulas are required. The interpretation of Markov chain output and manipulation is also much easier than it is with formulas for a specific case. It is also the only realistic way where dual-wielding is concerned, as you would have to be crazy even to consider deriving closed-form expressions for the probability distributions for that situation. It is so easy to make a mistake with a binomial or multinomial coefficient here or there, that I have to admit I didn't obtain the above expressions entirely "by hand," but with the help of Mathematica, which is quite handy for dealing with symbolic math.