knitr::opts_chunk$set(echo = TRUE)
RAW SCORE: 38/60
Suppose that X is a random variable and Y = aX+b The three expectation rules are: rule 1: $E(c) = c$ rule 2: $E(cX) = cE(X)$ * rule 3: $E(g_1(X)+...+g_n(X)) = E(g_1(X) +...+E(g_n(X))$
Prove the following are true using the three expectation rules above and discussed in class (quote the rules when proving):
$E(aX+b)$ using rule 3 we get $E(aX) + E(b)$
Using rule 2 for $E(aX)$ and rule 1 for $E(b)$ we get
$aE(X) + b$
$V(aX+b)$ using Rule 3 we get $V(aX) + V(b)$
Using Rule 2 on $V(aX)$ and rule 1 on $V(b)$
$a^2V(X)$
(i) E(Y): $E(2x-3)$ -> $E(2X) - 3$ -> $2E(X) - 3$
(ii) V(Y): $V(2x-3)$ -> $V(2X)$ -> $4V(X)$ -> $4*5 = 20$
(iii) V(H): $V(4Y+1)$ -> $V(4Y)$ -> $16V(Y)$ -> $16 * 20 = 320$
A statistician at a prestigious university was looking at past records of students in order that she could better prepare a science teached who wished to recruit students to more advanced course. The researcher made the following plot (see figure 1) using the code below the data.
library(s20x) data("course.df") head(course.df)
library(ggplot2) g = ggplot(course.df, aes(x = Degree, y = Exam, fill = Degree)) + geom_boxplot() + geom_point() #A g
T because Exam is countable and numerical
T because Gender is not countable nor numerical
Bsc because it shows the lowest Exam value at 42
Bsc because we can clearly see the the IQR is shorter than the others
geom_point() should be used to add the vertical points
If Y~Bern(p) then:
$\quad\quad P(y)=p^y(1-p)^{1-y}, y \in {0,1}$
$M_y(t) = E(e^{yt}) = \sum e^{yt}p(t) = e^{(0)t}p(0) + e^{1t}p(1) = q + pe^t$
$\mu_y = E(Y) = \sum yp(y) = 0p(0) + 1p(1) = p$
$\sigma^2_y = E((Y-\mu)^2) = \sum (Y-p)^2p(y) = (0-p)^2p(0) + (1-p)^2p(1) =p^2q + q^2p = pq(p+q) = pq$
$\frac{d[M_y(t)]}{dt}\Big|_{t=0} = \frac{d(q)}{dt} +\frac{d(pe^t)}{dt} = p$
$\frac{d^2M_y(t)}{dt^2}\Big|_{t=0} = pq$
From MS Ch.4 Ex 4.18, page 169. You may use any of information supplied in this exam including R output below to answer the questions. All probabilities and other answers are to be rounded to 4 decimal places.
Suppose the number Y of cracks per concrete specimen for a particular type of cement mix has approximately a Poisson probability distribution. Furthermore, assume that the average number of cracks per specimen is 2.5.
As stated in the problem, the mean is $\mu_y = 2.5$ and since in a Poisson distribution the $\mu_y = \sigma^2_y$ we can easily say that $\sigma_y = \sqrt{\sigma^2_y} = \sqrt{2.5} = 1.5811$
# This will give us the correct value when Y is exactly 5 # We use the density function dpois(5, 2.5)
1-ppois(1,2.5)
# The left bound is zero so we can take a lower tail from the right bound dpois(6,2.5)
And the answer to Y/N is YES it does agree with empirical rule.
ppois(5,2.5) - ppois(2,2.5)
Testing Problem: Suppose a durg test is 99% sensitive and 97% specific. That is, the test will produve 99% true positive results for drug users and 97% true negative results for non-drug users. Suppose that 0.2% of people are users of the drug. We need to find the solution to the question: If a randomly selected individual tests positive (+), what is the probability he or she is a User (U)?
Baye's Rule $p(A_i|B) = \frac{p(A_i)p(B|A_i)}{p(B)}$
$P(U|+) = \frac{p(U)p(+|U)}{p(U)p(+|U)+p(\bar{U})p(+|\bar{U})}$
p(+) = 1 - p(-)
$p(U)$
$p(u|+) = \frac{(.002)(.99)}{(.002)(.99) + (.998)(.03)} = .0620$
$p(\bar{U}|+) = \frac{(.998)(.01)}{(.998)(.01) + (.002)(.99)} = .847199$
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.