Blackjack strategy

From Rosetta Code
Revision as of 10:48, 1 July 2013 by Nigel Galloway (talk | contribs) (Created page with "{{task}} The objective of this task is to recreate and explore the following [http://www.blackjacktactics.com/blackjack/strategy/charts/single-deck/ Strategy charts]. Assume ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Task
Blackjack strategy
You are encouraged to solve this task according to the task description, using any language you may know.

The objective of this task is to recreate and explore the following Strategy charts.

Assume that my casino:

Uses a single deck;
Does not allow Double after split.

Begin by assuming the player's dealt hand contains no aces and is not a pair. Create functions which given the players dealt cards and the dealers exposed card returns the number of wins and losses for all possible continuations when the player either sticks or hits. Gather the results together, set a threshold at which you consider it wise to Double the bet and reconstruct the Hard Totals Table enhanced with precise probabilities.

Enhance your analysis by considering the case when the player's hand contains an Ace. Again by considering all continuations recreate the Soft Totals Table again enhanced with precise probabilities.

Finally complete your analysis by considering the case when the player's hand contains a pair. Again by considering all continuations recreate the Pair Splitting Table again enhanced with precise probabilities.

You should now create a function which randomly deals hands. Assuming I play 50 hands at a visit and visit everyday for a year applying the strategy defined by the tables you have created answer the following questions:

How many days will I win/lose?
What will be my biggest win?
What will be my biggest loss?
What will I win/lose over the year?