David Kauchak CS52 – Spring 2016

Slides:



Advertisements
Similar presentations
Adversarial Search Chapter 6 Section 1 – 4. Types of Games.
Advertisements

Adversarial Search Reference: “Artificial Intelligence: A Modern Approach, 3 rd ed” (Russell and Norvig)
Games & Adversarial Search Chapter 5. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent’s reply. Time.
February 7, 2006AI: Chapter 6: Adversarial Search1 Artificial Intelligence Chapter 6: Adversarial Search Michael Scherger Department of Computer Science.
Games & Adversarial Search
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2008.
Adversarial Search Chapter 5.
Adversarial Search Chapter 6.
Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
G51IAI Introduction to AI Minmax and Alpha Beta Pruning Garry Kasparov and Deep Blue. © 1997, GM Gabriel Schwartzman's Chess Camera, courtesy IBM.
1 Game Playing Chapter 6 Additional references for the slides: Luger’s AI book (2005). Robert Wilensky’s CS188 slides:
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2006.
Games & Adversarial Search Chapter 6 Section 1 – 4.
Game Playing State-of-the-Art  Checkers: Chinook ended 40-year-reign of human world champion Marion Tinsley in Used an endgame database defining.
Game Trees: MiniMax strategy, Tree Evaluation, Pruning, Utility evaluation Adapted from slides of Yoonsuck Choe.
Adversarial Search CS30 David Kauchak Spring 2015 Some material borrowed from : Sara Owsley Sood and others.
Game Playing.
Game Playing Chapter 5. Game playing §Search applied to a problem against an adversary l some actions are not under the control of the problem-solver.
Agents that can play multi-player games. Recall: Single-player, fully-observable, deterministic game agents An agent that plays Peg Solitaire involves.
Adversarial Search CS311 David Kauchak Spring 2013 Some material borrowed from : Sara Owsley Sood and others.
Adversarial Search Chapter 6 Section 1 – 4. Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
1 Adversarial Search CS 171/271 (Chapter 6) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Game tree search Chapter 6 (6.1 to 6.3 and 6.6) cover games. 6.6 covers state of the art game players in particular. 6.5 covers games that involve uncertainty.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
Adversarial Search. Regular Tic Tac Toe Play a few games. –What is the expected outcome –What kinds of moves “guarantee” that?
Adversarial Search Chapter 5 Sections 1 – 4. AI & Expert Systems© Dr. Khalid Kaabneh, AAU Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
ADVERSARIAL SEARCH Chapter 6 Section 1 – 4. OUTLINE Optimal decisions α-β pruning Imperfect, real-time decisions.
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.
Game playing Types of games Deterministic vs. chance
Game Playing Why do AI researchers study game playing?
Adversarial Search and Game-Playing
Adversarial Environments/ Game Playing
Announcements Homework 1 Full assignment posted..
Last time: search strategies
PENGANTAR INTELIJENSIA BUATAN (64A614)
mastermind: last details
CS 460 Spring 2011 Lecture 4.
CS Fall 2016 (Shavlik©), Lecture 11, Week 6
Pengantar Kecerdasan Buatan
Adversarial Search.
Game Playing.
State Space 4 Chapter 4 Adversarial Games.
Adversarial Search Chapter 5.
Games & Adversarial Search
Artificial Intelligence
Games & Adversarial Search
Adversarial Search.
Artificial Intelligence
Game playing.
Alpha-Beta Search.
Games & Adversarial Search
Games & Adversarial Search
NIM - a two person game n objects are in one pile
Artificial Intelligence
Alpha-Beta Search.
Alpha-Beta Search.
Minimax strategies, alpha beta pruning
Game Playing Fifth Lecture 2019/4/11.
Games & Adversarial Search
Adversarial Search CMPT 420 / CMPG 720.
Adversarial Search CS 171/271 (Chapter 6)
Minimax strategies, alpha beta pruning
CS51A David Kauchak Spring 2019
CS51A David Kauchak Spring 2019
Games & Adversarial Search
Adversarial Search Chapter 6 Section 1 – 4.
Unit II Game Playing.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning
Presentation transcript:

David Kauchak CS52 – Spring 2016 Adversarial search David Kauchak CS52 – Spring 2016

Admin Assignment 6 Assignment 7

Game playing Why study games? In, why try and write computer programs that can play games?

Why study games Clear success criteria Good motivator to push research Important historically for AI Fun  Some real-world problems fit this model game theory (economics) multi-agent problems

Game playing results?

Tic Tac Toe We want to write a program to play Tic Tac Toe. How would you do it? What types of decisions does it have to make?

Tic Tac Toe X X O O O X O X X O For any board configuration What move should ‘X’ make? X O Needs to make a move (ideally as good as possible)

Tic Tac Toe X For any board configuration What move should ‘X’ make? Needs to make a move (ideally as good as possible)

Tic Tac Toe X O X O X For any board configuration What move should ‘X’ make? X O Needs to make a move (ideally as good as possible) X

Tic Tac Toe How can we “learn” this (or figure it out)?

Tic Tac Toe as search Key idea: search all possible moves/configurations

Tic Tac Toe as search X X … X Explore all possible first moves by ‘X’

Tic Tac Toe as search … X X X Then, explore all possible next moves by ‘O’

Tic Tac Toe as search … X X O X O X O Explore all possible next moves by ‘O’

Tic Tac Toe as search … X X O X O X O Then, explore all possible next moves by ‘X’

Tic Tac Toe as search … X O X O X X O X O X X Explore all possible next moves by ‘X’

Tic Tac Toe as search X O X O X X O X O X … X When do we stop?

Tic Tac Toe as search … LOSE WIN TIE X X O X X O X X O X O O X X O O X Eventually, we’ll get to an game end X X O X X O X X O X O O X X O … O X O X O X O O X O X LOSE WIN TIE How does this help us? Try and make moves that move us towards a win, i.e. where there are leaves with a WIN.

Tic Tac Toe X’s turn … O’s turn … X’s turn … … … Problem: we don’t know what ‘O’ will do

I’m X, what will ‘O’ do? X O O’s turn

Minimizing risk The program doesn’t know what move O (the opponent) will make It can assume, though, that it will try and make the best move possible Even if O actually makes a different move, we’re no worse off. Why? X O

Defining a scoring function X X O X X O X X O X O O X X O … O X O X O X O O X O X LOSE WIN TIE +1 -1 Idea: define a function that gives us a “score” for how good each board state is for us higher scores mean better for us

Defining a scoring function X X O Our (X) turn O O X O X What should be the score of this board state? +1: we can get to a win

Defining a scoring function X X O Opponent’s (O) turn O X O X What should be the score of this board state? -1: opponent can get to a win (we lose)

Defining a scoring function X O -1 Opponent’s (O) turn +1 -1

Defining a scoring function X O Our (X) turn O X What should be the score of this board state?

Defining a scoring function X O Our (X) turn O X X O O turn O What’s the score of this state? X X O X O X O X O X O O O O O X turn +1 O +1 O +1 +1 - No matter what choice O makes at this stage, we still have a choice where we can win. X O X X X X X X X X O O X O X O X O O X O X O O +1 O O +1 +1 +1 X X X X X X X O X X X

Defining a scoring function X O What’s the score of this state? Our (X) turn +1 O X X O O turn +1 O X X O X O X O X O X O O O O O X turn +1 O +1 O +1 +1 Since we get to choose at this stage AND if we choose to place an X in the lower left we win, this state is a win X O X X X X X X X X O O X O X O X O O X O X O O O +1 O +1 +1 +1 X X X X X X X O X X X

Defining a scoring function X Our (X) turn O What should be the score of this state? 0: If we play perfectly and so does O, the best we can do is a tie (could do better if O makes a mistake)

How should X play?

How should X play? When it’s “my” turn, pick the highest scoring state When it’s the opponent’s turn, assume the lowest scoring state (from my perspective) If we can reach the end games, we can percolate these answers all the way back up

How to calculate this tree Start from the leaves and propagate the score up: if X’s turn, pick the move that maximizes the utility if O’s turn, pick the move that minimizes the utility This results in an optimal strategy!

Another example: Baby Nim MAX MIN Take 1 or 2 sticks at each turn Goal: take the last stick MAX What move should I take? MIN MAX

Baby Nim MAX MIN MAX MIN MAX 5 4 3 2 1 W MAX MIN Take 1 or 2 at each turn Goal: take the last stick MAX MAX MAX wins MIN MIN W = 1.0 MAX MAX W = -1.0 MIN wins/ MAX loses

Baby Nim ? 1.0 1.0 1.0 -1.0 -1.0 -1.0 -1.0 1.0 MAX MIN MAX MIN MAX 5 4 3 2 1 W MAX MAX MIN MIN Take 1 or 2 at each turn Goal: take the last match MAX MAX MAX wins MIN MIN 1.0 1.0 W = 1.0 1.0 ? MAX MAX W = -1.0 -1.0 -1.0 -1.0 -1.0 MIN wins/ MAX loses 1.0

Baby Nim ? 1.0 1.0 1.0 1.0 -1.0 -1.0 -1.0 -1.0 1.0 MAX MIN MAX MIN MAX 5 4 3 2 1 W MAX MAX MIN MIN Take 1 or 2 at each turn Goal: take the last match MAX MAX MAX wins ? MIN MIN 1.0 1.0 W = 1.0 1.0 MAX MAX W = -1.0 1.0 -1.0 -1.0 -1.0 -1.0 MIN wins/ MAX loses 1.0

Baby Nim ? -1.0 1.0 1.0 1.0 1.0 -1.0 -1.0 -1.0 -1.0 1.0 MAX MIN MAX 5 4 3 2 1 W MAX MAX MIN MIN Take 1 or 2 at each turn Goal: take the last match MAX MAX MAX wins ? MIN MIN -1.0 1.0 1.0 W = 1.0 1.0 MAX MAX W = -1.0 1.0 -1.0 -1.0 -1.0 -1.0 MIN wins/ MAX loses 1.0

Baby Nim 5 4 3 2 1 W MAX MAX MIN MIN Take 1 or 2 at each turn Goal: take the last match ? MAX MAX MAX wins MIN MIN -1.0 -1.0 1.0 1.0 W = 1.0 1.0 MAX MAX W = -1.0 1.0 -1.0 -1.0 -1.0 -1.0 MIN wins/ MAX loses 1.0

Baby Nim 5 4 3 2 1 W MAX MAX MIN MIN Take 1 or 2 at each turn Goal: take the last match MAX MAX -1.0 MAX wins ? MIN MIN -1.0 -1.0 1.0 1.0 W = 1.0 1.0 MAX MAX W = -1.0 1.0 -1.0 -1.0 -1.0 -1.0 MIN wins/ MAX loses 1.0

Baby Nim 5 4 3 2 1 W MAX MAX MIN MIN Take 1 or 2 at each turn Goal: take the last match ? MAX MAX -1.0 MAX wins MIN MIN -1.0 -1.0 -1.0 1.0 1.0 W = 1.0 1.0 MAX MAX W = -1.0 1.0 -1.0 -1.0 -1.0 -1.0 MIN wins/ MAX loses 1.0

Baby Nim 5 4 3 2 1 W MAX MAX ? MIN MIN Take 1 or 2 at each turn Goal: take the last match MAX MAX -1.0 1.0 MAX wins MIN MIN -1.0 -1.0 -1.0 1.0 1.0 W = 1.0 1.0 MAX MAX W = -1.0 1.0 -1.0 -1.0 -1.0 -1.0 MIN wins/ MAX loses 1.0

Baby Nim 5 4 3 2 1 W MAX MAX MIN MIN -1.0 Take 1 or 2 at each turn Goal: take the last match MAX MAX 1.0 -1.0 MAX wins ? MIN MIN -1.0 -1.0 -1.0 1.0 1.0 W = 1.0 1.0 MAX MAX W = -1.0 1.0 -1.0 -1.0 -1.0 -1.0 MIN wins/ MAX loses 1.0

Baby Nim 5 4 3 2 1 W MAX MAX MIN MIN -1.0 Take 1 or 2 at each turn Goal: take the last match ? MAX MAX 1.0 -1.0 MAX wins ? MIN MIN -1.0 -1.0 -1.0 -1.0 1.0 1.0 W = 1.0 1.0 MAX MAX W = -1.0 1.0 -1.0 -1.0 -1.0 -1.0 MIN wins/ MAX loses 1.0

Baby Nim 5 4 3 2 1 W MAX MAX MIN MIN -1.0 Take 1 or 2 at each turn Goal: take the last match ? MAX MAX 1.0 1.0 -1.0 MAX wins MIN MIN -1.0 -1.0 -1.0 -1.0 1.0 1.0 W = 1.0 1.0 MAX MAX W = -1.0 1.0 -1.0 -1.0 -1.0 -1.0 MIN wins/ MAX loses 1.0

Baby Nim 5 4 3 2 1 W MAX MAX ? MIN MIN -1.0 Take 1 or 2 at each turn Goal: take the last match MAX MAX 1.0 1.0 1.0 -1.0 MAX wins MIN MIN -1.0 -1.0 -1.0 -1.0 1.0 1.0 W = 1.0 1.0 MAX MAX W = -1.0 1.0 -1.0 -1.0 -1.0 -1.0 MIN wins/ MAX loses 1.0

Baby Nim Which move? 5 4 3 2 1 W MAX MAX MIN MIN 1.0 -1.0 Take 1 or 2 at each turn Goal: take the last match MAX MAX 1.0 1.0 1.0 -1.0 MAX wins MIN MIN -1.0 -1.0 -1.0 -1.0 1.0 1.0 W = 1.0 1.0 MAX MAX W = -1.0 1.0 -1.0 -1.0 -1.0 -1.0 MIN wins/ MAX loses 1.0

Baby Nim could still win, but not optimal!!! 5 4 3 2 1 W MAX MAX MIN MIN 1.0 -1.0 Take 1 or 2 at each turn Goal: take the last match MAX MAX 1.0 1.0 1.0 -1.0 MAX wins MIN MIN -1.0 -1.0 -1.0 -1.0 1.0 1.0 W = 1.0 1.0 MAX MAX W = -1.0 1.0 -1.0 -1.0 -1.0 -1.0 MIN wins/ MAX loses 1.0

One more minimax example 3 12 8 A11 A12 A13 2 4 6 A21 A22 A23 14 5 2 A31 A32 A33 Which move should be made: A1, A2 or A3?

One more minimax example 3 2 2 A11 A12 A13 A21 A22 A23 A31 A32 A33 3 12 8 2 4 6 2 5 14

Properties of minimax Minimax is optimal! Yes (if tree is finite) Yes (against an optimal opponent) Minimax is optimal! What are the requirements to use minimax (i.e. what types of games can we solve)? O(bm) O(bm) (depth-first exploration)

Properties of minimax Minimax is optimal! Yes (if tree is finite) Yes (against an optimal opponent) Minimax is optimal! What are the requirements to use minimax (i.e. what types of games can we solve)? Must have full view of board state (e.g. stratego wouldn’t work) No chance/probability Board state space can’t be too big! O(bm) O(bm) (depth-first exploration)

Game state size What impacts the size of the board state space?

Game state size What impacts the size of the board state space? Number of possible moves from each board state Number of moves before the game finishes (depth of the tree)

Game state space size How many of this can we solve optimally? 0 Ply Branching Factor Estimates for different two-player games Tic-tac-toe 4 Connect Four 7 Checkers 10 Othello 30 Chess 35 Go 300 How many of this can we solve optimally?

Game state space size “solved” games CHINOOK (2007) computer-dominated 0 Ply 1 Ply 2 Ply Can search entire space Branching Factor Estimates for different two-player games “solved” games Tic-tac-toe 4 Connect Four 7 Checkers 10 Othello 30 Chess 35 Go 300 CHINOOK (2007) Can’t  computer-dominated

Mastermind revisited Leverage some of these ideas for Mastermind!

3 colors, 3 pegs 3 Colors: Red, Green, Blue 3 pegs: [____, ____, ____] How many different codes?

3 colors, 3 pegs 27! (colorspegs = 33) [Red, Red, Red] [Red, Red, Green] [Red, Red, Blue] [Red, Green, Red] [Red, Green, Green] [Red, Green, Blue] [Red, Blue, Red] [Red, Blue, Green] [Red, Blue, Blue] [Green, Red, Red] [Green, Red, Green] [Green, Red, Blue] [Green, Green, Red] [Green, Green, Green] [Green, Green, Blue] [Green, Blue, Red] [Green, Blue, Green] [Green, Blue, Blue] [Blue, Red, Red] [Blue, Red, Green] [Blue, Red, Blue] [Blue, Green, Red] [Blue, Green, Green] [Blue, Green, Blue] [Blue, Blue, Red] [Blue, Blue, Green] [Blue, Blue, Blue]

3 colors, 3 pegs [Red, Red, Red] [Red, Red, Green] [Red, Red, Blue] [Red, Green, Green] [Red, Green, Blue] [Red, Blue, Red] [Red, Blue, Green] [Red, Blue, Blue] [Green, Red, Red] [Green, Red, Green] [Green, Red, Blue] [Green, Green, Red] [Green, Green, Green] [Green, Green, Blue] [Green, Blue, Red] [Green, Blue, Green] [Green, Blue, Blue] [Blue, Red, Red] [Blue, Red, Green] [Blue, Red, Blue] [Blue, Green, Red] [Blue, Green, Green] [Blue, Green, Blue] [Blue, Blue, Red] [Blue, Blue, Green] [Blue, Blue, Blue] Codemaker chooses this code

Naïve approach (assignment 3) What would our naïve approach guess first? [Red, Red, Red] [Red, Red, Green] [Red, Red, Blue] [Red, Green, Red] [Red, Green, Green] [Red, Green, Blue] [Red, Blue, Red] [Red, Blue, Green] [Red, Blue, Blue] [Green, Red, Red] [Green, Red, Green] [Green, Red, Blue] [Green, Green, Red] [Green, Green, Green] [Green, Green, Blue] [Green, Blue, Red] [Green, Blue, Green] [Green, Blue, Blue] [Blue, Red, Red] [Blue, Red, Green] [Blue, Red, Blue] [Blue, Green, Red] [Blue, Green, Green] [Blue, Green, Blue] [Blue, Blue, Red] [Blue, Blue, Green] [Blue, Blue, Blue]

Naïve approach (assignment 3) Exact Inexact Guess 1: [Red, Red, Red] Response? (codemaker) [Red, Red, Red] [Red, Red, Green] [Red, Red, Blue] [Red, Green, Red] [Red, Green, Green] [Red, Green, Blue] [Red, Blue, Red] [Red, Blue, Green] [Red, Blue, Blue] [Green, Red, Red] [Green, Red, Green] [Green, Red, Blue] [Green, Green, Red] [Green, Green, Green] [Green, Green, Blue] [Green, Blue, Red] [Green, Blue, Green] [Green, Blue, Blue] [Blue, Red, Red] [Blue, Red, Green] [Blue, Red, Blue] [Blue, Green, Red] [Blue, Green, Green] [Blue, Green, Blue] [Blue, Blue, Red] [Blue, Blue, Green] [Blue, Blue, Blue]

Naïve approach (assignment 3) Exact Inexact Guess 1: [Red, Red, Red] Response (codemaker) [Red, Red, Red] [Red, Red, Green] [Red, Red, Blue] [Red, Green, Red] [Red, Green, Green] [Red, Green, Blue] [Red, Blue, Red] [Red, Blue, Green] [Red, Blue, Blue] [Green, Red, Red] [Green, Red, Green] [Green, Red, Blue] [Green, Green, Red] [Green, Green, Green] [Green, Green, Blue] [Green, Blue, Red] [Green, Blue, Green] [Green, Blue, Blue] [Blue, Red, Red] [Blue, Red, Green] [Blue, Red, Blue] [Blue, Green, Red] [Blue, Green, Green] [Blue, Green, Blue] [Blue, Blue, Red] [Blue, Blue, Green] [Blue, Blue, Blue] Which ones can we eliminate?

Naïve approach (assignment 3) Exact Inexact Guess 1: [Red, Red, Red] Response (codemaker) [Red, Red, Red] [Red, Red, Green] [Red, Red, Blue] [Red, Green, Red] [Red, Green, Green] [Red, Green, Blue] [Red, Blue, Red] [Red, Blue, Green] [Red, Blue, Blue] [Green, Red, Red] [Green, Red, Green] [Green, Red, Blue] [Green, Green, Red] [Green, Green, Green] [Green, Green, Blue] [Green, Blue, Red] [Green, Blue, Green] [Green, Blue, Blue] [Blue, Red, Red] [Blue, Red, Green] [Blue, Red, Blue] [Blue, Green, Red] [Blue, Green, Green] [Blue, Green, Blue] [Blue, Blue, Red] [Blue, Blue, Green] [Blue, Blue, Blue] Any with red in them: 19 removed

Naïve approach (assignment 3) What would our naïve approach guess next? [Green, Green, Green] [Green, Green, Blue] [Green, Blue, Green] [Green, Blue, Blue] [Blue, Green, Green] [Blue, Green, Blue] [Blue, Blue, Green] [Blue, Blue, Blue]

Naïve approach (assignment 3) Exact Inexact Guess 2: [Green, Green, Green] Response? (codemaker) [Green, Green, Green] [Green, Green, Blue] [Green, Blue, Green] [Green, Blue, Blue] [Blue, Green, Green] [Blue, Green, Blue] [Blue, Blue, Green] [Blue, Blue, Blue]

Naïve approach (assignment 3) Exact Inexact Guess 2: [Green, Green, Green] Response? 1 (codemaker) [Green, Green, Green] [Green, Green, Blue] [Green, Blue, Green] [Green, Blue, Blue] [Blue, Green, Green] [Blue, Green, Blue] [Blue, Blue, Green] [Blue, Blue, Blue] Which ones can we eliminate?

Naïve approach (assignment 3) Exact Inexact Guess 2: [Green, Green, Green] Response? 1 (codemaker) [Green, Green, Green] [Green, Green, Blue] [Green, Blue, Green] [Green, Blue, Blue] [Blue, Green, Green] [Blue, Green, Blue] [Blue, Blue, Green] [Blue, Blue, Blue] Must have one green: removed 5.

Naïve approach (assignment 3) What would our naïve approach guess next? [Green, Blue, Blue] [Blue, Green, Blue] [Blue, Blue, Green]

Naïve approach (assignment 3) Exact Inexact Guess 3: [Green, Blue, Blue] Response? (codemaker) [Green, Blue, Blue] [Blue, Green, Blue] [Blue, Blue, Green]

Naïve approach (assignment 3) Exact Inexact Guess 3: [Green, Blue, Blue] Response? 1 2 (codemaker) [Green, Blue, Blue] [Blue, Green, Blue] [Blue, Blue, Green] Which ones can we eliminate?

Naïve approach (assignment 3) Exact Inexact Guess 3: [Green, Blue, Blue] Response? 1 2 (codemaker) [Green, Blue, Blue] [Blue, Green, Blue] [Blue, Blue, Green] Only 1!

Naïve approach (assignment 3) What would our naïve approach guess next? [Blue, Green, Blue] [Blue, Blue, Green]

Naïve approach (assignment 3) Exact Inexact Guess 4: [Blue, Green, Blue] Response? (codemaker) [Blue, Green, Blue] [Blue, Blue, Green]

Naïve approach (assignment 3) Exact Inexact Guess 4: [Blue, Green, Blue] Response? 1 2 (codemaker) [Blue, Green, Blue] [Blue, Blue, Green]

Naïve approach (assignment 3) Exact Inexact Guess 5: [Blue, Blue, Green] Response? 3 (codemaker) [Blue, Blue, Green]

Naïve approach (assignment 3) It took us 5 guesses. Guess 1: [Red, Red, Red] Guess 2: [Green, Green, Green] Guess 3: [Green, Blue, Blue] Guess4: [Blue, Green, Blue] Guess 5: [Blue, Blue, Green] Can we do better (less guesses)?