Question 1: What is the expected number of heads in tossing a coin three times?
## Provide your answer here.
y <- c(0, 1, 2, 3)
p <- c(0.125, 0.375, 0.375, 0.125)
weighted.mean(y,p)
## [1] 1.5
Question 2: What is variance number of heads in tossing a coin thrice?
## Provide your answer here.
exp <- weighted.mean(y,p)
a <- c(0, 1, 4, 9)
b <- c(0.125, 0.375, 0.375, 0.125)
exp_2 <- weighted.mean(a, b)
var <- exp_2 - (exp)^2
var
## [1] 0.75
Question 3: You flip a fair coin 6 times, what is the probability of getting 5 or 6 heads?
## Provide your answer here.
pbinom(4,size=6,prob=0.5, lower.tail = FALSE)
## [1] 0.109375
Question 4: Suppose that diastolic blood pressures (DBPs) from men aged 30-44 are normally distributed with a mean of 80mmHg and a standard deviation of 10 mmHg. What is the probability that a random 30-44 year old has a DBP less than 70?
## Provide your answer here.
pnorm(70,mean=80,sd=10,lower.tail = TRUE)
## [1] 0.1586553
Question 5: Brain volume for adult men is normally distributed with a mean of about 1,100 cc with a standard deviation of 80 cc. What brain volume represents the 95th percentile ?
## Provide your answer here.
qnorm(0.95,mean=1100,sd=80,lower.tail = TRUE)
## [1] 1231.588
Question 6: Refer to Q6, Brain volume for adult men is normally distributed with a mean of about 1,100 cc with a standard deviation of 80 cc. Consider the sample mean of 100 random adult men from this population. What is th 95th percentile of the distribution of the sample mean?
## Provide your answer here.
qnorm(0.95,mean=1100,sd=80/10,lower.tail = TRUE)
## [1] 1113.159
Question 7: In a population of interest, a sample of 12 men yielded a sample average brain volume of 1,100cc and a standard deviation of 30cc. What is a 95% Student’s T confidence interval for the mean brain volume in this new population?
## Provide your answer here.
n <- 12
μ <- 1100
σ <- 30
q = 0.95
confidence_Interval = μ + c(-1, 1) * qt(q, df=n-1) * σ / sqrt(n)
confidence_Interval
## [1] 1084.447 1115.553