Subj : Re: efficient way of processing m combinations of n numbers in p sets To : comp.programming From : Willem Date : Tue Aug 16 2005 05:47 pm Mike wrote: ):-) 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. Well, let's see.. Suppose you bet A, B, C, D, E, F. Further suppose horse A winning is the worst case for that. Increasing any or all of the other bets would not change A being the worst case. You can start at betting the minimum for each horse, and you then have to increase bet A until horse A ceases to be the worst case. Then, horse B is the worst case, so you start increasing that horse's bet. You'll now probably alternate between increasing bets A and B. Make sure to record the best you've found so far, because after a while this search will start to tend downward again, if it does, stop and take the best you found so far. Alternatively: If you find the exact turnover point (analytically) , you will have two equal worst cases, let's say horses A and B. Increasing bet A makes B the worst case and vice versa, so you have to increase both bets at the same time, by proportionate amounts. Find the next exact turnover point analytically, and so on, having horse after horse join the worst case. If enough horses joined the worst case, increasing their bets will not lead to decreased loss any more, and you have found the minimum. Does that help ? SaSW, Willem -- Disclaimer: I am in no way responsible for any of the statements made in the above text. For all I know I might be drugged or something.. No I'm not paranoid. You all think I'm paranoid, don't you ! #EOT .