| Cantor Pairing Function |
Website Links For Function |
Information AboutCantor Pairing Function |
| CATEGORIES ABOUT PAIRING FUNCTION | |
| set theory | |
|
Any pairing function can be used in Set Theory to prove that Integer s and Rational Number s 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'':N''k'' → N into a new function ''g'':N → N. Every pairing function is Primitive Recursive . DEFINITION A pairing function is a Bijective function : CANTOR PAIRING FUNCTION The Cantor pairing function is a pairing function : defined by : When we apply the pairing function to and we often denote the resulting number as This definition can be inductively generalized to the Cantor tuple function : as : Inverting the Cantor pairing function Suppose we are given ''z'' with : and we want to find ''x'' and ''y''. It is helpful to define some intermediate values in the calculation: : : : where ''t'' is the Triangle Number of ''w''. If we solve the quadratic equation : for ''w'' as a function of ''t'', we get : which is a strictly increasing and continuous function when ''t'' is non-negative real. Since : we get that : and thus :. So to calculate ''x'' and ''y'' from ''z'', we do: : : : :. Since the Cantor pairing function is invertible, it must be one-to-one and onto. REFERENCES |
|
|