Question #85287

Prove or disprove the following: 

1. lg√n ∈ O(lg n) (√n means square root of n)

2. lg n ∈ O(lg√n) 

3. 2n+1 ∈ O(2n)


Expert's answer

Answer on Question #85287 - Programming & Computer Science - Algorithms

Question 85287:

Prove or disprove the following:

1. lognO(logn),(n\log \sqrt{n} \in O(\log n), (\sqrt{n} means square root of nn )

2. lognO(logn)\log n\in O\bigl (\log \sqrt{n}\bigr)

3. 2n+1O(2n)2n + 1 \in O(2n)

Answer:

Def.: f(n)=O(g(n))n0N,c0,nn0,f(n)cg(n)f(n) = O\big(g(n)\big) \Leftrightarrow \exists n_0 \in \mathbb{N}, \exists c \geq 0, \forall n \geq n_0, |f(n)| \leq c * g(n)

1. logn=1/2logn1logn,nN\left| \log \sqrt{n} \right| = \left| 1 / 2 \log n \right| \leq 1 * \log n, \forall n \in \mathbb{N}

2. logn=2logn4logn,nN|\log n| = \left|2\log \sqrt{n}\right|\leq 4*\log \sqrt{n},\forall n\in \mathbb{N}

3. 2n+12n+1<4n,nN|2n + 1| \leq |2n| + |1| < 4 * n, \forall n \in \mathbb{N}

Answer provided by https://www.assignmentexpert.com

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS