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

  A major statistics canada household survey

A major Statistics Canada household survey, the Survey of Labour and Income Dynamics or SLID, the latest of which is referred to as SLID 2009.

  Explain and demonstrate using the elasticity formula

Suppose that a 10% decrease in the price of a product has resulted in a 30% increase in the quantity demanded for a product. Is demand elastic or inelastic in this price range? Explain and demonstrate using the elasticity formula.

  What is the marginal cost per unit for the first units

A purely competitive firm finds that the market price for its product is $30.00. It has a fixed cost of $100.00 and a variable cost of $17.50 per unit for the first 50 units and then $35.00 per unit for all successive units. What is the average varia..

  Interest rates differ between two countries

If interest rates differ between two countries, it is an indication that the financial markets are not in equilibrium, and that investment flows should be taking place between the two countries. Agree? Disagree? Explain.

  Dansby-willig performance index-horizontal merger

Dansby-Willig Performance Index, horizontal merger, Herfindahl-Hirschman Index (HHI), Perfect competition, brand myopic, diseconomies of scale.

  Suppose an economy is in long-run equilibrium

Suppose an economy is in long-run equilibrium. The central bank raises the money supply by 5 percent. Use your diagram to show what happens to output and the price level as the economy moves from the initial to the new short-run equilibrium. What cau..

  What can you tell me about elmer preferences

Elmer Fudd likes to hunt “wabbits” but also likes to hunt duck. His utility function can be expressed as U(W,D)= 1/(-(2W^2+D^2 )^2 ). Write the tangency condition, what can you tell me about Elmer’s preferences? Suppose that the price of hunting Duck..

  Draw the market demand and market supply curves

You're given the following demand and supply tables: a. Calculate market demand and market supply. P D1 D2 D3 DMarket $30 20 5 10 40 15 3 7 50 10 0 5 60 5 0 0 P S1 S2 S3 SMarket $30 0 4 11 40 0 8 17 50 10 12 18 60 10 15 20 b. Draw the market demand a..

  Determine the book value of equipment for first six years

A company has acquired a paint booth (see prices). The anticipated life for the booth is 14 years but the company plans to depreciate it as a 7 year MARCS property (half year conversion). Determine the book value of the equipment for its first six ye..

  Same total amount of tax regardless of their income

As a result of U.S. tariffs imposed on wool from New Zealand, the quantity of this wool that is imported has.  Suppose everybody paid the same total amount of tax regardless of their income. This type of tax system would be. Assume that the governmen..

  Increase the money supply

The Fed wants to increase the money supply (which is currently 4,000) by 200. The money multiplier is 3. For each 1 percentage point the discount rate falls, banks borrow an additional 20. Explain how the Fed can achieve its goals using the following..

  Combined impact be on equilibrium price-quantity of gasoline

Suppose that a carbon tax is imposed and electric cars become common. What will the combined impact be on the equilibrium price and quantity of gasoline? Explain your reasoning and show graphically. Remember quantity falls, but change in price is ind..

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