Sunday, January 9, 2022

AnaPoker Development Notes

\(  s1 (m,n,p,q,r)  = \dfrac{52*51*50*49*48}{120} - \dfrac{m(m-1)(m-2)(m-3)(m-4)}{120}   \)

\(  s2 (m,n,p,q,r)  = \dfrac{(m-1)(m-2)(m-3)(m-4)}{24}  - \dfrac{n(n-1)(n-2)(n-3)}{24}\)

\(  s3 (m,n,p,q,r)  = \dfrac{(n-1)(n-2)(n-3)}{6}  - \dfrac{p(p-1)(p-2)}{6}\)

\(  s4 (m,n,p,q,r)  = \dfrac{(p-1)(p-2)}{2}  - \dfrac{q(q-1)}{2}\)

\(  s5 (m,n,p,q,r)  = (q-1)  - r \)

\(  t0 (m,n,p,q,r)  = \dfrac{52*51*50*49*48}{120} \)

\(  t1 (m,n,p,q,r)  = \dfrac{(m-1)(m-2)(m-3)(m-4)(m-5)}{120}   \)

\(  t2 (m,n,p,q,r)  = \dfrac{(n-1)(n-2)(n-3)(n-4)}{24}   \)

\(  t3 (m,n,p,q,r)  = \dfrac{(p-1)(p-2)(p-3)}{6}   \)

\(  t4 (m,n,p,q,r)  = \dfrac{(q-1)(q-2)}{2}   \)

\(  t5 (m,n,p,q,r)  = r  \)


1. Calculate the combinations of all the poker 5-card hands.

2. Derive the indexing method for all the combinations (m,n,p,q,r)

3. Write functions to generate all the combinations from the highest rank.

4. Create the <key.value> pair for the combinations.

5. Create the 21 combinations of the 5-card index for the 7-card hands.

6. Find the highest rank in the 21 combinations.

7. Calculate the estimated win rate after the flop and the turn


Notes:

1. Card number from 52 to 1 by the order AKQJT98765432

2. The total rank of 5-card hands is 7462.

3. Ranks

  • 1: Royal Flush
  • 2~10: Straight Flush
  • 11~166: Four of a Kind 
  • 167~322: Full House
  • 323~1599: Flush
  • 1600~1609: Straight
  • 1610~2467: Three of a Kind
  • 2468~3325: Two Pair
  • 3326~6185: One Pair




No comments:

Post a Comment