Dynamic - Dynamic Programming Practice Questions These...

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

View Full Document Right Arrow Icon
Dynamic Programming Practice Questions These questions are NOT to turn in; they are just for your practice. Question 1. (This is similar to the “sticks” problem presented in class.) Consider a two- player game in which players make consecutive moves. There are 21 sticks in a pile. At each turn, a player may take one, two, four, or seven sticks from any one pile. Whoever takes the last stick loses the game. Use dynamic programming to determine from which states you can win this game, and from which states you can force your opponent to lose. Hint: you know that if there’s 1 stick left, you will lose. So “1 stick remaining” is a losing state. Can you figure out some easy winning states from there? Continue working backwards until you get to 21. Question 2. (This is similar to the telephone line example presented in class.) Homer loves doughnuts, and wishes to purchase exactly 17 doughnuts. At the Qwik-E-Mart, Homer can buy one doughnut for $0.50, a pack of three doughnuts for $1.20, and a pack
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/25/2010 for the course ESI 6314 taught by Professor Vladimirlboginski during the Fall '09 term at University of Florida.

Page1 / 2

Dynamic - Dynamic Programming Practice Questions These...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online