Blackjack Project. Due Wednesday, Dec. 6

Similar documents
Make better decisions. Learn the rules of the game before you play.

BLACKJACK. Game Rules. Definitions Mode of Play How to Play Settlement Irregularities

CSCI 4150 Introduction to Artificial Intelligence, Fall 2004 Assignment 7 (135 points), out Monday November 22, due Thursday December 9

A. Rules of blackjack, representations, and playing blackjack

Players try to obtain a hand whose total value is greater than that of the house, without going over 21.

HOW TO PLAY BLACKJACK

A UNIQUE COMBINATION OF CHANCE & SKILL.

how TO PLAY blackjack

STATION 1: ROULETTE. Name of Guesser Tally of Wins Tally of Losses # of Wins #1 #2

For this assignment, your job is to create a program that plays (a simplified version of) blackjack. Name your program blackjack.py.

CS 210 Fundamentals of Programming I Spring 2015 Programming Assignment 8

Statistical House Edge Analysis for Proposed Casino Game Jacks

BLACKJACK Perhaps the most popular casino table game is Blackjack.

Live Casino game rules. 1. Live Baccarat. 2. Live Blackjack. 3. Casino Hold'em. 4. Generic Rulette. 5. Three card Poker

EDC Championship rules v1.3 As adapted for ECA European Dealer Championship. General

Here are two situations involving chance:

After receiving his initial two cards, the player has four standard options: he can "Hit," "Stand," "Double Down," or "Split a pair.

CS 210 Fundamentals of Programming I Fall 2015 Programming Project 8

Buster Blackjack. BGC ID: GEGA (October 2011)

SPANISH 21. Soft total-- shall mean the total point count of a hand which contains an ace that is counted as 11 in value.

NUMB3RS Activity: A Bit of Basic Blackjack. Episode: Double Down

BLACKJACK. The following words and terms, when used in this section, shall have the following meanings unless the context clearly indicates otherwise.

Blackjack and Probability

TABLE GAMES RULES OF THE GAME

Welcome to the Best of Poker Help File.

make the faux pas of touching them! They are dealt face up for a reason, primarily to prevent a few types of player cheating.

HOW to PLAY TABLE GAMES

Poker Hand Rankings Highest to Lowest A Poker Hand s Rank determines the winner of the pot!

Cashback Blackjack TO PLAY THE GAME. The objective of the game is to get closer to 21 than the dealer without going over.

Beeches Holiday Lets Games Manual

LET S PLAY PONTOON. Pontoon also offers many unique payouts as well as a Super Bonus of up to $5000 on certain hands.

No Flop No Table Limit. Number of

PROPOSED RULEMAKING PENNSYLVANIA GAMING CONTROL BOARD

HEADS UP HOLD EM. "Cover card" - means a yellow or green plastic card used during the cut process and then to conceal the bottom card of the deck.

Analysis For Hold'em 3 Bonus April 9, 2014

CATFISH BEND CASINOS, L.C. RULES OF THE GAME FORTUNE PAI GOW

The Secret to Performing the Jesse James Card Trick

Poker Rules Friday Night Poker Club

PROBABILITY Case of cards

CSEP 573 Applications of Artificial Intelligence Winter 2011 Assignment 3 Due: Wednesday February 16, 6:30PM

TEXAS HOLD EM BONUS POKER

CATFISH BEND CASINOS, L.C. RULES OF THE GAME FOUR CARD POKER

CHASE THE FLUSH. Ante wager-- means a wager required by the game to initiate the start to the round of play.

Team 13: Cián Mc Leod, Eoghan O Neill, Ruaidhri O Dowd, Luke Mulcahy

CS107L Handout 06 Autumn 2007 November 2, 2007 CS107L Assignment: Blackjack

13:69E 1.13Z 5 Card Hi Lo table; physical characteristics. (a) 5 card hi lo shall be played at a table having on one side

Moose Mathematics Games Journal Table of Contents

FLOP POKER. Rank-- or ranking means the relative position of a card or hand as set forth in Section 5.

Simulations. 1 The Concept

Games for Drill and Practice

Hold em Project. 1 Overview. Due Wed. Dec. 7

Exploitability and Game Theory Optimal Play in Poker

Ante or ante wager means the initial wager required to be made prior to any cards being dealt in order to participate in the round of play.

Table Games Rules. MargaritavilleBossierCity.com FIN CITY GAMBLING PROBLEM? CALL

Crown Melbourne Limited. Blackjack Rules

Texas Hold'em $2 - $4

1. Definitions 2. Mode of Play 3. How to Play 4. Settlement 5. Irregularities

MATHEMATICS E-102, FALL 2005 SETS, COUNTING, AND PROBABILITY Outline #1 (Probability, Intuition, and Axioms)

Ultimate Texas Hold em features head-to-head play against the player/dealer and optional bonus bets.

GAMBLING ( ) Name: Partners: everyone else in the class

To play the game player has to place a bet on the ANTE bet (initial bet). Optionally player can also place a BONUS bet.

FAST ACTION HOLD EM. Copy hand-- means a five-card hand of a player that is identical in rank to the five-card hand of the dealer.

Casino Lab AP Statistics

HIGH CARD FLUSH 1. Definitions

All Blackjack HOUSE RULES and dealing procedures apply. Dealer will offer insurance when showing an ACE.

ULTIMATE TEXAS HOLD EM

Homework 8 (for lectures on 10/14,10/16)

Fall 2017 March 13, Written Homework 4

Maryland State Lottery and Gaming Control Agency Standard Rules - Double Draw Poker

The game of poker. Gambling and probability. Poker probability: royal flush. Poker probability: four of a kind

Chapter-wise questions. Probability. 1. Two coins are tossed simultaneously. Find the probability of getting exactly one tail.

FOUR CARD POKER. Hand-- means the best four card poker hand that can be formed by each player and the dealer from the cards they are dealt.

2. A separate designated betting area at each betting position for the placement of the ante wager;

LET IT RIDE POKER. Stub-- means the remaining portion of the deck after all cards in the round of play have been dealt or delivered.

LESSON 4. Second-Hand Play. General Concepts. General Introduction. Group Activities. Sample Deals

Bridge Players: 4 Type: Trick-Taking Card rank: A K Q J Suit rank: NT (No Trumps) > (Spades) > (Hearts) > (Diamonds) > (Clubs)

POKER. Bet-- means an action by which a player places gaming chips or gaming plaques into the pot on any betting round.

13:69E-1.13Z Criss cross poker; physical characteristics

Maryland State Lottery and Gaming Control Agency Standard Rules Criss Cross Poker

Example 1. An urn contains 100 marbles: 60 blue marbles and 40 red marbles. A marble is drawn from the urn, what is the probability that the marble

CHAPTER 659a. FORTUNE ASIA POKER

Ch. 670a SIX-CARD FORTUNE PAI GOW POKER a.1. CHAPTER 670a. SIX-CARD FORTUNE PAI GOW POKER

Bonus Side Bets Analysis

Crown Melbourne Limited. Baccarat Rules

CHAPTER 69F RULES OF THE GAMES

The student will explain and evaluate the financial impact and consequences of gambling.

THREE CARD POKER. Game Rules. Definitions Mode of Play How to Play Settlement Irregularities

Simulation Modeling C H A P T E R boo 2005/8/ page 140

Project 2 - Blackjack Due 7/1/12 by Midnight

Intermediate Math Circles November 1, 2017 Probability I

73 Assignee: Four Queens, Inc., Las Vegas, Nev. (21) Appl. No.: 840, Filed: Feb. 24, Int. Cl... A63F1/00 52 U.S. C...

Programming Exam. 10% of course grade

MATH-1110 FINAL EXAM FALL 2010

CIS 2033 Lecture 6, Spring 2017

2 A fair coin is flipped 8 times. What is the probability of getting more heads than tails? A. 1 2 B E. NOTA

User Guide / Rules (v1.6)

Blackjack Terms. Lucky Ladies: Lucky Ladies Side Bet

Blackjack Card Counting Primer

LEARN HOW TO PLAY MINI-BRIDGE

Defensive Signals. Attitude Signals

Transcription:

Blackjack Project Due Wednesday, Dec. 6 1 Overview Blackjack, or twenty-one, is certainly one of the best-known games of chance in the world. Even if you ve never stepped foot in a casino in your life, you probably know the basic idea: try to get as close to 21 as possible without going over. Though the complete rules of blackjack vary from casino to casino, the game I ll describe is fairly representative of what you re likely to find. I ve tried to avoid as much jargon as possible, but several discriptions become prohibitively tedious without such words as natural, soft hands, and hole cards, so they ll be defined as we go. 2 The rules of play 1. The number of players. At most blackjack tables, there is one dealer and from one to six players. The player to the dealer s left receives his cards first, and is said to be on first base. The final player on the dealer s right is the last to get his cards, and is said to be on third base. 1 2. The deck. Most casinos continue to use 52 card decks, often two decks or six decks at a time to discourage card counters. However many decks the dealer is using, he will stop roughly half way through and reshuffle. 3. Betting. The players make their bets before any cards are dealt. 4. The deal. The players and dealer receive two cards each, the dealer s one up and one down, the players both down. Cards received down are typically referred to as hole cards. 5. Numerical value of the cards. The numerical value of each face card jack, queen, and king is ten. Except for the ace, the numerical value of each other card is simply that card s face value. Critically, the ace can be counted as either a one or an eleven. We refer to a hand with an undetermined ace in it as a soft hand and a hand without an undetermined ace in it as a hard hand. For example, a hand with two tens and an ace would be considered hard because counting the ace as 11 would bust the hand, so it s determined. 1 Try to ignore the fact that this is exactly opposite to a batter s view of the baseball diamond. 1

6. Object of play. The goal of casino blackjack is to obtain a total that is greater than the dealer s but does not exceed twenty-one. 7. Naturals. If either the player or the dealer receives a total of 21 on his first two cards, the hand is called a natural. If a player has a natural and the dealer does not, the player receives 1 1 times his original bet from the dealer. If the dealer has a natural 2 and the player does not, the player loses his original bet. The dealer checks his hand after the deal, and if he has a natural, play stops. The player loses unless he also has a natural. If both the player and the dealer have naturals, no money changes hands. 8. The player s draw. Beginning with the man on first base, the dealer goes around the table asking each player if he would like more cards. The player can take as many cards as he likes, one at a time, face up, until he either stands quits taking cards or busts goes over 21. If the player busts, he must immediately turn up his hole cards, and he loses his original bet, which is a critical rule in two respects. First, it means that even if the dealer eventually busts, the player has lost the casino s primary advantage. And second, it means that the remaining players get to see this player s cards prior to making their own decisions. 9. The dealer s draw. In almost any casino, the dealer s play will be fixed and his rules of play will be posted at the table. The most common dealer play is as follows: once the players all have their cards, he turns up his single hole card. If his total is 16 or less he must draw another card. If his total is 17 or more necessarily counting his first ace as an eleven 2, he must stand. He continues drawing until his total is 17 or more. 10. The settlement. If the player doesn t bust and the dealer does, the player wins even money the amount he bet. If neither the player nor the dealer busts, the one with with higher total wins an amount equal to the player s original bet. If the dealer and the player both have the same total, no money changes hands. 11. Splitting pairs. If a player s initial two cards form a pair identical, except in suit, he can choose to turn them both face up and play out two separate twin hands. His original bet goes on one of the two hands, and an equal amount usually, non-negotiably is bet on the other, thus doubling the player s total bet. The player automatically receives a second card face down on each of the split cards and may continue drawing cards face up as usual. One exception to this general rule is that if a player splits aces, he gets exactly one additional card on each hand. If the points in one of his hands sums to 21 in this case, it does not count as a natural. Similarly, if the player has split tens or face cards, an ace will not give him a natural. Finally, if a player splits a pair and receives a third matching card on one of the hands, he is not permitted to split the new hand. 12. Doubling down. After looking at his initial two cards, but before he has drawn, a player may elect to double his bet and draw exactly one more card. A player splitting any pair besides aces can elect to double down on one or both of his twin hands. 2 Some casinos give their dealers some leeway here, and let them draw on 17 if the 17 includes counting an ace as 11. 2

3 Definitions Our approach will be to determine the gaming decision that will optimize the player s expectation at each stage of the game. The following definitions will be critical in our analysis. 1. W is a random variable representing the player s winnings or losses. 2. x represents the player s total at the time of his decision. 3. D represents the value of the dealer s up card. 4. T represents the dealer s total at the end of the game. 5. J represents the total obtained by a player after drawing one card to whatever he currently holds. 6. ES x [W ] = E[W Player stands with x] represents the expectation of a player who stands on x. 7. ED x [W ] = E[W Player draws exactly one card to x] represents the expectation of a player who draws exactly one more card on x. 8. MD represents the minimum standing number. A player holding x M should stand. A player holding x < M should draw. Notice that ES x and Ex D are conditional expectations, conditioned on the player s having total x and using a particular strategy. This superscript/subscript notation will save a lot of writing. Also, notice that if ED x [W ] Ex S [W ] > 0, the player should draw. If Ex D [W ] ES x [W ] < 0, the player should stand. If these two expectations are the same, the player can either stand or draw with equal expectation of success. Finally, the D in ED x [W ] stands for draw, and is unrelated to the value D representing the dealer s up card. At first glance, it might seem possible that while one draw will hurt our chances, multiple draws could improve them. For example, it might appear plausible that we could have ED 12 E12 S < 0, but E15 D E12 S > 0. For hard hands, however, we observe that this is not possible. The odds of drawing in this case from a 12 to a 13, 14, or 15 are precisely those of drawing from 15 to 22, 23, and 24 all clearly losing hands. In this way, we create more ways of losing without creating any additional ways of winning, so ED 15 < E12 D. One caveat here: In the event that ED x Ex S = 0, and for x small enough so that we cannot possibly bust, we can draw to a better position. See the discussion in Section 4.1 below. 4 Expectations For simplicity, we will assume that the player bets one dollar, keeping in mind that the optimal strategy for a one dollar bet is exactly the same as the optimal strategy for any other bet in the sense of expected value. First, we develop a representation for the expected 3

value of a player who chooses to stand on total x < 21. If x 21, the player s optimal strategy is clear. We have, ES[W x ] = 1 P T > 21 + 1 P T < x 1 P x < T 21 = P T > 21 + P T < x 1 P {T x} {T > 21} which we will record in the final form = P T > 21 + P T < x 1 + P T x + P T > 21, E x S[W ] = 2P T > 21 + 2P T < x + P T = x 1. 1 Similarly, we find a convenient expression for the expectation of a player who draws exactly one card on total x. For this calculation, we will condition on the random variable J, the total a player obtains after exactly one draw: 21 ED[W x ] = ED[W x J < 17]P J < 17+ ED[W x J = j]p J = j+ed[w x J > 21]P J > 21. j=17 Each of these conditional expectations is straightforward to compute. We have keeping in mind that we consider a one dollar bet, E x D[W J < 17] = 1 P T > 21 1 P T 21, E x D[W J = j] = 1 P T > 21 + 1 P T < j 1 P j < T 21, E x D[W J > 21] = 1. Combining, we conclude rearranging terms ED[W x ] =P J < 17 2P T > 21 1 P J > 21 + 21 j=17 P J = j P T > 21 + P T < j P j < T 21. 2 Proceeding similarly, we develop our decision equation, ED[W x ] ES[W x ] = 2P T < x P T = x 2P T > 21P J > 21 21 + P T = t 2P t < J 21 + P J = t. 3 t=17 Clearly, the decision equation requires some justification. Justifying this equation will be the first assignment of the project. 4.1 Consistency Check of Decision Equation Let s consider two baseline cases: xhard < 12 and xsoft < 17, for which we know we want to draw. Does our decision equation 3 agree with our intuition? Observe that in each 4

of these cases, the first three addends on the right-hand side of the decision equation are all zero, the first two because T 17 by dealer s rules, and the third because, since we cannot bust by drawing with xhard < 12 or xsoft < 17, P J > 21 = 0. All that s left is the sum of probabilites, which must all be greater than 0 by our axioms of probability. Hence, ED x [W ] Ex S [W ] 0, and we conclude that it s at least as good to draw as to stand, and we should draw. In order to understand this last assertion, consider the case xhard = 4, the lowest hard hand possible. In this case, every probability in equation 3 is zero, and we have ED[W x ] ES[W x ] = 0. That is, for xhard this small, whether we stand or draw, our only chance of winning is if the dealer busts. Since we cannot bust, however, we clearly want to draw. 5 Assignments 1. Finish our derivation of the decision equation by establishing equation 3. 2. Player s probabilities Assuming the case of a perfectly shuffled deck of cards, and no counting i.e., if a certain card is drawn, it is no less likely that that card will be drawn again, which is almost the case for multiple decks of cards, determine for 12 xhard 17, the player s probabilities for the decision equation 3: P J = t, t = 17,..., 21 P t < J 21, t = 17,..., 21 P J > 21. Keep in mind that each of these probabilities is actually a conditional probability, conditioned on the player s current hand, xhard. For example, in the case xhard = 12, you will need to compute P J = t xhard = 12, t = 17,..., 21 P t < J 21 xhard = 12, t = 17,..., 21 P J > 21 xhard = 12. 3. Write a MATLAB M-file that simulates a dealer using the rules described in these notes. Notice that dealer s probabilities should be conditioned on the knowledge we have, that the dealer s up card has value D. In fact, whatever decision we make in the absence of counting must be based solely on the value of this card. Consequently, each dealer probability in equation 3 should be regarded as a conditional probability. We might want to compute, for example, P T = 17 D = 10 the probability that the dealer ends up with 17, given that he has a 10 showing. Observe that this would be an extremely tedious calculation analytically. We would have to consider every possible way the dealer could get from 10 to 17, from multiple draws like a 2 in the hole and draws 2,2,A, to a 7 in the hole and no draw. This is why we proceed in the dealer s case through simulation. 5

4. Focus for a moment on the probability P T = 17 D = 6, which you will obtain by simulation using your program from Part 3. Determine the number of hands that must be simulated to ensure that follow me here the probability that the error on this probability is larger than.005 is less than.05. More generally, you will be using the same program to estimate either six or seven probabilities at once, depending upon whether or not a natural is possible. Assuming six observations, determine the number of simulations required to ensure that the probability of one or more of the errrors being larger than.005 is less than.05. I.e., there is a 95% chance that none of the probabilities has an error this large. Notice that it s more or less fair here to assume that the random variables are independent, even though they re clearly not. They would be entirely independent if you considered them to arise from independent simulations, and so doing the whole thing with one simulation can be considered a minor cheat to save time. 5. Use the number of simulations determined from Part 4 to develop a table of Dealer s probabilities. For calibration, you should compare your results with the following: For the case D = 6, we find: >>dealer21 17: 0.16551 18: 0.10615 19: 0.10629 20: 0.10173 21: 0.097125 21, natural: 0 busted: 0.4232 For the case D = 2, we find >>dealer21 17: 0.13991 18: 0.13488 19: 0.12967 20: 0.12394 21: 0..11807 21, natural: 0 busted: 0.35352 Since these probabilities are approximate that s the nature of simulation, you will not get exactly the same values, but your values should agree with these within ±.005 see Part 4. 6. Use equation 3 and the analysis above to develop a basic strategy no splitting pairs or doubling down for hard blackjack hands. That is, develop a table of minimum standing numbers MD for all possible values of D. 6