Katana VentraIP

Pairing function

In mathematics, a pairing function is a process to uniquely encode two natural numbers into a single natural number.[1]

Any pairing function can be used in set theory to prove that integers and rational numbers have the same cardinality as natural numbers.[1]

Hopcroft and Ullman pairing function[edit]

Hopcroft and Ullman (1979) define the following pairing function: , where .[1] This is the same as the Cantor pairing function below, shifted to exclude 0 (i.e., , , and ).