hw5 - 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 Homework 5 Due at the beginning of class on Wednesday, October 24, 2007 This homework consists of 5 problems Problem 1 Consider the three-element list with the following initial configuration: ( x 1 , x 2 , x 3 ), (ie, x 1 is at the front). What is the cost of MTF for the access sequence: x 3 , x 2 , x 3 , x 2 . Prove that the optimal offline cost to serve the same access sequence is 8. Problem 2 Let MTF d be a variant of MTF that moves an accessed item at position i at least i/d - 1 positions closer to the front of the list. Show that for any static request sequence of size n , the cost is MTF d ( σ ) d (2 OPT C ( σ ) + OPT P ( σ ) - OPT F ( σ ) - n ) . (See handouts for meaning of notation.) Problem 3 Let ALG0 be any list accessing algorithm and let σ be any request sequence. Prove that there is an algorithm ALG1 that uses only paid transpositions (before the access) such that the cost of ALG0 and ALG1 are the same. (Don’t worry about how one would go
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.

Page1 / 2

hw5 - 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