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!

  • 0
    As far as I can tell, this is a question about two numbers, not four.2010-09-27
  • 0
    @Qiaochu Yuan yeah, you're right.2010-09-27

1 Answers 1

4

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