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

  Economics assignment

This document contains various important questions and their appropriate answers in the subject field of Economics.

  Demand and supply curves

Economics is the study of the principles governing the allocation of scarce means among competing ends when the objective of the allocation is to maximize the attainment of the ends.

  Long-run perfectly competitive equilibrium for the firm

Evaluate Government intervene and correct this situation?(a) Explain the concept of a concentration ratio. A rise in the price of magarine Explain the impact of external costs and external benefits on resource allocation long-run perfectly c..

  Supply and demand diagrams

Explain each of the following using supply and demand diagrams,  With the use of a graph, explain how these two programs affect cigarette consumption and the price of cigarettes.

  Case study: fisher-price toys

The case study of the Fisher-Price Toys, Inc., a popular case in basic economics and management from the prestigious Harvard Business School.

  Draw the production possibility curve

Draw the production possibility curve and a. Define consumer surplus and producer surplus.

  Tax revenue

The Australian government administers two programs that affect the market for cigarettes

  Maximize total welfare

How many tickets to sell to maximize total welfare.

  Difference between the cv and the ev

The change in consumer surplus (?CS) is not "theoretically" justifiable like the CV and EV but it continues to be the most widely used measure of consumer welfare change. Explain how this can be reconciled

  Depict von neumann-morgenstern utility index u in a diagram

Depict the von Neumann-Morgenstern utility index u in a diagram

  What is the market solution

What is the market solution (market price and quantity) and What is the total surplus of the society under the market solution

  Calculate gross national product and net national product

Calculate gross national product and net national product

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