It takes a few shortcuts. For example, this part:
if(r < 17, switch(r, 1, .3, 2, .2, 3, .12, 4, .08, 5, .07, 6, .06, 7, .05, 8, .04, .01), 0)
... assigns a percentage for players who rank better than 17 (so 16th place and under). However, the switch() statement only assigns values for ranks 1st through 8th. Because according to the chart, ranks 9th through 16th all get 1 percent, the switch() has a default of .01. To avoid giving .01 percent to ALL players, we use the if() to weed out any players who rank 17th or greater. We could have done this with a longer switch() statement:
switch(r, 1, .3, 2, .2, 3, .12, 4, .08, 5, .07, 6, .06, 7, .05, 8, .04, 9, .01, 10, .01, 11, .01, 12, .01, 13, .01, 14, .01, 15, .01, 16, .01)