5.0

5.0 | 1 rating Rate this file 4 Downloads (last 30 days) File Size: 5.3 KB File ID: #36561
image thumbnail

Texas Holdem Win Probabilities

by Oliver Rice

 

07 May 2012

Calculates the probability of each player winning a round of Texas Holdem

| Watch this File

File Information
Description

The CardAnalyze function estimates the probability of each player at a table of Texas Holdem winning the round.

Variable inputs are accepted for number of players, player's cards, cards on the table, and number of Monte Carlo iterations to use in estimating probabilities.

The function is able to operate at 3 levels of information

Standard:
Only one player's cards are known

Perfect:
All players' cards are known

Collusion:
Some of the players' cards are known, some are not.

A 1.7ghz dual core processor is able to calculate 10,000 iterations for 6 players in under 1 second.

Starting a matlab pool will yield a notable speed increase
'matlabpool local'

If speed is still a concern, over half the computational time is spent on the loop call of 'randpermut'. This would be an area to improve.

 The original purpose of the function was to develop strategies for identifying player collusion via machine learning.

MATLAB release MATLAB 7.13 (R2011b)
Tags for This File  
Everyone's Tags
card, collusion, flop, game, game theory, hand, holdem, poker, pokerbot, probability, river, strategy, texas, theory, win
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (6)
11 May 2013 Daniel

Hi Oliver,

I have the same problem as described below. When running the process the following error appears:
??? Error: File: CardAnalyze.m Line: 130 Column: 11
Expression or statement is incorrect--possibly unbalanced (, {, or [.

I think it is because of the expression [~,Loc] which is not allowed.

Thanks in advance

Danyo

09 Jul 2012 Duy  
09 May 2012 Oliver Rice

Saurabh,
Okay, lets try this. The simplest inputs you can give are

CardAnalyze([],[],6,15000)

This is random cards for every player. It will return a list of 6 win probabilities (1 per player) that should all be equal to within half a percent.

It sounds like you will be running using 'standard' information. So lets now try adding 2 cards in your hand and estimating the probability of winning.

CardAnalyze([2.1;2.3],[],6,15000)

The above will return the probability of you winning with pocket 2s pre-flop.

And now finally, when the flop, turn and river go on the board you can add them into the 'table' parameter like so.

CardAnalyze([2.1;2.3],[4.2,11.1,12.3],6,15000)

So now it is estimating again with a 4 of suit 2, a jack of suit 1 and a 12 of suit 3 on the table. The choice of which suit equals which decimal is up to you, just keep it consistant. Also, as people fold, you can adjust the 6 to represent the number of players remaining in the hand.

Let me know if you have any trouble.
Oliver

08 May 2012 saurabh korgaonkar

oliver
thanks actually am also new to matlab file-exchange.
I wanted to try out your program against texas hold'em in Facebook.
currently i just played your demo program and had the following error
Can you give me some set of sample values just so i know the working of the program if i am doing it wrong

08 May 2012 Oliver Rice

Saurabh,

I am not able to recreate your error. Please list the inputs you are using and I'll do my best to troubleshoot for you.

Best,
Oliver

08 May 2012 saurabh korgaonkar

??? Error: File: CardAnalyze.m Line: 130 Column: 11
Expression or statement is incorrect--possibly unbalanced (, {, or [.

Error in ==> DemoCardAnalyze at 31
WinProb = CardAnalyze(Hand,Table,nPlayers,nIter);

Contact us