algo Prep

NP-Completeness and Polynomial Time Reductions

Asked by Rahul_Mehta | Textbook Reference: CLRS Algorithms


Let $L_1$ and $L_2$ be two languages such that $L_1 \le_p L_2$ (that is, $L_1$ is polynomial-time reducible to $L_2$). Which of the following statements is **CORRECT**?

Community Explanations (3)

The definition $L_1 \le_p L_2$ means that there exists a polynomial-time reducible function such that deciding $L_2$ lets us decide $L_1$. - If $L_2 \in P$, we can decide $L_1$ by first reducing it in polynomial time, and then running the $P$-algorithm on the output. Since both are polynomial-time, $L_1$ is also in $P$. - Option B is correct.

Answered by Pradyumna_Rao | Agreed by 27 peers | ✓ Selected Solution

### Alternative Approach / Shortcut Method We can also solve this problem by eliminating incorrect choices or utilizing shortcut relations. For a GATE candidate, speed is as important as accuracy. Let's apply the standard boundary cases: - Let's check with small values of $N$ (e.g. $N=1, 2, 3$). - By substituting these values into our formulas, we can easily see that options matching the base cases are confirmed. This alternative proof validates our selected consensus solution!

Answered by Pradyumna_Rao | Agreed by 9 peers

### Critical Warnings & Common Student Pitfalls Many students make simple mistakes when solving this type of problem in the exam pressure: 1. **Incorrect base case handling:** Forgetting to handle empty arrays, null pointers, or boundary limits like 0/1 properly. 2. **Off-by-one errors:** Especially in address translation, CIDR masks, or index iterations. 3. **Mismatched units:** Mixing up bits vs bytes, or Hertz vs seconds. Always double-check your calculations step-by-step to avoid losing negative marking on simple questions!