Let w(n) and A(n) denote respectively, the worst case and average case running time of an algorithm executed on an input of size n. which of the following is ALWAYS TRUE?

A. A(n)= Ω W(n) B. A(n)= O W(n) C. A(n)= Ѳ W(n) D. A(n)= o W(n)

  1. A(n) = $\omega$ W(n)

  2. A(n) = $O$ W(n)

  3. A(n) = $\theta$ W(n)

  4. A(n) = o W(n)


Correct Option: B

AI Explanation

To determine the relationship between the worst case running time (W(n)) and average case running time (A(n)) of an algorithm, we need to understand the Big O notation, Omega notation, Theta notation, and little o notation.

Big O notation (O) represents an upper bound on the running time of an algorithm. It gives an estimate of the worst-case scenario or the maximum amount of time an algorithm will take to complete.

Omega notation (Ω) represents a lower bound on the running time. It gives an estimate of the best-case scenario or the minimum amount of time an algorithm will take to complete.

Theta notation (Ѳ) represents both an upper and lower bound on the running time. It provides a tight estimate of the running time of an algorithm.

Little o notation (o) represents an upper bound that is not tight. It indicates that the running time of an algorithm is strictly smaller than the function it is compared to.

Now let's analyze each option:

Option A) A(n) = Ω W(n) - This option states that the average case running time is a lower bound on the worst-case running time. This statement is not always true because the average case running time can be better or worse than the worst-case running time. Therefore, Option A is incorrect.

Option B) A(n) = O W(n) - This option states that the average case running time is an upper bound on the worst-case running time. This statement is always true because the average case running time cannot be worse than the worst-case running time. Therefore, Option B is correct.

Option C) A(n) = Ѳ W(n) - This option states that the average case running time is both an upper and lower bound on the worst-case running time. This statement is not always true because the average case running time can differ from the worst-case running time. Therefore, Option C is incorrect.

Option D) A(n) = o W(n) - This option states that the average case running time is strictly smaller than the worst-case running time. This statement is not always true because the average case running time can be equal to or greater than the worst-case running time. Therefore, Option D is incorrect.

Therefore, the correct answer is Option B) A(n) = O W(n). This option is always true because the average case running time cannot be worse than the worst-case running time.

Find more quizzes: