Subj : Re: efficient way of processing m combinations of n numbers in p sets To : comp.programming From : Willem Date : Wed Aug 17 2005 08:10 am Mike wrote: ) If I understand the problem correctly - you don't need to do any ) significant computation to get the answer. ) ) So I assume the problem is as follows: ) ) You have n horses H1...Hn, each is at odds O1..On, you have a total of B ) to bid on the horses, and (finally) you want ) to minimise the worst case loss (or maximise the worst case gain) ) resulting from any particular horse winning, by ) choosing a series of bids B1..Bn, on each horse. ) ) I am assuming your odds Oi, for horse Hi, means that if you pay x dollars ) and the horse wins, you get Oi*x dollars ) back. This means that if horse Hi wins you pay B1+B2+B3+....+Bn, and get ) back Oi*Bi. ) ) ) So, the defining equations are: ) ) Sum(Bi) = B ) Wi = Oi*Bi-Sum(Bi) = Oi*Bi - B ) ) Now, you want to maximise the minimum value of Wi, this will occur when ) all the Wi are identical, i.e equal to some value Wmim. I don't agree with this step, on the grounds that there are minimum and maximum bets, in other words, restrictions on Bi. ) So, Wi = Oi*Bi - B = Wmin, thus ) ) Bi=(Wmin+B)/Oi ) ) Still want to know what Wmin is, so if we sum the above for all i we get... ) ) sum(Bi) = sum((wmin+B)/Oi) = (Wmin+B)*Sum(1/Oi) ) ) so, if we define P = sum(1/Oi) and do a little more algebra we finally ) end up with the solution... ) ) Your bet Bi on each horse should be Bi = B/(P*Oi), where P = Sum(1/Oi), ) and your expected return regardless of which horse wins ) will be Wmin = B*(1/P-1). QED and all that. Okay, here's something to think about: Scaling all bets by the same factor will scale the payout for each possible outcome by the same amount, will therefore not change which payout is the worst case, and will therefore scale the worst case payout by the same amount. Therefore, assuming positive bets only, the optimum bet is either not to bet at all, or to bet an infinite amount of money. (Assuming no restrictions on betting, which your analasys did) I guess the outcome of your analysis is not an absolute number, but the betting amounts, relative to each other. But, assuming there are betting restrictions, I do not believe the analysis is correct as such. 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 .