Programming wise, you can make it as easy or difficult as you like

The easiest way is to do a totalisator, that way - you don't make the odds at all, they make themselves..

Here's an example, lets say we have 6 horses in a race, and we're betting on who we think will win.

Person A bets $50 on number 1

Person B bets $500 on number 2

Person C bets $100 on number 3

Person D bets $300 on number 4

Person E bets $1000 on number 5

Person F bets $50 on number 6

Ok, the total amount bet from all people is $2000 - this is called the pool.

Now, to calculate the dividend (or odds) for each horse, you simply divide the total money in the pool ($2000) by the total money bet on each individual horse, so we get:

Horse 1: 2000 / 50 = 40.00

Horse 2: 2000 / 500 = 4.00

Horse 3: 2000 / 100 = 20.00

Horse 4: 2000 / 300 = 6.67

Horse 5: 2000 / 1000 = 2.00

Horse 6: 2000 / 50 = 40.00

Now, these are the dividends for $1, so which ever horse wins the person who backed it would receive the dividend x $ bet.

A few points:

1. The total payout (dividend of winner x total bet on winner) will always be exactly equal to the total money in the pool (all you are doing is splitting up the total amount bet equally amongst the winners)

2. If you convert these dividends to probabilities (1/dividend) you will get a total of 100% (i.e. 1/40 + 1/4 + 1/20 + 1/6.67 + 1/2 + 1/40 = 1.00).

Now, a 100% market means that all the money paid out to winners is the same as the money that was paid in bets.

Bookmakers generally operate to markets of around 120%, meaning that on average they skim 20% of the money off the top before they give it back to the winners. If the totalisator wants to make a profit, then the same thing happens, instead of dividing the total pool by the amount bet by winners, they first skim a bit off the pool (usually around 15%), so even though there was $2000 bet, they only divide 2000 x (1-0.15) = 1700 amongst the winners, and keep the other $300 for themselves.

To put this in practice you would need to track completely separate pools for each bet type. All win bets will have a separate pool and separate dividends from place bets, which would also be separate to that of show bets, which would also be separate from that of trifecta bets etc. (for place betting, you would still do the above calculations, but first you would divide the total pool by 2 - as there are two horses that can run 1st and 2nd. For show betting you would need to divide the pool by 3 etc.)

How is that - more confusing or less confusing