blob: 98f73141a4c9ea8fe72269a9873eb6b769424659 (
plain)
1
2
3
4
5
6
7
8
9
10
|
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);
var10 = var*10;
disp(var10, "The variance is")
|