Exercise

Composition of Polynomial Reductions

Prove transitivity while accounting for output length.

Assignment sources

Semester A 2026 assignmentsOfficial assignmentexercise3.pdfQ1Authoritative course artifact
Noy 2025 high-quality exam preparation and community solutionsCommunity solutionפתרון מטלה 3 - סיבוכיות.pdfQ1High-quality preparation and community solution — not official

Problem

Suppose A≤mpBA\le_m^p B via ff and B≤mpCB\le_m^p C via gg. Prove A≤mpCA\le_m^p C. Your runtime argument must account for the length of f(x)f(x).

Hint 1

Which function naturally maps an AA-instance directly to a CC-instance?

Hint 2

If ff runs in time p(n)p(n), its output cannot contain more than p(n)p(n) symbols. Apply the runtime polynomial for gg to that bound.

Full solution

Define h(x)=g(f(x))h(x)=g(f(x)). Correctness is

x∈A  ⟺  f(x)∈B  ⟺  g(f(x))∈C.x\in A\iff f(x)\in B\iff g(f(x))\in C.

Let ff run in time p(n)p(n) and let gg run in time q(m)q(m) on inputs of length mm, for polynomials p,qp,q. Since a machine can write at most one constant-size symbol per step, ∣f(x)∣≤p(∣x∣)|f(x)|\le p(|x|) up to a model-dependent constant. Thus

Th(n)≤p(n)+q(p(n)),T_h(n)\le p(n)+q(p(n)),

which is polynomial. Therefore hh is a polynomial-time many-one reduction.

Checkpoint

The key step is not merely that two polynomial algorithms are called; the intermediate instance must itself have polynomial length.

Provenance note

This is an original formulation of the standard transitivity proof, aligned with textbook definitions. No student submission is used as authority.

Common mistakes

  • Skipping a direction of correctness or an input-format edge case.
  • Measuring resources against a numeric value rather than encoded input length.
  • Treating an informal intuition as a proof of the stated bound.

Sources and verification

  • Merged summary, pp. 43-49
  • 2026 transcript 9
  • Sipser 3e, sec. 7.4
  • Catalog mapping: data/exercises.json; statements and solutions are independently written; personal submissions are non-authoritative.
Guided construction

NP-complete reduction chain

Step 1 of 5
Known-hard Asource instance x
f(x)total polynomial compiler
Target B solverhypothetical fast algorithm
The solver's yes/no answer decides A