Nodejs Poker Holdem

With this program, you will be Nodejs Holdem Poker able to claim commissions of up to 50%. The percentage you get from the affiliate program will be determined by the number of first-time depositors Nodejs Holdem Poker of the previous month, and this will be summarized from all the casinos you market. Poker-holdem-engine provides an engine to play Texas Hold'em Poker in respect of the official rules. Poker here is meant to be played by other programs, which should be listen for POST http request somewhere in the Internet, or on your localhost. Gambling online for real money is highly popular and great fun Nodejs Holdem Poker because you can play at any time of the day or night, on your pc, tablet Nodejs Holdem Poker or mobile. There are always hundreds of slots and many other games available and you don't even need to change out of your pajamas to enjoy them. A deck of French playing cards, as it is used in Texas Hold’em, contains 52 different cards; in a heads-up game two players are playing against each other. Both of them get two private cards dealt pre-flop face down. There are (52 2) = 1326 different possible pairs of cards that players can get.

  1. Nodejs Poker Holdem Play
  2. Nodejs Poker Holdem Poker

Our “Smart Poker Table” detects the players’ cards as well as the community cards. It computes the winning probabilities for each player, according to the rules of Texas Hold’em, and renders them onto a screen.

Team members. Felix Starke, Tobias Robl, Pascal Meßner, and Timo Denk

Technical details. The software that reads the RFID readers is written in Node.js and C++. It makes API calls to a Java application that computes the probabilities. The UI itself is connected the Node.js backend through socket.io.

Music. Bazanji – Life I Chose, inspired by Daniel Negreanu.

Part List

  • #4×2+5 RFID readers: RFID-RC522 13,56 MHz
  • #52 RFID stickers: NFC Smart Tag Adhesives Sticker 1152 Bits (attached to the poker deck)
  • Poker deck with 52 cards
  • Wooden board with green coating
  • Raspberry Pi (the version does not matter)
  • CD74HC4067 16-channel multiplexer (for reading that many RFID readers with a single Raspberry Pi)
HoldemHoldem

In this article we define and publish the exact pre-flop probabilities for each possible combination of two hands in Textas Hold’em poker. An online tool at tools.timodenk.com/poker-odds-pre-flop makes the data visually accessible.

Nodejs Poker Holdem Play

Table of Contents

Introduction

Nodejs poker holdem game

A deck of French playing cards, as it is used in Texas Hold’em, contains 52 different cards; in a heads-up game two players are playing against each other. Both of them get two private cards dealt pre-flop face down. There are $binom{52}{2}=1326$ different possible pairs of cards that players can get. In this work we determine the odds of each starting hand to win against any other starting hand. There is no equation or easy way of calculating the winning probability of a given hand, since it would be required to contain all the rules and mechanics of the game.

Statistical approaches can determine the winning odds of one starting hand against another very quickly. This gives results that are statistically accurate but not guaranteed to be exact. However, for mathematical analysis of certain properties of pre-flop situations, the precise numbers are a requirement.

Win Function

Hold’em cards can have 13 different ranks and four different suits
$$begin{align}
mathcal{R}=&left{text{Ace}, text{2}, text{3}, text{4}, text{5}, text{6}, text{7}, text{8}, text{9}, text{10}, text{Jack}, text{Queen}, text{King}right},
mathcal{S}=&left{text{Club}, text{Heart}, text{Spade}, text{Diamond}right},.end{align}$$A card is an ordered pair of rank and suit; the set of all cards that exist in a the card deck is denoted as
$$begin{align}mathcal{C}=mathcal{R}timesmathcal{S},end{align}$$ with $leftlvertmathcal{C}rightrvert=52$. The set of possible starting hands, every possible combination of two distinct cards, is defined by
$$begin{align}mathcal{H}=left{left{c_1inmathcal{C},c_2inmathcal{C}right}mid c_1neq c_2right}end{align}$$ and has a cardinality of $lvertmathcal{H}rvert=binom{52}{2}=1326$. The set is containing unordered pairs because the two private cards are not ordered either.

Calculating the Cartesian product of the set of possible hands with itself gives a new set of ordered pairs, that is $mathcal{M}=mathcal{H}timesmathcal{H}$, with $leftlvertmathcal{M}rightrvert=1,758,276$. This set contains all combinations of two starting hands as ordered pairs. The order matters, because we define the meaning of each of the pairs as a pre-flop situation where the first starting hand plays against the second.

In this work we search for the winning odds function
$$begin{align}
o:mathcal{M}rightarrowleft{xinmathbb{Q}mid0le xle1right},
end{align}$$ that outputs for any pre-flop situation $left(h_1,h_2right)$, the odds of starting hand $h_1$ to win against $h_2$. Since every card exists only once in a deck, two players cannot play against each other if $h_1cap h_2neemptyset$. For these cases $o$ is undefined.

Post-flop, five community cards are dealt. Three on the flop, followed by the turn card, and finally the river card. $binom{52}{5}=2598960$ different combinations are possible. We define $mathcal{P}$ as the set of all possible community cards, where each $pinmathcal{P}$ is itself a set of five different cards. The community cards $p$ determine which player wins, that is the one whose starting hand builds the best showdown hand. If both showdown hands are of equal rank at showdown, the pot is split. Given a pre-flop situation $m=(h_1,h_2)$ where the starting hand $h_1$ plays against $h_2$, only a subset of $mathcal{P}$, namely $$begin{align}mathcal{P}_{(h_1,h_2)}=left{pinmathcal{P}mid pcap h_1=pcap h_2=emptysetright}end{align}$$ can be dealt, as some cards are already taken from the deck.

Furthermore a win function
$$begin{align}w:{(minmathcal{M},pinmathcal{P}_m)}rightarrow{0,1}end{align}$$is required, that assesses a situation at showdown and returns $1$, if the first starting hand in $m$ wins against the second hand, given the public cards $p$. In case of loss or split it returns $0$. $w$ is defined by the rules of poker. With these definitions at hand we can define the odds of a hand to win against another hand as
$$begin{align}o(m)=frac{displaystylesum_{pinmathcal{P}_m}w(m,p)}{lvert mathcal{P}_mrvert},.end{align}$$In words, $o$ is dividing the number of possible community cards where $h_1$ wins against $h_2$ by the number of community cards that can be dealt altogether.

Data and Results

With the odds function $o$ at hand, we can define the winning odds matrix $mathbf{M}inmathbb{Q}^{lvertmathcal{H}rverttimeslvertmathcal{H}rvert}$ as
$$M_{i,j}=o(mathcal{H}_i,mathcal{H}_j),.$$ The matrix contains the winning odds for every heads-up pre-flop situation and is undefined at places, where $mathcal{H}_i$ and $mathcal{H}_j$ cannot play against each other (because of shared cards). From its row vectors, i.e. $mathbf{M}_{i,:}$, we can compute the average odds of a hand $mathcal{H}_i$ to win against a random hand, by taking the average of all entries with values. The probabilities for a split between two hands are given by $1-M_{i,j}-M_{j,i}$.

We release $mathbf{M}$ in two ways.

  1. As an online tool with user interface at tools.timodenk.com where the user can pick their pre-flop situation and get the exact odds, i.e. $o(m)$ and $o(m)lvertmathcal{P}_mrvert$.
  2. As a serialized Java object holding the $o(m)lvertmathcal{P}_mrvert$ values for every $m$. The object can be imported into a Java program and processed from there.

We have already conducted some experiments related to the non-transitivity of the win function. For example, we found the three hands
$$begin{align}
h_1=&left{left(text{Ace},text{Club}right),left(text{2},text{Club}right)right}
h_2=&left{left(text{10},text{Spade}right),left(text{9},text{Spade}right)right}
h_3=&left{left(text{2},text{Heart}right),left(text{2},text{Diamond}right)right},
end{align}$$to satisfy$$begin{align}
oleft(h_1,h_2right)approx&0.54gt0.5
oleft(h_2,h_3right)approx&0.53gt0.5
oleft(h_3,h_1right)approx&0.61gt0.5,.
end{align}$$Expressed in words, this means for a hand $h_1$, which statistically beats $h_2$, which in turn beats a third hand $h_3$, it cannot be concluded that $h_1$ beats $h_3$ as well. The win function is not transitive.

The most uneven pre-flop situation exists, if the hands$$begin{align}
h_1=&left{left(text{King},text{Club}right),left(text{King},text{Diamond}right)right}
h_2=&left{left(text{King},text{Heart}right),left(text{2},text{Club}right)right}
end{align}$$play against each other (or suit permutations). The pair of kings has a $94.16%$ chance of winning. The pot is chopped in $1.53%$ of all possible outcomes.

Surprisingly, Aces do not appear in this constellation. The reason is that the hand A2 could hit a straight with just three cards (3, 4, 5). On the other hand, K2 needs four cards (A, 3, 4, 5 or 3, 4, 5, 6) in order to build a straight that uses the 2. Also noteworthy is the fact, that the King of Clubs of $h_1$ blocks flushes, which $h_2$ could have otherwise gotten using the Deuce of Clubs.

The lowest winning probability and highest probability for a split pot exists if $$begin{align}
h_1=&left{left(text{3},text{Club}right),left(text{2},text{Diamond}right)right}
h_2=&left{left(text{3},text{Diamond}right),left(text{2},text{Club}right)right}
end{align}$$battle each other. Both hands have an equal chance of winning, namely $0.71%$. Consequently, a split occurs with a likelihood of $98.57%$.

Interestingly, the get-together of 43 vs. 43 (same suits as above) comes with a higher winning probability ($0.73%$). That’s (at least partly) because there are a few more flushes, for which one of the hands does not only play the board.

The lowest split probability of just $0.19%$ is there, if the following hands play:$$begin{align}
h_1=&left{left(text{9},text{Club}right),left(text{8},text{Diamond}right)right}
h_2=&left{left(text{Ace},text{Spade}right),left(text{Ace},text{Heart}right)right},.
end{align}$$In which cases would the pot be chopped? For instance if a straight flush of Clubs from 2 to 6 occurs.

Nodejs Poker HoldemNodejs poker holdem game

Nodejs Poker Holdem Poker

Still unsolved is the search for the longest non-transitive chain of mutually disjoint pre-flop hands, such that $$o(h_1, h_2)>0.5land o(h_2,h_3)>0.5landdotsland o(h_n,h_1)>0.5,.$$

Special thanks goes to Dominik Müller for fruitful discussions and many algorithm optimization ideas.