Probability law associated with a combination of chips and weapons

Probability law associated with a combination of chips and weapons

> Programming

If you use a system of calculating the best combination of items (chips and weapons) inflicting damage on your opponent, you probably have a (personal) way of calculating the damage of the combination you are studying: if you are pessimistic, you take for example the sum of the minimum damage of each item, if you are more neutral you may take the sum of the average damage, ...

The purpose of this page will be to give notions of probabilities allowing to study the probability associated with the damage of such a "combo" in a more detailed way.

Warning: This article requires some math skills. At least high school notions of integral calculus, preferably some notions of probability too.

Summary

> 1. Motivation >2. Random draw when using chip or weapon >3. Direct approach >4. Continuous approach > 4.1. Principles > 4.2. Probability density associated with an item > 4.3. Convolution > 4.3.1 Introduction: discrete case > 4.3.2 Continuous case > 4.3.3 Some properties > 4.4. Practical calculation in LeekScript > 4.4.1 Case of combos in Leek Wars: simplifications due to context > 4.4.2 Formal calculation: polynomials > 4.4.3 Piece-defined functions > 4.4.4 Convolution > 4.4.5 Critical hits: sum of two slots >5. Management of absolute armor and fixed damage items: mixed law > 5.1. Absolute Armor: Atom at 0 > 5.1.1 Mixed laws > 5.1.2 Dirac distribution at 0 > 5.2. Items with fixed damage and critical hits: atoms elsewhere > 5.2.1 Critical hits and atoms > 5.2.2 Distribution of Dirac at any point > 5.3. Calculation in LeekScript >6. Repartition function and probability tools > 6.1 Definition and calculation > 6.2 Usage >7. Remarks

Motivation

Obtaining an average value of the damage done by a combo is not very difficult. However, you may want to have more accurate information than the average: if you are looking to ensure a minimum of damage (for example to have a good chance of killing), the average does not help you much.

Let's take an example: your opponent has only 430 hit points left, has 155 absolute armor, and you have 400 strength and no agility (and therefore no chance of getting a critical hit). You have selected two combos that can kill the opponent: use your Rhino three times, or use your Rifle twice.

Indeed, the maximum damage inflicted with three uses of the Rhino is given by:

and those given by two uses of the rifle are:

which is over 430 in both cases, for a similar TP cost (we'll assume you have 15, and the rhino in hand).

The calculation of the average damage, which is done in the same way, gives 450 for the rhino as for the rifle. All that can be deduced from the average is that the rhino, like the rifle, has more than a 50% chance of killing the opponent. But that doesn't help us choose the combo that's most likely to be lethal.

We therefore need, if we want to maximize the chances of killing the adversary, more precise information.

> Spoiler: it's the rifle that has the best chance here, with a 94.4% chance of killing, against 90.4% for the rhino.

This case, relatively simple, may seem without much interest and perhaps quite intuitive. The tools presented below make it possible to take into account more varied combos, as well as the chances of critical hits, which have a sometimes more obscure influence on the probabilities of damage.

Finally, note that this study of probabilities can have other applications (healing oneself, for example, one can look for the best healing combo with conditions such as "not to heal oneself more than the number of missing hit points"). I'm just presenting the tool here, it's up to you to use it as you wish.

Random draw when using chip or weapon

The game uses, each time a weapon or chip is used, one and only one random draw (between 0 and 1) for all effects. The value of each effect is then given by:

where draw is the number between 0 and 1 obtained.

This draw