By: Finn V. Jensen
Poker is a Bayesian network that models a
simplified version of the game of poker. The network can help
predict who has the best hand - your or your opponent.
Poker Game -
Download
This example
originates from the book
"An introduction to Bayesian
Networks" .
Consider a simplified poker game with the
following rules:
Each player receives three cards and is allowed
two rounds of changing cards. In the first round you may discard
any number of cards from your hand and get replacements from the
pack of cards. In the second round you may discard at most two
cards.
The various types of hands are classified in
the following way (in increasing rank): nothing special, 1 ace, 2
of the same value, 2 aces, flush (3 of a suit), straight (3 of
consecutive values), 3 of the same value, straight flush.
The following Bayesian belief network can
calculate the probability of you having the best hand after the two
rounds of changing, based on the number of cards your opponent has
discarded and an assumed strategy of the opponent:
|
|
|
The nodes
OH0,
OH1 and
OH2 represent the opponent's hand initially, after the
first change
(FC) and after the second change
(SC) respectively.
MH represents my hand before the bidding starts. Note that
we have exact knowledge of the state of this node, so the initial
distribution is not important.
Of course the probabilities of the various
states of
OH2 depend on the presumed strategy of the opponent.
In the network enclosed in the installations of
the Hugin GUI, the following strategy for the opponent is
assumed:
- If nothing special, then change 3
- If 1 ace, then keep the ace
- If 2 of consecutive values or 2 of a
suit or 2 of the same value, then discard the third card
- If 2 of a suit and 2 of consecutive
values, then keep 2 of a suit
- If 2 of a suit and 2 of the same value
or 2 of consecutive values and 2 of the same value, then keep the
2 of the same value
- If flush, straight, 3 of the same value
or straight flush, then keep it
Now you can enter
the states of
FC,
SC and
MH and get the probability of you having the best hand.
This network has been installed on your
computer with the Hugin software.
Open the network in Hugin . You
can find the network in the directory where you installed Hugin
(e.g. C:/Program Files/Hugin/Hugin Light/Samples).