hw5 - Computer Science 340 Reasoning about Computation...

  • Homework Help
  • PresidentHackerCaribou10582
  • 2
  • 100% (1) 1 out of 1 people found this document helpful

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

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 implementing such an algorithm.) Consider a variant of the list accessing problem in which
Image of page 1

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

Image of page 2
This is the end of the preview. Sign up to access the rest of the document.
  • Fall '07
  • CharikarandChazelle
  • Insertion Sort, Online algorithm, adversary, list accessing algorithm, better randomized algorithm

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern