This for the set of compositions of n using {1,2} according to the random va\ riable "number of 2's" The Average, Variance, and Scaled Moments Up to the, 6, -th of a Certain Combinatorial Random Variable By Shalosh B. Ekhad Theorem: Suppose that there is an infinite family of cominatorial families, \ on which there is a combinatorial random variable Let , P[n](w), be the weight-enumerator according to that random variable of\ the n-th member of our family. Suppose that you found out (e.g. by the transfer matrix method) that the bi-variate gener\ infinity ----- \ n 1 ating function, , ) P[n](w) t , equals , ------------- / 2 ----- -t w - t + 1 n = 0 In other words infinity ----- \ n 1 ) P[n](w) t = ------------- / 2 ----- -t w - t + 1 n = 0 Definition: Let a(n) be defined by the ordinary generating function infinity ----- \ n 1 ) a(n) t = ----------- / 2 ----- -t - t + 1 n = 0 then, of course, a(n), is the number of elements in the n-th family. The EXACT expression, in terms of a(n) and n, for the EXPECTATION is 2/5 n a(n) + (- 1/5 - n/5) a(n - 1) ----------------------------------- a(n) and in Maple notation (2/5*n*a(n)+(-1/5-1/5*n)*a(n-1))/a(n) The EXACT expression, in terms of a(n) and n, for the VARIANCE is 2 2 2 2 2 (1/25 n a(n) - 1/25 n a(n) a(n - 1) - 1/25 a(n - 1) - 2/25 a(n - 1) n 2 2 2 / 2 - 1/25 a(n - 1) n + 3/25 n a(n) + 1/25 a(n) a(n - 1)) / a(n) / and in Maple notation (1/25*n^2*a(n)^2-1/25*n^2*a(n)*a(n-1)-1/25*a(n-1)^2-2/25*a(n-1)^2*n-1/25*a(n-1) ^2*n^2+3/25*n*a(n)^2+1/25*a(n)*a(n-1))/a(n)^2 The EXACT expression, in terms of a(n) and n, for the, 3, -th moment about the mean is / 3 3 3 3 3 2 |-2/125 a(n - 1) + 1/125 n a(n) - 6/125 a(n - 1) n - 6/125 a(n - 1) n \ 3 3 3 2 3 2 - 2/125 a(n - 1) n - 3/125 a(n) n - 2/25 a(n) n + 1/25 a(n) a(n - 1) 2 2 2 3 2 + 3/125 a(n) a(n - 1) + 9/125 n a(n) a(n - 1) + 1/125 n a(n) a(n - 1) 2 2 2 + 3/125 n a(n) a(n - 1) - 3/125 n a(n) a(n - 1) 3 2 13 2 \ / 3 - 3/125 n a(n) a(n - 1) + --- a(n) a(n - 1) n| / a(n) 125 / / and in Maple notation (-2/125*a(n-1)^3+1/125*n^3*a(n)^3-6/125*a(n-1)^3*n-6/125*a(n-1)^3*n^2-2/125*a(n -1)^3*n^3-3/125*a(n)^3*n^2-2/25*a(n)^3*n+1/25*a(n)^2*a(n-1)+3/125*a(n)*a(n-1)^2 +9/125*n^2*a(n)^2*a(n-1)+1/125*n^3*a(n)^2*a(n-1)+3/125*n*a(n)*a(n-1)^2-3/125*n^ 2*a(n)*a(n-1)^2-3/125*n^3*a(n)*a(n-1)^2+13/125*a(n)^2*a(n-1)*n)/a(n)^3 The EXACT expression, in terms of a(n) and n, for the, 4, -th moment about the mean is / 4 4 4 12 4 18 4 2 |-3/625 a(n - 1) + 2/625 n a(n) - --- a(n - 1) n - --- a(n - 1) n \ 625 625 12 4 3 4 4 4 3 4 2 - --- a(n - 1) n - 3/625 a(n - 1) n + 2/625 a(n) n + 1/125 a(n) n 625 4 3 2 2 - 1/125 a(n) n - 7/125 a(n) a(n - 1) + 4/125 a(n) a(n - 1) 3 3 3 4 3 + 6/625 a(n) a(n - 1) - 2/625 n a(n) a(n - 1) + 1/625 n a(n) a(n - 1) 46 2 2 2 3 2 2 + --- n a(n) a(n - 1) + 2/125 n a(n) a(n - 1) 625 4 2 2 12 3 12 3 3 - 2/625 n a(n) a(n - 1) + --- n a(n) a(n - 1) - --- n a(n) a(n - 1) 625 625 4 3 3 2 - 6/625 n a(n) a(n - 1) - 8/625 a(n) a(n - 1) n 3 54 2 2 \ / 4 - 8/125 a(n) a(n - 1) n + --- a(n) a(n - 1) n| / a(n) 625 / / and in Maple notation (-3/625*a(n-1)^4+2/625*n^4*a(n)^4-12/625*a(n-1)^4*n-18/625*a(n-1)^4*n^2-12/625* a(n-1)^4*n^3-3/625*a(n-1)^4*n^4+2/625*a(n)^4*n^3+1/125*a(n)^4*n^2-1/125*a(n)^4* n-7/125*a(n)^3*a(n-1)+4/125*a(n)^2*a(n-1)^2+6/625*a(n)*a(n-1)^3-2/625*n^3*a(n)^ 3*a(n-1)+1/625*n^4*a(n)^3*a(n-1)+46/625*n^2*a(n)^2*a(n-1)^2+2/125*n^3*a(n)^2*a( n-1)^2-2/625*n^4*a(n)^2*a(n-1)^2+12/625*n*a(n)*a(n-1)^3-12/625*n^3*a(n)*a(n-1)^ 3-6/625*n^4*a(n)*a(n-1)^3-8/625*a(n)^3*a(n-1)*n^2-8/125*a(n)^3*a(n-1)*n+54/625* a(n)^2*a(n-1)^2*n)/a(n)^4 The EXACT expression, in terms of a(n) and n, for the, 5, -th moment about the mean is / 5 3 2 2 3 |-4/3125 a(n - 1) - 7/125 a(n) a(n - 1) + 2/125 a(n) a(n - 1) \ 4 5 5 5 + 2/625 a(n) a(n - 1) + 3/3125 n a(n) - 4/625 a(n - 1) n 5 2 5 3 5 4 - 8/625 a(n - 1) n - 8/625 a(n - 1) n - 4/625 a(n - 1) n 5 5 5 4 5 3 68 5 - 4/3125 a(n - 1) n - 3/625 a(n) n - 4/125 a(n) n + --- a(n) n 625 4 4 2 4 + 1/625 a(n) a(n - 1) + 6/625 n a(n) a(n - 1) + 4/625 n a(n) a(n - 1) 3 4 4 4 - 4/625 n a(n) a(n - 1) - 6/625 n a(n) a(n - 1) 5 4 4 4 - 2/625 n a(n) a(n - 1) + 7/625 n a(n) a(n - 1) 5 4 3 3 2 + 1/625 n a(n) a(n - 1) + 4/125 n a(n) a(n - 1) 4 3 2 5 3 2 + 1/625 n a(n) a(n - 1) - 1/625 n a(n) a(n - 1) 2 2 3 16 3 2 3 + 8/125 n a(n) a(n - 1) + --- n a(n) a(n - 1) 625 4 2 3 5 2 3 - 2/625 n a(n) a(n - 1) - 2/625 n a(n) a(n - 1) 16 4 3 4 2 39 4 + --- a(n) a(n - 1) n - 6/125 a(n) a(n - 1) n - --- a(n) a(n - 1) n 625 625 11 3 2 3 2 2 34 2 3 - --- a(n) a(n - 1) n - 2/625 a(n) a(n - 1) n + --- a(n) a(n - 1) n 125 625 \ / 5 | / a(n) / / and in Maple notation (-4/3125*a(n-1)^5-7/125*a(n)^3*a(n-1)^2+2/125*a(n)^2*a(n-1)^3+2/625*a(n)*a(n-1) ^4+3/3125*n^5*a(n)^5-4/625*a(n-1)^5*n-8/625*a(n-1)^5*n^2-8/625*a(n-1)^5*n^3-4/ 625*a(n-1)^5*n^4-4/3125*a(n-1)^5*n^5-3/625*a(n)^5*n^4-4/125*a(n)^5*n^3+68/625*a (n)^5*n+1/625*a(n)^4*a(n-1)+6/625*n*a(n)*a(n-1)^4+4/625*n^2*a(n)*a(n-1)^4-4/625 *n^3*a(n)*a(n-1)^4-6/625*n^4*a(n)*a(n-1)^4-2/625*n^5*a(n)*a(n-1)^4+7/625*n^4*a( n)^4*a(n-1)+1/625*n^5*a(n)^4*a(n-1)+4/125*n^3*a(n)^3*a(n-1)^2+1/625*n^4*a(n)^3* a(n-1)^2-1/625*n^5*a(n)^3*a(n-1)^2+8/125*n^2*a(n)^2*a(n-1)^3+16/625*n^3*a(n)^2* a(n-1)^3-2/625*n^4*a(n)^2*a(n-1)^3-2/625*n^5*a(n)^2*a(n-1)^3+16/625*a(n)^4*a(n-\ 1)*n^3-6/125*a(n)^4*a(n-1)*n^2-39/625*a(n)^4*a(n-1)*n-11/125*a(n)^3*a(n-1)^2*n-\ 2/625*a(n)^3*a(n-1)^2*n^2+34/625*a(n)^2*a(n-1)^3*n)/a(n)^5 The EXACT expression, in terms of a(n) and n, for the, 6, -th moment about the mean is /17 2 4 6 5 |--- a(n) a(n - 1) n - 1/3125 a(n - 1) + 3/3125 a(n) a(n - 1) \625 4 2 21 3 3 2 4 + 6/3125 a(n) a(n - 1) - --- a(n) a(n - 1) + 4/625 a(n) a(n - 1) 625 6 6 6 6 2 + 1/3125 n a(n) - 6/3125 a(n - 1) n - 3/625 a(n - 1) n 6 3 6 4 6 5 - 4/625 a(n - 1) n - 3/625 a(n - 1) n - 6/3125 a(n - 1) n 6 6 6 5 34 6 3 34 6 2 - 1/3125 a(n - 1) n - 6/3125 a(n) n + --- a(n) n + ---- a(n) n 625 3125 371 6 353 5 12 5 - ---- a(n) n + ---- a(n) a(n - 1) + ---- n a(n) a(n - 1) 3125 3125 3125 2 5 4 5 + 3/625 n a(n) a(n - 1) - 3/625 n a(n) a(n - 1) 12 5 5 6 5 - ---- n a(n) a(n - 1) - 3/3125 n a(n) a(n - 1) 3125 27 2 2 4 18 3 2 4 + --- n a(n) a(n - 1) + --- n a(n) a(n - 1) 625 625 4 2 4 5 2 4 + 2/625 n a(n) a(n - 1) - 3/625 n a(n) a(n - 1) 6 2 4 5 5 - 1/625 n a(n) a(n - 1) - 3/3125 n a(n) a(n - 1) 6 5 21 4 4 2 + 2/3125 n a(n) a(n - 1) + --- n a(n) a(n - 1) 625 5 4 2 26 3 3 3 + 6/625 n a(n) a(n - 1) + --- n a(n) a(n - 1) 625 19 4 3 3 6 3 3 + --- n a(n) a(n - 1) - 1/625 n a(n) a(n - 1) 625 5 4 5 3 - 4/125 a(n) a(n - 1) n - 9/125 a(n) a(n - 1) n 111 5 2 594 5 213 4 2 + ---- a(n) a(n - 1) n + ---- a(n) a(n - 1) n - ---- a(n) a(n - 1) n 3125 3125 3125 399 4 2 2 21 4 2 3 - ---- a(n) a(n - 1) n - --- a(n) a(n - 1) n 3125 625 3 3 21 3 3 2\ / 6 - 2/25 a(n) a(n - 1) n - --- a(n) a(n - 1) n | / a(n) 625 / / and in Maple notation (17/625*a(n)^2*a(n-1)^4*n-1/3125*a(n-1)^6+3/3125*a(n)*a(n-1)^5+6/3125*a(n)^4*a( n-1)^2-21/625*a(n)^3*a(n-1)^3+4/625*a(n)^2*a(n-1)^4+1/3125*n^6*a(n)^6-6/3125*a( n-1)^6*n-3/625*a(n-1)^6*n^2-4/625*a(n-1)^6*n^3-3/625*a(n-1)^6*n^4-6/3125*a(n-1) ^6*n^5-1/3125*a(n-1)^6*n^6-6/3125*a(n)^6*n^5+34/625*a(n)^6*n^3+34/3125*a(n)^6*n ^2-371/3125*a(n)^6*n+353/3125*a(n)^5*a(n-1)+12/3125*n*a(n)*a(n-1)^5+3/625*n^2*a (n)*a(n-1)^5-3/625*n^4*a(n)*a(n-1)^5-12/3125*n^5*a(n)*a(n-1)^5-3/3125*n^6*a(n)* a(n-1)^5+27/625*n^2*a(n)^2*a(n-1)^4+18/625*n^3*a(n)^2*a(n-1)^4+2/625*n^4*a(n)^2 *a(n-1)^4-3/625*n^5*a(n)^2*a(n-1)^4-1/625*n^6*a(n)^2*a(n-1)^4-3/3125*n^5*a(n)^5 *a(n-1)+2/3125*n^6*a(n)^5*a(n-1)+21/625*n^4*a(n)^4*a(n-1)^2+6/625*n^5*a(n)^4*a( n-1)^2+26/625*n^3*a(n)^3*a(n-1)^3+19/625*n^4*a(n)^3*a(n-1)^3-1/625*n^6*a(n)^3*a (n-1)^3-4/125*a(n)^5*a(n-1)*n^4-9/125*a(n)^5*a(n-1)*n^3+111/3125*a(n)^5*a(n-1)* n^2+594/3125*a(n)^5*a(n-1)*n-213/3125*a(n)^4*a(n-1)^2*n-399/3125*a(n)^4*a(n-1)^ 2*n^2-21/625*a(n)^4*a(n-1)^2*n^3-2/25*a(n)^3*a(n-1)^3*n-21/625*a(n)^3*a(n-1)^3* n^2)/a(n)^6 Let , b, be the largest positive root of the polynomial equation 2 -b + b + 1 = 0 and in Maple notation -b^2+b+1 = 0 whose floating-point approximation is 1.618033988 Then the size of the n-th family (i.e. straight enumeration) is very close t\ o n (b + 1) b ---------- 2 + b and in Maple notation (b+1)/(2+b)*b^n and in floating point n 0.7236067977 1.618033988 The average of the statistics is, asymptotically (2 b - 1) n 1 ----------- - --- 5 b 5 b and in Maple notation 1/5*(2*b-1)/b*n-1/5/b and in floating-point .2763932022*n-.1236067978 The variance of the statistics is, asymptotically (3 b + 1) n b - 1 ----------- + ---------- 25 (b + 1) 25 (b + 1) and in Maple notation 1/25*(3*b+1)/(b+1)*n+1/25*(b-1)/(b+1) and in floating-point .8944271908e-1*n+.9442719092e-2 The skewness of the statistics is, asymptotically 2 (720 b + 445) n + (-2424 b - 1498) n + 2040 b + 1261 -------------------------------------------------------------- 3 2 (1610 b + 995) n + (510 b + 315) n + (54 b + 33) n + 2 b + 1 and in Maple notation ((720*b+445)*n^2+(-2424*b-1498)*n+2040*b+1261)/((1610*b+995)*n^3+(510*b+315)*n^ 2+(54*b+33)*n+2*b+1) and in floating-point (1609.984471*n^2-5420.114387*n+4561.789336)/(3600.034721*n^3+1140.197334*n^2+ 120.3738354*n+4.236067976) The kurtosis of the statistics is, asymptotically 2 (315 b + 195) n + (-169 b - 103) n - 274 b - 168 ------------------------------------------------- 2 (105 b + 65) n + (22 b + 14) n + b + 1 and in Maple notation ((315*b+195)*n^2+(-169*b-103)*n-274*b-168)/((105*b+65)*n^2+(22*b+14)*n+b+1) and in floating-point (704.6807062*n^2-376.4477440*n-611.3413127)/(234.8935687*n^2+49.59674774*n+2.61\ 8033988) The standardized, 5, -th moment (about the mean) of the statistics is, asymptotically 4 3 ((16912500 b + 10452500) n + (-106310500 b - 65703500) n 2 + (201466125 b + 124512925) n + (-108122430 b - 66823310) n + 17493905 b / 5 4 + 10811849) / ((378175 b + 233725) n + (199625 b + 123375) n / 3 2 + (42150 b + 26050) n + (4450 b + 2750) n + (235 b + 145) n + 5 b + 3) and in Maple notation ((16912500*b+10452500)*n^4+(-106310500*b-65703500)*n^3+(201466125*b+124512925)* n^2+(-108122430*b-66823310)*n+17493905*b+10811849)/((378175*b+233725)*n^5+( 199625*b+123375)*n^4+(42150*b+26050)*n^3+(4450*b+2750)*n^2+(235*b+145)*n+5*b+3) and in floating-point (37817499.82*n^4-237717502.3*n^3+450491962.7*n^2-241769076.6*n+39117581.87)/( 845625.0034*n^5+446375.0349*n^4+94250.13259*n^3+9950.251247*n^2+525.2379872*n+ 11.09016994) The standardized, 6, -th moment (about the mean) of the statistics is, asymptotically 3 2 5 ((4830 b + 2985) n + (-7830 b - 4840) n + (-18880 b - 11670) n + 28628 b / + 17693) / ( / 3 2 (1610 b + 995) n + (510 b + 315) n + (54 b + 33) n + 2 b + 1) and in Maple notation 5*((4830*b+2985)*n^3+(-7830*b-4840)*n^2+(-18880*b-11670)*n+28628*b+17693)/(( 1610*b+995)*n^3+(510*b+315)*n^2+(54*b+33)*n+2*b+1) and in floating-point 5*(10800.10416*n^3-17509.20613*n^2-42218.48169*n+64014.07701)/(3600.034721*n^3+ 1140.197334*n^2+120.3738354*n+4.236067976) Finally here is the asymptotic expressions, to order 2, of the standarized \ third to, 6, -th moment 144 b + 89 381890 b + 236021 The , 3, -th standardized moment is, --------------- - ---------------------- (322 b + 199) n 2 5 (46368 b + 28657) n 0.4472135956 1.647213595 and in floating-point, ------------ - ----------- n 2 n 47 b + 29 10679 b + 6600 The , 4, -th standardized moment is, 3 - ------------- - ------------------ (21 b + 13) n 2 5 (987 b + 610) n 2.236067977 2.163932022 and in floating-point, 3 - ----------- - ----------- n 2 n The , 5, -th standardized moment is, 100 (6765 b + 4181) 40 (779585071 b + 481810071) ------------------- - ---------------------------- (15127 b + 9349) n 2 (102334155 b + 63245986) n 44.72135955 304.7213595 and in floating-point, ----------- - ----------- n 2 n The , 6, -th standardized moment is, 65 (144 b + 89) 2 (1157603 b + 715438) 15 - --------------- - ---------------------- (322 b + 199) n 2 (46368 b + 28657) n 29.06888371 49.93111628 and in floating-point, 15 - ----------- - ----------- n 2 n This took, 0.154, seconds.