Binary Hyperbolic Pairing Function
version 0.1

Another in my series of "hyperbolic" pairing functions. This one pairs two numbers by concatenating their bits (except for the leading ones) with a prefix, which orders the pairs in rather thick "shells," but it's practical in that encoding or decoding a pair takes a constant number of operations, and a linear amount of time per bit of input.
Also included is a "tupling function," implemented as a Python class that converts a list of positive ints to a single positive int (and back), and also supports iteration, reverse iteration, and push and pop on both ends (with limitations).
The Jupyter notebook pdf explains the math of the things fairly well, although there's a lot of obsoleted and experimental code still in there.
Makefile (1K) 

bin_hyp_thumb.png (17K) 

bin_pair_py.txt (14K) 
The working code as a Python module. 
binary_hyperbolic_pairing.ipynb (99K) 
The Jupyter notebook source. 
binary_hyperbolic_pairing.pdf (606K) 
The notebook as a pdf. 
makeindex.php.txt (4K) 
This static page was made with a
php script.
Last change April 13, 2021 19:32:30 EDT.
Steve Witham
Up to my temporary home page.