Question 1
(10 pts) In the example of random group of students, section 1.11.2, let X be the number of CS students chosen. Find pX(x).
Question 1 Code
p_x_1 <- c(choose(48, 0) * choose(20, 4) / choose(68, 4), choose(48, 1) * choose(20, 3) / choose(68, 4),
choose(48, 2) * choose(20, 2) / choose(68, 4))
x_1 <- c(0, 1, 2)
d_f_1 <- data.frame(x_1, p_x_1)
d_f_1
## x_1 p_x_1
## 1 0 0.005949275
## 2 1 0.067191807
## 3 2 0.263167912
Question 2
(10 pts) Let X1, X2, . . . are independent indicator variables with different probabilities of success. That is, P(Xi = 1) = pi . Define Yn = X1 + X2 + . . . + Xn. Find E(Yn), V ar(Yn) and coefficient of variation of Yn.
Question 2 Code
No code was used for this question
Question 2 Work ^^
Question 3
(10 pts) For a random variable, its hazard function also referred to as the instantaneous failure rate is defined as the instantaneous risk (conditional probabilty) that an event of interest will happen in a narrow span of time duration. For a discrete random variable X, its hazard function is defined by the formula hX(k) = P(X = k + 1|X > k) = pX(k) 1 − FX(k)
Question 3 Code
No code was used for this question
Question 3 Work ^^
Question 4
(10 pts ) In the Watts-Strogatz model in section 5.1.3, find the probability that a specified node connects to exactly one shortcut.
Question 4 Code
Note: In this scenario, d = 3, and k = 1 shortcut for any of the 6 nodes (n = 6).
The equation used is choose(n-3, d-2)(choose(n2/2 - 3n/2 - (n-3), k - (d-3)) /
choose(n2/2 - 3n/2, k)
#Probability that a specified node has exactly 1 shorcut
p_n_1 <- choose(3,1) * choose(6, 0) / choose(9,1) # p_n_1 <- 0.3333