# How does one partition real numbers in two equinumerous sets (non-trivial)?

I better explain my goal with simplified example.

I look for a function $f:(0,1)\rightarrow\{0,1\}$ such that $\forall \varepsilon>0 \,\,\exists \text{ bijection }\varphi:\{x\in(0,\varepsilon): f(x) = 0\}\rightarrow\{ x\in(0,\varepsilon):f(x)=1\}$. What this function would do is it would actually partition $(0,1)$ in two equinumerous disjoint sets, so that in every infinitely small interval there is equal "number" of elements from each partition.

-

Every irrational in $(0,1)$ determines a unique infinite sequence of positive integers and vice versa, via continued fractions: $$x=\frac1{a_1+\frac1{a_2+\frac1{\dots}}},$$ If the sequence is such that, from some point on, only $6$s and $7$s appear, put $x$ in the first set. Else, put $x$ in the second set. Both sets meet each interval in continuum ($=|\mathbb R|$) many points.

-

The way the problem is formulated, you just need both $f^{-1}(0) \cap (0,\varepsilon)$ and $f^{-1}(1) \cap (0,\varepsilon)$ to contain an interval for any $\varepsilon>0$ (that way both are uncountable). For instance, $$f(x)=\lfloor{1/x}\rfloor{\text{ mod }}2$$ will work.

-
Thank you, I think this works. Although my question wasn't exact enough, I suppose, because what I wanted is to avoid $(0,\varepsilon)$ to contain interval, but sure I will keep your answer and upvote it. – haemhweg Dec 5 '13 at 2:43
I think what you really want is for every interval $(a,b)\subset(0,1)$ to contain uncountably many points where $f(x)=0$ and uncountably many points where $f(x)=1$. Any such $f$ can't be constant on any interval. – mjqxxxx Dec 5 '13 at 3:07

Let $C$ be the Cantor set, and let $\mathbb Q$ be the set of all rational numbers. Let $A=\{s+t:s\in C,t\in\mathbb Q\}$, i.e., $A$ is the union of all rational translates of the Cantor set. Let $B=\mathbb R\setminus A$. Then $|A\cap I|=|B\cap I|=|\mathbb R|$ for every interval $I=(a,b),a\lt b$.

Define $f(x)=1$ if $x\in A$, $f(x)=0$ if $x\in B$.

-
+1 despite giving the cantor set a name normally reserved for the complex numbers. ;) – Dustan Levenstein Dec 5 '13 at 5:49

To do the partition, define a function $f(x)$ by the following operation. Let $y$ be the fractional part of $x$. Express $y$ in ternary, with trailing zeros if there is a choice. If there are an infinite number of $2$'s in the expansion, set $f(x)=0$. Otherwise, look at the digit after the last $2$, setting $f(x)=0$ if it is a zero and $f(x)=1$ if it is a $1$. Within any interval, there is a subinterval of the form $(\frac {3k+2}{3^m},\frac{3k+3}{3^m})$ These numbers all have a $2$ in the $m$ place. There are uncountably many followed by only $0$s and $1$s, so uncountably many $f(x)=0$ and $f(x)=1$ in every interval.

-

Hmm, how about looking at the first nonzero digit in the decimal expansion of x and sending x to 0 if it's odd and 1 if it's event?

-
Wouldn't I then have contradiction with $(0;0.11) = (0;0.1)\cup(0.1;0.11)\cup\{0.1\}$ and then I would have this function partitioning well for $(0;0.1)$ and sending everything to "odd" partition from $(0.1; 0.11)$? – haemhweg Dec 5 '13 at 2:08
But I think there should still be a bijection, since both preimages are still uncountable (I'm assuming that there's no cardinality between that of the integers and that of the reals). – Nishant Dec 5 '13 at 2:19

Write $x$ in base $3$. Consider the sets $$A := \{x | \text{the expansion of } x \text{ has finitely many 2s, but infinite 1s} \}$$ $$B := \{x | \text{the expansion of } x \text{ has finitely many 1s, but infinite 2s} \}$$ They are obviously disjoint, and dense, because any $y \in \mathbb{R}$ can be approximated arbitrarily by a finite sequence, and then you can append a tail of $1$s or $02$s to land in $A$ or $B$.

Now, $A$ is uncountable because it contains numbers with no 2, and those are in bijection with $\mathbb{R}$ by reinterpreting the expansion in binary. Similarly, $B$ is uncountable. More importantly, the same argument holds for the intersection of $A$ (or $B$) with any subinterval, so both $A$ and $B$ are uncountable in any small region.

To obtain a partition of all of $\mathbb{R}$, simply join $\mathbb{R} \setminus (A \cup B)$ to $A$, and you are set (pun intended).

-