# HW1 solns.pdf - Homework 1: Solutions ORIE 4520:...

• Xenocygne2
• 7

This preview shows page 1 - 3 out of 7 pages.

ORIE 4520: Stochastics at ScaleFall 2015Homework 1: SolutionsSid Banerjee ([email protected])Problem 1: (Practice with Asymptotic Notation)An essential requirement for understanding scaling behavior is comfort with asymptotic (or ‘big-O’)notation. In this problem, you will prove some basic facts about such asymptotics.Part (a)Given any two functionsf(·) andg(·), show thatf(n) +g(n) = Θ(max{f(n), g(n)}).
Part (b)An algorithmALGconsists of twotunablesub-algorithmsALGAandALGB, which have to beexecuted serially (i.e., one run ofALGinvolves first executingALGAfollowed byALGB). Moreover,given any functionf(n), we can tune the two algorithms such that one run ofALGAtakes timeO(f(n)) andALGBtakes timeO(n/f(n)). How should we choosefto minimize the overall runtimeof ALG (i.e., to ensure the runtime of ALG isO(h(n)) for the smallest-growing functionh)?How would your answer change ifALGAandALGBcould be executed in parallel, and we haveto wait for both to finish?
Part (c)We are given a recursive algorithm which, given an input of sizen, splits it into 2 problems of sizen/2, solves each recursively, and then combines the two parts in timeO(n). Thus, ifT(n) denotesthe runtime for the algorithm on an input of sizen, then we have:T(n) = 2T(n/2) +O(n)Prove thatT(n) =O(nlogn).1
ORIE 4520: Stochastics at ScaleFall 2015Homework 1: SolutionsSid Banerjee ([email protected])Hint: Note that for a constant size input, the algorithm takesO(1)time.How many recursionsdoes it require to reduce a problem of sizento constant size subproblems? What is the total runtimeoverhead at each recursive level?

Course Hero member to access this document

Course Hero member to access this document

End of preview. Want to read all 7 pages?

Course Hero member to access this document

Term
Summer
Professor
NoProfessor
Tags
Probability theory, Sid Banerjee