summaryrefslogtreecommitdiff
path: root/291/CH4/EX4.6a/eg4_6a.sce
blob: 590bd709ce57d64835f2c5cf240ebb155b35ec3c (plain)
1
2
3
4
5
6
7
8
9
probXequalsi = 1/6;
expecXsquared = 0;
for n=1:6
    expecXsquared = expecXsquared + (n*n*probXequalsi)
end

expecX= 3.5 // from eg 4.4a
var = expecXsquared - (expecX^2);
disp(var, "The variance is")