- Thread starter
- #1

Hi all,

I am a programmer and in one of my projects I need a cash payout calculator based on upper and lower minimums and variable input.

Here are the variables:

Total amount to payout

Total number of payouts

Set minimum first place payout

Set minimum last payout

"K" to vary the slope of the curve

Example

Total amount to payout is 10000.

Payout is for 15 places.

1st places is guaranteed 4000.

Last payout (15) is 100.

I had someone help "many" years ago, but the total amount paid out was more than the size of the payout pool. Here is the code:

( ^ ) operator is for exponent

K = inK

N = pay_places

AA = last_pay

Z = max_pay

D = pool

Sum = 0

F = Z / AA

BB = F ^ (1 / ((N - 1) ^ K))

loop I = 0 TO N - 1

NewSum = 0

loop I = N - 1 TO 0 by -1

. (more code to write out data)

.

end

Thanks in advance for any assistance

Bob

I am a programmer and in one of my projects I need a cash payout calculator based on upper and lower minimums and variable input.

Here are the variables:

Total amount to payout

Total number of payouts

Set minimum first place payout

Set minimum last payout

"K" to vary the slope of the curve

Example

Total amount to payout is 10000.

Payout is for 15 places.

1st places is guaranteed 4000.

Last payout (15) is 100.

I had someone help "many" years ago, but the total amount paid out was more than the size of the payout pool. Here is the code:

( ^ ) operator is for exponent

K = inK

**(inK is the K value to modify the slope)**N = pay_places

**(N=number of places to pay out)**AA = last_pay

**(AA=base prize minimum)**Z = max_pay

**(Z=top prize minimum)**D = pool

**(D=total payout)**Sum = 0

F = Z / AA

BB = F ^ (1 / ((N - 1) ^ K))

loop I = 0 TO N - 1

Sum = Sum + AA * BB ^ (I ^ K)

endNewSum = 0

loop I = N - 1 TO 0 by -1

NewSum = NewSum + AA * BB ^ (I ^ K) * D / Sum

recommend = AA * BB ^ (I ^ K)

**(This adds up high)**pay_out = round((AA * BB ^ (I ^ K)),1)

.**(but correctly sets hi and lo bounds)**. (more code to write out data)

.

end

Thanks in advance for any assistance

Bob

Last edited: