4th Street Bar Hive-Bar

Hive-Bar Powered by Hive beta-fdb5b5b

Community post

Pairing is caring /

Dear thinking people,

let ```N``` denote the natural numbers and let ```[n]``` denote a set with n elements. Fix a natural number ```m```.

I'm looking for a bijection between N x N, and the function space [3] --> [m] x [6].
In other word, I need a one-one mapping between the pairs of natural numbers and the key-value pairs with 3 different possible keys that take values in the set of pairs from [m] x [6].

It might be simpler to even relax the problem and replace [m] with N, although I'll only be really interested in functions that map into the first m integers in that pair.

https://i.imgur.com/lk2bqtV.jpg

On a related note, since I know there are bored strong programmers out there, how are such small function spaces best encoded in the language C#, for example? If anyone is up for a challenge, try coding up the back and forth of the related Cantor pairing function:
https://en.wikipedia.org/wiki/Pairing_function

Best Regards
qed

44 upvotes $3.51

Replies (1)

Review before signing

Posting as . Signing with . Keychain permission: Posting. Hive Keychain will ask you to approve this action next.


  
Technical details

Operation fingerprint: