Pairing Functions

September 27, 2011

Sometimes you have to encode reversibly two (or more) values onto a single one. The typical example of a pairing function that encodes two non-negative integers onto a single non-negative integer (therefore a function f:\mathbb{Z}^*\times\mathbb{Z}^*\to\mathbb{Z}^*) is the Cantor function, instrumental to the demonstration that, for example, the rational can be mapped onto the integers.

In a more pragmatic way, it may be necessary to encode two values onto one for data compression purposes, or to otherwise exploit a protocol that does not allow many distinct values to be sent separately. The simplest way of pairing two integer is to interleave their bits, for example, with something like:

Read the rest of this entry »


Wallpaper: Karlův Most, 5h05

September 22, 2011

(Karlův Most, 5h05, 1920×1200)

You can find more wallpapers here


Wallpaper: Mes ennemis

September 22, 2011

(Mes ennemis, 1920×1200)

You can find more wallpapers here


Wallpaper: Une autre gare, un autre voyage

September 22, 2011

(Une autre gare, un autre voyage, 1920×1200)

You can find more wallpapers here


Wallpaper: NY

September 22, 2011

(NY, 1920×1200)

You can find more wallpapers here


Wallpaper: Time²

September 22, 2011

(Time², 1920×1200)

You can find more wallpapers here


Wallpaper: Karlův Most, 4h55

September 22, 2011

(Karlův Most, 4h55, 1920×1200)

You can find more wallpapers here