Consider a random sequence of numbers, like 1, 4, 15, 21, 27, 15... There are no constraints on what numbers may appear in the sequence. Think of it as each element in the sequence is obtained using a random number generator. The question is, do we have a function that will give unique output by performing mathematical operations on this sequence? By unique, I mean when the function is applied on sequence A, it must output a value that's different from the output obtained by applying the same function on any other sequence (or the same sequence but numbers placed in different order) in the world. If we don't have such functions, can you tell me if it is even possible? Do we have anything that gets close?
Asked
Active
Viewed 1,846 times
2
-
Are the values always integers? And Is it always a finite sequence? – quasi May 14 '18 at 04:05
-
@quasi Yes. All the n terms are known. But sequence A can have equal, less, or more elements than another sequence B. Values are always integers. – May 14 '18 at 04:08
-
see https://math.stackexchange.com/q/243590/297952 – Kat May 14 '18 at 04:14
-
Take the function that maps a sequence to the same sequence. – Michael May 14 '18 at 06:14
2 Answers
3
Assume each input sequence has finitely many terms, and all terms are nonnegative integers.
Let the function $f$ be given by $$f\bigl((x_1,...,x_n)\bigr) = p_1^{1+x_1}\cdots p_n^{1+x_n}$$ where $p_k$ is the $k$-th prime number.
Then by the law of unique factorization, the function $f$ has the property you specified.
More generally, if negative integer values are also allowed, then define $f$ by $$f\bigl((x_1,...,x_n)\bigr) =p_1^{e(x_1)}\cdots p_n^{e(x_n)}$$ where $$ e(x_k)= \begin{cases} 1+x_k&\text{if}\;x_k\ge 0\\[4pt] x_k&\text{if}\;x_k < 0\\[4pt] \end{cases} $$
quasi
- 61,115
-
Do we have proof that it works for all integer sequences in the world? A link to learn further would be excellent. – May 14 '18 at 04:21
-
That is a proof that it works for all finite integer sequences in the world. You plug in a different sequence you get a different prime factorization and so you get a different number. Any sequence you put in will give a value. This answer is complete. – fleablood May 14 '18 at 04:31
-
If $$p_1^{1+x_1}\cdots p_n^{1+x_m}=p_1^{1+x_1}\cdots p_n^{1+x_n}$$ the law of unique factorization forces $m=n$, and $x_k=y_k$, for all $k$. – quasi May 14 '18 at 04:49
2
There exists several such functions. Two different examples that are also surjective in a certain sense:
- continued fraction: $f((x_1,...,x_n)) = x_1 + \cfrac{1}{x_2+\cfrac{1}{\cdot \cdot \cdot + \cfrac{1}{x_n}}}$. Every positive rational $x$ can be written like that in a unique way (and every $x \in \mathbb{R}_+$ if the sequences can be infinite).
$ $
- Engel's expansion: $f((x_1,...,x_n)) = \frac{1}{x_1}+\frac{1}{x_1x_2}+\cdot\cdot\cdot+\frac{1}{x_1\cdot\cdot\dot x_n}$. Every positive rational $x$ can be written like that in a unique way (and every $x \in \mathbb{R}_+$ if the sequences can be infinite).
charmd
- 6,212
-
Doesn't Engel's expansion for x result in a non-decreasing sequence of integers? In my case though, smaller numbers can follow larger integers. Please correct me if I'm wrong. – May 14 '18 at 04:50
-
1If the $a_i$ are all positive integers, then $a_1, a_1 + a_2 -1, a_1 + a_2 +a_3-2, \ldots$ is a non-decreasing sequence of integers and gives a one-to-one mapping between arbitrary sequences and non-decreasing sequences. – David K May 14 '18 at 04:54