index.html // ^^^^^^^^^^^^^^^ // // or just make ...ceteris paribus (everything necessary to // make the same thing happen being inserted in the makefile). ?> A Binary Hyperbolic Pairing

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.

"The notebook as a pdf.", "binary_hyperbolic_pairing.ipynb" => "The Jupyter notebook source.", "bin_pair_py.txt" => "The working code as a Python module." ); $subst_url = array( ); echo "\n"; exec( "/bin/ls -ld Makefile *.png *.pdf *.ipynb *.txt", $lines ); foreach( $lines as $line ) { echo "\n"; $parts=explode( " ", $line ); foreach( $parts as $path ) { } ; // Empty loop leaves path as last part $pieces=explode( "/", $path ); foreach( $pieces as $file ) { } ; // Empty loop leaves file as last part $size=ceil( filesize($file) / 1024 ); echo '\n"; if( isset( $cmt[$file] ) ) { echo "\n"; } echo "\n\n"; } echo "
'; if( isset( $subst_url[$file] ) ) $url = $subst_url[ $file ]; else $url = $file; if( $line[0]=="d" ) { echo "$file/"; } else { echo "$file (${size}K)"; } echo "$cmt[$file]
\n"; ?>

This static page was made with a php script. Last change
--Steve Witham Up to my temporary home page.