Math 2.0

example

Cantor pairing function

Example

The Cantor pairing function is the function π ⁣:N×N→N\pi \colon \mathbb{N} \times \mathbb{N} \to \mathbb{N} with π(x,y)=(x+y)(x+y+1)2+y.\pi(x, y) = \frac{(x + y)(x + y + 1)}{2} + y. It is a bijection. It lists the pairs along the diagonals x+y=0,1,2,…x + y = 0, 1, 2, \dots: π(0,0)=0\pi(0, 0) = 0, π(1,0)=1\pi(1, 0) = 1, π(0,1)=2\pi(0, 1) = 2, π(2,0)=3\pi(2, 0) = 3.

Remarks

So N×N\mathbb{N} \times \mathbb{N} is countably infinite. See product of countable sets is countable. The value (x+y)(x+y+1)/2(x + y)(x + y + 1)/2 is the number of pairs on the earlier diagonals, and yy is the position on the diagonal.

Explanations

L1 human

Write the pairs (x,y)(x, y) in an infinite grid. Walk through the grid along the short diagonals, one after the other, and number the pairs as you go. Each pair gets exactly one number, and each number gets exactly one pair.

What this node needs for W3
  • a person confirmed each agent-written section: rule P04 (0 of 1)

The writing levels say how complete the text of a node is. They do not measure its truth.

What depends on this

3 nodes use this node, directly or through other nodes.

Sources

  1. Web https://en.wikipedia.org/wiki/Pairing_function, Cantor pairing function