Let's take a horse at odds of 5.0. Your liability per horse is £100. Therefore, if the horse wins, you lose £100. If the horse loses, you make £25 profit, minus commission.
I did spot an error in my formula for calculating profit though.


Incidentally, as regards the random number thing, I used random numbers in two ways. I generated a random number between 11 and 40 and divided it by 10 to arrive at random odds between 1.1 and 4.0.
I also generated a random number between 1 and 100,000. Let's say that a horse has a 60% chance of winning. There is a 60% chance that the number generated will be between 1 and 60,000, so I will declare the horse a winner if the random number is between 1 and 60,000. That's the principle I used.
Jeff