Question 1: What is the expected number of heads in tossing a coin three times?
heads <- c(3*0.5)
heads
## [1] 1.5
Question 2: What is variance number of heads in tossing a coin thrice?
variance <- c(3*0.5*(1-0.5))
variance
## [1] 0.75
Question 3: You flip a fair coin 6 times, what is the probability of getting 5 or 6 heads?
prob5heads <- c(6/64)
prob5heads
## [1] 0.09375
prob6heads <- c(1/64)
prob6heads
## [1] 0.015625
prob5heads + prob6heads
## [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?
DBP <- 70
mean <- 80
sd <- 10
probability <- pnorm(70, 80, 10)
probability
## [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 ?
qrtl <- 0.95
mean <- 1100
sd <- 80
brainvol <- qnorm(0.95, 1100, 80)
brainvol
## [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?
mean <- 1100
sd <- 80
n <- 100
percentile <- qnorm(0.95, 1100, 80/10)
percentile
## [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?
mean <- 1100
sd <- 30
n <- 12
quantile = 0.975
confidenceInterval <- 1100 + c(-1, 1) * qt(0.975, 12-1) * 30 / sqrt(12)
confidenceInterval
## [1] 1080.939 1119.061