IAE Academy

ISRO CS 2023 Q.24: solution and answer

ISRO 2023 · CSQ.24 · 1 mark · MCQ

The asymptotic complexity of 4 functions f1, f2, f3, f4 are
f1(n) = 2^n
f2(n) = n^(3/2)
f3(n) = n log n
f4(n) = n^(log n)
Arrange them in increasing order of complexity.

  1. (A)

    f2, f3, f4, f1

  2. (B)

    f1, f2, f3, f4

  3. (C)

    f3, f2, f4, f1

  4. (D)

    f3, f1, f2, f4

See the question in the paper

Answer and solution

ANSWER

The increasing order is , which is option (c).

Official answer: CSource: ISRO's revised and final answer key of 16 February 2024

  1. Compare with . Divide both by : against . A logarithm grows slower than any positive power of , so . Hence .

  2. Compare with . The exponent eventually exceeds and keeps growing, while is constant. So . Hence .

  3. Compare with by taking logarithms (base 2): and . Since , we get .

  4. Combining: , that is .

  5. Check the options: (a) puts before , which is wrong. (b) puts the exponential first, which is wrong. (d) puts before and , which is wrong. Only (c) matches the order .

KEY IDEA

Compare growth rates by dividing out common factors or by taking logarithms: is smaller than any power , a function is super-polynomial but still below because .

WATCH OUT FOR

Treating as a polynomial and placing it below , or treating it as exponential and placing it above . Its exponent grows without bound, so it beats every fixed power of , yet its logarithm is far smaller than .

From the ISRO CS 2023 paper. Every question of this paper · The full paper (PDF, ISRO) · All 2 ISRO Complexity questions, with notes