Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2.3 EXPAND Define the median of a collection of N distinct comparable elements to be an element v from that collection that is larger than

image text in transcribed
image text in transcribed
image text in transcribed
2.3 EXPAND Define the median of a collection of N distinct comparable elements to be an element v from that collection that is larger than exactly [N/2] (or equivalently, smaller than exactly [N/21 - 1) other elements from the same collection. Consider the problem of finding the median of the elements in two sorted lists of sizes m and n (not necessarily equal), respectively. (1 point) 1. Express this problem formally (unique name, input conditions, output conditions). (1+1 points) 2. (a) Describe a simple algorithm to compute that median. (b) Find its tight (Big-Theta) asymptotically complexity as a function of the total number of elements. (2+1 points) 3. (a) Show how you can use the medians of the two lists to reduce an instance of this problem to smaller sub-instances. (b) State a precise self-reduction for this problem, (1+2+1 points) 4. (a) State a recursive algorithm that solves the problem based on your reduction. (b) For the special case when m = 1, obtain from it a recurrence expressing its running time as a function of n. (c) Solve the recurrence and find a tight (Big-Theta) asymptotic bound on the complexity in the worst case. 2.3 EXPAND Define the median of a collection of N distinct comparable elements to be an element v from that collection that is larger than exactly [N/2) (or, equivalently, smaller than exactly [N/21 - 1) other elements from the same collection. Consider the problem of finding the median of the elements in two sorted lists of sizes m and n (not necessarily equal), respectively. (1 point) 1. Express this problem formally (unique name, input conditions, output conditions). (1+1 points) 2. (a) Describe a simple algorithm to compute that median. (b) Find its tight (Big-Theta) asymptotically complexity as a function of the total number of elements. (2+1 points) 3. (a) Show how you can use the medians of the two lists to reduce an instance of this problem to smaller sub-instances. (b) State a precise self-reduction for this problem, (142+1 points) 4. (a) State a recursive algorithm that solves the problem based on your reduction. (b) Por the special case when m = 1, obtain from it a recurrence expressing its running time as a function of n. (c) Solve the recurrence and find a tight (Big-Theta) asymptotic bound on the complexity in the worst case. Mike Rowe is the President, CEO, and only employee of MikeRoweSoft Corporation. He is working on a project to compute Fibonacci numbers, defined by the properties F = 0, F1=1, and FR = Fn-1 +F-2 for n>1. Mike conjectures that Fibonacci numbers satisfy the intriguing property F = FF-1-1+ F F -for all n > m 20. From this conjectured property, he derives the following self- reduction to compute a pair of successive Fibonacci numbers (F2n-1, F2) given the prior pair of successive Fibonacci numbers (F-1,F), for n> 1: F2-1 = - + F = (2F:-1 +F.FR Now he believes this self-reduction provides a better way than the usual (n) algorithm to compute F. However, he has not taken TCSS 343, and hence he has so far been unable to prove his conjecture correct and his algorithm to be better than en). (2 points) 1. Prove that Mike's conjectured property is correct. (Hint: try induction) (1 point) 1. Write an algorithm to compute (F:-1,F) for any n> 1 based on the above self-reduction. (2 points) 1. Find the tight (Big-Theta) asymptotic complexity of this algorithm and show that it indeed beats the usual linear-time method to compute Fibonacci numbers. 2.3 EXPAND Define the median of a collection of N distinct comparable elements to be an element v from that collection that is larger than exactly [N/2] (or equivalently, smaller than exactly [N/21 - 1) other elements from the same collection. Consider the problem of finding the median of the elements in two sorted lists of sizes m and n (not necessarily equal), respectively. (1 point) 1. Express this problem formally (unique name, input conditions, output conditions). (1+1 points) 2. (a) Describe a simple algorithm to compute that median. (b) Find its tight (Big-Theta) asymptotically complexity as a function of the total number of elements. (2+1 points) 3. (a) Show how you can use the medians of the two lists to reduce an instance of this problem to smaller sub-instances. (b) State a precise self-reduction for this problem, (1+2+1 points) 4. (a) State a recursive algorithm that solves the problem based on your reduction. (b) For the special case when m = 1, obtain from it a recurrence expressing its running time as a function of n. (c) Solve the recurrence and find a tight (Big-Theta) asymptotic bound on the complexity in the worst case. 2.3 EXPAND Define the median of a collection of N distinct comparable elements to be an element v from that collection that is larger than exactly [N/2) (or, equivalently, smaller than exactly [N/21 - 1) other elements from the same collection. Consider the problem of finding the median of the elements in two sorted lists of sizes m and n (not necessarily equal), respectively. (1 point) 1. Express this problem formally (unique name, input conditions, output conditions). (1+1 points) 2. (a) Describe a simple algorithm to compute that median. (b) Find its tight (Big-Theta) asymptotically complexity as a function of the total number of elements. (2+1 points) 3. (a) Show how you can use the medians of the two lists to reduce an instance of this problem to smaller sub-instances. (b) State a precise self-reduction for this problem, (142+1 points) 4. (a) State a recursive algorithm that solves the problem based on your reduction. (b) Por the special case when m = 1, obtain from it a recurrence expressing its running time as a function of n. (c) Solve the recurrence and find a tight (Big-Theta) asymptotic bound on the complexity in the worst case. Mike Rowe is the President, CEO, and only employee of MikeRoweSoft Corporation. He is working on a project to compute Fibonacci numbers, defined by the properties F = 0, F1=1, and FR = Fn-1 +F-2 for n>1. Mike conjectures that Fibonacci numbers satisfy the intriguing property F = FF-1-1+ F F -for all n > m 20. From this conjectured property, he derives the following self- reduction to compute a pair of successive Fibonacci numbers (F2n-1, F2) given the prior pair of successive Fibonacci numbers (F-1,F), for n> 1: F2-1 = - + F = (2F:-1 +F.FR Now he believes this self-reduction provides a better way than the usual (n) algorithm to compute F. However, he has not taken TCSS 343, and hence he has so far been unable to prove his conjecture correct and his algorithm to be better than en). (2 points) 1. Prove that Mike's conjectured property is correct. (Hint: try induction) (1 point) 1. Write an algorithm to compute (F:-1,F) for any n> 1 based on the above self-reduction. (2 points) 1. Find the tight (Big-Theta) asymptotic complexity of this algorithm and show that it indeed beats the usual linear-time method to compute Fibonacci numbers

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions

Question

=+5. What is your impression of the Carbon Principles?

Answered: 1 week ago

Question

What are the different techniques used in decision making?

Answered: 1 week ago