The game begins with two cards dealt to both dealer and player. We consider the version in which each player competes independently against the dealer. All face cards count as 10, and an ace can count either as 1 or as 11. “The object of the popular casino card game of blackjack is to obtain cards the sum of whose numerical values is as great as possible without exceeding 21. The rules of the game directly from the book are below: The Reinforcement Learning book by Sutton and Barto has a blackjack example in chapter 5 that led to many of the ideas in this post. Monte Carlo Control with Seeing Both Dealer cards.Monte Carlo Control with “Blackjack” and Doubling Down.The OpenAI Gym Environment and Modifications.Monte Carlo Control (Solving for an optimal policy).Monte Carlo Prediction (Evaluating a fixed policy).