![ProdyPlot](http://artent.net/wp-content/uploads/2012/08/ProdyPlot2-150x139.png)
What percentage of “random fractions” have an even denominator? My friend Pig told me that the answer is around 1/3. (At least the answer is 1/3 for two somewhat natural definitions of the term “random fraction”.) Here is the experimental “proof” in Mathematica.
Mathematica input for test #1:
percentage[v_List, pred_] := N[ Length[Select[v, pred]] / Length[v] ]; percentage[ Table[ RandomInteger[{1, 1000}] / RandomInteger[{1, 1000}], {100000} ], EvenQ[Denominator[#]] ]
Output for test #1:
0.33343
Mathematica input for test #2:
percentage[ Table[i/j, {i, 1000}, {j, 1000}] // Flatten // Union, EvenQ[Denominator[#]] ]
Output for test #2 :
0.333443
Related Posts via Categories
-
I have a quasiproof in the case where we consider fractions m/n with m,n bounded by N.
Let U_N be the rationals with numerator and denominator less than N. T_N those with numerator odd and S_N those with numerator even. Its clear that doubling N multiplies the sizes of these by 4. Now S_N is inside T_N. Multiplying members of T_N by 1/2 gives about half the members of S_2N, namely only those with denominators less than N. Thus 1/4 |T_N| = 1/2 |S_2N| so S is half the size of T. To finish the proof is easy now. Let m/n be a fraction with n even. Then n/m is a fraction with n even. So S is the same as T’. Thus T + T’ has size 3S.
-
Oops. There is a misprint. I meant S_N those with denominator even.
-
f[n_Integer] :=
Count[Flatten@(Apply[Divide, #, {2}] &@
Table[{x, y}, {x, n}, {y, n}]),
x_Rational /; EvenQ[Denominator[x]]]/n^2DiscretePlot[f[n], {n, 100}]
-
Suppose I want an analytic expression for a probability measure on the set of rationals in (0,1) such that the probability of a fraction having an even denominator is exactly 1/3.
1. Is this easy?
2. What about the same question for numerator instead of denominator? (ha ha, sigh….)
-
Well, I have a suggestion. Suppose S is a set of rationals in (0,1). Let U_N be the set of rationals m/n in (0,1) with m<n=<N. Let S_N = U_N intersect S. Then define the measure of S to be the limit |S_N|/|U_N| assuming this limit exists.
-
-
Comments are now closed.
22 comments