Machine-translated by Google. Questions are authored in English.
Top

Discussion

Consider the following functions, where \(n\) is a positive integer.

\(n^{1/3}\), \(\log(n)\), \(\log(n!)\), \(2^{\log(n)}\)

Which one of the following options lists the functions in increasing order of asymptotic growth rate?

Note: Assume the base of log to be 2.

  • A.\(\log(n)\), \(n^{1/3}\), \(2^{\log(n)}\), \(\log(n!)\)
  • B.\(n^{1/3}\), \(\log(n)\), \(\log(n!)\), \(2^{\log(n)}\)
  • C.\(\log(n)\), \(n^{1/3}\), \(\log(n!)\), \(2^{\log(n)}\)
  • D.\(2^{\log(n)}\), \(n^{1/3}\), \(\log(n)\), \(\log(n!)\)

Answer: A

The increasing order is \(\log(n)\), \(n^{1/3}\), \(2^{\log(n)}\), \(\log(n!)\).

Simplify each function first:

  • log(n) grows more slowly than any positive power of n;
  • n1/3 is a polynomial of degree 1/3;
  • 2log n with base-2 logarithms is exactly n;
  • log(n!) is Θ(n log n) by Stirling's approximation.

So the order is log n, n1/3, n, n log n. An order that puts n1/3 below log n reverses the rule that every power beats a logarithm. Putting 2log n first misses that it equals n, and putting it last ranks n above n log n.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.