CS 371 - Introduction to Artificial Intelligence
Homework #5

Due at the beginning of class 16

Note: Work is to be done together in pairs.

Dynamic Programming and Value Iteration

0. Reading: Read the given handout Solving the Dice Game Pig: an introduction to dynamic programming and value iteration, and study the accompanying sample code.  This code can be downloaded from the Pig project webpage Description section.

1. Dynamic Programming Solving Pig Solitaire: Solve Pig Solitaire, the first exercise of section 2.4, according to this specification.  Answer the written exercises in your README file.

2. Value Iteration Solving Pig: Solve Pig, the first exercise of section 3.5, according to this specification.  Answer the written exercises in your README file.

3. Value Iteration Solving Two-Dice Pig: The rules of Two-Dice Pig are the same as the previous standard 1-die Pig except:

  1. Two standard dice are rolled.
  2. If neither shows a 1, their sum is added to the turn total.
  3. If a single 1 is rolled, the player’s turn ends with the loss of the turn total.
  4. If two 1s are rolled, the player’s turn ends with the loss of the turn total and score.

Solve Two-Dice Pig with value iteration according to this specification.   Answer the written exercises for the previous exercise applied to Two-Dice Pig in your README file.

Todd Neller