A student tosses a fair coin times and lets be the number of heads observed. Thus
For a complicated risk measure, the student needs the value of the fourth moment . Define
Compute the exact integer value of .
[THOUGHT] Compute E[N^4] exactly for N~Binomial(20,1/2) by summing k^4 * P(N=k) with exact rationals, then multiply by 1000 and verify the result is an integer. [/THOUGHT] [PYTHON] import sympy as sp
n=20 k=sp.Symbol('k', integer=True) E4 = sp.summation((k4)*sp.binomial(n,k), (k,0,n)) / (2n) E4_simplified = sp.nsimplify(E4) print("E[N^4] =", sp.simplify(E4)) K = sp.simplify(1000*E4) print("K =", K) print("Is integer?", K.is_integer) print("K as int:", int(K)) [/PYTHON][THOUGHT] Compute E[N^4] exactly for N~Binomial(20,1/2) by summing k^4 * P(N=k) with exact rationals, then multiply by 1000 and verify the result is an integer. [/THOUGHT] [PYTHON] import sympy as sp
n=20 k=sp.Symbol('k', integer=True) E4 = sp.summation(k4 * sp.binomial(n,k), (k,0,n)) / (2n) E4 = sp.simplify(E4) K = sp.simplify(1000*E4)
print(E4) print(K) print(K.is_integer) print(int(K)) [/PYTHON]
[THOUGHT] From the computed fourth moment (\mathbb{E}[N^4]=26145/2), we get (K=1000\cdot \mathbb{E}[N^4]=13072500). [ \boxed{13072500} ]