Professional Documents
Culture Documents
Stats
Stats
Week 4 TUTORIALS:
Let X have the Bernoulli distribution with parameter p. That is, assume
that X is either 0 or 1 with Pr(X=1)=p. What is the expectation of X?
E(X) = 0 × (1 − p) + 1 × p = p
Suppose that a random variable X can take each of the five values
-2,0,1,3 and 4 with equal probability. What is the variance of X?
x=c(-2,0,1,3,4)
fx= c(0.2,0.2,0.2,0.2,0.2) #or, you may use fx=rep(.2,5)
Properties of expectations
EX=sum(x*fx)
1. E(a) = a
varx=sum(fx*(x-EX)^2)
2. E(aX+B) = aE(X) + b
varx 4.56
3. E(X1 + X2 +…+ Xn) = E(X1) + E(X2) + …+ E(Xn)
4. E(aX1 + bX2 + c) = aE(X1) + bE(X2) + c
5. E(X1X2) = E(X1)E(X2) if X1 and X2 are statistically independent