Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!

share|cite|improve this question
As far as I can tell, this is a question about two numbers, not four. – Qiaochu Yuan Sep 27 '10 at 18:34
@Qiaochu Yuan yeah, you're right. – Nalandial Sep 27 '10 at 20:24
up vote 3 down vote accepted

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

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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