1
$\begingroup$

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.

  • 3
    The numbers don't look too random if they share a large prefix...2012-05-23
  • 0
    Does 192097086290220871233 count?2012-05-23
  • 0
    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$?2012-05-23
  • 0
    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.2012-05-23
  • 0
    Have you considered using a hashing function?2012-05-23
  • 0
    @Eugene: yes, but from my knowledge of hashes, we will need $A$,$B$ and $C$ to come up with an identical hash. However, $A$ will only know $X$, not $B$ and $C$, and so on. So the hash will be different?2012-05-23
  • 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 http://en.wikipedia.org/wiki/Data_compression2012-05-23
  • 0
    @RobertIsrael: Thanks for your input. In that case I'll probably have no choice but to adopt lhf's method.2012-05-23

1 Answers 1

0

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.