# I have some unclear things in mind related to integrating a Dirichlet function.

On the Wikipedia it says "For example, the Dirichlet function, which is 0 where it's argument is irrational and 1 otherwise, has a Lebesgue integral, but does not have a Riemann integral. Furthermore, the Lebesgue integral of this function is zero, which agrees with the intuition that when picking a real number uniformly at random from the unit interval, the probability of picking a rational number should be zero." My first question is that an explanation for the fact that picking at random a real number from the unit interval the probability of picking a rational number should be zero is that for example on (0,1), (0,1) intersected with Q is countably infinite and that (0,1) intersected with R-Q is uncountably infinite? If so, then it means that an uncountably infinite set is infinite times bigger then a countably infinite set? Another thing which I didn't get from that Wikipedia statement is why the Dirichlet function does not have a Riemann integral. I understand that for example on (0,1) there are infinite rational numbers and "probably" (I used probably because I don't know yet if what I've anticipated in my first question was correct) infinite times more irrational numbers. As far as I know the function is not continuous, so it won't be continuous on (0,1). The reason why the function is not continuous as far as I understood is that f(X0) has to be equal to the limit of the function when X converges to that X0 but the limit doesn't properly exist because of the variation of the function nearby that X0 as there are many rational and irrational numbers which converge to that X0, is my approach good? But in this case on (0,1) the points of discontinuity don't form a set that is at most countable so that it has Lebesgue measure 0? In this case on (0,1) this will be a bounded function with countably many discontinuities so it will be Riemann integrable. But also, if we consider a division with finite partitions I understand that the maximum for each partition will be 1 and the minimum will be 0 so that the maximum Darboux sum will be 1 and the minimum Darboux sum will be 0. But what if we take a division with a number of partitions which is close to infinite so that on every partition the maximum and the minimum will be the same then the maximum Darboux sum and the minimum Darboux sum will be the same so their differnce will be 0 so it is Riemann integrable. As far as I understood the Riemann integrals, for me the Dirichlet function wouldn't be Riemann integrable if only I'd knew that for example on (0,1) there are not very much rational or irrational numbers which are consecutive so that calculating the area below the graph of the Dirichlet function would be like calculating the area under some points which don't have length so it would be impossible to calculate the area of those rectangles because they don't properly have a surface.

• I lost you when you mentioned that rational and irrational numbers can be consecutive. There are no gaps... Between each two real numbers (doesn't matter if those two are rational or irrational) there is uncountably infinitely many real numbers - (countably) infintely many rational numbers and (uncountably) infintely many irrational numbers. There is, for example, no smallest rational and no smallest irrational number $\gt 0$ - for any such number that you would suggest as a counterexample - I would halve it!
– user491874
Feb 1 '18 at 11:57
• I thought of that Dirichlet being 1 one for Q intersected with (0,1) and 0 for R-Q on (0,1), and I imagined that if there are not many rational or irrational consecutive numbers the graph will look approximately like a point in 1 then another one in 0 then another one again in 1 etc. Feb 1 '18 at 12:04
• I'm not a native English speaker and I might have expressed that wrong, what I meant was that if there would be many consecutive rational numbers for example there would be a line at y=1 on the graph and so there will exist an area under that line but if there wouldn't be many consecutive rational numbers because they would be interrupted by the irrational numbers then I imagine the graph will look as said above, I didn't mean that there are gaps on real numbers axis Feb 1 '18 at 12:11

• No, this isn't a contradiction because density of rationals is defined as I have stated above. However, the "probability of picking up a rational from the unit interval is 0" is a different concept. What this means is that given any small positive number $\epsilon$, you can cover all the rationals by countably many intervals whose total length will be less than $\epsilon$. You can choose $\epsilon$ as small as you want. Hence the probability of choosing the rationals is zero. Feb 1 '18 at 12:45