To create a application that can be used to take bets on various events the application function is similar to the Parimutuel betting system.
Consider a hypothetical event which has eight possible outcomes. Each outcome has a certain amount of money wagered:
Thus the total pool of money on the event is $514.00. Following the start of the event, no more wagers are accepted. The event is decided and the winning outcome is determined to be Outcome 4 with $55.00 wagered. The payout is now calculated. First the commission or take for the wagering company is deducted from the pool; for example with a commission rate of 14.25% the calculation is: $514 × (1 - 0.1425) = $440.76. The remaining amount in the pool is now distributed to those who wagered on Outcome 4: $440.76 / $55 ≈ $8 per $1 wagered. This payout includes the $1 wagered plus an additional $7 profit.
The program will need to be flexible from 2 participants up to any defined number of participants.
An algebraic summary is in the attachment.