I have a problem where i have n-elements and the size of these elements must be 1 all together (sum), but they need to be exponentially sized. Lets say I have 5 elements, the first one needs to be 0.5, 2nd 0.25, 3rd 0.15, 4th 7, 5th 3 (the sizes should be proportionally distributed, but the first one should be 0.5).
I have tried to implement exponential decay, but how can I set it as a sum? Should I solve this problem in any other way...with exponential series?
I am a developer and I don't have an idea how to solve this math problem. The solution should look as a chart graph where the next bar is lower than the previous one, but they need to have a combined height of 1.