Determining the nonnegative values

Assignment Help Business Economics
Reference no: EM131399698

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.

Reference no: EM131399698

Questions Cloud

Research the differences in implementing eigrp : Research the differences in implementing EIGRP in IPv4 and IPv6. Discuss the advantages of migrating EIGRP from IPv4 to IPv6. Describe the different CLI commands in implementing each protocol.
Describe the shape of the histogram : The variable TimeToNext is the time until the next eruption after the present eruption. Draw a histogram of this variable. Describe the shape of the histogram.
Describe the effects of the atomic bombs on hiroshima : Describe the effects of the atomic bombs on Hiroshima and Nagasaki.Please read attached "WWII" document and provide your thoughts. Please read attached "Atomic Bombing of Hiroshima Announcement" and provide your thoughts.
Determine the percentage of respondents : Determine the percentage of respondents who favor stronger gun control laws and the percentage of respondents who oppose stronger gun control laws.
Determining the nonnegative values : 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 ..
Design an adt that stores the side effects of various drugs : Design an ADT that stores the side effects of various drugs. Each drug should have a list of associated side effects. Provide a method that returns the side effects of a given drug. Then use a dictionary to implement the class DrugSideEffects.
Provides a description of contents of the strategy playbook : Review media piece Capstone Strategy Playbook for Exceptional Results: Description of the Playbook. This media piece provides a description of the contents of the Strategy Playbook, which was also a resource.
Draw a histogram of the data for the hrssleep variable : Draw a histogram of the data for the HrsSleep variable. Describe the shape of this histogram, and comment on any other interesting features of the data.
Draw a dotplot for the cds variable : Draw a stem-and-leaf plot for the CDs variable.- Draw a histogram for the CDs variable.- Draw a dotplot for the CDs variable.

Reviews

Write a Review

Business Economics Questions & Answers

  What happens to consumer surplus in the market for lemons

Suppose there is an early freeze in California that reduces the size of the lemon crop. What happens to consumer surplus in the market for lemons?

  Explain how an economy with a short­term equilibrium

Explain how an economy with a short­term equilibrium below the long­term equilibrium will adjust to bring the two into alignment. Explain how an economy with a short­term equilibrium above the long­term equilibrium will adjust to bring the two into a..

  Product profitability to focusing on customer profitability

How can we account for the upheaval in orientation from focusing on product profitability to focusing on customer profitability? If it's such a good idea, why didn't companies operate from the perspective of building customer value 50 years ago?

  Order to stabilize the level of gdp by managing money supply

Suppose that the Fed has decided that it should have an activist monetary policy in order to stabilize the level of GDP by managing the money supply. When the following events occur, show whether the Fed’s policy will actually stabilize GDP or not:

  Respect to the medical care sector

Every economy, as well as the medical care sector, must decide the following: what should be produced, how it should be produced, how it should be distributed, and how to allow growth and innovation. With respect to the medical care sector, how are t..

  Desert community wants to punish excessive water usage

Suppose the government of a desert community wants to punish excessive water usage, where "excessive" is defined as any usage greater than 100 gallons/week. to do this, the government paces a flat $100 income tax on anyone who consumes more than 100 ..

  Compensating wage differentials for unfavorable job

Some people have asserted that the concept of compensating wage differentials for unfavorable job characteristics cannot exist in industries in which union contracts force salaries and benefits to be the same across firms. If SUNY campuses were the o..

  Government involvement in the marketplace

Which of the following factors reduces the need for government involvement in the marketplace?

  What is your estimate of the cost to produce each unit

The following data has been provided by your manufacturing department to estimate the standard cost of producing a particular product. What is your estimate of the cost to produce each unit? If you company wishes to make a 20% of the manufacturing co..

  The federal reserve uses to conduct monetary policy

The main tool that the federal reserve uses to conduct monetary policy is

  Revenue functions independent variable is the output

Revenue Function's Independent Variable is the Output. Copy Rights are the Natural Monopoly. Water Supply is the Natural Monopoly. Cost Equation's Independent Variable is the Output. Marginal Revenue is the Price in all cases.

  The budget constraint is kinked for all of these reasons

In the two-period model, the budget constraint is kinked for all of these reasons, except. For a consumer not bound by the collateral constraint, an increase in the present value of the collateral leads to.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd