Problem 1

advertisement
Problem 1
a) Independence in pairs does not imply the multiplication rule for events. Suppose we
toss a die twice and let A=”odd outcome of the first toss”, B=”odd outcome of the second
toss”, C=”sum is odd”. Show that there is a pairwise independence, i.e., A and B, B and C
as well as A and C are independent by showing
P (A, B) = P (A)P (B),
P (B, C) = P (B)P (C),
P (A, C) = P (A)P (C).
Further, show that A, B and C (all three) are not independent by showing
P (A, B, C) 6= P (A)P (B)P (C).
b) Multiplication rule does not imply independence in pairs
We will show that
P (A, B, C) = P (A)P (B)P (C)
(1)
does not imply that A, B and C are independent. Let the sample space be S={1,2,3,4,5}
and let A={1,4}, B={2,4}, C={3,4} and P r(1) = P r(2) = P r(3) = p − p 3 , P r(4) = p3 ,
where p = 0.1. Show that A,B and C satisfy (1) while P (A, B) = p3 , i.e, A and B are not
independent.
Problem 2.
Write a matlab code to simulate 1000 random variables with probability distribution
f (x) = 5x4
on the interval [0, 1]. Calculate the numerical cumulative distribution of the simulated random variables by counting how many of them are less than a given number. Plot the
numerical cumulative distribution against analytical one obtained from f (x).
Problem 3
Use rejection method to simulate 1000 random variable with probability distribution
1
f (x) = √ exp(−x2 /2)
2 π
on the interval [0, ∞] using g(x) = exp(−x). Calculate the numerical cumulative distribution
of the simulated random variables by counting how many of them are less than a given
number. Plot the numerical cumulative distribution against analytical one. Use erf function
for the analytical distribution.
1
Download