Logarithms and big O notation

767 Views Asked by At

Recall the equivalence: $$m=2^k \implies k=log_2m$$ (a) Consider the sequence: $a_1=1, a_{k+1}=2a_k$ what is the smallest k for which $a_k \geq n$? Your answer should be a function of n, and you can leave it in big-O notation.

(b) Consider the sequence: $a_1=2, a_{k+1}=a_k^2$ what is the smallest k for which $a_k \geq n$? Your answer should be a function of n, and you can leave it in big-O notation.


i am totally confused about this question, can someone please walk me through this problem or give me a nudge in the right direction, (also where does the n come from?)

1

There are 1 best solutions below

4
On

$n$ is just another variable.

This is really just a compound problem: you need to break it into parts and solve the parts.

For example, one part of the first problem could be

Find a formula for the general term of the sequence given by $a_1 = 1$, $a_{u+1}=2a_u$

(I changed the dummy variable because it doesn't matter, but it might help eliminate confusion between this part and the rest of the problem)

(I say 'could be', because this is just one approach to the problem)