Learning to Play Blackjack Thomas Boyett Presentation for CAP 4630 Teacher: Dr. Eggen.

Slides:



Advertisements
Similar presentations
Intelligent Agents Russell and Norvig: 2
Advertisements

Artificial Intelligence: Chapter 2
Agents the AI metaphor. D Goforth - COSC 4117, fall The agent model  agents include all aspects of AI in one object-oriented organizing model:
Intelligent Agents Chapter 2. Outline Agents and environments Agents and environments Rationality Rationality PEAS (Performance measure, Environment,
ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 1 Please pick up a copy of the course syllabus from the front desk.
Artificial Intelligence Lecture No. 5 Dr. Asad Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Lecture 10. Simplified roulette European roulette has numbers 0,1,…36. xD0s
Warm up 1)We are drawing a single card from a standard deck of 52 find the probability of P(seven/nonface card) 2)Assume that we roll two dice and a total.
BLACKJACK SHARKS: Aabida Mayet, Omar Bacerra, Eser Kaptan March 15, 2010.
An application of the Probability Theory
12 Pontoon1May Pontoon program CE : Fundamental Programming Techniques.
Computer Science 313 – Advanced Programming Topics.
January 11, 2006AI: Chapter 2: Intelligent Agents1 Artificial Intelligence Chapter 2: Intelligent Agents Michael Scherger Department of Computer Science.
CSE 471/598, CBS 598 Intelligent Agents TIP We’re intelligent agents, aren’t we? Fall 2004.
ICS-171: Notes 2: 1 Intelligent Agents Chapter 2 ICS 171, Fall 2005.
Intelligent Agents Chapter 2 ICS 171, Fall 2005.
Plans for Today Chapter 2: Intelligent Agents (until break) Lisp: Some questions that came up in lab Resume intelligent agents after Lisp issues.
Uninformed Search Reading: Chapter 3 by today, Chapter by Wednesday, 9/12 Homework #2 will be given out on Wednesday DID YOU TURN IN YOUR SURVEY?
CSE 471/598 Intelligent Agents TIP We’re intelligent agents, aren’t we? Spring 2004.
INTELLIGENT AGENTS Yılmaz KILIÇASLAN. Definitions An agent is anything that can be viewed as perceiving its environment through sensors and acting upon.
Rational Agents (Chapter 2)
Chapter 5 Black Jack. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 5-2 Chapter Objectives Provide a case study example from problem statement.
For Wednesday Read chapter 3, sections 1-4 Homework: –Chapter 2, exercise 4 –Explain your answers (Identify any assumptions you make. Where you think there’s.
Intelligent Agents Chapter 2. Outline Agents and environments Rationality PEAS (Performance measure, Environment, Actuators, Sensors) Environment types.
Intelligent Agents. Software agents O Monday: O Overview video (Introduction to software agents) O Agents and environments O Rationality O Wednesday:
Blackjack: An Analysis of Probability By: John Theobald.
1 AI and Agents CS 171/271 (Chapters 1 and 2) Some text and images in these slides were drawn from Russel & Norvig’s published material.
1 Intelligent Systems Q: Where to start? A: At the beginning (1940) by Denis Riordan Reference Modern Artificial Intelligence began in the middle of the.
Game Playing.
How R&N define AI Systems that think like humans Systems that think rationally Systems that act like humans Systems that act rationally humanly vs. rationally.
Chapter 2 Intelligent Agents. Chapter 2 Intelligent Agents What is an agent ? An agent is anything that perceiving its environment through sensors and.
Lection 3. Part 1 Chapter 2 of Russel S., Norvig P. Artificial Intelligence: Modern Approach.
Outline Agents and environments Rationality PEAS (Performance measure, Environment, Actuators, Sensors) Environment types Agent types Artificial Intelligence.
Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
AI in game (I) 권태경 Fall, outline AI definition taxonomy agents.
Chapter 2 Hande AKA. Outline Agents and Environments Rationality The Nature of Environments Agent Types.
Chapter 2 Intelligent Agents 1. Chapter 2 Intelligent Agents What is an agent ? An agent is anything that perceiving its environment through sensors(أجهزة.
A RTIFICIAL I NTELLIGENCE Intelligent Agents 30 November
For Friday No reading (other than handout) Homework: –Chapter 2, exercises 5 and 6 –Lisp handout 1.
Introduction of Intelligent Agents
Instructional Objective  Define an agent  Define an Intelligent agent  Define a Rational agent  Discuss different types of environment  Explain classes.
Agents and Uninformed Search ECE457 Applied Artificial Intelligence Spring 2007 Lecture #2.5.
Rational Agency CSMC Introduction to Artificial Intelligence January 8, 2007.
Rational Agency CSMC Introduction to Artificial Intelligence January 8, 2004.
GamblingGambling What are the odds? Jessica Judd.
Intelligent Agents Introduction Rationality Nature of the Environment Structure of Agents Summary.
Week 8 : User-Defined Objects (Simple Blackjack Game)
Chapter 2 Agents. Intelligent Agents An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that environment.
CSE 471/598 Intelligent Agents TIP We’re intelligent agents, aren’t we?
Lecture 2: Intelligent Agents Heshaam Faili University of Tehran What is an intelligent agent? Structure of intelligent agents Environments.
CPSC 420 – Artificial Intelligence Texas A & M University Lecture 2 Lecturer: Laurie webster II, M.S.S.E., M.S.E.e., M.S.BME, Ph.D., P.E.
Intelligent Agents Chapter 2. How do you design an intelligent agent? Definition: An intelligent agent perceives its environment via sensors and acts.
Intelligent Agents. Outline Agents and environments Rationality PEAS (Performance measure, Environment, Actuators, Sensors) Environment types Agent types.
Gambling and probability 1. Odds and football.  Predict the Premier League results for this weekend.  Can you estimate the probability of a win/draw/loss.
CHAPTER 2 Oliver Schulte Intelligent Agents. Outline Artificial Intelligence a modern approach 2 Agents and environments Rationality PEAS (Performance.
Understanding AI of 2 Player Games. Motivation Not much experience in AI (first AI project) and no specific interests/passion that I wanted to explore.
Chapter 5 Adversarial Search. 5.1 Games Why Study Game Playing? Games allow us to experiment with easier versions of real-world situations Hostile agents.
ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 1 Please pick up a copy of the course syllabus from the front desk.
Artificial Intelligence AIMA §5: Adversarial Search
Artificial Intelligence Programming Spring 2016
Lecture 13.
Game Theory Just last week:
Lecture 11.
Chapter 5 Black Jack.
Lecture 10.
Artificial Intelligence Lecture No. 5
Game Playing in AI by: Gaurav Phapale 05 IT 6010
Intelligent Agents Chapter 2.
© James D. Skrentny from notes by C. Dyer, et. al.
AI and Agents CS 171/271 (Chapters 1 and 2)
Presentation transcript:

Learning to Play Blackjack Thomas Boyett Presentation for CAP 4630 Teacher: Dr. Eggen

Objective Design and implement an agent that learns to play Blackjack. The rational agent approach to AI described in Chapter 2 of our textbook was used as a guide. Accomplish this without supplying to the agent theories or rules about how to play the game optimally.

Specifying the Task Environment Can be considered the problem that a rational agent is the solution too. Designing a good solution always includes gaining an in depth knowledge of the problem. PEAS Performance – Objective measure of work quality. Environment – The things the agent will interact with. ActuatorsSensors

Other Properties of the Task Environment Fully observable vs. partially observable Deterministic vs. stochastic Episodic vs. sequential Static vs. dynamic Discrete vs. continuous Single agent vs. multi-agent

The Rules Unlike most cards games you play only against the dealer. Whoever has the highest valued hand without exceeding 21 is the winner. Going above 21 is called Busting and is an immediate loss. Aces are worth 11 or 1, your choice. Kings, Queens, Jacks and Tens are worth 10. All other cards are worth their face value. The suit of the card is ignored. The dealer gives you two cards face up and deals himself two cards, one of them face up. This is one of the features of Blackjack that cause it to be a partially observable task environment.

The Rules If you want another card you can hit. If you are satisfied with your hand you can stand. Whoever has the best score wins the game. If the scores are equal then the game is a draw. If either player on the initial deal receives an ace and any card worth 10 then they have a Blackjack. A Blackjack is immediate victory unless both players have a Blackjack, this results in a draw.

Types of Rational Agents Simple reflex agents Model-based reflex agents Goal-based agents Utility-based agents All types can be extended to be learning agents. The Blackjack agent will be designed as a learning model-based reflex agent.

The Components of a Learning Agent Performance element Critic Learning element Problem Generator

The Performance Element The part of the agent that chooses what to do. The Blackjack agent in this design will be limited to Hitting and Standing. Optimal winning and betting are separate and Complex problems.

The Performance Element Chooses to hit or stand based on dealer’s Value and its own value. Actions stored in a reference table. Columns represent dealer’s value and rows represent the agent’s value.

The Performance Element HHHHHHHHHH 3HHHHHHHHHH 4HHHHHHHHHH …………………………… 16SSSSSHHHHH 17SSSSSSSSHH 18SSSSSSSSSS 19SSSSSSSSSS 20SSSSSSSSSS

The Critic The critic tells the learning element if the results of an action were good or bad. The critical part of a learning agent must be objective and independent of the learning element.

The Critic If the agent chooses to hit: The outcome is good if the agent did not bust. The outcome is bad if the agent did. If the agent chose to stand: The outcome is good if the agent won the game. The outcome is bad if the agent lost. The outcome is ignored if the game ends in a draw. Neither dealer or player benefit from a draw or are penalized by it.

The Learning Element Makes improvements to the performance element. Works in direct response to feedback provided by the critic.

The Learning Element The actual structure of a lookup table entry are four values that represent the agent’s previous experience with a Specific dealer/player value combination. The learning element maintains these values. # Hits resulting in bad feedback # Hits resulting in good feedback # Stands resulting in bad feedback. # Stands resulting in good feedback.

The Learning Element The good/bad ratio of the hitting and standing results are computed and whichever ratio is largest decides the perceived optimal action. This approach allows the agent to improve based on previous results. Thousands of games must be played to generate a reliable lookup table.

The Learning Element An example of table computation. A hypothetical Table entry for dealer with Value 8 and player with value 12. Since GH/BH is greater than GS/BS this data evaluates to MUST HIT on (8,12). GH45 BH5 GS20 BS30 GS/BH = 45/5 = 9 GS/BS = 15/35 = 0.429

Problem Generator The problem generator’s job is to occasionally tell the learning agent to try a non optimal action for a given situation. At the cost of sometimes behaving less optimally the agent is given the opportunity to find less obvious ways to perform better.

The Problem Generator Force the agent to play a set of games either only hitting or standing. Naïve policy if you are playing to win, but it allows the agent to learn about the quality of both choices in all circumstances. Problem generation may seem counter productive but it allows the agent to learn information that otherwise would have been left undiscovered.

Results Before Being allowed to learn: Average Win%: 17% Average Lose%: 80% After being allowed to learn without guidance from a problem Generator (50,000 games): Average Win%: 32% Average Loss%: 60% After being allowed to learn with a problem generator (50,000 games): Average Win%: 45% Average Loss%: 49%

Results in Perspective A player that always hits: Average Win%: 15% Average Loss%: 80% A player that flips a coin to decide hit/stand: Average Win%: 24% Average Loss%: 70%

Results in Perspective A player that always stands: Average Win%: 40% Average Loss%: 55% A professional Blackjack player who uses Basic (Optimal) Strategy: Average Win%: 45% Average Loss%: 49%

References Artificial Intelligence: A Modern Approach, Second Edition. Stuart Russel, Peter Norvig. Prentice Hall, 2003.