For a database-frontend, I need to calculate a "score" from a multitude of different variables. While this in itself is rather easy, there is one smaller part that I can't figure out how to solve. The specifications are as following:
- The result must be a percentage value between 0% and 100%.
- Given is a set of [1,n] percentage values ([22%, 79%, 30%] for example).
- The percentages should have a positive effect on each other, but not in a way that they just sum up.
- The order of the percentages in the set must not matter.
Some examples:
- [79%, 22%] => ~85%
- [20%, 60%, 10%] => ~70%
- [90%,90%] => 98%
- [60%] => 60%
- [25%] => 25%
- [100%] => 100%
- [20%, 100%] => 100%
- [10%, 100%, 30%] => 100%
- [75%, 0%] => 75%
- [0%] => 0%
As a developer, I probably have a different approach for mathematics - it is a bit difficult for me to find the correct words to describe what I mean. If you need any further information, let me know! As the solution must written in code anyways, I am also open to pseudo-code or just steps to take.
I would be very happy about every idea - thanks in advance!