1
$\begingroup$

The title and tags are a little goofy since I'm not quite sure what to call this. This may be more of a computer science question, but I thought I'd ask here too.

I have two integers $n$ and $m$ that are arbitrarily (logically) related with integers $x$ and $y$, respectively, where all values are finite and $> 0.$

I'd like to know if there's a way to combine $n$ and $x$, and $m$ and $y$, into two numbers (integer, decimal, whatever) such that neither will overlap. Additionally, I need to be able to perform some kind of operation to reverse the previous process to once again obtain $n$ and $x$, and $m$ and $y$.

Let me know if this isn't clear. Thanks in advance!

$\endgroup$
  • $\begingroup$ As far as I can tell, this is a question about two numbers, not four. $\endgroup$ – Qiaochu Yuan Sep 27 '10 at 18:34
  • $\begingroup$ @Qiaochu Yuan yeah, you're right. $\endgroup$ – Nalandial Sep 27 '10 at 20:24
4
$\begingroup$

You could employ a pairing function, e.g. Cantor's or others.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.