HSR Help Karl Lieberherr 1/23/20111Asymptotic Growth.

Slides:



Advertisements
Similar presentations
Pareto Points Karl Lieberherr Slides from Peter Marwedel University of Dortmund.
Advertisements

EECS 4101/5101 Prof. Andy Mirzaian. Lists Move-to-Front Search Trees Binary Search Trees Multi-Way Search Trees B-trees Splay Trees Trees Red-Black.
Analysis of Algorithms
Scientific Community Game Karl Lieberherr 4/29/20151SCG.
 The running time of an algorithm as input size approaches infinity is called the asymptotic running time  We study different notations for asymptotic.
© The McGraw-Hill Companies, Inc., Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
Algorithms Recurrences. Definition – a recurrence is an equation or inequality that describes a function in terms of its value on smaller inputs Example.
Algorithms and Data Review Fall 2010 Karl Lieberherr 1CS 4800 Fall /7/2010.
1 ICS 353 Design and Analysis of Algorithms Spring Semester (062) King Fahd University of Petroleum & Minerals Information & Computer Science.
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
2 -1 Analysis of algorithms Best case: easiest Worst case Average case: hardest.
Data Structures, Spring 2004 © L. Joskowicz 1 Data Structures – LECTURE 3 Recurrence equations Formulating recurrence equations Solving recurrence equations.
Data Structures, Spring 2006 © L. Joskowicz 1 Data Structures – LECTURE 3 Recurrence equations Formulating recurrence equations Solving recurrence equations.
Addition מבנה המחשב + מבוא למחשבים ספרתיים תרגול 7#
Analysis of Recursive Algorithms
CHAPTER 2 ANALYSIS OF ALGORITHMS Part 2. 2 Running time of Basic operations Basic operations do not depend on the size of input, their running time is.
מבנה מחשבים תרגול מספר 4. Definition: A Boolean function f :{0,1} n  {0,1} is monotone if x  y  f (x)  f ( y) (where x  y means : for every i x i.
Design and Analysis of Algorithms Minimum Spanning trees
Minimum Spanning Trees
Analysis of Algorithms CS 477/677 Recurrences Instructor: George Bebis (Appendix A, Chapter 4)
February 17, 2015Applied Discrete Mathematics Week 3: Algorithms 1 Double Summations Table 2 in 4 th Edition: Section th Edition: Section th.
SCG Example Labs Ahmed Abdelmeged Karl Lieberherr.
by Chris Brown under Prof. Susan Rodger Duke University June 2012
Software Development Developing a MAX-CSP Solver Karl Lieberherr.
Analysis of Algorithms
Definitions Ahmed. Definition: A ranking function r is said to have the LimitedCollusionEffect (LCE) property if for any two arbitrary players px and.
The Selection Problem. 2 Median and Order Statistics In this section, we will study algorithms for finding the i th smallest element in a set of n elements.
Fundamentals CSE 373 Data Structures Lecture 5. 12/26/03Fundamentals - Lecture 52 Mathematical Background Today, we will review: ›Logs and exponents ›Series.
INTRODUCTION. What is an algorithm? What is a Problem?
Complexity 20-1 Complexity Andrei Bulatov Parallel Arithmetic.
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu Lecture 9.
Algorithm Analysis CS 400/600 – Data Structures. Algorithm Analysis2 Abstract Data Types Abstract Data Type (ADT): a definition for a data type solely.
NU ACM Talk Virtual Scientific Communities for Driving Innovation and Learning Karl Lieberherr joint work with Ahmed Abdelmeged and Bryan Chadwick 11/28/20151SCG.
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu Lecture 3.
4/24/2011Crowdsourcing1 Quantifier Game: Set of Playgrounds Claim: I can go at least as high as you. Claim: I can solve the Highest Safe Rung problem for.
NU ACM Talk Virtual Scientific Communities for Driving Innovation and Learning Karl Lieberherr joint work with Ahmed Abdelmeged and Bryan Chadwick 12/21/20151SCG.
The Algorithms we use to learn about Algorithms Karl Lieberherr Ahmed Abdelmeged 3/16/20111Open House 2011.
Lecture 14 Lower Bounds Decision tree model Linear-time reduction.
2/19/2016 Recurrences. 2/19/2016 Evaluating Run-time of Loops MergeSort(Array A) int n=A.length; int i=0; int t=1 for (t=1;t
BITS Pilani Pilani Campus Data Structure and Algorithms Design Dr. Maheswari Karthikeyan Lecture1.
Algorithm Analysis Lakshmish Ramaswamy. What Constitutes Good Software? Code correctness Good design Code reusability OO design can help us in achieving.
Lecture #3 Analysis of Recursive Algorithms
Algorithmic Foundations COMP108 COMP108 Algorithmic Foundations Algorithm efficiency Prudence Wong.
Dr Nazir A. Zafar Advanced Algorithms Analysis and Design Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar.
1 Section 5.1 Analyzing Algorithms Let P be a problem and A an algorithm to solve P. The running time of A can be analyzed by counting the number of certain.
EXAMPLE FORMULA DEFINITION 1.
Theoretical analysis of time efficiency
Analysis of Algorithms CS 477/677
Applied Discrete Mathematics Week 2: Functions and Sequences
COMP108 Algorithmic Foundations Algorithm efficiency
Randomized Algorithm (Lecture 2: Randomized Min_Cut)
CS 3343: Analysis of Algorithms
Analysis of algorithms
Outline Introducing perfect binary trees Definitions and examples
Time Complexity Analysis Neil Tang 01/19/2010
Algorithm Analysis Neil Tang 01/22/2008
CS 3343: Analysis of Algorithms
Use Pascal’s triangle to expand the expression (3 x - 2 y) 3
Advance Analysis of Lecture No 9 Institute of Southern Punjab Multan
CS 3343: Analysis of Algorithms
Linear Sorting Sorting in O(n) Jeff Chastine.
Approximation Algorithms
Analysis of Algorithms
Print the following triangle, using nested loops
At the end of this session, learner will be able to:
Analysis of algorithms
Chapter 8: Overview Comparison sorts: algorithms that sort sequences by comparing the value of elements Prove that the number of comparison required to.
Table Lookup Illustrated with Product Stress Testing
Maximum Bipartite Matching
Presentation transcript:

HSR Help Karl Lieberherr 1/23/20111Asymptotic Growth

HSR Asymptotic Growth jars to break: k 0 1 questions asked: q M: maximum number of rungs n rungs: 0,1,2,3, …,n-1 1/23/20112Asymptotic Growth

HSR Asymptotic Growth jars to break: k 0 1 questions asked: q M: maximum number of rungs n rungs: 0,1,2,3, …,n-1 1/23/20113Asymptotic Growth

HSR Asymptotic Growth jars to break: k 0 1 questions asked: q M: maximum number of rungs n rungs: 0,1,2,3, …,n-1 1/23/20114Asymptotic Growth

HSR Asymptotic Growth jars to break: k 0 1 questions asked: q M: maximum number of rungs n rungs: 0,1,2,3, …,n /23/20115Asymptotic Growth

HSR Asymptotic Growth jars to break: k 0 1 questions asked: q M: maximum number of rungs n rungs: 0,1,2,3, …,n /23/20116Asymptotic Growth

HSR Asymptotic Growth jars to break: k 0 1 questions asked: q M: maximum number of rungs n rungs: 0,1,2,3, …,n-1 1/23/20117Asymptotic Growth

Magic for now * * * * * * * HSR(11,2)=4 M(2,4)=11 * * * HSR(7,2)=3 M(2,3)=7 HSR(4,1)=3 M(1,3)=4 HSR(4,2)=2 M(2,2)=4 HSR(3,1)=2, M(1,2)=3 1/23/20118Asymptotic Growth

* ** ** * * 40* ** *******8**** * ***** * HSR(11,2)=4 M(2,4)=11 M(k,q)=n 4 choose 2 = 6 4 choose 1 = 4 4 choose 0 = 1 11 = sum= M(2,4) Claim: For all k,q (k<=q): M(k,q) = Sum[i=0 to k](q choose i) 1/23/20119Asymptotic Growth

HSR Question jars to break: k 0 1 questions asked: q M: maximum number of rungs n rungs: 0,1,2,3, …,n-1 1/23/201110Asymptotic Growth

Definition of M recurrence: M(k,q) = M(k-1,q-1) + M(k,q-1) M(0,q) = 1 M(k,k) = 2 k M(0,q): 0 jars to break M(k,k): k jars to break and q=k questions to ask: use binary search. 1/23/201111Asymptotic Growth

M = SF M ~ Modified Pascal SF ~ Sum Formula M(k,q)) = M(k-1,q-1) + M(k,q-1) M(0,q) = 1 M(q, q) = 2^q SF(k,q) = Sum[i=0 to k](q choose i) in Theta(q^k) SF has the following properties: (1) SF(0,q) = q choose 0 = 1 = M(0,q) (2) SF(q, q) = Sum[i=0 to q] q choose i = 2^q = M(q, q) (3) SF(k, q) = SF(k-1, q-1) + SF(k,q-1) 1/23/201112Asymptotic Growth

3rd property (Ahmed) SF(X-1, Y-1) + SF(X-1, Y) = Sum[i=0 to Y-1] X-1 choose i + Sum[i=0 to Y] X-1 choose i = Sum[i=0 to Y-1] X-1 choose i + Sum[i=1 to Y] X-1 choose i + X-1 choose 0 = Sum[i=0 to Y-1] X-1 choose i + Sum[i=0 to Y-1] X-1 choose (i+1) + 1 = Sum[i=0 to Y-1] ( X-1 choose i + X-1 choose (i+1) ) + 1 = Sum[i=0 to Y-1] ( X choose (i+1) ) + 1 = Sum[i=0 to Y-1] ( X choose (i+1) ) + X choose 0 = Sum[i=1 to Y] ( X choose i ) + X choose 0 = Sum[i=0 to Y] ( X choose i ) = SF(X, Y) Therefore, SF(X,Y) = M(X,Y). X=q,Y=k, switch X and Y 1/23/201113Asymptotic Growth

HSR Asymptotic Growth jars to break: k 0 1 questions asked: q M: maximum number of rungs n rungs: 0,1,2,3, …,n-1 1/23/201114Asymptotic Growth

HSR Asymptotic Growth jars to break: k 0 1 questions asked: q M: maximum number of rungs n rungs: 0,1,2,3, …,n-1 1/23/201115Asymptotic Growth

HSR Asymptotic Growth jars to break: k 0 1 questions asked: q M: maximum number of rungs n rungs: 0,1,2,3, …,n-1 1/23/201116Asymptotic Growth

HSR Asymptotic Growth jars to break: k 0 1 questions asked: q M: maximum number of rungs n rungs: 0,1,2,3, …,n /23/201117Asymptotic Growth

HSR Asymptotic Growth jars to break: k 0 1 questions asked: q M: maximum number of rungs n rungs: 0,1,2,3, …,n /23/201118Asymptotic Growth

HSR Iterative jars to break: k 0 1 questions asked: q M: maximum number of rungs n rungs: 0,1,2,3, …,n-1 1/23/201119Asymptotic Growth b c 1 b+1 b+1+c

What is the running time of our decision tree construction algorithm? Input: (n,k), k<=n Output: decision tree of minimum depth that correctly determines the highest safe rung for a ladder with rungs 0..n-1 and k jars to break. Algorithm: – Construct slice of modified Pascal Triangle – Determine tree structure from Pascal Triangle – Fill in rung questions internal to tree What is its asymptotic running time? 1/23/2011Asymptotic Growth20

Claim Alice claims: she can construct DT(n,k) in time O(f(n,k)). Express bound as a function of output size. 1/23/2011Asymptotic Growth21