FANDOM


This is part IV of a series on the maths behind drop rates.

This part continues the explanations of part III and will show you how to calculate your chances if a box grants a guaranteed, but variable amount of desired items (for example, the Expert Bundle of the 5th Anniversary event granting 1-7 Audi R8 e-tron SE blueprints).

Expectations revisited

In Part II we have examined the expected values of items in a box. Now it's time for the more precise definition that is used in probability theory, because numbers can have expected values, too.

Let $ X $ be a random variable with a finite number of finite outcomes $ x_1 $, $ x_2 $, ..., $ x_k $ occurring with probabilities $ p_1 $, $ p_2 $, ..., $ p_k $, respectively. The expected value or expectation of $ X $ is defined as

$ \operatorname{E}[X] = \sum_{i=1}^k x_i\, p_i = x_1p_1 + x_2p_2 + \ldots + x_kp_k $.[1]

Since all probabilities $ p_i $ add up to 1 ($ p_1 + p_2 + \ldots + p_k = 1 $), the expected value is the weighted average, with $ p_i $’s being the weights. In the special case of all probabilities being the same ($ p_1 = p_2 = \ldots = p_k $), the weighted average turns into the simple average.

Example: If $ X $ represents the outcome of a roll of a fair six-sided die, the possible values for $ X $ are 1, 2, 3, 4, 5, and 6, all equally likely (each having the probability of $ \tfrac16 $). The expectation of $ X $ is

$ \operatorname{E}[X] = 1\cdot\frac16 + 2\cdot\frac16 + 3\cdot\frac16 + 4\cdot\frac16 + 5\cdot\frac16 + 6\cdot\frac16 = 3.5 $.

In this case (all outcomes of $ X $ have the same probability $ p $), the general formula becomes

$ \operatorname{E}[X] = \sum_{i=1}^k x_i\, p = x_1p + x_2p + \ldots + x_kp $.

The box inside the box

The "Elite Supplies" of the McLaren 720S World Tour and the "Expert Bundle" of the 5th Anniversary event have in common that they both contain guaranteed blueprints, but you don't know the exact number you'll get. For example, the Expert Bundle grants between 1 and 7 of them.

As resources are rare and an event usually offers several ways to spend them, it would be cool to know what we can expect before we take a decision. The most important questions are:

  1. How many blueprints can I expect?
  2. How probable is it that I get a certain number of blueprints?

How many blueprints can I expect?

In Part II I had introduced the "box inside the box" principle to isolate the random items that we wanted to examine. Now we do the same, but this time, we take the blueprints and think of them as a sub-box. If you open it, you have the chance to draw either 1, 2, ..., or 7 blueprints. So the content of this sub-box is nothing more than a variable $ D $ (for the desired items drawn) with the finite outcomes 1, 2, ..., 7. Gameloft doesn't say anything about the probabilities of each number, so we have to assume that they are all the same. In this case we can compare it with a fair seven-sided die, and the expected number of blueprints we get if we open a very large number of boxes is the simple average:

$ \operatorname{E}[D] = \sum_{i=1}^7 i\cdot\frac17 = 1\cdot\frac17 + 2\cdot\frac17 + 3\cdot\frac17 + 4\cdot\frac17 + 5\cdot\frac17 + 6\cdot\frac17 + 7\cdot\frac17= 4 $.

If the seven-sided die wasn't fair, there would be different probabilities assigned to each of the outcomes of $ D $, and we would get a weighted average. This is the way Gameloft could adjust the number of blueprints you get from a box, even if the description "1-7 blueprints" was still true. To verify this, a very large number of boxes would have to be opened in order to get a valid statistical base for a calculation. I'm talking of 1,000 or more boxes, which is impossible, so we have to live with a certain rest of uncertainty.

How probable is it that I get a certain number of blueprints?

Let's assume you have A8AnniversaryCoins 1,050. With these coins you can buy 3 Expert Bundles for A8AnniversaryCoins 350 each. As we know that the expected value $ \operatorname{E}[D] $ for one box is 4, it's tempting to simply multiply this with the number of boxes, so we should get 12 blueprints. But remember that an expected value needs a very large number of draws to become a good approximation of reality. How reliable is this prediction if we only open 3 boxes?

There are $ 7^3 $ permutations,[2] and 4 + 4 + 4 is one of them. It has a probability of $ \tfrac1{7^3} $ = 0.29 %. But there are other combinations that also grant 12 blueprints: 4 + 5 + 3, for example, or 2 + 3 + 7, each having a probability of $ \tfrac1{7^3} $.

So if we want to know the probability of getting at least 12 blueprints, we first have to find the number $ c_{12} $ of combinations whose sum equals 12. As we can also get more than 12 blueprints (and we won't complain), we then have do the same for $ c_{13} $, $ c_{14} $, ... up to the maximum number of blueprints we can get, which is the number of boxes multiplied with the maximum number of blueprints per box ($ 3 \cdot 7 = 21 $). The sum of the combinations $ c_{12} $, $ c_{13} $, ... $ c_{21} $ is the final number of combinations with at least 12 blueprints from 3 boxes. As each of these combinations has a probability of $ \tfrac1{7^3} $, the probability $ P(D \ge 12) $ of getting at least 12 blueprints is

$ P(D \ge 12 ) = \frac{c_{12}}{7^3} + \frac{c_{13}}{7^3} + \ldots + \frac{c_{21}}{7^3} $.

Generally, the probability of getting at least $ d $ desired items from boxes containing a variable number of guaranteed items is

$ P(D \ge d) = \frac1{m^n} \cdot \sum_{i=d}^{nm} c_i $.
$ d $: number of desired items
$ m $: maximum number of items per box
$ n $: number of boxes
$ c_i $: number of combinations with a sum of exactly $ i $ items
$ D $: event of desired items drawn
$ P(D \ge d) $: probability of $ D $ being equal to or greater than $ d $

But we still have to find out the values for $ c_i $. The general formula to calculate them is

$ c_i = \sum_{k=0}^{\left \lfloor \frac{i-n}{m} \right \rfloor} (-1)^k \cdot \binom nk \cdot \binom{i - mk - 1}{n - 1} $.

For those interested in how to derive the $ c_i $ formula, there's a good explanation of an analogous example with n-sided dice at StackExchange.[3]

Now we have everything we need to calculate the probability of getting at least 12 blueprints from 3 Expert Bundles. It is

$ \begin{align} P(D \ge 12) & = \frac1{7^3} \cdot \sum_{i=12}^{3 \cdot 7} c_i, \quad c_i := \sum_{k=0}^{\left \lfloor \frac{i-3}{7} \right \rfloor} (-1)^k \cdot \binom 3k \cdot \binom{i - 7k - 1}{3 - 1}\\ \\ \\ & = 55.39 %. \end{align} $

So you've got a 55.39 % chance of getting at least the expected number of 12 blueprints. You think that's not much for something called an expected value?

To get an orientation, one should also calculate the probabilities for the other numbers of blueprints. I did this in Table 1; the row with 12 blueprints is highlighted. At the bottom you can find the value of 0.29 % for 21 blueprints which sounds somewhat familiar. It's the $ \tfrac1{7^3} $ we've calculated before. As there is only one of $ 7^3 $ combinations that delivers a sum of 21 blueprints (7+7+7), its probability is $ \tfrac1{7^3} $.

Table 2 shows the probabilities of getting exactly (not at least) the number of desired blueprints for several numbers of boxes. I've cut the rows at $ d = 21 $ because this is the maximum number of blueprints you can get in our example of 3 boxes.

I've also added the expectations in the top row so you can see that the expected value has indeed the highest probability—but it's perhaps lower than one might have expected. It even decreases when you open more boxes. That's no contradiction because the more boxes you have, the more possibilities there are to place the desired items in a sequence with an exponentially increasing length of $ 7^n $.

Table 1:
Probabilities of getting
at least $ d $ blueprints
$ d $
(Blueprints)
$ P(D \ge d) $
($ n = 3 $ boxes,
$ \operatorname{E}[D] = 12 $)
1 100 %
2 100 %
3 100 %
4 99.71 %
5 98.83 %
6 97.08 %
7 94.17 %
8 89.80 %
9 83.67 %
10 75.51 %
11 65.89 %
12 55.39 %
13 44.61 %
14 34.11 %
15 24.49 %
16 16.33 %
17 10.20 %
18 5.83 %
19 2.92 %
20 1.17 %
21 0.29 %
Table 2:
Probabilities of getting
exactly $ d $ blueprints
$ d $
(Blueprints)
$ P(D = d) $
($ n = 2 $ boxes,
$ \operatorname{E}[D] = 8 $)
$ P(D = d) $
($ n = 3 $ boxes,
$ \operatorname{E}[D] = 12 $)
$ P(D = d) $
($ n = 4 $ boxes,
$ \operatorname{E}[D] = 16 $)
$ P(D = d) $
($ n = 5 $ boxes,
$ \operatorname{E}[D] = 20 $)
1 0 % 0 % 0 % 0 %
2 2.04 % 0 % 0 % 0 %
3 4.08 % 0.29 % 0 % 0 %
4 6.12 % 0.87 % 0.04 % 0 %
5 8.16 % 1.75 % 0.17 % 0.01 %
6 10.20 % 2.92 % 0.42 % 0.03 %
7 12.24 % 4.37 % 0.83 % 0.09 %
8 14.29 % 6.12 % 1.46 % 0.21 %
9 12.24 % 8.16 % 2.33 % 0.42 %
10 10.20 % 9.62 % 3.50 % 0.75 %
11 8.16 % 10.50 % 4.83 % 1.25 %
12 6.12 % 10.79 % 6.21 % 1.93 %
13 4.08 % 10.50 % 7.50 % 2.80 %
14 2.04 % 9.62 % 8.58 % 3.81 %
15 0 % 8.16 % 9.33 % 4.91 %
16 0 % 6.12 % 9.62 % 6.04 %
17 0 % 4.37 % 9.33 % 7.08 %
18 0 % 2.92 % 8.58 % 7.91 %
19 0 % 1.75 % 7.50 % 8.45 %
20 0 % 0.87 % 6.21 % 8.63 %
21 0 % 0.29 % 4.83 % 8.45 %

There's another link between the two tables: If you choose a value in the $ n = 3 $ column of Table 2 and add all following values, you get the corresponding value in Table 1. That's what we did in a more abstract way in the $ \frac1{7^3} \cdot \sum_{i=12}^{21} c_i $ part of the formula above.

DiagramProbabilities
The diagram to the right illustrates the symmetry of the values surrounding the expected value and also shows its decreasing probability when the number of boxes increases. Technically, this is called a discrete probability distribution,[4] and the formula we have found to produce this distribution is a probability mass function.[5]

By the way, you can use our probability mass function for dice games, too! Just replace the maximum number of items per box $ m $ with 6 (sides of a die) and the number of boxes $ n $ with the number of dice you use (or the number of rolls with one die, it's the same). The number of desired items $ d $ is the sum of pips you want to get.

Of course, it would take ages to calculate this manually. You can do it by using the functions shared at the end of this series.

The next post will answer the remaining question how many boxes must be opened to have at least a defined chance (for instance 90 %) of obtaining a desired item.

If you have questions or find mistakes: Feel free to comment!

References

  1. See Wikipedia: Expected value.
  2. See Part III: Permutation.
  3. "Probability that the sum of k dice is n". StackExchange. 2017-05-21. Retrieved 2018-09-19.
  4. See Wikipedia: Probability distribution.
  5. See Wikipedia: Probability mass function.
Community content is available under CC-BY-SA unless otherwise noted.