Is there a way to encode all decimal numbers between 0 and 1 into whole numbers?

154 Views Asked by At

Is there a way to encode ALL decimal numbers between 0 and 1 into whole numbers with a rationale that supports sum operations between the encoded numbers?

so 1=0.1 2=0.2 3=0.3...

1+2 = 3 .. 0.2+0.1 = 0.3 .. 3 = 0.3

But in way that we could theoretically include ALL decimal numbers between 0 and 1 and it still works

2

There are 2 best solutions below

2
On BEST ANSWER

No.

There are an uncountable number of real numbers between 0 and 1 and there are only a countable number of whole numbers.

0
On

Yes. Encode them all to 0.

There is no other way. If $x \ne 0$ maps to $n \ne 0$ then $1/2 x$ must map to $1/2 n$ (so $1/2*x + 1/2*x$ maps to $1/2*n + 1/2*n$). So $(1/2)^m x$ must map to $(1/2)^m n$ for all $m$ but $(1/2)^m * n$ can't all be whole numbers.