Jump to content

Payout Algorithm


aclavec

Recommended Posts

I am looking for a payout algorithm. Here is the problem.

 

Variables - Number of Users, Entry Fee (Per User)

 

Each user enters a competition and pays an entry fee.

When the competition is complete each user is ranked and is

paid based on their performance. I am trying to generate an algorithm

which will take in the number of users and their entry fee and calculate

a payout for each user. I would like all players to receive a payout

even if last place gets practically nothing. I suspect the graph of the

payout curve would look exponential. I would like this algo to be configurable

to maximize the houses take, or to maximize payout to the users.

 

Any thoughts on this?

Link to comment
Share on other sites

Here is my model:

Let's the MAX rank achieved by someone is Rank_Max

The payout for this user will be X.

 

Because each user is getting paid based on the perfomance(rank) the payout for each user will be

 

X*(Rank(I))/Rank_MAX)

 

where Rank(I) is rank of user I.

The sum of all payouts should be = to Number_of_users*Fee

 

where Fee is enry fee

 

So we have

Sum(X*Rank(I)/Rank_MAX)=Number_of_users*Fee

OR

X*Sum(Rank(I)/Rank_MAX)=Number_of_users*Fee

 

Based on this the algo should be:

1. X= Number_of_users*Fee / Sum(Rank(I)/Rank_MAX)

 

2. Payout(I)=X * Rank(I)/Rank_Max for each user I

 

 

To max payout we can try to change the entry Fee.

With incresement of entry fee the number of users will go down.

Let's B will be the number of users when fee=0, assuming linear dep.

we can say then

Number_of_users=B-A*Fee

with some fee there will not be any users.Let's say the lowest such fee is Fee_Max and since 0=B-A*Fee_Max => A=B/Fee_Max

 

To max payout we need to max X which is

X= Number_of_users*Fee / Sum(Rank(I)/Rank_MAX)

OR

X=(B-A*Fee)Fee/Sum(Rank(I)/Rank_MAX))

Taking deriv. by Fee to find max:

B-2A*Fee_opt=0

OR Fee_opt=B/2A science A=B/Fee_Max

we can say that

Fee_opt=Fee_Max/2

 

So, the max payout will be for Fee_Max/2

Link to comment
Share on other sites

lwebzem,

 

Thanks for the reply. I do have some questions.

 

I am trying to put an example through your algo and it isn't working out.

Suppose 10 people enter for $10 each. The total amount to go around is

$100.

 

Using your algo:

 

sum(rank(i)/10) = 5.5

 

payout(1) = ((10*$10)/5.5) * (1/10) ) = 1.18

 

This means the number one ranked user gets paid $1.18? This doesn't seem right. I might be interpreting your algo incorrectly. Can you provide an example?

 

Thank you.

Link to comment
Share on other sites

Oops. I was in fact interpreting it wrong. I assumed that rank(1) was first

place. Actually rank(n) is first place and rank(1) is last. I graphed it out and

it looks good. One thing about this algo is that it is a linear payout. Is it possible to tweak this to get an exponential payout to favor the top ranked players?

 

Thanks again.

Link to comment
Share on other sites

Here is the exponentional model:

 

I am going to use exp function y=e^(-rank)

where e=2.71.....

^ is for power

and rank is ranks: 0,1,2,3,4,5....RL where 0 rank is for the best perfomer,

1 is for next to best, and so on and RL is rank of lowest performer.

 

If you use another counting then ajustment should be done.

So the best performer will get max payout because e^(-0) = 1

the next to best will get e^(-1)=1/e

next will get e^(-2)=1/(e*e)

and so on. (This is only percent not the dollar amount)

This way we have exponentional distribution.

 

To get actual dollar amount we use equation

 

Sum(X*e^(-rank(i))=N*Fee

where rank(i) is rank for ith performer

 

so the algo will be

 

1. X=(N*Fee)/Sum(e^(-rank(i))

2. payout for performer i will be

Payout=X*e(-rank(i))

 

where rank(0) is rank of the best performer

 

The Sum is geometric progression with q=1/e and can be simplified

 

Sum=(((1/e)^N)-1)/((1/e)-1)=(q^N-1)/(q-1)

 

The calculations for max. payout will be the same assuming

that q^N ~ const as N getting bigger.

Link to comment
Share on other sites

lwebzmem,

 

Great! Thank you so much. I like it. One final question, I promise. Is there a way to alter the exponential payout to have a more gradual curve? Ideally something inbetween the linear and exponential. I didn't know if this could be done with a scale factor or something.

 

Thanks again for your help.

Link to comment
Share on other sites

You are very welcome. To have a more gradual curve instead of e=2.71

use any number between 1 and 2.71 ( 1 < e < 2.71...)

 

for example we can take e=2, and here is how it looks:

 

rank 0 1 2 3 4

e=2 1 0.5 0.25 0.125 0.065

e=2.71 1 0.369 0.136 0.05 0.018

 

Everything will be the same, only need to change e=2.71 to another number.

 

Let me know please if any other questions.

Thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.