The r-to-1 collision problem is an important theoretical problem in
complexity theory,
quantum computing
Quantum computing is a type of computation whose operations can harness the phenomena of quantum mechanics, such as superposition, interference, and entanglement. Devices that perform quantum computations are known as quantum computers. Thou ...
, and
computational mathematics
Computational mathematics is an area of mathematics devoted to the interaction between mathematics and computer computation.National Science Foundation, Division of Mathematical ScienceProgram description PD 06-888 Computational Mathematics 2006 ...
. The collision problem most often refers to the 2-to-1 version:
given
even and a function
, we are promised that f is either
1-to-1 or 2-to-1. We are only allowed to make queries about the value of
for any
. The problem then asks how many such queries we need to make to determine with certainty whether f is 1-to-1 or 2-to-1.
Classical solutions
Deterministic
Solving the 2-to-1 version deterministically requires
queries, and in general distinguishing r-to-1 functions from 1-to-1 functions requires
queries.
This is a straightforward application of the
pigeonhole principle
In mathematics, the pigeonhole principle states that if items are put into containers, with , then at least one container must contain more than one item. For example, if one has three gloves (and none is ambidextrous/reversible), then there m ...
: if a function is r-to-1, then after
queries we are guaranteed to have found a collision. If a function is 1-to-1, then no collision exists. Thus,
queries suffice. If we are unlucky, then the first
queries could return distinct answers, so
queries is also necessary.
Randomized
If we allow randomness, the problem is easier. By the
birthday paradox
In probability theory, the birthday problem asks for the probability that, in a set of randomly chosen people, at least two will share a birthday. The birthday paradox is that, counterintuitively, the probability of a shared birthday exceeds 5 ...
, if we choose (distinct) queries at random, then with high probability we find a collision in any fixed 2-to-1 function after
queries.
Quantum solution
The
BHT algorithm, which uses
Grover's algorithm
In quantum computing, Grover's algorithm, also known as the quantum search algorithm, refers to a quantum algorithm for unstructured search that finds with high probability the unique input to a black box function that produces a particular output ...
, solves this problem optimally by only making
queries to ''f''.
References
Algorithms
Polynomial-time problems