Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use...
-
Upload
rosalyn-terry -
Category
Documents
-
view
216 -
download
1
Transcript of Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use...
Formal Statement of Problem
Improving the profit margin by
optimizing the win ratio through the
use of various strategies and
algorithmic computations.
Natural Language
Dealt from “shoe” of cards consisting of 1 deck. One Player vs. Dealer Player and Dealer each start with two cards. Dealers 2nd card is unknown until player actions
are complete The player has 2 legal moves in our
implementation: Hit – draw one card Stand – end their turn
The player’s goal is to have a card total higher than the dealer, without exceeding 21.
Blackjack
n = number of cards x = player card value If the player or dealer has blackjack, they
win outright. If both the dealer and player have blackjack, the hand is a draw
Player receive a 1.5:1 to return when they draw blackjack, if they lose they simply lose their bet.
∑𝑛=2
2
𝑥=21 ,𝑥1=10 , 𝑥2=11
States of the GameInitial Deal
Player Turn
(t<22) Hit
Bust State
Dealer Turn
(t>21) HitStand
CompareHands
(t>21) Hit
*(>17) Hit
* Must do
Player Win
Dealer Win
Absorb
State
t = Hand Total
Push
CheckBlackjackNone
>1 Blackjack
Benchmark Perfect Game
250,000 “shuffled” decks that each class will use as well
Each deck is used for 4 games only The player has the highest valued hand
by knowing the card before it is dealt. Never takes into account the dealer’s
cards. Will be the highest winning ratio for each
of the tested algorithms.
Benchmark Test Results
Win Lost Push0
100000
200000
300000
400000
500000
600000
Perfect Game
Hand 1 Hand 2 Hand 3 Hand 40
100000
200000
300000
400000
500000
600000
Perfect Game
Algorithms
Naïve Approach Uses card counting to calculate chance of
busting when taking a hit. Monte Carlo
Simulates 1000 variations of hand outcomes for each possible decision (hit or stand), chooses the most successful decision.
Combinatorial Analysis Observes the probability of the state of the
dealer’s hand and the chance of the player busting when taking a hit (using card counting as well).
Naïve Algorithm
Bases the player’s decision on the probability of a successful hit.
successfulHit= (safeCards/remainingCards) * 100
Observes player wins, losses, and pushes over 1,000,000 hands for each targetPercentage in the set T:
T: {0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100}
If successfulHit < targetPercentage:
Hit Else:
Stand
Naïve Results
Not Scaled evenly due to heavy losses from outcomes!!!
0 20 40 60 80 100
0
100000
200000
300000
400000
500000
600000
700000
800000
900000
losswinpush
0 20 40 60 80 100
0
100000
200000
300000
400000
500000
600000
hand 1hand 2hand 3hand 4
Monte Carlo
Making certain the uncertain. Convert models of an outcome into varied
lengths used to simulate possible results. The closer the lengths are to the true
conclusion probability the more viable the prediction.
More weighted heuristics will give the problem more conclusive data.
Randomly choose a number along the number line and record how many times it occurs.
Some answers will surface to the top.
Monte Carlo Methods
Method 1 : Given that the current state is not in the absorbing state use the 1000 guesses or combinations to find out how many go past the first hit. Used greater than .55
Method 2: Given that the current state is not an absorbing state calculate the amount of times won. Used greater than .5
Method 3: Given that the current state is not an absorbing state calculate the amount of times won without a hit and with a hit. Use the higher of the two values.
Monte Carlo Results
Method 1
Method 2
Method 3
0
100000
200000
300000
400000
500000
600000
Win LostPush
Method 1 Method 2 Method 30
100000
200000
300000
400000
500000
600000
Hand 1Hand 2Hand 3Hand 4
Combinatorial Analysis
Observes the distribution of all possible dealer end-states, given the dealer’s “up-card”.
Enumerates each end state with a probability, which is then incremented to one of seven state variables:
{state17, state18, state19, state20, state21, blackjack, bust} Implements stack which holds the game state to allow backtracking upon
reaching a leaf.
Calculates the probability of the player losing when standing. (standLoss)
Calculates the probability of the player losing when taking a hit (busting). (hitLoss)
If standLoss > hitLoss :
Hit Else:
Stand
Combinatorial AnalysisstandLoss
Calculates the probability of the player losing when standing. Sums the probability of non-bust dealer end-
states that have a higher total than the player’s hand.
Ex 1. Given the player hand [Kh, 6s] (Total: 16) standLoss =
state17+state18+state19+state20+state21
Ex 2. Given the player hand [Kh, 8s] (Total: 18) standLoss = state19+state20+state21
Combinatorial Analysishitloss
Calculates the probability of the player losing when taking a hit (busting).
Counts number of cards that will cause player’s hand to exceed 21 (bustCards).
Counts remaining cards in deck. hitLoss = bustCards/remainingCards
Combinatorial Analysis Results
Win Lost Push0
100000
200000
300000
400000
500000
600000
1 Mil
Hand 1 Hand 2 Hand 3 Hand 40
100000
200000
300000
400000
500000
600000
1 Mil
Which is better
Perfe
ct G
ame
Naïve
MC M
etho
d 1
MC M
etho
d 2
MC M
etho
d 3
Combi
nato
rial
0
100000
200000
300000
400000
500000
600000
Wins
Wins
Future Ideas
Integrate more heuristics and weights to increase win ratio.
Incorporate more than one algorithm in the decision making process.
Understand Monte Carlo better and how to program implementation into a “chaotic” environment.
Add splits and double down to the calculations to see if it gets better results for the player.
Why Does this Qualify for CSC380?
We learned a lot about the algorithms we did implement. Including a few we didn’t.
Found it more difficult to explain easy terms rather than harder ones.
Complex problems and even more complex solutions.
I learned again why I never bet.
Questions for You
Why is Monte Carlo methods used primarily in ‘predicting’ the Stock Market? Although unpredictable, the Stock Market has
a lot of historical data and regular data that can be measured to offer a solution to an unsolvable prediction.
2. What data structure would best suit a back tracking algorithm? Stack
Questions for You
What is an absorbing state?
A final state, defined by constraints, which cannot transition to another state
Sources
https://math.dartmouth.edu/theses/undergrad/2014/Vaidyanathan-Thesis.pdf
The Evolution of Blackjack Strategies by Graham Kendall and Craig Smith
Evolving Strategies in Blackjack by David Fogel