Math:Resource Preservation: Difference between revisions

From Melvor Idle
mNo edit summary
mNo edit summary
Line 21: Line 21:
So the number of daggers produced is <math>120 + (120 \times 0.8) + (120 \times 0.8 \times 0.8) + ... + (120 \times 0.8^n)</math> where <math>n</math> is a number as huge as you can imagine.
So the number of daggers produced is <math>120 + (120 \times 0.8) + (120 \times 0.8 \times 0.8) + ... + (120 \times 0.8^n)</math> where <math>n</math> is a number as huge as you can imagine.


If we replace the number <math>120</math> with any other number <math>a</math> and the probability 0.8 with any other probability <math>r</math>, the number of produced daggers would look like this:
If we replace the number <math>120</math> with any other number <math>a</math> and the probability <math>0.8</math> with any other probability <math>r</math>, the number of produced daggers would look like this:


<math>a + (a \times r) + (a \times r \times r) + ... + (a \times r^n)</math>
<math>a + (a \times r) + (a \times r \times r) + ... + (a \times r^n)</math>

Revision as of 19:32, 20 May 2022

This page was last updated for (v1.0.3).

Let's say you have 120 bars, 80% resource preservation, and 0% doubling chance.

If a dagger takes one bar to create, how many daggers would you create on average out of 120 bars?

The answer is [math]\displaystyle{ \frac{120}{1 - 80/100}= \frac{120}{0.2} = 600. }[/math]


The main idea behind the preservation is that you can reuse what you preserved to make more stuff.

Using the same example with 120 bars, you take 120 actions producing 120 daggers, but with 80% preservation you are left with [math]\displaystyle{ 120 \times 0.8 = 96 }[/math] bars.

Now you can use those 96 bars to do the same thing, and you will be left with [math]\displaystyle{ 96 \times 0.8 = 76.8 }[/math] bars on average.

Repeat that to infinity, and you will get the average number of daggers that you will produce from 120 bars.

But how do we calculate this number?


So the number of daggers produced is [math]\displaystyle{ 120 + (120 \times 0.8) + (120 \times 0.8 \times 0.8) + ... + (120 \times 0.8^n) }[/math] where [math]\displaystyle{ n }[/math] is a number as huge as you can imagine.

If we replace the number [math]\displaystyle{ 120 }[/math] with any other number [math]\displaystyle{ a }[/math] and the probability [math]\displaystyle{ 0.8 }[/math] with any other probability [math]\displaystyle{ r }[/math], the number of produced daggers would look like this:

[math]\displaystyle{ a + (a \times r) + (a \times r \times r) + ... + (a \times r^n) }[/math]

or in short

[math]\displaystyle{ \sum\limits_{n=0} ar^n }[/math].

This thing is called a geometric progression, and it turns out that its value is equal to [math]\displaystyle{ \frac{a(1 - r^n)}{1 - r} }[/math].

And because [math]\displaystyle{ r \lt 1 }[/math] and [math]\displaystyle{ n }[/math] is very big, it can be simplified to [math]\displaystyle{ \frac{a(1 - 0)}{1 - r} = \frac{a}{1 - r} }[/math].

So, coming back to our example where [math]\displaystyle{ a = 120 }[/math] and [math]\displaystyle{ r = 0.8 }[/math], we get

[math]\displaystyle{ \frac{120}{1 - 0.8} = 600 }[/math].