I have studied the source code and think i finaly got it:
Even tho the program calculates eq in one go it is mor understandable to first calculate the propability that a player finishes in 1st, 2nd, 3d and so on and then multiply these numbers with coresponding payouts.
To calculate P(1) - propability that a player finishes first:
p(1) = Sp/T, where Sp is the players stack and T is the total chps in the toruney.
To calculate P(2):
P(2) = S2/T*Sp/(T-S2) + S3/T*Sp/(T-S3) + ... + Sn/T*Sp/(T-Sn)
Each part in this sum is the propability that a nother player finishes first multiplyed with the propablility that player P finishes 2nd when the other players stack is taken out of the equation. In the formula above p=1 so Sp actually means S1 whith is the player we want to calculate the propability for.
The calculations for P(3), P(4) will follow a similar pattern.......... just kidding
Here it is:
4 players, Pn = player 1
P(3) = S2/T // The propability that player 2 finishes first
* S3/(T-S2) // Prop for player 3 finishes first when player 2 finishes 1st
* Sn/(T-S2-S3) // Pn finishes 3d when p2 comes 1st and p3 comes 2nd
+ S2/T*S4/(T-S2)*Sn/(T-S2-S4) //P2 1st, P4 2nd and Pn 3d
+ S3/T*S2/(T-S3)*Sn/(T-S3-S2) //P3 1st, P2 2nd and Pn 3d
+ S3/T*S4/(T-S3)*Sn/(T-S3-S4) //P3 1st, P4 2nd and Pn 3d
+ S4/T*S2/(T-S4)*Sn/(T-S4-S2) //P4 1st, P2 2nd and Pn 3d
+ S4/T*S3/(T-S4)*Sn/(T-S4-S3) //P4 1st, P3 2nd and Pn 3d
This sum gives the propability that Pn=P1 finishes in 3d place.
Each part of this sum means:
(p that pl. A finishes first) *
(p that pl. B finishes 2nd when pl. A's stack is taken out of the equation) *
(p that pl 1 finishes 3d when pl. A's and B's stack is taken out)
Use this "formula" for each posible combination of player A and B.
To calculate P(4):
You will get a large number of partial sums on the form:
ps(Sn,Sa,Sb,Sc,T) = Sa/T * Sb/(T-Sa) * Sc/(T-Sa-Sb) * Sn/(T-Sa-Sb-Sc)
where Sa, Sb, Sc is the stacks of 3 other players
Sn is the stack of our player. T = the total number of chips.
P(4) = ps(S1,S2,S3,S4,T)+
ps(S1,S2,S4,S3,T)+
ps(S1,S3,S2,S4,T)+
ps(S1,S3,S4,S4,T)+
ps(S1,S4,S2,S3,T)+
ps(S1,S4,S3,S2,T)
As we can we use each posible grup of tre other players to calculate the propability for P(4).
To calculate P(5), with 10 players in the field:
P(5) = ps(S1,S2,S3,S4,T)+ps(S1,S2,S3,S5,T)+...+ps(S1,S2,S 3,S10,T)+
ps(S1,S2,S4,S3,T)+ps(S1,S2,S4,S5,T)+...+ps(S1,S2,S 4,S10,T)+
....
and so on until every posible grouping of 3 players other than player 1 is used in the formula.
Example of ps:
ps(S1,S2,S3,S4,T) = S2/T*S3/(T-S2)*S4/(T-S2-S3)*S1/(T-S2-S3-S4)
To conclude: I can understand why this calculation is impractical to use for large number of payuts and players, because the number of calculations involed will hit the sky prety fast. Maybe one could use montecarlo simulation here?
To estimate P(n) for a player you the would have to randomly select n-1 other players than the one in question and calculate ps(,,,). Do this many times and obtain an average value for ps(,,,) and multiply that average with the number of ps(,,,) you would need in an acurate calculation.