Hi I am trying to write the algorithm to calculate the winning amount of the winners. My problem is as below,
1) I have open ended tournament in which participants can be in ratio of 2 (i.e 2,4,8,16 and so on) 2) I am going to declare 50% or 25% of them as winners for each respective position Ex.- If i have 32 participants then in case of 50% winners my winners are as below,
Position Number Of winners
1st 1
2nd 1
3rd 2
4th 4
5th 8
and if i have 25% of winners then winners will be till 4th position
3) Now i want to distribute the winning amount in them unequally as winner of 1st position will get more and then 2nd is little less than 1st and 3rd is little less than 2nd and so on 4) The multiple number of winners on position 3rd on words will get the same amount Ex. If amount to distribute is $800 then in 8 winners then the rough distribution for this will be like as below,
Position Number of Winners Amount for each Winner
1 1 300
2 1 150
3 2 75(Each)
4 4 50 (Each)
-------------------------------
Total 800
(this is rough calculation we need formula or directions which will help us or guide to how to get the winning amount)
We are trying various methods but we are weak in math so unable to find any formula any help would be great.we are not expecting the exact formula (if have then great) but any direction would be great. Thanks in advance.
Update
I tried this formula
Divide 800 in 8
(X + 4) + (X + 3) + (X + 2) + (X + 1) + (X - 1) + (X - 2) + (X - 3) + (X - 4)
In above case X = 800/8 =100 it will give
104 + 103 + 102 + 101 + 99 + 98 + 97 + 96 = 800.
But now the problem is I have 2 players on 3rd position and 4 players on 4th position, and players on same position must have same prize.