31.0k views
3 votes
Which proof technique is commonly used to show that a greedy algorithm is not optimal?

a) Greedy stays ahead
b) Counterexample
c) Contradiction
d) Induction

User Mangooxx
by
8.4k points

1 Answer

3 votes

Final answer:

The contradiction proof technique is commonly used to show that a greedy algorithm is not optimal.

Step-by-step explanation:

The correct answer is c) Contradiction. A contradiction proof technique is commonly used to show that a greedy algorithm is not optimal. This involves assuming that the greedy algorithm is optimal, and then using logical reasoning to demonstrate that this assumption leads to a contradiction or a counterexample.

For example, let's consider a scenario where a greedy algorithm is used to solve a scheduling problem. If we can find a counterexample or scenario where the greedy algorithm does not produce the optimal solution, we can prove that the algorithm is not optimal.

Contradiction is a powerful proof technique that helps us analyze and evaluate the effectiveness of greedy algorithms in solving a wide range of problems.

User Zhong Huiwen
by
8.3k points