Rationals in J are expressed in lowest terms, that is, the numerator and denominator are relatively prime. Consequently it can not be that both are even, and if they were to start with then in their reduced form they would contribute to the portion where the denom is odd.
The full answer to your question probably can be worked out from this. ----- Original Message ----- From: John Randall <[EMAIL PROTECTED]> Date: Wednesday, May 7, 2008 9:15 Subject: [Jchat] Denominators of random rationals To: [email protected] > Random rationals do not have random denominators. > > NB. denominator of rational > denom=:{: @ (2&x:) > NB. generate some random rationals > f=:_2 %/\ x: @: >: @ ?. @: #~ > NB. proportion of odd denominators > g=:(+/%#) @: (1 = 2 |denom"0) > > g 1e6 f 1e4 > 0.6806 > > About 2/3 of the rationals have odd denominators, and only 1/3 have > even denominators. > > Problem: Why? > > > Best wishes, > > John ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
