Can I take log on both sides of inequality such way? f ( n ) &#x2264;<!-- ≤ -->

abbracciopj

abbracciopj

Answered question

2022-06-27

Can I take log on both sides of inequality such way?
f ( n ) c n k
and get
log ( f ( n ) ) k c log n
I know that by rules the result inequality should be like this
log ( f ( n ) ) log ( c n k )
but I read in book where inequality (1) in inequality (2) and want to know which way it was done
Edit: this is not general case, the questions relates to the algorithms and O-notation

Answer & Explanation

upornompe

upornompe

Beginner2022-06-28Added 20 answers

You can take the logarithm on both sides of the inequality, if you know the numbers are positive. This produces log ( f ( n ) ) log ( c n k )
However log ( c n k ) is not the same thing as k c log n, so your second inequality doesn't follow. What you do have is log ( c n k ) = log ( c ) + k log ( n ), so you can get
log ( f ( n ) ) log ( c ) + k log ( n )
Yahir Crane

Yahir Crane

Beginner2022-06-29Added 9 answers

yes you can since l o g is an increasing function and hence preserves the inequality. the main condition is that both sides lies in the domain of l o g i.e. they are positive
log ( f ( n ) ) log [ c n k ] = log c + log n k = log c + k log n
If c > 1 then log c > 0 and so
log ( f ( n ) ) k log n k c log n

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?