In mathematics a pairing function is a process to uniquely encode two natural numbers into a single natural number.
Pairing functions are used in set theory to proof that integers and rational numbers have the same cardinality as natural numbers.In theoretical computer science they are used to encode a function defined on a vector of natural numbers f:Nk → N into a new function g:N → N.
A pairing function is a bijective function