Answer the following:

Question 1: What is the expected number of heads in tossing a coin three times?

n=3
p=0.5
n*p
## [1] 1.5

Question 2: What is variance number of heads in tossing a coin thrice?

n=3
p=0.5
q=1-p
var=n*p*q
var
## [1] 0.75

Question 3: You flip a fair coin 6 times, what is the probability of getting 5 or 6 heads?

dbinom(5,6,0.5)+dbinom(6,6,0.5)
## [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?

pnorm(70,mean=80,sd=10)
## [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 ?

qnorm(0.95,mean=1100,sd=80)
## [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?

q=(80^2)/1100
s=100*q
qnorm(0.95,mean=100,sd=s)
## [1] 1057.006

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?

a<-1100
sd<-30
n<-12
error<-qnorm(0.975)*sd/sqrt(n)
a-error
## [1] 1083.026
a+error
## [1] 1116.974