67.2k views
1 vote
The number of operations executed by algorithms A an B is 40n² and 2n³, respectively. Determine the n₀ such that A is better than B for n>= n₀.

a.value of no must be 0
b.value of no must be greater than or equal to 10
c.value of no must be greater than or equal to 20
d.value of n0 must be less than or equal to 20

1 Answer

1 vote

Final answer:

Therefore, the correct option is:

c.value of no must be greater than or equal to 20

To determine the value of n₀ at which algorithm A becomes better than algorithm B, we compare the number of operations executed by both algorithms. Algorithm A is better than B for values of n greater than or equal to 20.

Step-by-step explanation:

To determine the value of n₀ such that algorithm A is better than algorithm B for n >= n₀, we need to compare the number of operations executed by both algorithms. Algorithm A has 40n² operations and algorithm B has 2n³ operations. We want to find the value of n at which A becomes better than B, meaning that the number of operations executed by A is smaller than the number of operations executed by B. So we can set up the following inequality:

40n² < 2n³

To solve this inequality, we can divide both sides by n², since n cannot be 0 (otherwise the inequality would not make sense):

40 < 2n

Dividing both sides by 2 gives:

20 < n

This means that A is better than B for values of n greater than 20. Therefore, the value of n₀ must be greater than or equal to 20.

User Isaac Moses
by
7.8k points