Answer the following:

JUSTINE BRYLE C. MACASO

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

a<-dbinom(0,3,0.5)
b<-dbinom(1,3,0.5)
c<-dbinom(2,3,0.5)
d<-dbinom(3,3,0.5)
expected_h<-0*a+1*b+2*c+3*d
expected_h
## [1] 1.5

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

a<-dbinom(0,3,0.5)
b<-dbinom(1,3,0.5)
c<-dbinom(2,3,0.5)
d<-dbinom(3,3,0.5)
expected_h<-0*a+1*b+2*c+3*d
variance_h<-a*(0-expected_h)^2+b*(1-expected_h)^2+c*(2-expected_h)^2+d*(3-expected_h)^2
variance_h
## [1] 0.75

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

getting_five<-dbinom(5,6,0.5)
getting_six<-dbinom(6,6,0.5)
getting_fiveorsix<-getting_five+getting_six
getting_fiveorsix
## [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(q=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 ?

qnorm(0.95,1100,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?

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

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