Assign weights dynamically according to random generated element numbers between 3 & 15

104 Views Asked by At

I have levels of people (say X) generated randomly for an assignment. i have to distribute points among them levelwise. Now lower levels demand a less weight and higher levels get high weights.

Normally if levels were a known number, I would divide the percent (100) with number of Levels and distribute the points according to that percentage. But since the randomly generated levels are dynamic I am finding it difficult to attribute the weights.

For example; If Number of Levels (X) is 8

normal distribution would be 12.5% at each level

So if total points are, say 200, every level would get 25 points

But since i need weighted distribution like, in this example, I would distribute it as

Levels  Percentage
1          5.5%
2          7.5%
3          9.5%
4         11.5%
5         13.5%
6         15.5%
7         17.5%
8         19.5%

The points would be distributed in this way.

I need a formula to calculate weights dynamically according to the number of levels, which is generated randomly. For example if number of levels is 6. Then how would be the weighted percentages calculated?

Thanks in advance.

1

There are 1 best solutions below

0
On

Hi I did find the solution to this. 'Arithmetic Progression' formula solved this problem

S = (n/2) × (2a + (n−1)d)
Where 
S=100
n=number of levels
a=first level percentage
Solve for 'd' then make the series