Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Business Economics Expert

Consider the following recurrence for a function T that takes on nonnegative values and is defined on integers ≥ 1:T(n) ≤ 5 if 1 ≤ n  ≤ 4 or ≤T(7n/10) + T(n/5) + 3n if n > 4. Prove that T(n) is O(n). You should present a particular constant c and prove that T(n) ≤ c · n for all n ≥ 1.

Motivation: This recurrence actually comes up in the following situation. Say we wish to find the median of n distinct elements, using as few comparisons as possible. Recall that the median is an element with rank the floor of n/2 .More generally, say we wish to find the k-th smallest of n elements. We could sort the n numbers but this takes about n log n comparisons. Instead we do the following which, by the theorem proven in this question, uses O(n) comparisons:

Divide the elements up into groups of 5 (don't worry now about what to do if n isn't divisible by 5); find themedian of each group of 5, using a linear in n number of comparisons in total. This gives us about n/5 median points. Recursively find the median of these median points using about T(n/5) comparisons; call this element b. Using a linear in n number of comparisons, compare every element to b; let S1 be the set of elements ≤ b, and let S2 be the set of elements > b. Because of the way b was chosen, each of S1 and S2 must have at most 7n/10 elements.If k ≤ |S1|, then recursively find the k-th smallest element of S1, otherwise recursively find the (k - |S1|)-th smallest element of S2; this takes at most T(7n/10) comparisons.

Business Economics, Economics

  • Category:- Business Economics
  • Reference No.:- M92209506
  • Price:- $15

Priced at Now at $15, Verified Solution

Have any Question?


Related Questions in Business Economics

In 2009 the hershey company of pennsylvania became the

In 2009, the hershey company of pennsylvania became the latest company to open a candy factory in mexico, joining other american candy companies including brach's confections and ferrara pan candy, which had opened plans ...

The equation used to predict how long a cold will last is

The equation used to predict how long a cold will last is y=-1.8 + 0.09x1 + 3.2x2 - 1.9x3, where x1 is person's temperature on the first day, x2 is number of people seen each day, and x3 is the amount of sleep the person ...

What p-value was found when determining whether there is a

What P-value was found when determining whether there is a difference in the IQ of girls and boys in problem 6? Should you reject the null hypothesis? 1. P-Value = 0.465. Yes, you should reject the null hypothesis which ...

Research scenarionbspa social psychologist is interested in

Research Scenario:  A social psychologist is interested in whether the number of days spent in a refugee camp predicts trauma levels in recently resettled refugees. He interviews 17 refugees to determine how many days th ...

Trans-pacific partnership tppa what are the economic

Trans-Pacific Partnership (TPP) A. What are the economic implications? Provide a credible citation. B. What possible impact could this event have on global trade? Provide a credible citation. C. What is President Trump's ...

Tom works for a fruit company and found that the weights of

Tom works for a fruit company and found that the weights of pineapples are normally distributed with mean = 500 grams and standard deviation = 100 grams. a. If he randomly chooses 16 pineapples and measures their weights ...

Four balls are independently projected onto one target the

Four balls are independently projected onto one target, the probability of a hit for each is P1 = 0.1 , P2 = 0.2 , P3 = 0.3 , P4 = 0.4. What are the probabilities P04, P14, P24, P34, P44 that zero, one (1), two (2), thre ...

Each of 30 teams in a league has a demand for generic

Each of 30 teams in a league has a demand for generic advertising of Q = 260 - 4P. Price is measured in thousands of dollars. Ads cost $510,000 each. How many ads will the teams want to purchase as a group?

This weekend martha has time to read 40pages of economics

This weekend, Martha has time to read 40pages of economics and 30pages of sociology. Alternatively, she could read 10pages of economics and 90pages of sociology. Which of these equations describes all combinations of pag ...

A study claims that 77 of children under the age of 13 in

A study claims that 77 % of children under the age of 13 in British Columbia have been vaccinated from the chicken pox. A survey of randomly selected residents of a certain city included 652 children who were under the a ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As