First off,  p - q == p - (1 - p) == 2*p - 1. Second, b cancels in that 
equation, giving you f == 2*p - 1, which should be a constant.  So maybe you 
typed it wrong?

To find the maximum, you should use derivatives.  See 
http://en.wikipedia.org/wiki/Differential_calculus#Optimization.  The maximum 
value of a differential function on an interval will occur either at one of the 
end points of the interval or at a point where the derivative is equal to 0.

Aaron Meurer
On Jun 14, 2010, at 4:35 PM, butch wrote:

> Pot is $ in poker pot
> 
> minBet is minimum amount you must bet to play
> 
> pot odds are calculated by
> b = Pot/minBet
> 
> p is the probability of winning a poker hand:
> 
> 0.0 <= p <= 1.0
> 
> q is the probability of loosing a poker hand:
> 
> q = 1.0 - p
> 
> f is the calculated kelly bet
> 
> f = ( b * (p-q)) / b
> 
> substituting b with Pot/minBet
> 
> f = ( (Pot/minBet) ( p - q )) / ( Pot/minBet)
> 
> Solve for max f such that
> 
> f >= minBet and,
> f <= Pot
> 
> I did this with a loop incrementing the value for minBet until it was
>> = (f + delta)
> 
> That calculated value of "f" is the max value meeting the constraints.
> 
> Anybody have a suggestion on how to solve this explicitly and not use
> a loop?
> 
> 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/sympy?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to