CSCI 446
Artificial Intelligence
Fall 2016

Montana Tech
Computer Science & Software Engineering



ASSIGNMENT 5

The goal of this assignment is to write machine learning code. You will use case-based learning to identify human interaction patterns and make predictions.


Using the programming language of your choice, you are to write a "mind reader" program, using case based reasoning techniques.

Prior to user input, the program is going to guess whether a user is going to input a "head" or a "tail", as if a coin has been tossed. Without being told what the program guessed, the user will then choose to enter "heads" or "tails". The program's guess and the user's input will then be compared. If the program guessed correctly, it gets a point. If not, the user gets a point. The program continues until either the program or the user reaches 25 points.

The program will keep track of past behavior of the user, and over time, build a case base of what the user has input. This case base will consist of four consecutive head/tail choices, as shown below. Let's say the user has entered the following 10 choices:

H H T H T T T H T H
1 2 3 4 5 6 7 8 9 10

The first three times the program guesses what the user will input next, it has no history, and must make random guesses. After that, it may then start looking at past user behavior. In the above example, the computer has the following cases available by the 10th user input:

1. H H T H
2. H T H T
3. T H T T
4. T T T H
5. T T H T
6. T H T H

Thus, when the user has guessed a series of HHT in the past, the next guess was H, so if the program sees this pattern again, it should guess the user will input an H next. In fact, given this set of cases, and the most recent sequence of 3 (HTH), this matches case number 2, and the computer would guess that the next user input will be a T.

If the exact pattern isn't available in the case base, the program must decide which patterns match the best to the current pattern, and then determine which one to use. How you choose to do this should be documented in your code and in your report!!

Run your program 10 times, and report the outcomes. How many times does the program win, how many times does the user win? What do you think this means? Write up your approach to the problem, the results you obtained, and your conclusions in a report, and turn in both the report and the source code electronically. Please provide instructions on how to compile and run it.

Submission. Submit your work via the Moodle Assignemnt 5 dropbox.

Page last updated: November 04, 2016