Subj : Re: efficient way of processing m combinations of n numbers in p sets To : comp.programming From : Mike Date : Tue Aug 16 2005 09:39 am :-) The formula itself is straightforward - maybe I'm making it more complicated than it needs be. Obviously any of the 6 horses can win. oddsN is the odds for horseN, stakeN is the stake placed on horseN if horseN wins, the loss or gain = (OddsN * stakeN) -stake1-stake2-stake3-stake4-stake5-stake6. We then need to vary stakeN for every horseN and record the worst loss for each set of 6 stakes. We then use the the best of these "worst" cases as a basis for placing the bets. Thanks, Mike. .