Top Banner
BLACKJACK STRATEGY OPTIMIZATION Rene Plowden Joseph Libby
28

Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

Dec 17, 2015

Download

Documents

Rosalyn Terry
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

BLACKJACK STRATEGY

OPTIMIZATIONRene PlowdenJoseph Libby

Page 2: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

Formal Statement of Problem

Improving the profit margin by

optimizing the win ratio through the

use of various strategies and

algorithmic computations.

Page 3: Rene Plowden Joseph Libby. 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.

Page 4: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

Winning Constraints

d = dealer total n = number of cards p = player total

Page 5: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

Dealer Constraints

d = dealer total n = number of cards

Page 6: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

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

Page 7: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

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

Page 8: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

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.

Page 9: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

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

Page 10: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

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).

Page 11: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

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

Page 12: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

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

Page 13: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

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.

Page 14: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

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.

Page 15: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

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

Page 16: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

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

Page 17: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

Combinatorial Analysis

Page 18: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

Dealer’s State Diagrams

Page 19: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

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

Page 20: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

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

Page 21: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

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

Page 22: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

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

Page 23: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

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.

Page 24: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

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.

Page 25: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

Questions

Page 26: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

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

Page 27: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

Questions for You

What is an absorbing state?

A final state, defined by constraints, which cannot transition to another state

Page 28: Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.

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