I will be attempting the below:
Exercise 3.
Let X1 and X2 be independent random variables with common distribution Px = 0 (1/8), 1 (3/8), 2 (1/2). Find the distribution of the sum X1 + X2.
Solution:
Let z = X1 + X2
P(z = 0)
P0 <- 1/8*1/8
P0
## [1] 0.015625
P(z = 1)
P1 <- 1/8*3/8 + 3/8*1/8
P1
## [1] 0.09375
P(z = 2)
P2 <- 1/8*1/2 + 3/8*3/8 + 1/2*1/8
P2
## [1] 0.265625
P(z = 3)
P3 <- 3/8*1/2 + 1/2*3/8
P3
## [1] 0.375
P(z = 4)
P4 <- 1/2*1/2
P4
## [1] 0.25
print(c(P0, P1 ,P2 ,P3 ,P4))
## [1] 0.015625 0.093750 0.265625 0.375000 0.250000