


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
In this cs141 assignment, students are required to build an intelligent agent capable of playing blackjack, a card game commonly played in casinos. The agent should formulate the game as a markov decision process (mdp) and solve for an optimal policy. The students will implement a monte-carlo control algorithm to compute an optimal strategy. The assignment involves understanding the rules of blackjack, formulating it as an mdp, implementing the mdp interface, and solving the control problem.
Typology: Study Guides, Projects, Research
1 / 4
This page cannot be seen from the preview
Don't miss anything!



CS141 Introduction to AI Professor Meinolf Sellmann
“You cannot beat a roulette table unless you steal money from it.” —Albert Einstein
Expert game playing is one of the claims to fame of modern AI. But the majority of AI’s pop- ular success stories involve deterministic games, like chess and checkers. In this assignment, you will build an intelligent agent that is capable of playing the classic card game of Blackjack, which, unlike chess and checkers, is rife with randomness. You will achieve this goal by formu- lating the game as a Markov Decision Process (MDP), and solving for an optimal policy. Your BlackJackPlayer should even be able to tip the odds in its favor by counting cards.
Blackjack is card game commonly played in casinos, in which one or more players compete against a select player called the dealer. The object of the game is achieve a point value as close to 21 as possible without going over. The CS141 version of Blackjack is a slightly simplified version of the typical casino game. Each hand proceeds as follows:
In theory, we can assume an infinite deck, which implies that the probability of dealing each possible card is always 521. In practice, however, we play blackjack with a finite set of decks (say 10). Under these circumstances, the probability of dealing a certain card depends on the number
Javadocs for all of the support code are available at http://cs.brown.edu/courses/cs141/blackjack/index.html. Here’s a summary of the important classes available to you.
BlackjackPlayer: Represents a player of blackjack. You must implement methods for betting and getting the next action. The methods for reshuffling and processing cards notify your player about events that happen during the game so that it may count cards.
BlackjackMDP: Represents a Markov Decision Process. You should implement either SARSA or Q-Learning to generate a map from states to values. We recommend implementing the ActionValueMap class and using it to encapsulate all possible values for the actions at a given state. Your player should then call getBestAction to select the best action in the given state.
BlackjackSimulator: Simulates hands of blackjack. This is where the game is played, and this class also contains the main method.
We need:
Our handin script turns in everything in the current directory and all subdirectories. To hand in this project, navigate into the directory containing the files and directories you wish to hand in and run cs141-handin blackjack.
Easy Extend your Blackjack player and the simulator to allow for doubling-down. This means that after looking at only your first two cards, you may double your initial bet and only take one more card, at which point the players turn is over.
Hard Extend your Blackjack player and the simulator to allow for splitting. Splitting is an action that can only be taken after the initial cards are dealt, and only when the two cards have the same rank. The cards are split into two hands and the player must place an additional bet equal in value to their original bet. A new card is dealt to accompany each of the split cards and the two hands are played separately.