User:Guy Bukzi Montag/sandbox

''Nothing to see here. It's only my playground for future blog posts.''

Everything on this page is a draft and will be deleted when the final post is published.

''If you do see something here, it's probably a blog post in the making. Feel free to comment, corrections are welcome!''

---

Drop Rates Explained: 5th Anniversary (II)

Part I of this post is finished and has has moved to a blog post.

---

This part contains the explanations promised in part I and will show you


 * how to extract probabilities (drop rates) from many percentages given in a box info and
 * how to calculate the probability of getting desired items from a certain amount of boxes.

The boxes granted by the 5th Anniversary event will serve as examples, but the methods also work for other boxes.

Definitions
Every box has two properties:
 * the description ("Contains 4 possible rewards", "Grants 15 Engine cards! At least 1 will be an i6 card!") and
 * the box info (A8BoxInfo.png, or A8BoxInfoAnniversaryBundle.png for 5th Anniversary Bundles) which shows a list of percentages for the items in the box.

Drop rate (probability)
Sometimes the description of a box already contains information about probabilities: If an item is marked as "guaranteed" or described as "At least 1 will be [...]", its drop rate or probability is 100 %.


 * The drop rate of an item is the probability of getting it in a box.

Percentage (expected value)
Contrary to the belief of many players, the percentages shown in the box info do not represent the probabilities of the items. Instead, they show the distribution of items that can be expected if a very large amount of boxes is opened. For example, a guaranteed blueprint in a box with 4 items has a probability of 100 % (because it's guaranteed), but its expected value in relation to the other items in the box is 25 % because it will always be 1 of the 4 items, thus $$\tfrac{1}{4}$$ = 25 %. This 25 % value is the one listed in the box info, not the probability.


 * The percentage or expected value of an item is its amount relative to the other items inside a box, expressed in percent.

Random-only boxes
Sometimes the expected value of an item allows us to deduce its probability directly. For example, if there are 4 random items in a box and 1 has an expected value of 20 % shown in the box info, it's probable that we get 20 of this item if we open 100 boxes. This number can vary because the item is still random and 100 is not a reliable size of a statistical sampling. But if we open 1,000 or even 100,000 boxes, the share of the chosen item will become more and more close to 20 %.


 * The percentage (expected value) of an item equals its probability if there are only random items in a box.

Example: The Specialist Bundle of the 5th Anniversary event "contains 3 possible rewards". None of them is marked as guaranteed.

Info:
 * Blueprint Boxes: 10 %
 * Tokens: 3.33 %
 * Credits: 23.33 %
 * Pro Kit Boxes: 63.33 %

So if we open 100 boxes, we are likely to get more or less 10 blueprints.

That's all there is to say about random-only boxes. There more boxes you open, the more probable it is that you get exactly the number of items defined by their expected values given in the info.

Boxes with guaranteed items
As seen above, guaranteed items distort the percentages of a box. As we already know that their probability is 100 %, we can leave them out and concentrate on what the percentages would have been without them.

Example: The Novice Bundle "contains 2 possible rewards". One of the items in the list (a BMW M2 SE blueprint) is marked as guaranteed.

Info:
 * Blueprint Boxes: 87.5 %
 * Pro Kit Boxes: 12.5 %

In this case we cannot simply say that the probability of getting a Pro Kit Box is 12.5 %. It's true that we can expect roughly 125 Pro Kit Boxes if we open 1,000 Novice Bundles, but this is only the expected value, not the probability. The reason is: Every box contains 2 items, and 1 out of 2 is guaranteed. So 50 % of the 2 items are guaranteed blueprints, 37,5 % are random blueprints and 12.5 % are Pro Kit Boxes.

The real distribution is:
 * 50 % of the bundle's items are guaranteed blueprints,
 * 37,5 % of the other 50 % are random blueprints and
 * 12.5 % of the other 50 % are Pro Kit Boxes.

12.5 % of 50 % is the same as 25 % of 100 %, so the real probability of Pro Kit Boxes in a Novice Bundle is 25 %.

Sort out guaranteed items
Apart from this, a box can have hidden rules that aren't mentioned. For example, the 5th Anniversary Expert Bundles always grant either credits or tokens—there is no box containing none them.

How many blueprints do I get for n coins?
Let's assume that you have. With those coins you can buy either
 * 3 Expert Bundles ( each) or
 * 7 Specialist Bundles ( each) or
 * 14 Novice Bundles ( each).

The Expert bundle grants at least 1 Audi R8 e-tron SE blueprint per box; the maximum number you can get is 7. Assumed that there are no underlying probabilities for certain amounts of blueprints, you can imagine this as an urn containing 7 boxes: one box with 1 blueprint, one box with 2, one with 3 and so on. If you draw one box from the urn, each box and thus each amount of blueprints has the same probability: $$\tfrac{1}{7}$$.

As you can buy 3 Expert Bundles for your coins, you can draw 3 times from the urn (with putting back the drawn item).
 * The probability of getting the maximum number of blueprints from 3 draws (i. e. 3 times box number 7) is $$\tfrac{1}{7} \cdot \tfrac{1}{7} \cdot \tfrac{1}{7} = \tfrac{1}{7^3} = \tfrac{1}{343}$$ = 0.29%.
 * Each other combination of boxes has the same probability of $$\tfrac{1}{343}$$, but there are several combinations that grant, for example, 20 blueprints (maximum number minus 1): 7-7-6, 7-6-7 and 6-7-7, each with a probability of $$\tfrac{1}{343}$$. So the probability for 20 blueprints is $$\tfrac{3}{343}$$ = 0.87%.
 * This leads to the question in how many ways you can combine three summands from 1 to 7 so that the result is the desired number of blueprints. You can imagine that as throwing a seven-sided dice three times. Technically, this is a special case of a composition problem which is examined in combinatorics (see Wikipedia article for further explanations).

The probability of getting the maximum number of items from d draws out of n items is $$\frac{1}{n^d}$$.

As the number of draws equals the number of boxes you can buy, the number of boxes is defined by $$\lfloor\frac{amount of coins}{box price}\rfloor$$ Bla

\begin{align} m &= \sum_{k=0}^{\lfloor \frac{s-n}{7} \rfloor} (-1)^k \cdot \binom nk \cdot \binom{s - 1 - 7k}{n - 1}\\ &= \sum_{k=0}^{\lfloor\frac{s-n}{7}\rfloor} (-1)^k \cdot \frac{n!}{k! \cdot (n-k)!} \cdot \binom{s - 1 - 7k}{n - 1} \end{align} $$

Bla

with m: probability of a sum n: amount of boxes s: sum of blueprints

How many coins do I need to assemble a car with a probability of 90 %?
Bla

Which bundle grants more tokens: Expert or Specialist?
Bla

Appendix
Mercedes-Benz SE:

The amount of boxes needed to get at least 1 (one!) blueprint with a probability of 90 % is


 * $$n \geq \frac{\ln(1 - 0.9)}{\ln(1 - 0.1)} = 21.85$$.