I am currently trying to calculate some expressions of means of iid (independent and identically distributed) random variables. I try to verify my manual calculations with Mathematica: I defined
m[Subscript[X, i_]] := m[Subscript[X, 1]] /; i != 1
m[Subscript[X, i_] Subscript[X, j_]] := m[Subscript[X, i]] m[Subscript[X, j]] /; i != j
which works fine. ($E(X_j)=E(X_1)$ and $E(X_iX_j)=E(X_i)E(X_j)$ if $i\neq j$)
I know that Mathematica can simplify sums with variable bound like Sum[a, {i, 1, n}] to an.
Now I consider a sum for a fixed $j$:
Sum[m[Subscript[X, i] Subscript[X, j]], {i, 1, n}]
Is it possible to make Mathematica simplify it to $(n-1)E(X_1)^2+E(X_j^2)$?
Times[a,n]so its a product. What is your point? – meneken17 Jul 14 '17 at 12:35