review2 - Computer Science 340 Reasoning about Computation...

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

View Full Document Right Arrow Icon
Computer Science 340 Reasoning about Computation Review Session 2 Friday, January 11, 2008 Problem 1 Recall the cow grazing problem from Homework 5. The cow is on a path that leads to food, but the cow doesn’t know what direction the food lies in. The goal was to design an online algorithm for the cow to traverse the path and find the food. The deterministic algorithm we proposed in the solution was the following. The cow starts in an arbitrary direction for one unit of distance. If it does not find food, it comes back to the starting position and tries the other direction going 2 units of distance. Each time it comes back to the start position, it goes in the other direction for twice the distance it tried before. We argued that the competitive ratio of this algorithm was 9. Several of you got this, or some variant of this idea. Next we asked you to design a randomized algorithm with better competitive ratio. Several students proposed randomizing the previous deterministic algorithm by picking a
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 homework help was uploaded on 01/29/2008 for the course COS 340 taught by Professor Charikarandchazelle during the Fall '07 term at Princeton.

Page1 / 2

review2 - Computer Science 340 Reasoning about Computation...

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