I want to analyze the poker game tree in a mathematical point of view. As always in mathematics one tries to start with a subproblem. Intuitively a tree without a limit on maximal sequential bets is theoretically infinitely large. So there has to be this limit from beginning. For now this recursion is regarding just one betting round. For comprehensibility assume its the river (Game is over at leafnodes). My first approach is the following recursion:
Code:
T(#Players p, #Bet limit b)
T_helper(#Players p, #Bet limit b, #Left actors l)
Initially T(p, b) := T_helper(p, b, p)
Recursive definition:
T_helper(p, b ,l)
/ | \
/ | \
aggressive/ passive| fold\
/ | \
/ | \
T_helper(p, b-1 , p-1) T_helper(p, b, l-1) T_helper(p-1, b, l-1)
T(x,x,0) = 1 (End, all players acted)
T(1,x,x) = 1 (End, all (but one) players folded)
T(x,0,i) = 2^(i+1)-1 (No more raises allowed -> no growth through raises -> Binary tree of depth i)
I tested this recursion and at least for the small values it seems to be correct. Now I want to show the size of the tree by induction. There are two challenging parts.
First is the aggressive branch which resets the left actors to p-1, meaning that the depth of the subtree in this branch gets at least p-1 larger every time a bet is placed. This is the reason why an unlimited amount of bets make the tree grow infinitely. Out of this one can imply that the largest path in this game tree is bounded by the path in which the limit on bets is exhausted and the maximum passive actions is made between the aggressive actions. Hence it follows the maximum path consists of p-1 passive actions (checks) and b times a raise following p-2 (p-1 would finish the round) passive actions (calls), additionally one last call concludes the path.
Code:
maxDepth of T(p, b)
= p-1 + b (1+ p-2) + 1
= p-1 + b(p-1) + 1
= (b+1)(p-1) + 1
Further the smallest path is the length of passive plays in a row, hence minDepth of T(p, b) = p
The second problem I don't know to handle is, that there is some kind of anomaly in the beginning. Initially p is equal to l. Which is, as soon as a bet has been placed, no more possible. This means that the sub trees are not "congruent" to the parent tree.
The following c code can be used to recursively calculate the amount of nodes.
Code:
#include "stdlib.h"
#include "stdio.h"
void T_helper(int p, int b, int l, int* size, int* cont, int* term) {
if (p == 1){
++*size;
++*term;
return;
}
if (l == 0){
++*size;
++*cont;
return;
}
if (b == 0){
++*size;
T_helper(p, b, l-1, size, cont, term);
T_helper(p-1, b, l-1, size, cont, term);
return;
}
++*size;
T_helper(p, b-1, p-1, size, cont, term);
T_helper(p, b, l-1, size, cont, term);
T_helper(p-1, b, l-1, size, cont, term);
}
void T(int p, int b, int* size, int* cont, int* term) {
T_helper(p, b, p, size, cont, term);
}
int main(int argc, char *argv[])
{
if (argc != 3)
return 1;
int size, cont, term;
T(::atoi(argv[1]), ::atoi(argv[2]), &size, &cont, &term);
printf("T(%s, %s):\nSize: %d\nContinuing: %d\nTerminating: %d\n",
argv[1], argv[2], size, cont, term);
return 0;
}
I unfortunately have never done a proof by induction over several variables. I do not even have a guess on what to proof. So I would appreciate any help.