Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Let's say I have 3 people who each has a random number:

A: 1920970862902
B: 1920970862087
C: 1920970861233

How do I create a single number $X$ from $N$ (in this case, 3) numbers, where if I give $X$ to $A$, $B$ or $C$, they will be able to use $X$ to determine if their own number is inside? Is this even possible?

Extra Info: I'm using this for a programming function, so I would prefer simple formulas.

share|improve this question
3  
The numbers don't look too random if they share a large prefix... –  lhf May 23 '12 at 2:26
    
Does 192097086290220871233 count? –  lhf May 23 '12 at 2:28
    
As lhf suggests, what about just concatenating all the numbers together? Or do you want $X$ to have the same length as the numbers of $A$, $B$, and $C$? –  Austin Mohr May 23 '12 at 2:31
    
lhf: well they are timestamps, so they aren't that random, the randomness comes from the fact that they can be generated anytime. AustinMohr: well if I have 20 random numbers then it might become an issue. $N$ could range from 1 to ~100 numbers. Preferably $X$ should be the same length, or at least not too long. –  Wei Hao May 23 '12 at 2:33
3  
It's impossible to compress random numbers: if you want to encode a sequence of $N$ arbitrary integers of $d$ digits each, you'll need at least $Nd$ digits to do so. On the other hand, if the numbers are not completely random, some compression may be possible. Look at en.wikipedia.org/wiki/Data_compression –  Robert Israel May 23 '12 at 2:43
show 3 more comments

1 Answer

up vote 0 down vote accepted

If you're dealing with timestamps they're probably counted from a far away date. Move to a date closer to now but still far from the timestamps and you'll be able to use less digits to represent each timestamp. I've used 1920970860000 for that closer date in my comment and got 2902, 2087, 1233, joined together into 290220871233. But for 100 timestamps you'll still need several digits, probably 400 say.

share|improve this answer
    
Thanks. That's an interesting suggestion. –  Wei Hao May 23 '12 at 2:58
add comment

Your Answer

 
discard

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.