Question 1: What is the expected number of heads in tossing a coin three times?
a<-c(0,1,2,3)
b<-c(0.125,0.375,0.375,0.125)
Eh<-sum(a*b)
Eh
## [1] 1.5
Thus the expected number of heads is 1.5.
Question 2: What is variance number of heads in tossing a coin thrice?
v<-c(0,0.375,1.5,1.125)
variance<-sum(v)-(Eh^2)
variance
## [1] 0.75
And so, the variance is 0.75.
Question 3: You flip a fair coin 6 times, what is the probability of getting 5 or 6 heads?
d<-c(0,1,2,3,4,5,6)
e<-c(1/64, 6/64, 15/64, 20/64, 15/64, 6/64, 1/64)
n<- factorial(6)
f<-factorial(5)
probooffive<-(n/f)/64
proboofsix<-(n/n)/64
probofgetfiveorsix<-probooffive+proboofsix
probofgetfiveorsix
## [1] 0.109375
The probability of getting 5 or 6 heads is 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,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 ?
k<-1100
z<-1.645
sd<-80
X<-k+z*sd
X
## [1] 1231.6
Thus the 95th percentile of this distribution is approximately 1232.
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?
sd<-80
n<-100
sdk<-sd/sqrt(100)
x<-k+z*sdk
x
## [1] 1113.16
Thus the 95th percentile of the distribution of the sample mean is approximately 1113.
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?
SampleSize<-12
mean<-1100
standevx<-30
par<-0.95
zw<-2.009
standevxx<-standevx/sqrt(SampleSize)
standarderror<-zw*standevxx
standarderror
## [1] 17.39845
CI<-mean+c(-17.39845,17.39845)
CI
## [1] 1082.602 1117.398
Therefore, the confidence interval is (1082.602, 1117.398).