Pedagogical Possibilities for the 2048 Puzzle Game Todd W. Neller.

Slides:



Advertisements
Similar presentations
Heuristics in AI Search. waretopics/software/story/0,10801, 99340,00.html waretopics/software/story/0,10801,
Advertisements

Todd W. Neller Gettysburg College
Ch 4. Heuristic Search 4.0 Introduction(Heuristic)
Techniques for Dealing with Hard Problems Backtrack: –Systematically enumerates all potential solutions by continually trying to extend a partial solution.
For Friday Finish chapter 5 Program 1, Milestone 1 due.
AI for Connect-4 (or other 2-player games) Minds and Machines.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2008.
Part2 AI as Representation and Search
CS 484 – Artificial Intelligence
Lecture 12 Last time: CSPs, backtracking, forward checking Today: Game Playing.
Artificial Intelligence in Game Design Heuristics and Other Ideas in Board Games.
10/19/2004TCSS435A Isabelle Bichindaritz1 Game and Tree Searching.
Minimax and Alpha-Beta Reduction Borrows from Spring 2006 CS 440 Lecture Slides.
Mahgul Gulzai Moomal Umer Rabail Hafeez
This time: Outline Game playing The minimax algorithm
CS 561, Sessions Administrativia Assignment 1 due tuesday 9/24/2002 BEFORE midnight Midterm exam 10/10/2002.
CS 561, Sessions Last time: search strategies Uninformed: Use only information available in the problem formulation Breadth-first Uniform-cost Depth-first.
Games with Chance Other Search Algorithms CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 3 Adapted from slides of Yoonsuck Choe.
Game Playing CSC361 AI CSC361: Game Playing.
Solving Probabilistic Combinatorial Games Ling Zhao & Martin Mueller University of Alberta September 7, 2005 Paper link:
1 search CS 331/531 Dr M M Awais A* Examples:. 2 search CS 331/531 Dr M M Awais 8-Puzzle f(N) = g(N) + h(N)
CS 460, Sessions Last time: search strategies Uninformed: Use only information available in the problem formulation Breadth-first Uniform-cost Depth-first.
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?
Problem Solving and Search in AI Heuristic Search
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2006.
Monte Carlo Go Has a Way to Go Haruhiro Yoshimoto (*1) Kazuki Yoshizoe (*1) Tomoyuki Kaneko (*1) Akihiro Kishimoto (*2) Kenjiro Taura (*1) (*1)University.
HEURISTIC SEARCH. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 Portion of the state space for tic-tac-toe.
The Poker Squares Challenge Todd W. Neller. What is the Poker Squares Challenge? A semester-long contest where Gettysburg College students (individuals.
1 Reinforcement Learning: Learning algorithms Function Approximation Yishay Mansour Tel-Aviv University.
Heuristic Search Heuristic - a “rule of thumb” used to help guide search often, something learned experientially and recalled when needed Heuristic Function.
The Parameterized Poker Squares EAAI NSG Challenge
1 Adversary Search Ref: Chapter 5. 2 Games & A.I. Easy to measure success Easy to represent states Small number of operators Comparison against humans.
Game Trees: MiniMax strategy, Tree Evaluation, Pruning, Utility evaluation Adapted from slides of Yoonsuck Choe.
Lecture 5CSE Intro to Cognitive Science1 Algorithmic Thinking III.
PSU CS 370 – Introduction to Artificial Intelligence Game MinMax Alpha-Beta.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 2 Adapted from slides of Yoonsuck.
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.
Game Playing. Introduction Why is game playing so interesting from an AI point of view? –Game Playing is harder then common searching The search space.
Game Playing.
AD FOR GAMES Lecture 4. M INIMAX AND A LPHA -B ETA R EDUCTION Borrows from Spring 2006 CS 440 Lecture Slides.
 Summary  How to Play Go  Project Details  Demo  Results  Conclusions.
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.
Lecture 5: Backtracking Depth-First Search N-Queens Problem Hamiltonian Circuits.
Game-playing AIs Part 1 CIS 391 Fall CSE Intro to AI 2 Games: Outline of Unit Part I (this set of slides)  Motivation  Game Trees  Evaluation.
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 Playing. Introduction One of the earliest areas in artificial intelligence is game playing. Two-person zero-sum game. Games for which the state space.
For Friday Finish chapter 6 Program 1, Milestone 1 due.
Outline Intro to Representation and Heuristic Search Machine Learning (Clustering) and My Research.
Today’s Topics Playing Deterministic (no Dice, etc) Games –Mini-max –  -  pruning –ML and games? 1997: Computer Chess Player (IBM’s Deep Blue) Beat Human.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
Will Britt and Bryan Silinski
The Standard Genetic Algorithm Start with a “population” of “individuals” Rank these individuals according to their “fitness” Select pairs of individuals.
Adversarial Search. Regular Tic Tac Toe Play a few games. –What is the expected outcome –What kinds of moves “guarantee” that?
Artificial Intelligence in Game Design Board Games and the MinMax Algorithm.
Luca Weibel Honors Track: Competitive Programming & Problem Solving Partisan game theory.
Adversarial Search and Game-Playing
By: Casey Savage, Hayley Stueber, and James Olson
Last time: search strategies
CS Fall 2016 (Shavlik©), Lecture 11, Week 6
Adversarial Search.
Artificial Intelligence Problem solving by searching CSC 361
Games with Chance Other Search Algorithms
The Parameterized Poker Squares EAAI NSG Challenge
NIM - a two person game n objects are in one pile
Game Playing Fifth Lecture 2019/4/11.
Lecture 9 Administration Heuristic search, continued
Games with Chance Other Search Algorithms
Adversarial Search CS 171/271 (Chapter 6)
Unit II Game Playing.
Presentation transcript:

Pedagogical Possibilities for the 2048 Puzzle Game Todd W. Neller

Outline Introduction to the 2048 Game Sample 2048 Assignments The Importance of Sharing Assignments Wanted: High Fun/SLOC Assignments

What is 2048? 4-by-4 square grid partially filled with tiles labeled with powers of 2. Primary goal: merge tiles in order to create a tile labeled 2048 (2 11 ) Secondary goal: achieve higher scores and higher tiles. Initial board has 2 randomly generated tiles. – Uniformly random position – Values 2 (with probability.9) or 4.

2048 Turn Move left, right, up, or down, if it results in a change to the grid. – Change can be from tile sliding, and/or – merging same number tiles by sliding them together along a row/column line. No legal move  game over. Player chooses a direction along a line: – All tiles merge and slide in that direction if possible. – From the front to the back, successive identical tile pairs merge into a new tile with their sum. – (Merged tiles cannot merge again in the same movement.) – All tiles slide as far as possible in the direction of motion.

Downward Move Example

How can 2048 be useful to CS Ed? CS1, CS2: Modeling – 1D, 2D array, iteration exercise – Queue exercise CS1/CS2: MC Simulation AI – Heuristic evaluation – Search (Expectimax, etc.)

Modeling Given a 4-by-4 puzzle grid, – Is the game over? – Can the player legally move in a given direction? – What are the legal directions of motion? Given a single line of tiles, compute the result of a move towards the front of that line. Given a 4-by-4 puzzle grid, – Compute the result of a move in a given direction.

Heuristic Evaluation Score one’s preference for a given board. For non-AI students, the instructor can supply search code using student heuristics. How much should one value: – … having our maximum value tile in a corner? – … monotonicity along a snake-like path? – … monotonicity along any line? – … the maximum tile of a line along an edge? – … adjacent identical tiles? – … empty cells? Such open-ended assignments encourage creativity and deeper problem-solving engagement.

Simple Game Play Greedy – Pick the move that immediately (before random tile generation) yields the grid with the maximum heuristic evaluation Monte Carlo: – After each possible play, For a fixed number of trials (e.g. 1000): – Simulate n (e.g. 2) moves (after n random tile generations) and accumulate the heuristic evaluation of the final resulting state. Divide by the number of trials to get an avg. heuristic value. – Choose move with the maximum avg. heuristic value.

Advanced Game Play Choice node and chance nodes? –  Expectimax – Maximize at choice nodes, average at chance nodes – Evaluate heuristic at depth cutoff – Chance sampling: Average over a sample rather than all possible chance events Monte Carlo Tree Search Maximize expected utility of choice Average utilities of chance outcomes Maximize Average

Performance Results Algorithm Median Score Mean Score Std. Dev. Max. Tile Median Tile random simple greedy simple Monte Carlo (depth 3) expectimax (depth 2) expectimax (depth 3) sample expectimax (depth 2) sample expectimax (depth 3) Simple Monte Carlo can achieve the 2048 tile. Chance sampling provides significant speedup with comparable performance.

Why is Nifty Nifty? Nifty Assignments sessions ( and spin-offs, e.g. Model AI Assignments ( Experiential learning is deep learning Model, well-designed, applied assignments form the foundation of experiential learning. Model assignments take significant time, effort, expertise, and revision to develop. Sharing such assignments through repositories aids the efficient advancement of CS education.

What Not to Assign Motivating question #1: Why isn’t a Chess game a good intro CS assignment? – Complex rules (e.g. moves, en passant, castling) are often a distraction from the lesson. Motivating question #2: Why isn’t Tic-tac- toe my favorite intro CS assignment? – Tic-tac-toe is boring once you know the strategy.

Wanted: High Fun/SLOC Assignments The best game/puzzle assignments: – Require few source-lines-of-code to model (simple) – Are fun and interesting, offering an experience worth revisiting (  satisfaction) and sharing (  promotion) Examples: Breakthrough, Connect6, Pig, Nim Games (Subtraction, 3-Pile Nim, Chomp), 2048 I would be interested in your best examples as well!

Conclusion 2048 offers many good exercises for CS1 through advanced AI. – Modeling assignments are suitable for CS1. – Simple AI yields satisfying results. Sharing exercises for deep, experiential learning is worth our effort. Wanted: High Fun/SLOC Assignments!