[Paper Review] When are two algorithms the same?
This paper argues that there is no satisfactory equivalence relation to formally define when two algorithms are the same, even in the restricted context of deterministic, small-step, non-interactive algorithms. By analyzing cases of intuitive algorithmic sameness that resist precise definition, the authors conclude that the notion of 'same algorithm' is inherently subjective and cannot be captured by any rigorous equivalence relation on programs.
People usually regard algorithms as more abstract than the programs that implement them. The natural way to formalize this idea is that algorithms are equivalence classes of programs with respect to a suitable equivalence relation. We argue that no such equivalence relation exists.
Motivation & Objective
- To investigate whether a precise equivalence relation can be defined to capture the intuitive notion that two programs implement the same algorithm.
- To examine the limitations of existing approaches—such as Curry-Howard correspondence and proof equivalence—in defining algorithmic sameness.
- To demonstrate that even in a restricted class of algorithms (deterministic, small-step, non-interactive), the intuitive notion of algorithmic sameness is too vague for formalization.
- To show that subjective judgments about algorithmic identity persist even when program syntax and semantics are well-defined.
- To argue that the problem of algorithmic sameness is fundamentally ill-posed, not just technically difficult, due to inherent ambiguity in human intuition about algorithm identity.
Proposed method
- Analyzing cases where two programs clearly compute the same function but are intuitively considered different algorithms, such as insertion sort vs. selection sort.
- Examining the role of programming language and semantics in defining programs, advocating for stable, well-defined languages to avoid a moving target.
- Using the Curry-Howard correspondence to explore proof equivalence as a potential route to algorithm equivalence, but rejecting it as too fine-grained.
- Investigating how small, incremental modifications to programs can blur the line between algorithmic identity and difference, creating a gray area.
- Drawing analogies with other domains—proofs, theorems, translations—to show that the problem of sameness is pervasive and similarly intractable.
- Applying reverse mathematics as a coarse equivalence notion for theorems, contrasting it with intuitive notions of equivalence to highlight the gap in formalization.
Experimental results
Research questions
- RQ1Can a precise equivalence relation be defined on programs such that two programs are equivalent if and only if they implement the same algorithm?
- RQ2Why do standard approaches—such as the Curry-Howard correspondence or proof equivalence—fail to capture intuitive algorithmic sameness?
- RQ3To what extent is the intuitive notion of 'same algorithm' subjective, and can this subjectivity be formalized?
- RQ4How do small syntactic or structural changes in programs affect the perception of algorithmic identity, and where does the boundary lie?
- RQ5Are there analogous problems in other domains (e.g., proofs, theorems, translations) that mirror the difficulty of defining sameness in algorithms?
Key findings
- No equivalence relation on programs can fully capture the intuitive notion that two algorithms are the same, even in the restricted class of deterministic, small-step, non-interactive algorithms.
- Even when two programs compute the same function and are syntactically similar, people may reasonably disagree on whether they implement the same algorithm, indicating inherent subjectivity.
- The Curry-Howard correspondence and proof equivalence approaches yield equivalence relations that are too fine, failing to identify intuitively equivalent algorithms as such.
- Small, incremental modifications to a program can lead to a sequence where each step is trivial, yet the initial and final programs are perceived as different algorithms, showing a lack of clear boundary.
- The problem of algorithmic sameness is not merely technical but conceptual: the intuitive notion is too vague and context-dependent to be formalized as a precise equivalence relation.
- Analogous problems in other domains—such as equivalence of proofs, theorems, or translations—exhibit the same intractability, suggesting a deeper foundational issue.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.