qed avatar

Pairing is caring /

qed

Published: 17 Sept 2017 › Updated: 17 Sept 2017Pairing is caring /

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.

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

Leave Pairing is caring / to:

Written by

<3 I do tutorials on logic, math, physics, programming

Read more #math posts


Best Posts From qed

We have not curated any of qed's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From qed