Você está na página 1de 4

A LGORITHMS & DATA S TRUCTURES

INF1 2003

Tutorial 3
Exercise 1
Let , such that , be the maximum of . Then the probabilities satisfy

and recall that


Exercise 2
We shall solve the following recurrence equation

for by repeated substitutions. Let us unfold . Observe the pattern for . So if then

Proof: by induction on n we show that . In the base case and as required. Let . By IH (induction hypothesis) assume . Now that for all

(by denition)

(by IH)

Exercise 3
We shall solve the following recurrence equation

for by repeated substitutions. Let us unfold . Observe the pattern for


. So if

then

Proof: by induction on n we show that as required. Let . By IH (induction hypothesis) assume that for all . Now

. In the base case and


(by denition) 1

(by IH)

A LGORITHMS & DATA S TRUCTURES

INF1 2003

Exercise 4
Let be the size of the array, i.e., and assume that . Then and for . Let us reformulate the recurrence equation . such that we consider only the points where for some integer . Hence we shall Let . Observe that solve the following recurrence equation

for . by repeated substitutions. Let us unfold . Observe the pattern for . So if then However, implies that . So . . In the base case Proof: by induction on k we show that and (by denition) as required. Let . By IH (induction for all . Now hypothesis) assume that (by denition) (by IH)

Exercise 5

Exercise 6
a) Let us x and , then for all . Another possibility and because for all . The validity of is e.g. the second case can be proved by induction. In the basic step we have to check which is true. For the inductive step let and by IH we that . We want to show that , which assume that is true because

(by IH) , then

b) Let us x e.g. and Why and how did we nd it?

for every

A LGORITHMS & DATA S TRUCTURES

INF1 2003

c) Let and . Then for all . The argument for why is a little bit more difcult this time and we will prove it by induction on . For the base case (n=100) we have calculator if you want to :-)). Let

which is true (check this on a

and we assume by IH that


. We aim to show that


(1)

In order to do that we will in fact prove a stronger claim

If we succeed to show this then by IH

(2)

To nish the proof we will now argue that (2) is true for all . To prove is the same as to prove (both sides are non-negative), which is the same as , which is the same as , which is the same as , which is the same , which is obviously true for all because . as d) Let us x. e.g. .

inequality (1) is also proven.

, and the

and

, then

for all

e) First we show that

for all . Next we have to show that is . Let and for all . immediately implies that

is . Let

and . Then

which

Exercise 7

(!!! but also e.g. , these are not optimal estimates)

and

even if

(and we usually write only since the base of the logarithm is irrelevant for the -notation as proved during the lecture) The argument for this is the following:

A LGORITHMS & DATA S TRUCTURES

INF1 2003

Exercise 8
It is true that is but is not . Hence is not .

Exercise 9
Assume that and which means that there are natural numbers and , and real numbers and such that

for all and for all . and Let us dene for all and hence .

, which implies that

Você também pode gostar