Consider the following example:
One (1) farm has the production value of 1. But for each 10 farms, the production is reduced by half. So what is the production value for 30 farms?
Calculating manually is quite straight forward;
For the first 10 farms -> 10 production
For the second 10 farms -> 10 * 0.5 = 5 production
And for the last 10 farms -> 10 * 0.25 = 2.5 production
Result: 17.5 production
But creating a formula isn't so trivial;
Searching for similar problems I found this excellent post by the user Scott: https://superuser.com/a/1527430/2156837
Using his formula: R = V * (1 – d^N) / (1 – d)
Where V is the base value, d is the diminishing rate, and N the number of interactions.
The only detail, from my previous example, is that I don't have the number of interactions. But it can be easily calculated by dividing the total (30) by the base number (10).
So it goes like this:
R = 10 * (1 - 0.5^(30/10)) / (1 - 0.5)
R = 17.5
It works! But there is just one problem..
Assume the same example but for 35 farms instead.
For the first 10 farms -> 10 production
For the second 10 farms -> 10 * 0.5 = 5 production
The following 10 farms -> 10 * 0.25 = 2.5 production
And for the remaining 5 farms -> 5 * 0.125 = 0.625 production
Result: 18.125
By using the formula;
R = 10 * (1 - 0.5^(35/10)) / (1 - 0.5)
R = 18.23223305
Conclusion: the formula does not work if the number of interactions (N) is not an integer.
Can any math magicians tell me what went wrong or how to fix it? Thank you in advance!