Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

How does one construct a bijection from (0,1) to the irrationals in (0,1)? Or if I am getting my notation right, can you provide an explicit function $f:(0,1)\rightarrow(0,1)\backslash\mathbb{Q}$ such that f is a bijection?

share|improve this question
1  
Related: math.stackexchange.com/questions/418/… –  Jonas Meyer Oct 25 '12 at 6:41
add comment

1 Answer 1

up vote 13 down vote accepted

(1) Choose an infinite countable set of irrational numbers in $(0,1)$, call them $(r_n)_{n\geqslant0}$.

(2) Enumerate the rational numbers in $(0,1)$ as $(q_n)_{n\geqslant0}$.

(3) Define $f$ by $f(q_n)=r_{2n+1}$ for every $n\geqslant0$, $f(r_n)=r_{2n}$ for every $n\geqslant0$, and $f(x)=x$ for every irrational number $x$ which does not appear in the sequence $(r_n)_{n\geqslant0}$.

Let me suggest you take it from here and show that $f$ is a bijection between $(0,1)$ and $(0,1)\setminus\mathbb Q$.

share|improve this answer
    
Well I found $r_n = \frac{\pi}{4n}$, but I am not so sure how to enumerate the rationals and avoid repeats like 1/2 = 2/4 –  fhyve Oct 25 '12 at 7:43
2  
All that matters is that such enumerations of the rationals exist. However, if really you need to enumerate the rationals in (0,1), here is a (quite classical) way: first, express every rational in the lowest terms, that is, as p/q where p and q are positive integers with no common factor other than one; then, sort the fractions in the ascending order of p+q ; in case of a tie, the smaller fraction comes first. The first few terms in this enumeration are 1/2, 1/3, 1/4, 2/3, 1/5, 1/6, 2/5... –  Did Oct 25 '12 at 7:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.