\(P(X\ge 99.8 | \mu = 98.6, \sigma = 1)\)
1-pnorm(99.8,98.6,1)
## [1] 0.1150697
\(P(X\ge 99.8 | \mu = 98.6, \sigma \bar{_x} = \frac{1}{\sqrt{10}})\)
#P(Xbar < 99.8 | Mu=98.6, Se= 1/sqrt(10))
Xbar=99.8
Mu=98.6
Se=1/sqrt(10)
1-pnorm(Xbar,Mu,Se)
## [1] 7.390116e-05
\(\bar{x}\pm Z_.975 \frac{\sigma}{\sqrt{n}}\)
Z=qnorm(.975)
lower = Xbar-Z*Se
upper = Xbar+Z*Se
mylist=c(lower,upper)
names(mylist)=c("Lower", "Upper")
mylist
## Lower Upper
## 99.1802 100.4198
\(\hat{p}\pm Z_.975 \frac{\hat{p}(1-\hat{p})}{\sqrt{n}}\)
phat=47/100
Z2=qnorm(.975)
N=100
Se2=sqrt(phat*(1-phat)/N)
lower2=phat-Z2*Se2
upper2=phat+Z2*Se2
mylist2=c(lower2,upper2)
names(mylist2)=c("Lower", "Upper")
mylist2
## Lower Upper
## 0.3721784 0.5678216
n=\(\lceil\frac{{Z^2}\sigma^2}{\epsilon^2}\rceil\)= \(\lceil\frac{{Z^2}\pi(1-\pi)}{\epsilon^2}\rceil\)
You should generally assume that \(\pi\) is .5, as it maximizes the required sample size.
MOE=.03
Z3=qnorm(.975)
Sigma2=sqrt(.5*.5)
n=ceiling(Z3^2*Sigma2^2/MOE^2)
n
## [1] 1068