# HW3s05 - COT5405 SP05 HW3 Due: Monday March 7, 05 2:45 PM...

This preview shows pages 1–2. Sign up to view the full content.

Analysis of Algorithms Spring 2005 On-Campus Assignment #3 Page 1 of 3 COT5405 SP05 HW3 Due: Monday March 7, 05 2:45 PM Please submit any 4 (and you must attempt the ones marked as “compulsory”) Question 1: (Compulsory) 1 2 3 You need to write a dynamic programming algorithm to play this game. There are three bowls in this game, each starting with X , Y and Z number of balls respectively ( X , Y , Z totally independent). A move constitutes exactly one of the following: Remove 1 ball from bowl 1 Remove 1 or 2 ball(s) from bowl 2 Remove 2 or 3 balls from bowl 3 Players take alternate moves, and the first player unable to make a move loses. i.e., if it’s a player’s turn to move but the playing board is either (0,0,0) or (0,0,1) balls, he/she loses. Devise an algorithm that will, given numbers ( X , Y , Z ), determine who ( A or B ) is the winner of the game, provided both players play optimally ( A is player who makes the first move). No pseudocode is required - just write the recurrence relation and justify its correctness. Argue

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 05/27/2011 for the course COT 5405 taught by Professor Ungor during the Fall '08 term at University of Florida.

### Page1 / 3

HW3s05 - COT5405 SP05 HW3 Due: Monday March 7, 05 2:45 PM...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online