I am writing a program which requires me to calculate percantages, modify them and calculate winning probabilities of a sports team. What I need to calculate in the program is increase the percentages depend on its value and keep the correct ratio between them.
For instance, if I increase the value of % 66.6 by adding % 20 of it’s own value, it becomes:
(% 66.6 x % 20) / 10000 = % 13.32 à % 66.6 + % 13.32 = % 79.92
But if I do the same thing to for example % 95, it becomes:
(% 95 x % 20) / 10000 = % 19 à % 95 + % 19 = % 114
As can be seen, it goes way beyond % 100 which is not what I wanted.
So instead of increasing the percentages by adding % 20 percent to the main value, I tried to solve this issue by making:
% 100 - % 66.6 = % 33.4
% 100 - % 95 = % 5
And made the increase based on this remaining values:
(% 33.4 x % 20) / 10000 = % 6.68 à % 66.6 + % 6.68 = % 73.28
(% 5 x % 20) / 10000 = % 1 à% 95 + % 1 = % 96
This solves the problem of how much increase needed to each percentage, but this time the ratio between them gets anaccurate.
For instance I have this probability calculation:
( % 83.3 x % 80) / 10000 = % 66.6
If I make the same calculations:
% 100 - % 83.3 = % 16.7
% 100 - % 80 = % 20
% 100 - % 66.6 = % 33.4
(% 16.7 x % 20) / 10000 = % 3.34 à % 83.3 + % 3.34 = % 86.64
(% 20 x % 20) / 10000 = % 4 à% 80.0 + % 4 = % 84
(% 33.4 x % 20) / 10000 = % 6.68 à% 66.6 + % 6.68 = % 73.28
Now, if I calculate the probability as before:
( % 86.64 x % 84) / 10000 = % 72.77
As can be seen it’s not equal to 73. 28
For instance, if I increase the value of % 66.6 by adding % 20 of it’s own value, it becomes:
(% 66.6 x % 20) / 10000 = % 13.32 à % 66.6 + % 13.32 = % 79.92
But if I do the same thing to for example % 95, it becomes:
(% 95 x % 20) / 10000 = % 19 à % 95 + % 19 = % 114
As can be seen, it goes way beyond % 100 which is not what I wanted.
So instead of increasing the percentages by adding % 20 percent to the main value, I tried to solve this issue by making:
% 100 - % 66.6 = % 33.4
% 100 - % 95 = % 5
And made the increase based on this remaining values:
(% 33.4 x % 20) / 10000 = % 6.68 à % 66.6 + % 6.68 = % 73.28
(% 5 x % 20) / 10000 = % 1 à% 95 + % 1 = % 96
This solves the problem of how much increase needed to each percentage, but this time the ratio between them gets anaccurate.
For instance I have this probability calculation:
( % 83.3 x % 80) / 10000 = % 66.6
If I make the same calculations:
% 100 - % 83.3 = % 16.7
% 100 - % 80 = % 20
% 100 - % 66.6 = % 33.4
(% 16.7 x % 20) / 10000 = % 3.34 à % 83.3 + % 3.34 = % 86.64
(% 20 x % 20) / 10000 = % 4 à% 80.0 + % 4 = % 84
(% 33.4 x % 20) / 10000 = % 6.68 à% 66.6 + % 6.68 = % 73.28
Now, if I calculate the probability as before:
( % 86.64 x % 84) / 10000 = % 72.77
As can be seen it’s not equal to 73. 28