I think you're not using Expectation
correctly. I could be wrong though, but from what I see in the documentation, your second argument is not of the required types. It's supposed to be basically x \[Distributed] dist
where x
is a symbolic variable, not a table of symbolic values.
Edit. My bad, the syntax {x,y,z,...}\[Distributed] dist
exists but it's for multivariate distributions. Maybe the syntax {Subscript[x, 1] \[Distributed] Subscript[dist, 1],
Subscript[x, 2] \[Distributed] Subscript[dist, 2], \[Ellipsis]}
is what you want, but I'm not sure how you would write this with a formal number of parameters.
Edit#2. That being said even X[x, imax] can't be called without imax being defined. Table[x[i], {i,imax}]
would return the error 'Table: iterator {i,imax} does not have appropriate bounds'.