CSE 5314 On-line Computation Homework 1 Wook Choi Feb/26/2004.

Slides:



Advertisements
Similar presentations
Analysis of Algorithms II
Advertisements

Completeness and Expressiveness
THE WELL ORDERING PROPERTY Definition: Let B be a set of integers. An integer m is called a least element of B if m is an element of B, and for every x.
Chapter 3 Direct Proof and Proof by Contrapositive
Incremental Linear Programming Linear programming involves finding a solution to the constraints, one that maximizes the given linear function of variables.
Topics covered: Memory subsystem CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Brewer’s Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services Authored by: Seth Gilbert and Nancy Lynch Presented by:
Outline. Theorem For the two processor network, Bit C(Leader) = Bit C(MaxF) = 2[log 2 ((M + 2)/3.5)] and Bit C t (Leader) = Bit C t (MaxF) = 2[log 2 ((M.
A (1+  )-Approximation Algorithm for 2-Line-Center P.K. Agarwal, C.M. Procopiuc, K.R. Varadarajan Computational Geometry 2003.
1 Competitive analysis of the LRFU paging algorithm Edith Cohen -- AT&T Haim Kaplan -- Tel Aviv Univ. Uri Zwick -- Tel Aviv Univ.
PTAS for Bin-Packing. Special Cases of Bin Packing 1. All item sizes smaller than Claim 1: Proof: If then So assume Therefore:
CPSC 668Set 10: Consensus with Byzantine Failures1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
The main idea of the article is to prove that there exist a tester of monotonicity with query and time complexity.
Lower Envelopes (Cont.) Yuval Suede. Reminder Lower Envelope is the graph of the pointwise minimum of the (partially defined) functions. Letbe the maximum.
Derandomized DP  Thus far, the DP-test was over sets of size k  For instance, the Z-Test required three random sets: a set of size k, a set of size k-k’
Dictionaries and Hash Tables1  
Regular Expression (EXTRA)
CSE 421 Algorithms Richard Anderson Lecture 6 Greedy Algorithms.
1 More Applications of the Pumping Lemma. 2 The Pumping Lemma: Given a infinite regular language there exists an integer for any string with length we.
Cache Performance Analysis of Traversals and Random Accesses R. E. Ladner, J. D. Fix, and A. LaMarca Presented by Tomer Shiran.
Ecole Polytechnique, Nov 7, Online Job Scheduling Marek Chrobak University of California, Riverside.
Preference Analysis Joachim Giesen and Eva Schuberth May 24, 2006.
Equivalence Relations: Selected Exercises
Minimizing Cache Usage in Paging Alejandro Salinger University of Waterloo Joint work with Alex López-Ortiz.
The Fundamentals: Algorithms, Integers, and Matrices CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Methods of Proof & Proof Strategies
Introduction to Proofs
Reading and Writing Mathematical Proofs
Mathematical Induction. F(1) = 1; F(n+1) = F(n) + (2n+1) for n≥ F(n) n F(n) =n 2 for all n ≥ 1 Prove it!
Online Paging Algorithm By: Puneet C. Jain Bhaskar C. Chawda Yashu Gupta Supervisor: Dr. Naveen Garg, Dr. Kavitha Telikepalli.
Online Algorithms. Introduction An offline algorithm has a full information in advance so it can compute the optimal strategy to maximize its profit (minimize.
 2004 SDU Lecture 7- Minimum Spanning Tree-- Extension 1.Properties of Minimum Spanning Tree 2.Secondary Minimum Spanning Tree 3.Bottleneck.
Minimizing Cache Usage in Paging Alejandro López-Ortiz, Alejandro Salinger University of Waterloo.
Complexity 20-1 Complexity Andrei Bulatov Parallel Arithmetic.
Mathematical Induction
Defining Liveness by Bowen Alpern and Fred B. Schneider Presented by Joe Melnyk.
A Optimal On-line Algorithm for k Servers on Trees Author : Marek Chrobak Lawrence L. Larmore 報告人:羅正偉.
Chapter 8 Maximum Flows: Additional Topics All-Pairs Minimum Value Cut Problem  Given an undirected network G, find minimum value cut for all.
1 Chapter 5-1 Greedy Algorithms Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Fault tolerance and related issues in distributed computing Shmuel Zaks GSSI - Feb
Copyright © Zeph Grunschlag, Induction Zeph Grunschlag.
15.082J & 6.855J & ESD.78J September 30, 2010 The Label Correcting Algorithm.
5.1 Indirect Proof Objective: After studying this section, you will be able to write indirect proofs.
David Luebke 1 2/26/2016 CS 332: Algorithms Dynamic Programming.
Problem 3.2 Paging Algorithms-Time & Space Requirements Problem:What are the space and time requirements of LIFO, LFU, and LED? LRU:(least-recently-used):
 2004 SDU 1 Lecture5-Strongly Connected Components.
CSE 421 Algorithms Richard Anderson Lecture 8 Greedy Algorithms: Homework Scheduling and Optimal Caching.
CSE 5314 – Spring 2004 Homework #1 - Solutions [Soumya Sanyal] Q 1.5: Prove that the algorithm “MTF every-other-access” (i.e. move the item to the front.
Chapter 10 Mutual Exclusion Presented by Yisong Jiang.
Approximation Algorithms based on linear programming.
Sorting by placement and Shift Sergi Elizalde Peter Winkler By 資工四 B 周于荃.
 2004 SDU Uniquely Decodable Code 1.Related Notions 2.Determining UDC 3.Kraft Inequality.
Theory of Computational Complexity Probability and Computing Chapter Hikaru Inada Iwama and Ito lab M1.
Equivalence Relations: Selected Exercises
Math/CSE 1019C: Discrete Mathematics for Computer Science Fall 2012
Exercise 3.10 Prove Theorem 3.8 R(ALG) >= k(s+1)/(k+s) Solution:
Streaming & sampling.
Exercise Exercise Proof that
Chapter 5. Optimal Matchings
Greedy Algorithms / Caching Problem Yin Tat Lee
Richard Anderson Autumn 2015 Lecture 8 – Greedy Algorithms II
Greedy Algorithms: Homework Scheduling and Optimal Caching
Greedy Algorithms / Caching Problem Yin Tat Lee
Richard Anderson Winter 2019 Lecture 8 – Greedy Algorithms II
Richard Anderson Autumn 2016 Lecture 8 – Greedy Algorithms II
Exercise (11).
Exercise (10).
Equivalence Relations: Selected Exercises
THE WELL ORDERING PROPERTY
Richard Anderson Autumn 2019 Lecture 8 – Greedy Algorithms II
Presentation transcript:

CSE 5314 On-line Computation Homework 1 Wook Choi Feb/26/2004

Exercise 1.9 Prove Lemma 1.1 Lemma 1.1 (Pairwise Property lemma) An algorithm satisfies the pairwise property if and only if for every request σ, when ALG servers σ, the relative order of every two elements x and y in L is the same as their relative order in L xy when ALG servers σ xy Proof using the partial cost model which does consider only the cost from negative comparisons until a requested item is found in the list: Consider any request sequence σ = r 1, r 2,, …,r n for the list L. σ xy is defined to be σ after deletion of all the requests for items except for x and y where x, y  L (x ≠ y); L xy is the projection of the list L over x and y, thus having the same initial order as in L. For each x, and integer 1 ≤ j ≤ n, the penalty cost attributed to x is denoted by ALG (x,j) in accessing j th request, r j where: Let ALG * (σ xy ) and ALG xy * (σ) be the total cost for processing σ xy over L xy and σ over {x,y}  L, respectively. Since r j can be either x or y, ALG * (σ xy ) = ALG xy * (σ) = ALG (x,j) + ALG (y,j). Then, ALG satisfies pairwise property if ALG * (σ xy ) = ALG xy * (σ). Since the relative order of any two elements x and y  L is the same as their relative order in L xy, ALG(σ xy ) and ALG xy * (σ) are the same for all x and y pairs. For example, if r j = x, ALG * (σ xy ) = ALG xy * (σ) = and if r j = y, ALG * (σ xy ) = ALG xy * (σ) = 1 + 0, assuming that x is ahead of y. Therefore, Lemma 1.1 holds. if x is in front of r j otherwise (including x = r j )

Exercise 1.12 Prove that TIMESTAMP satisfies the pairwise property TIMESTAMP Algorithm ( each element x maintains 2 timestamps, Recent x and Previous y ) When an element x is accessed if Recent x = 0 then Recent x  current time /* first time request */ else Previous x  Recent x, Recent x  current time examine each item y preceding x from the front of the list if Previous y < Previous x then move x before such a first item y. end-if end-if Proof using Lemma 1.1 Consider two elements x and y in the list L. Let σ xy be a subsequence of σ including all occurrences of only x and y. Let L xy be a list containing only x and y in the same initial order as in L. If the timestamp algorithm is run on L xy with σ xy and {x, y}  L with σ, the relative order of x and y in L and L xy depends only on which of Previous x and Previous y is greater. Thus, if and only if x is requested more recently than y, x is moved before y in both lists, L and L xy which means the relative order of the two elements in L xy is the same as their relative order of x and y in the original list L. Therefore, according to Lemma 1.1, the timestamp algorithm satisfies the pairwise property.

Exercise 3.7 Show that algorithm FIFO is not a marking algorithm Proof by contradiction: Assume that FIFO is a marking algorithm for k-phase partition of any fixed sequence σ. Then FIFO should not evict any marked page during some k phase. Without a loss of generality, let’s consider a cache with k slots which are indexed by i, 1  i  k, in the order of placement into the cache. Now, suppose the first request of page x during a k-phase is the i th page in the cache. So, this first request is hit and page x is marked after the request is processed. Then, for any remaining k-1 page requests, page x should not be evicted. Let i = 1 and there are i page faults within remaining k-1 page requests. This makes FIFO evict page x before the end of the k-phase. This contradicts our hypothesis. Therefore, FIFO is not a marking algorithm. Marking algorithm Each page in memory is associated with a bit called its mark. A page is marked when it is first requested and a marking algorithm never evicts a marked page from its cache during k pages accesses.