Question: How to specify this index of the sum the right way?

First of all, I use Maple 14.
I tried to generate N samples from a defined normal distribution and then let Maple calculate sample mean, sample standard deviation and a statistic Z for each of the i samples:

with(statistics):

N:=100:
n:=100:
X:=RandomVariable(Normal(500,50));


for i to N do
X||i:=Sample(X,n):
mu||i:=1/n*sum(X||i(1,j),j=1..n):
sigma||i:=sqrt(1/(n-1)*sum(((X||i(1,j)-mu||i))^(2),j=1..n)):
Z||i:=(mu||i-500)*sqrt(n)/sigma||i:
end do:

 

Unfortunately I get the following error:

 

Error, unsupported type of index, j


What did I do wrong and what can I do about it?

Thanks.

Please Wait...