PROCEEDINGS OF THE AMERICAN MATHEMATICAL SOCIETY Volume 121, Number I, May 1994 ON THE MEDIANS OF GAMMA DISTRIBUTIONS AND AN EQUATION OF RAMANUJAN K. P. CHOI (Communicated by Wei Y. Loh) Abstract. For n > 0, let k(n) denote the median of the T(n +1,1) distribution. We prove that n + \ < X(n) < min(«+ log2, n + + (2n + 2)_1). These bounds are sharp. There is an intimate relationship between X(n) andan equation of Ramanujan. Based on this relationship, we derive the asymptotic expansion of X(n) as follows: 2 8 64 27-23 X(n) =«+-+ 3 405«5103n2 39-52«3 Let median( Z 7) denote the median of a Poisson random variable with mean p., where the median is defined to be the least integer m such that P(Zft < m) > j. We show that the bounds on X(n) imply ß - log2 < median(z^) < p. + ±. This proves a conjecture of Chen and Rubin. These inequalities are sharp. 1. Introduction and statement of main results For a continuous random variable X, the median is defined to be the least x G (-oo, oo) such that P(X < x) = j ; and if X is an integer-valued random variable, the median of X is defined to be the least integer m such that P(X < m) > -. In either case, we denote the median of X by median(x). For «> 0, let X(n) denote the median of the Y(n + 1,1) distribution, the Gamma distribution with parameters «+ 1 and 1. In other words, 1 rkn) 1 /-oo, (1) -t / fe-'dt^-, / re-'dt n\jo n\ Jm 2' One of the main results in this paper is Theorem 1. For «> 0, (2) «+ <X(n) <min(«+ log2, «+ + (2«+ 2)_1). These bounds are sharp. Received by the editors August 14, 1992. 1991 Mathematics Subject Classification. Primary 62E10, 41A58, 33B15. Key words and phrases. Median, Gamma distribution, Poisson distribution, chi-square distribution, Poisson-Gamma relation, Ramanujan's equation. 245 1994 American Mathematical Society 0002-9939/94 $1.00 + $.25 per page
246 K. P. CHOI In this paper, we also consider the median of the Poisson distribution. Let Zfn denote a Poisson random variable with mean p. Then it will be shown in the next section that Theorem 1 implies the following Theorem 2. Let p e (0, oo). Then These bounds are best possible. p - log2 < median(zm) < p + j. This proves Conjecture la of Chen and Rubin [2]. Based on a numerical study, Chen and Rubin were led to a stronger conjecture, which states that X(n) - «is decreasing in «. This still remains open. At the end of this section, we see that the coefficients of the first four terms of the asymptotic expansion of X(n - 1) - (n - 1) are positive. This strongly suggests that their conjecture is very likely to hold. The work of this paper is also motivated by its connection with a well-known equation of Ramanujan. Ramanujan [7] and also his first letter to Hardy on January 16, 1913 contained the following statement: For «> 1, let 8(n) be defined as (3) < Y.»+m»; k=0 then j < 0(n) < \. He also gave the first four terms of the asymptotic expansion of 9(n): a, ^ 1 4 8 16 _/ 1 \ (4) 0(")=3+l^-2l3^-85ÔlP + 0bJ- This problem has attracted a lot of attention. For example, Szegö [9] and Watson [10] proved that 6(n) lies between \ and \, whereas further coefficients of the asymptotic expansion have been found by Bowman, Shenton, and Szekeres [1] and Marsaglia [6]. Knuth considered the asymptotic expansion of P(Zn < «- 1)/P(Z = n) from which he gave another derivation of the asymptotic expansion of 6(n), though with fewer terms (see Knuth [5, pp. 112-118]). We find that there is an intimate relationship between X(n) and 6(n) (see the first paragraph of 3); namely, Mn) (5) l-6(n) = tn-xe-'/nn-le-ndt. Jn This will enable us to deduce bounds on 6(n) based on Theorem 1 and, conversely, asymptotic expansion of X(n) based on that of 6(n). Theorem 3. With 9(n) defined as above and «> 1, we have 1 J3_ 19 1 _4 4_ 3 162«+ 243«2 K m) < 3 + 81«243«3 ' The upper bound in Theorem 3 is a decreasing function in «, and hence 6(n) < \ + 555 = 0.36625..., which is an improvement of the upper bound j.
ON THE MEDIANS OF GAMMA DISTRIBUTIONS 247 Theorem 4. With X(n) defined as above, we have 2 8 64 27,23 J 1 \ (6) ^) = "+3 + 4^-5T0l^+3^52>z3+OUj- The first three terms of the asymptotic expansion can also be derived from Dinges [3, Proposition 3.6]. Our method here is different, and with more work many more terms can be derived. Doodson [4] considered median(x ) - mode(x ) --^-^,V \ = median(x ) - («- 1), mean(x ) - mode(x ) where X denotes a Gamma random variable with parameters «and 1. Using our notation and results, this ratio is 2 8 144 23 281 A(n_l)_(M_1) = _ + + + +... 2. Proofs of Theorems 1 and 2 Proof of Theorem 1. Let X +1 be T(«+ 1,1) distributed. For x e [\, 1], n > 0, let a (x) = P(X +X >n + x) and A (x) = (n + l)\[a +x(x) - an(x)]. For «> 0 and / > 0, let y/ (t) = tn+xe-'. Therefore, /»OO /«OO A (x)= f^e-'dt-^ + l) fe-'dt Jn+x+X Jn+x rn+x+x = (n + x)n+le-("+xl - / tn+xe-' dt Jn+x / n+x+x = / W (n + x)-ipn(t)]dt. Jn+x We shall show at the end of the proof that (7) A,(log2)>0, «>2; (8) ^ (f + (2«+ 2)-1)>0, «>1; (9) An(\)<0, «>1. By the Central Limit Theorem, we have a (x) \ as «oo. From (9) we have an(\) is a strictly decreasing sequence; therefore, a (\) > \. Hence, X(n) > «+, «> 1. Direct computation shows that X(0) = log 2 >, establishing inequality (2) in the case «= 0. The second inequality is proved in the same way. To prove (7)-(9), we write A (x) = B (x) + E (x), where B (x) is due to the Taylor expansion of y/n(x) at «+ 1 up to the third derivative and
248 K. P. CHOI with En(x) the error term. It is not difficult to derive that _., f (3x - 2) 6x2-8x + 3 \. B»{X) = \W^)- n(n + l)2 \^n + V> and there exist Ç e [«+ x, n + 1] and (t) lying between «+ 1 and t such that E (x) ^{:\Q-jn ' {t~n-l) ^m))dt. Write y/nk)(t) = wk n(t)y/n(t)/tk and ukt (s) = wkt (n+ 1 + s) for s e [-(1 - x), x] C [-1, 1]. It is straightforward to verify that U4t (s) = s4 + (n + 1)[3(«- 1) - 8s - 6s2], it is decreasing in 5, and «4, (s) > u4t (l) > 0 when «> 6. For «> 6, this implies that y/ 4\Ç(t)) > 0; hence, En(x) is bounded above by (l-x)x (-l) 24(n + x)* Vn(n+i). Therefore, AH(\) < BH(\) + >pn(n + l)/[648(«+ l)2] < 0, proving (9) for n > 6. Remaining cases can be verified by direct calculation. Next, for «> 6, E (x) is bounded below by -[*» + (!-xflfiu-l) 120(«+ x)4 Vn(n + 1)- Since the leading term of /l (log2) is (31og2-2)/[6(«+ 1)], it is apparent that ^4 (log2) > 0 for «sufficiently large. Indeed, it can be verified to be positive for «> 6. Also, we have Bn(\ + r^) = (grj^i - gt^r^tm" + 1) and En(\ + 5^) > ^(ntw^" + l) Hence, An(\ + 57^) > 0. Remaining cases can be verified by direct calculation. Since X(0) = log 2 and X(n) n-*\ as 00, the bounds are sharp. This completes the proof of Theorem 1. d Remark 1. The lower bound in (2) and hence the upper bound in Theorem 2 were proved by an ingenious and yet elementary method in Chen and Rubin [2]. Proof of Theorem 2. Making use of the Poisson-Gamma relation, which states that for «> 0, p > 0 (10) P(Zli<n) = P(Xn+x>p), we see that P(Z^ ) < «) = 5 and, for X(n) < p < X(n + 1), median(z/j) = «+ 1. Since X(n + 1) - X(n) > «+ 1 + - («+ log2) > 0.97, for any p e (log 2, 00), there exists «> 0 such that X(n) < p < X(n + 1). Therefore, and median^) - /1 = «+ 1 - // > «+ 1 - A(«+ 1 ) > - log 2 median(z^) -p = n + l-p<n+l- X(n) < 3. For p G (0, log2], median( Zß) = 0, so -log2 < median(za) with equality holds when p = log 2. Let p = X(n) + e, where e is an arbitrarily small positive number. Then median( Z^) - p = n + 1 - X(n) - e = 3 - e + 0(n~x).
ON THE MEDIANS OF GAMMA DISTRIBUTIONS 249 This shows that the second inequality is sharp, and this completes the proof of Theorem 2. D 3. Proofs of Theorems 3 and 4 It is obvious that equation (4) is equivalent to P(Zn<n)-[l-d(n)]P(Z = n)=x2. Recalling the Poisson-Gamma relation (see equation (10)) and the definitions of y/ and X(n), we obtain (5). Proof of Theorem 3. Recall the definition of \pn(t). Then / /i+2/3+(2n)-' l-0(«)< / ipn-x(t)/ipn-x(n)dt. Jn Expanding y/ -X(t) at t = n up to the second derivative and estimating the error term as in the proof of Theorem 1, we can show that ipn-x(t)/y/ -X(n) is bounded above by, (t-n)2 (t-n)3,,, 1- - +, max 2 + 3s«-s3 2«6«3 0<i<2/3+(2«)-i \2 tt_y,\i ^, (t-n)2 (t-n) I)' from which we obtain the lower bound for 6(n). As shown in the proof of Theorem 1, for «> 6, yt^l^t) > 0 on [«, «+ ]. Therefore, y/'n"_x(,) > y/'n-x(n). It now follows that Wn-x(t) >l (t-n)2 (t-n)3 y/n-x(n) 2«3«2 For «> 6, this inequality and Theorem 1 imply '"*2" W.-ÁD,2 4 4 Jn Wn-x(n) 3 81«243«2' and the upper bound for 6(n) follows. It can be verified that the upper bound still holds for 1 < «< 5. This completes the proof of Theorem 3. D Proof of Theorem 4. Using the Taylor expansion of y/n-x at t = «, we have k=0 vi-i(n) (k(n) - n)k Wn-x(n) (k+l)\ We estimate the error term Rn as follows. Recall that ^3(0=^.1.-1(0^.-1(0/^.
250 K. P. CHOI It is not difficult to show by induction that wny -X = max{\wn<n-x(t)\ : n < t < «+ log 2} < tv!«^2. Therefore, I «">(f-»)* 0«.(0) / \Rn\ = NI Vn-i(n) (X(n) - n)n+x - (N+l)nN 2 0 as N -+ oo. <(A(«)-«)jV+1 l^,n_i (tv+1)! nn Let % = y/nk\(n)/y/n-x(n) for /: > 0. It is easy to verify that a0 = 1, ax = 0, and, for k > 2, ak = -(k - l)[ak_x + ak_2]/n. Then we obtain '- M-ËAîT From this we can derive the asymptotic expansion of X(n). This finishes the proof, d 4. Remarks It is not difficult to see that X median(r(a, X)) = median(r(a, 1)). Therefore, we have the following corollary from Theorem 1. Corollary 5. For n > 1 and X>0, we have < median(r(«, X)) - mean(r(«, X)) <-:. 3/Í A. The bounds are best possible. Using the fact that xl = T(f. 2). we have Corollary 6. For m > 1, The bounds are best possible. -\ < median(xl) - mean(/ m) < 2(-l + log2). Acknowledgment I would like to thank the referee for many helpful suggestions which improved the paper. References 1. K. O. Bowman, L. R. Shenton, and G. Szekeres, A Poisson sum up to the mean and a Ramanujan Problem, J. Statist. Comput. Simulation 20 (1984), 167-173. 2. J. Chen and H. Rubin, Bounds for the difference between median and mean of Gamma and Poisson distributions, Statist. Probab. Lett. 4 (1986), 281-283. 3. H. Dinges, Special cases of second order Wiener Germ approximations, Probab. Theory Related Fields 83 (1989), 5-57. 4. A. T. Doodson, Relation of the mode, median and mean in frequency curves, Biometrika 11 (1971), 425-429. 5. D. E. Knuth, The art of computer programming, Vol. 1, 2nd ed., Addison-Wesley, Reading, MA, 1973.
ON THE MEDIANS OF GAMMA DISTRIBUTIONS 251 6. J. C. W. Marsaglia, The incomplete Gamma function and Ramanujan's rational approximation to ex, J. Statist. Comput. Simulation 24 (1986), 163-168. 7. S. Ramanujan, J. Indian Math. Soc. 3 (1911), 151-152. 8. _, Collected Papers, Chelsea, New York, 1927. 9. G Szegö, Über einige von S. Ramanujan gesteile Aufgaben, J. London Math. Soc. 3 (1928), 225-232. 10. G. N. Watson, Theorems stated by Ramanujan (V): Approximations connected with e*, Proc. London Math. Soc. (2) 29 (1927), 293-308. Department of Mathematics, National University of Singapore, Singapore 0511, Republic of Singapore E-mail address: matckpflnusvm.bitnet