This article needs additional citations for verification .(August 2021) |
In mathematics, a pairing function is a process to uniquely encode two natural numbers into a single natural number.
Any pairing function can be used in set theory to prove that integers and rational numbers have the same cardinality as natural numbers. [1]
A pairing function is a bijection
More generally, a pairing function on a set is a function that maps each pair of elements from into an element of , such that any two pairs of elements of are associated with different elements of , [5] [a] or a bijection from to . [6]
Instead of abstracting from the domain, the arity of the pairing function can also be generalized: there exists an n-ary generalized Cantor pairing function on . [3]
Hopcroft and Ullman (1979) define the following pairing function: , where . [7] This is the same as the Cantor pairing function below, shifted to exclude 0 (i.e., , , and ). [8]
The Cantor pairing function is a primitive recursive pairing function
defined by
where . [8] [ better source needed ]
It can also be expressed as . [5]
It is also strictly monotonic w.r.t. each argument, that is, for all , if , then ; similarly, if , then .[ citation needed ]
The statement that this is the only quadratic pairing function is known as the Fueter–Pólya theorem. [9] Whether this is the only polynomial pairing function is still an open question. When we apply the pairing function to k1 and k2 we often denote the resulting number as ⟨k1, k2⟩.[ citation needed ]
This definition can be inductively generalized to the Cantor tuple function[ citation needed ]
for as
with the base case defined above for a pair: [10]
Let be an arbitrary natural number. We will show that there exist unique values such that
and hence that the function π(x, y) is invertible. 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
where ⌊ ⌋ is the floor function. 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. [5] [ additional citation(s) needed ]
To calculate π(47, 32):
so π(47, 32) = 3192.
To find x and y such that π(x, y) = 1432:
so w = 53;
so t = 1431;
so y = 1;
so x = 52; thus π(52, 1) = 1432.[ citation needed ]
The graphical shape of Cantor's pairing function, a diagonal progression, is a standard trick in working with infinite sequences and countability. [b] The algebraic rules of this diagonal-shaped function can verify its validity for a range of polynomials, of which a quadratic will turn out to be the simplest, using the method of induction. Indeed, this same technique can also be followed to try and derive any number of other functions for any variety of schemes for enumerating the plane.
A pairing function can usually be defined inductively – that is, given the nth pair, what is the (n+1)th pair? The way Cantor's function progresses diagonally across the plane can be expressed as
The function must also define what to do when it hits the boundaries of the 1st quadrant – Cantor's pairing function resets back to the x-axis to resume its diagonal progression one step further out, or algebraically:
Also we need to define the starting point, what will be the initial step in our induction method: π(0, 0) = 0.
Assume that there is a quadratic 2-dimensional polynomial that can fit these conditions (if there were not, one could just repeat by trying a higher-degree polynomial). The general form is then
Plug in our initial and boundary conditions to get f = 0 and:
so we can match our k terms to get
So every parameter can be written in terms of a except for c, and we have a final equation, our diagonal step, that will relate them:
Expand and match terms again to get fixed values for a and c, and thus all parameters:
Therefore
is the Cantor pairing function, and we also demonstrated through the derivation that this satisfies all the conditions of induction.[ citation needed ]
The function is a pairing function.
In 1990, Regan proposed the first known pairing function that is computable in linear time and with constant space (as the previously known examples can only be computed in linear time if multiplication can be too, which is doubtful). In fact, both this pairing function and its inverse can be computed with finite-state transducers that run in real time.[ clarification needed ] In the same paper, the author proposed two more monotone pairing functions that can be computed online in linear time and with logarithmic space; the first can also be computed offline with zero space. [4] [ clarification needed ]
In 2001, Pigeon proposed a pairing function based on bit-interleaving, defined recursively as:
where and are the least significant bits of i and j respectively. [11] [ better source needed ]
In 2006, Szudzik proposed a "more elegant" pairing function defined by the expression:
Which can be unpaired using the expression:
(Qualitatively, it assigns consecutive numbers to pairs along the edges of squares.) This pairing function orders SK combinator calculus expressions by depth. [5] [ clarification needed ] This method is the mere application to of the idea, found in most textbooks on Set Theory, [12] used to establish for any infinite cardinal in ZFC. Define on the binary relation
is then shown to be a well-ordering such that every element has predecessors, which implies that . It follows that is isomorphic to and the pairing function above is nothing more than the enumeration of integer couples in increasing order. [c]
"Pairing functions arise naturally in the demonstration that the cardinalities of the rationals and the nonnegative integers are the same, i.e., , originally due to Cantor."
In mathematics, the arithmetic–geometric mean of two positive real numbers x and y is the mutual limit of a sequence of arithmetic means and a sequence of geometric means. The arithmetic–geometric mean is used in fast algorithms for exponential, trigonometric functions, and other special functions, as well as some mathematical constants, in particular, computing π.
In mathematics, the discrete Fourier transform (DFT) converts a finite sequence of equally-spaced samples of a function into a same-length sequence of equally-spaced samples of the discrete-time Fourier transform (DTFT), which is a complex-valued function of frequency. The interval at which the DTFT is sampled is the reciprocal of the duration of the input sequence. An inverse DFT (IDFT) is a Fourier series, using the DTFT samples as coefficients of complex sinusoids at the corresponding DTFT frequencies. It has the same sample-values as the original input sequence. The DFT is therefore said to be a frequency domain representation of the original input sequence. If the original sequence spans all the non-zero values of a function, its DTFT is continuous, and the DFT provides discrete samples of one cycle. If the original sequence is one cycle of a periodic function, the DFT provides all the non-zero values of one DTFT cycle.
In mathematics, the floor function is the function that takes as input a real number x, and gives as output the greatest integer less than or equal to x, denoted ⌊x⌋ or floor(x). Similarly, the ceiling function maps x to the least integer greater than or equal to x, denoted ⌈x⌉ or ceil(x).
In mathematics, the error function, often denoted by erf, is a function defined as:
In mathematics, the Hermite polynomials are a classical orthogonal polynomial sequence.
In mathematics and physical science, spherical harmonics are special functions defined on the surface of a sphere. They are often employed in solving partial differential equations in many scientific fields. The table of spherical harmonics contains a list of common spherical harmonics.
In mathematics, the inverse trigonometric functions are the inverse functions of the trigonometric functions, under suitably restricted domains. Specifically, they are the inverses of the sine, cosine, tangent, cotangent, secant, and cosecant functions, and are used to obtain an angle from any of the angle's trigonometric ratios. Inverse trigonometric functions are widely used in engineering, navigation, physics, and geometry.
In mathematics, the sign function or signum function is a function that has the value −1, +1 or 0 according to whether the sign of a given real number is positive or negative, or the given number is itself zero. In mathematical notation the sign function is often represented as or .
In number theory, the integer square root (isqrt) of a non-negative integer n is the non-negative integer m which is the greatest integer less than or equal to the square root of n,
In mathematics, the lemniscate constantϖ is a transcendental mathematical constant that is the ratio of the perimeter of Bernoulli's lemniscate to its diameter, analogous to the definition of π for the circle. Equivalently, the perimeter of the lemniscate is 2ϖ. The lemniscate constant is closely related to the lemniscate elliptic functions and approximately equal to 2.62205755. It also appears in evaluation of the gamma and beta function at certain rational values. The symbol ϖ is a cursive variant of π; see Pi § Variant pi.
In mathematics, the Eisenstein integers, occasionally also known as Eulerian integers, are the complex numbers of the form
Euclid's theorem is a fundamental statement in number theory that asserts that there are infinitely many prime numbers. It was first proven by Euclid in his work Elements. There are several proofs of the theorem.
In mathematics, the lemniscate elliptic functions are elliptic functions related to the arc length of the lemniscate of Bernoulli. They were first studied by Giulio Fagnano in 1718 and later by Leonhard Euler and Carl Friedrich Gauss, among others.
In mathematics, a Beatty sequence is the sequence of integers found by taking the floor of the positive multiples of a positive irrational number. Beatty sequences are named after Samuel Beatty, who wrote about them in 1926.
In physics and mathematics, the solid harmonics are solutions of the Laplace equation in spherical polar coordinates, assumed to be (smooth) functions . There are two kinds: the regular solid harmonics, which are well-defined at the origin and the irregular solid harmonics, which are singular at the origin. Both sets of functions play an important role in potential theory, and are obtained by rescaling spherical harmonics appropriately:
In the 1760s, Johann Heinrich Lambert was the first to prove that the number π is irrational, meaning it cannot be expressed as a fraction , where and are both integers. In the 19th century, Charles Hermite found a proof that requires no prerequisite knowledge beyond basic calculus. Three simplifications of Hermite's proof are due to Mary Cartwright, Ivan Niven, and Nicolas Bourbaki. Another proof, which is a simplification of Lambert's proof, is due to Miklós Laczkovich. Many of these are proofs by contradiction.
In probability theory and statistics, the Conway–Maxwell–Poisson distribution is a discrete probability distribution named after Richard W. Conway, William L. Maxwell, and Siméon Denis Poisson that generalizes the Poisson distribution by adding a parameter to model overdispersion and underdispersion. It is a member of the exponential family, has the Poisson distribution and geometric distribution as special cases and the Bernoulli distribution as a limiting case.
In statistics, the complex Wishart distribution is a complex version of the Wishart distribution. It is the distribution of times the sample Hermitian covariance matrix of zero-mean independent Gaussian random variables. It has support for Hermitian positive definite matrices.
In algebra, a Landau-Mignotte bound (sometimes only referred to as Mignotte's bound) is one of a family of inequalities concerning a univariate integer polynomial f(x) and one of its factors h(x). A basic version states that the coefficients of h(x) are bounded independently of h(x) by an exponential expression involving only the degree and coefficients of f(x), i.e. only depending on f(x).
{{cite journal}}
: CS1 maint: date and year (link)