Try
Can two numbers between zero and one be stored in the digits of a single number? Start with binary notation, where the first fractional place is worth 1/2, the second 1/4, the third 1/8, and so on. Take x=1/2 and y=1/4. Write their expansions with trailing zeros, and place x’s digits in odd positions and y’s digits in even positions.
| Position within each input | 1 | 2 | 3 | Later positions |
|---|
| x=1/2 | 1 | 0 | 0 | All zero |
| y=1/4 | 0 | 1 | 0 | All zero |
| Output pair of digits | 10 | 01 | 00 | All zero |
| Output place values for this pair | 1/2, 1/4 | 1/8, 1/16 | 1/32, 1/64 | Successive halves |
The output is binary 0.1001000… with all remaining digits zero, equal to 1/2+1/16=9/16. Circle the odd output positions and recover x; circle the even positions and recover y. This table suggests a reversible encoding, but it is not yet a proof for arbitrary real inputs.
There is a trap: 1/2 also equals binary 0.011111…. Indeed the sum of 1/4+1/8+1/16+⋯ is 1/2. If we use that expansion instead while keeping y’s expansion, the output becomes 0.0011101010…, a different number. Its value is 1/16 plus the sum of the odd-position terms starting at position 3, namely 1/16+1/6=11/48. One input pair must not be assigned two outputs. We need an explicit convention before defining the map.
Predict
Our convention is to exclude digit streams that are eventually all maximal digits. In binary, exclude a stream that becomes all ones after some position. In decimal, exclude one that becomes all nines. Trailing zeros are allowed. “Eventually” includes streams with a long nonconstant beginning: the issue is the infinite tail, not the first few digits.
Predict which representations are canonical: decimal 0.249999…, decimal 0.250000…, and binary 0.010101…. The first is excluded; the second and third are allowed. A repeating pattern that contains infinitely many zeros is not eventually one. The interval is [0,1), so binary 0.111111… represents an excluded endpoint, not a permissible input.
Now predict whether every canonical binary output can be split into two canonical inputs. Consider 0.101010…. Its full stream contains infinitely many zeros. Its odd-position stream, however, contains only ones. Canonicality of a full stream does not imply canonicality of its two subsequences. We will use this distinction to disprove surjectivity.
Experiment
On paper encode x=1/4 and y=3/4. Keep four digits of each, mark the output positions, and convert the result to a fraction. Then exchange x and y. Does the encoding preserve the order of the pair?
Check both ordered pairs
The first pair has input streams 0100… and 1100…, producing 01110000…=7/16. Exchanging the inputs produces 10110000…=11/16. The odd/even assignment is part of the definition, so swapping the inputs generally changes the output. These finite terminating examples use canonical streams.
For a nonterminating example, split binary 0.101010… into odd and even positions. The two subsequences have values 1 and 0, so the first is outside [0,1). Do not “repair” it to a different input expansion and assume the output stays unchanged. The proposed map always uses the canonical expansion of each permitted input.
If you write only m digits of each input, you determine only 2m output digits. Filling the rest with zeros produces a lower approximation. The omitted binary tail is less than 2 raised to the power −2m for a canonical output. This is a numerical error bound, not proof that two infinite digit strings agree.
Understand
Fix an integer base b≥2. A digit is an integer from 0 through b−1. A stream of digits d₁,d₂,… represents the sum of dₙb^(−n) over positive integers n. Its partial sums increase and are bounded above by the geometric series with every digit b−1, whose value is 1. Thus the series exists. We call a stream canonical when it is not eventually b−1.
Existence. For x in [0,1), begin with remainder r₀=x. At each step set dₙ=floor(brₙ₋₁) and rₙ=brₙ₋₁−dₙ. Since each remainder lies in [0,1), each digit lies from 0 to b−1 and the new remainder again lies in [0,1). Repeated substitution gives
x = d₁/b + d₂/b² + ⋯ + dₙ/bⁿ + rₙ/bⁿ.
The last term is nonnegative and less than b^(−n), so the digit series converges to x. If the digits from some position N onward were all b−1, the same tail identity would give r at position N−1 equal to the geometric sum (b−1)/b+(b−1)/b²+⋯=1. This contradicts the remainder bound. The algorithm therefore produces a canonical expansion, including for zero, whose digits are all zero.
Uniqueness and the precise ambiguity. Suppose two distinct expansions have equal values and first differ at position k. Call the smaller digit there aₖ and the larger cₖ. Their difference contributes at least b^(−k). Every later digit difference together can cancel at most
(b−1) times the sum of b^(−j) for j greater than k, which equals b^(−k).
Consequently the first digit difference must be exactly one. Moreover, cancellation must be maximal at every later position: the stream with smaller kth digit has only b−1 afterward, and the other has only zeros afterward. A strict deficit in even one tail term would make full cancellation impossible. Thus the only ambiguity is a terminating expansion versus its maximal-tail alternative. Two canonical expansions cannot have this ambiguity, establishing uniqueness.
The injection. Expand x and y canonically in binary as a₁,a₂,… and b₁,b₂,…, then define I(x,y) by the stream a₁,b₁,a₂,b₂,…. Each input has infinitely many zero digits, so the output does too. Its value is below 1: the all-one sum is 1 and at least one positive term is missing. It is nonnegative and canonical, hence is a valid member of [0,1).
If I(x,y)=I(u,v), uniqueness makes their entire canonical output streams identical. Reading odd positions gives identical canonical streams for x and u, hence x=u; reading even positions gives y=v. This proves injectivity. It is not enough to say that the first few displayed digits can be decoded.
The image is smaller than the codomain. The number 2/3 has canonical binary expansion 0.101010…, by a geometric sum with first term 1/2 and ratio 1/4. Its odd subsequence is all ones, so no permitted input pair can encode it. More generally, an output is in the image exactly when both odd and even subsequences are not eventually one. Necessity follows from construction and uniqueness. Conversely, two such subsequences each represent a number below one and are its canonical expansion; interleaving those numbers reproduces the output. This proves both directions of the image description.
Apply
Try a changed base. Group each pair of binary digits into a single base-four digit eₙ=2aₙ+bₙ. The pairs 00, 01, 10, 11 become 0, 1, 2, 3. An eventual tail of threes would force both inputs eventually one, which is impossible. Uniqueness in base four now recovers each eₙ, and division by two recovers its ordered pair of bits. This is another injection, not automatically a surjection. For instance a constant base-four stream of twos would demand an all-one first input.
For a different domain, allow an arbitrary infinite binary stream and encode its digits directly as base-four digits 0 and 1. At the first disagreement k, the leading difference is 4^(−k), while the entire later tail difference is at most 4^(−k)/3. A positive gap remains, so no two streams have equal outputs. This stricter tail bound needs no canonical restriction on the input streams. State the input domain whenever using this alternative: a stream space and the real interval with chosen representations are related but are not interchangeable definitions.
Check a finite-prefix boundary
If the input prefixes are 11 and 00, the output prefix is 1010, with value 5/8. All encoded outputs sharing that prefix lie in [5/8,11/16). The upper endpoint would require an all-one output tail, so it is excluded. Further zeros and ones can still change the value within the interval; a finite table cannot establish uniqueness of infinite expansions.
Continue
The practice asks for proofs of the expansion algorithm, the ambiguity classification and the injection, as well as an exact description of failed decoding. Keep existence, uniqueness, injectivity and surjectivity as separate claims. A map from the interval into its square is easy to construct by sending x to the ordered pair (x,0); it is injective too. Turning these two injections into a bijection requires a separate two-injection theorem and its proof. That is the next mathematical step, not a conclusion already established by unrestricted digit splitting.