Teen Patti Winrates

Keywords: teen patti, three-card poker, ranking hands, Monte Carlo simulation

This project is hosted on GitHub.

Teen Patti is a card game popular in South Asia. It is a derivative of poker and three-card brag, and is also called flush. Each player is dealt a hand of three cards, and the betting continues till one player remains: players can pack, or choose to 'show' with adjacent players, where the hands are compared and the player with the worse hand has to pack.

The purpose of this project is to run Monte Carlo simulations to generate the win-rates of each possible hand, for games with a certain number of players. This is done by first simulating the running of a single game by defining hands for each player, and then comparing the hands to pick a winner. This is then run millions of times and the results are saved.

I started with first implementing playing cards on Python, using the class Cards. Building on this, I built a class Deck which consisted of 52 cards. There are 22,100 possible combinations for hands, with a fixed order of ranking. I implemented this using a top-down approach. Another class, Game, implemented the actual Teen Patti game. It simulated drawing hands consisting of 3 cards each for n (input) players, and according to the rankings defined earlier, picked the hand which would win (or tied). This would be one simulation of the game.

Then, I ran Monte Carlo simulations for the games. For each hand, I stored the total number of games it showed up in, and the number of times it won. This was used to calculate the winrate.

The results give an idea about which hands to bet on, and which hands to pack. For example, for a game of 8 players, the simulations showed that for hands starting from Ace Trail until King-pair, the winrate was greater than 50%.

Previous
Previous

Dark Pool Trading: An Experiment

Next
Next

quant-risk