Comparing two Big O notations

45 Views Asked by At

Please, could you help me with the question below. Demonstrate that O(log n^k) = O(log n):

2

There are 2 best solutions below

0
On BEST ANSWER

Using properties of logs, log(n^k) can easily be transformed into klog(n). Then, because constant factors 'small out' as it were when using big O notation, O(klog(n))= O(log(n)).

Thus, O(log(n^k)) = O(klog(n)) = O(log(n)).

0
On

Hint. One may observe that $$ \log \left(n^k \right)=k\log \left(n \right). $$