A288347 Median of X^2 + Y^2 where X and Y are independent random variables with B(n, 1/2) distributions.
1, 2, 5, 9, 13, 20, 25, 34, 41, 52, 61, 74, 85, 100, 116, 130, 149, 164, 185, 202, 225, 244, 269, 290, 317, 340, 369, 394, 425, 452, 485, 520, 549, 585, 617, 653, 689, 730, 765, 808, 845, 890, 929, 976, 1017, 1066, 1109, 1160, 1205, 1258, 1305, 1360, 1409
Offset: 1
Keywords
Links
- Robert Israel, Table of n, a(n) for n = 1..800
Crossrefs
Programs
-
Maple
f:= proc(n) local S,P,i,j,q; S:= sort( [seq(seq([i,j],i=0..n),j=0..n)],(a,b) -> a[1]^2 + a[2]^2 < b[1]^2 + b[2]^2); P:= ListTools:-PartialSums(map(t -> binomial(n,t[1])*binomial(n,t[2])/2^(2*n), S)); q:= ListTools:-BinaryPlace(P,1/2); if P[q] = 1/2 then S[q][1]^2 + S[q][2]^2 else S[q+1][1]^2 + S[q+1][2]^2 fi end proc: map(f, [$1..80]); # Robert Israel, Oct 04 2017
-
Mathematica
Squared[x_] := x^2; WeightsMatrix[n_] := Table[Binomial[n, i] Binomial[n, j], {i, 0, n}, {j, 0, n}]/2^(2 n); ValuesMatrix[n_, f_] := Table[f[i] + f[j], {i, 0, n}, {j, 0, n}]; Distribution[n_, f_] := EmpiricalDistribution[Flatten[WeightsMatrix[n]] -> Flatten[ValuesMatrix[n, f]]]; NewMedian[n_, f_] := Mean[Quantile[Distribution[n, f], {1/2, 1/2 + 1/2^(2 n)}]]; Table[NewMedian[n, Squared], {n, 53}]
Comments