\(1\). Indicate the scale of measurement used for each of the following variables and explain your answer.

a). Height of a mountain, as measured from sea level.

\(b)\) Social security numbers.

\(c)\) Age of a person, measured in number of days.

\(d)\) Time, as measured by Dr Lee, with the number \(0\) corresponding to her day of birth, the number \(−1\) the day before her birth, the number \(1\) the day after her birth, and so on.


\(2\). The measurement scale of a variable often depends on its interpretation or on what information is available. As an example, suppose that at the reception of a social event, consecutively numbered tickets, starting with “1”, were allotted at the door as people entered so that a raffle could be held. Determine the measurement scale of the variable, ticket number, in each of the following situation and explain your answer.

\(a)\) The number \(199\) was selected as a winning number and announced. Dr Lee compared the number to that on her ticket to see if she had won.

\(b)\) Dr Lee looked around the room and remarked to herself that “It doesn’t look like there are \(199\) people here”.

\(c)\) Dr Lee compared the winning number to that on her ticket, \(10\), and realized that she had entered the room too soon.

\(d)\) Dr Lee noticed that the arrivals were fairly regular and instinctively estimated by how much longer she should have delayed her arrival.


\(3\): Consider Example \(1\) of Lecture \(2\). Show, by using the definition of independence, that the trials (or selections) are not independent. Is the probability of success (selection of a minority applicant) the same for each trial?

Let \(A_i=\) the \(i^{th}\) minority was selected, where \(i=1,\dots, 8\)

\[\begin{equation} \begin{split} P(A_1) &= \frac{8}{60}\\ &= 0.133 \\ P(A_2|A_1) &= \frac{7}{59} \\ &= 0. 119 \\ P(A_2) &= P(A_2|A_1)P(A_1) + P(A_2|A_1^\prime) P(A_1^\prime) \\ &= \frac{7}{59} \frac{8}{60} + \frac{8}{59} \frac{52}{60} \\ &= 0.133 \end{split} \end{equation}\]

\(P(A_2) \ne P(A_2|A_1)\), so the trials are not independent.

Now, \(P(A_3)\) can be computed as following:

\[P(A_3)=P(A_3|A_2, A_1)P(A_2)P(A_1) + P(A_3|A_2^\prime, A_1)P(A_2^\prime)P(A_3) + P(A_3|A_2, A_1^\prime) + P(A_3|A_2^\prime, A_3^\prime)P(A_2^\prime)P(A_1^\prime)\]

(6/58)*(8/60)^2+(7/58)*(1-8/60)*(8/60)*2+(8/58)*(1-8/60)^2
## [1] 0.1333333

After the computation by R, we got \(P(A_3)=P(A_2)=P(A_1)=0.133\).

Similarly, \(P(A_4)\) is computed as follow:

(5/57)*(8/60)^3 + (6/57)*(8/60)^2*(1-8/60)*3 + (7/57)*(8/60)*(1-8/60)^2*3+(8/57)*(1-8/60)^3
## [1] 0.1333333

\(P(A_4)=0.133\)

After processing all the calculation, we will get \(P(A_i)=0.133\). Hence,the probability of success (selection of a minority applicant) is the same for each trial.


\(4\).Consider Example \(3\) of Lecture \(2\). Show, by using the definition of independence, that the random variables \(Y_A\) and \(Y_B\) are not independent.

\[P(Y_A=1 \cap Y_B=2)=0.188 \hspace{1cm} \text{(From Example $3$)}\] \[\begin{equation} \begin{split} P(Y_A=1) &= P(Y_A=1,Y_B=1,Y_{AB}=2)+P(Y_A=1,Y_B=2,Y_{AB}=1)+P(Y_A=1,Y_B=0,Y_{AB}=3)+P(Y_A=1,Y_B=3,Y_{AB}=0) \\ &= \frac{4!}{1!1!2!}\frac{1}{4} \frac{2}{4} \left(\frac{1}{4}\right)^2 +\frac{4!}{1!2!1!}\frac{1}{4} \left(\frac{2}{4}\right)^2 \frac{1}{4} + \frac{4!}{1!3!} \frac{1}{4} \left( \frac{1}{4} \right)^3 + \frac{4!}{1!3!} \frac{1}{4} \left( \frac{2}{4} \right)^3 \\ &= 0.423 \end{split} \end{equation}\]

\[\begin{equation} \begin{split} P(Y_B=2) &= P(Y_A=1, Y_B=2, Y_{AB}=1)+P(Y_A=2, Y_B=2, Y_{AB}=0)+P(Y_A=0, Y_B=2, Y_{AB}=2) \\ &= \text{similar to $P(Y_A=1)$} \\ &= 0.375 \end{split} \end{equation}\]

\[P(Y_A=1)*P(Y_B=2)=0.423*0.375= 0.158\]

So \(P(Y_A=1 \cap Y_B=2) \ne P(Y_A = 1)*P(Y_B=2)\), we cannot say \(Y_A\) and \(Y_B\) are independent.

### for P(Y_A=1) ###

x <- c()
multinomial<- function(x) dmultinom(x, size=4, prob=c(1/4,2/4,1/4))

input.mat <- matrix(c(1,1,2, 1,2,1, 1,0,3, 1,3,0), nrow=4, byrow=T)

output.mat <- matrix(, nrow=4, ncol=1)
for (i in 1:4) {
  output.mat[i,] <- multinomial(input.mat[i,])
}
colSums(output.mat)
## [1] 0.421875
### for P(Y_B=2) ###

input.mat2 <- matrix(c(1,2,1, 2,2,0, 0,2,2), nrow=3, byrow=T)
output.mat2 <- matrix(, nrow=3, ncol=1)
for (i in 1:3) {
  output.mat2[i,] <- multinomial(input.mat2[i,])
}
colSums(output.mat2)
## [1] 0.375
### P(Y_A)*P(Y_B) ###
colSums(output.mat)*colSums(output.mat2)
## [1] 0.1582031

\(5\). Let \(A\) be an event with \(P(A)>0\)

\[I_A = \left\{ \begin{array}{ll} 1, \text{if $A$ occurs;} \\ 0, \text{otherwise} \end{array} \right.\]

similarly, let \(B\) be an event with \(P(B)>0\) and \(I_B\) the indicator of \(B\). Show that \[Cov(I_A, I_B) = P(A \cap B)-P(A)P(B)\]

\[Cov(I_A, I_B) = E(I_A I_B) - E(I_A)E(I_B)\]

Because \(I_A\) and \(I_B\) are indicators, so

\[E(I_A I_B) = 1*1*P(A)*P(B)+1*0*P(A)*\left( 1-P(B) \right)+0*1*\left( 1-P(A) \right)*P(B) = P(A \cap B)\] \[E(I_A) = 1*P(A)+0*\left(1-P(A)\right)=P(A)\] \[E(I_B) = 1*P(B)+0*\left(1-P(B)\right)=P(B)\]

Hence, \[Cov(I_A, I_B) = P(A \cap B)- P(A)P(B)\]

=======================================================================================

\(6\). For discrete random variables \(Y\) and \(Z\), the conditional expectation of \(Y\) given that \(Z=k\) is defined, for all values of \(k\) such that \(P(Z=k)>0\), by

\[E(Y|Z=k)=\sum_a a P(Y=a|Z=k) = \sum_a a \left[ \frac{P(Y=a, Z=k)}{P(Z=k)} \right]\]

let \(Y\) and \(Z\) be independent binomial(\(n\), \(\pi\)) random variables. Calculate the conditional expectation of \(Y\) given that \(Y+Z = m\). You may use the fact that \(Y+Z\) has a binomial(\(2n\), \(\pi\)) distribution.

\[\begin{equation} \begin{split} E(Y|Y+Z=m) &=\sum_a a P(Y=a|Z=m-a) = \sum_a a \left[ \frac{P(Y=a, Z=m-a)}{P(Y+Z=m)}\right] \\ &= \sum_a a \frac{ {n \choose a} {n \choose m-a} \pi^a \left( 1-\pi \right)^{n-a} \pi^{m-a} \left( 1-\pi \right)^{n-m+a} }{{2n \choose m} \pi^m \left( 1-\pi \right)^{2n-m}} \\ &= \sum_a a \frac{ {n \choose a} {n \choose m-a}}{ {2n \choose m}} \\ &= \sum_a a \frac{{n \choose a}{2n-n \choose m-a}}{2n \choose m} \\ &= \sum_a a P(a) \end{split} \end{equation}\]

where \(P(a)\) is the PMF of hypergeometric distribution. Hence:

\[\begin{equation} \begin{split} E(Y|Y+Z=m) &= \sum_a a P(a) \\ &= m \frac{n}{2n} \\ &= \frac{m}{2} \\ \end{split} \end{equation}\]