View Single Post
  #23  
Old 09-04-2007, 07:03 PM
TNixon TNixon is offline
Senior Member
 
Join Date: Apr 2007
Posts: 616
Default Re: Heads Up Game Theory exercise

Yes, I took the blinds into account.

And I just realized where the confusion came from: one spot where I said "push with any 2". Sorry about that. Old habits. Much more used to talking about "any 2" than "any 1". [img]/images/graemlins/smile.gif[/img]

The simulator really did use the rules of your game, though, and the results were that the small blind averages a loss of about 1/3 of a bet every hand if he bets 100%, and villan calls with 34+.

Here's the code, should be very simple to verify, even without any direct programming knowledge:

<font class="small">Code:</font><hr /><pre>
printf( "Start run: p1 bets %d or greater, p2 calls %d or greater\n", p1Bet, p2Call );

srand( (unsigned)time( NULL ) );

int hands = 1000000;
float p1 = 0.0f;
float p2 = 0.0f;
for( int i = 0; i &lt; hands; i++ )
{
int c1, c2;

// post blinds
p1 -= 0.5;
p2 -= 1.0;

c1 = c2 = (int)(100.0f * (double)rand() / (double)RAND_MAX);
while( c2 == c1 )
c2 = (int)(100.0f * (double)rand() / (double)RAND_MAX);

if( c1 &lt; p1Bet ) // player 1 folds, p2 wins the blinds
{
p2 += 1.5f;
}
else // p1 bets
{
p1 -= 2.5;
if( c2 &lt; p2Call ) // p2 folds, p1 winds blinds plus gets his bet back
{
p1 += 4.0f;
}
else // p2 calls
{
p2 -= 2.0f;
if( c1 &gt; c2 ) // player 1 wins
{
p1 += 6.0f;
}
else // player 2 wins
{
p2 += 6.0f;
}
}
}
}
printf( "Final result: p1 = %f, %f/hand\n", p1, p1 / (double)hands );
printf( "Final result: p2 = %f, %f/hand\n", p2, p2 / (double)hands );
printf( "\n" );
</pre><hr />
Reply With Quote