Author Topic: Formula for league points  (Read 1772 times)

D71J

  • Newbie
  • *
  • Posts: 30
    • View Profile
Formula for league points
« on: September 21, 2010, 08:22:21 AM »
Hi,

for the league we are playing, I'm looking for a formula. Half of the number of players will finish in the points, the last one of these players in the points will get
10 points. The rest of the players we would like to give 10% more points then the previous one, so if we have 60 players, 30 of them will get points. 30th will
get 10 points, 29th -> 11 points, 28th -> 12 points, 27th -> 13 points, 26th -> 14 points, 25th -> 15 points, 24th -> 17 points, and so on.
The points needs to be rounded down when the points are ,5 or lower and up if they are ,6 or higher. I hope it makes a bit of sense wath I'm asking.
Can anyone give me the formula to do this?

Best regards,

Dave

Magic_fubu

  • Hero Member
  • *****
  • Posts: 1035
    • View Profile
Re: Formula for league points
« Reply #1 on: September 21, 2010, 10:56:48 AM »
It's sounding more like it's one more point than the one before it, which would be a variation of the n-r and n-r+1 formulas. That being the case, I believe you're going to want something like this:

Code: [Select]
if(r>0.5*n, n-r-21, 0)
That should definitely work for 60, and should work if you want to keep the point structure the same. If not, let me know and we will get one that for sure works :)
My cowboys shot down your rockets
---
If you send a request to me please send that you got me from here w/your TD name to confirm. Thanks!

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Formula for league points
« Reply #2 on: September 21, 2010, 12:09:32 PM »
assign("half", floor(n/2))
if(r <= half, round(10 * pow(1.1, half - r)))


Had to go back and look at this post: http://www.thetournamentdirector.net/forums/index.php?topic=2155.0

The disclaimer from that post is valid here, too:

Quote
You'll probably find that due to rounding, calculating the formula this way produces slightly different results (I would argue that this way is more correct).

The reason is that, in order to calculate the formula the way you've described it, the formula must be calculated recursively.  In other words, to know what place 24th gets, you must know what place 25th gets.  And in order to know what place 25th gets, you must know what place 26th gets.  The TD cannot recursive calculate formulas, so we had to take a different approach.  The problem is that each place is rounded, which changes the calculation when doing it recursively.  In our version, only the final value is rounded.

D71J

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Formula for league points
« Reply #3 on: September 22, 2010, 05:43:45 AM »
One more question: do I put this formula in the "points for playing"-box or somewhere else so I can test it?

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Formula for league points
« Reply #4 on: September 22, 2010, 10:38:22 AM »
Points for Playing.

D71J

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Formula for league points
« Reply #5 on: September 22, 2010, 11:32:25 AM »
I tested it and it works just the I wanted it to. Thank you very much, Corey.