Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

example of subsitution method format with solution: note: it is VERY IMPORTANT to find n 0 and c, by the definition of big o: 1.

image text in transcribed

example of subsitution method format

image text in transcribed

with solution:

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

note: it is VERY IMPORTANT to find n0 and c, by the definition of big o:

image text in transcribed

1. (15 pts) For the following recurrence, T(n) = 0 n = 1 T(n) = 4T(n-1) + c n>1 b. Use the substitution method to prove your above solution is correct. Show your work in sufficient details. Solving Recurrences with the Substitution Method (two steps): o Guess a solution Show the solution is correct by inductive proof. 1. Solve T(n) = c for n = 1 and T(n) = 2T(n/2) + cn for n> 1 using substitution. Guess: T(n) = O(nlgn). (We want to make a good guess - Is it a good guess?) Proof by Induction: 1) Goal: 2) Inductive Proof: Inductive Hypo: So far the restrictions (on C and no) are: 3) Base case: C n=1 TN-3 nal ten const Gws. T (n)= 0 (nlan2 There exists Some c'>o, nool for all na no TnEchlan show. n=no Bare care no no. @inductine Step: for @indutine step: Assume, holds for Smaller n (Stay Strong induting C C n=1 n> T(n)= 12T (AL) + en 1) Make a greens (through () 0 (nigh) the haurien tree). .S 2) show the quers That is show, 3c 20, noo, st. for au no no, T(n) = c'nign the the inductive Proof to show this -Induction Step T(A) Assume it holds for / That is Thus T(A) = c'h lg (hypo ) (n) = 21 (44) + cn (substitution) tch light on = c'h (Igh - lg ) = c'ncign-1) +on =c'algfcnten crigny 0 @? ( let -cntcn co casca we have c'>c That means if let c's C, nos T(n) = c'high" no So far, the restrictions on C and are c'>c, noI F let's verify whether Toh) = chign for n=1 Bare come and the values for cand no TUO =C, nos I No! ! verity for n=2 T(2) = 2T (1) + en = 2C +2C 2 = 40 s c'alg? That is A c pc ' 202C 2 cac Combining the two steps we can have let c'72c, no 32 T(n) = c'nlign we can have T(n) C'nign. That is th) = 0 (nigh) O-notation For function g(n), we define (g(n)), big-O of n, as the set: cgin) O(g(n)) = {f(n) : There exist positive constants c and no such that Vn2 no. we have 0 = f(n)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

Explain five common myths regarding entrepreneurship.

Answered: 1 week ago

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago