4 Student Tests

  • The E(X)=np. Thus we have μX = 5. The Var(X)=σX2 = np(1 − p). Thus we have 10 × 0.5 × (1 − 0.5)=2.5

  • What is the probability that a student will answer exactly five questions correct?

# size is n
dbinom(x=5,size=10,prob=.5)
## [1] 0.2460938
  • Probability that a student will answer at most 5 questions correctly
pbinom(q=5,size=10,prob=.5)
## [1] 0.6230469
  • Y and the number of incorrect. $Y = 10-X.
### using X space
pbinom(q=8,size=10,prob=.5) - pbinom(q=4,size=10,prob=.5)
## [1] 0.6123047
### using Y space
pbinom(q=5,size=10,prob=.5) - pbinom(q=1,size=10,prob=.5)
## [1] 0.6123047

15 Shipping Electronics

  • Well we have m good and n bad want to know the number bad found in a sample of 50… (ii)
  • Fewer than 3 defects..
    • How do we know which value goes to m and which goes to n?
    • Figure out what xorq are in the help file.
# total = 10000


dhyper(x=0,m=300,n=9700,k=50)+ dhyper(x=1,m=300,n=9700,k=50) + dhyper(x=2,m=300,n=9700,k=50) + dhyper(x=3,m=300,n=9700,k=50)
## [1] 0.9377102
phyper(q=3,m=300,n=9700,k=50)
## [1] 0.9377102
  • Let’s approximate
# p = m/N
pbinom(3,50,.03)
## [1] 0.9372401

19 Typesetting

  • The Var(X) is the same as the E(X) for the Poisson distribution.
  • Probability the next has no error…
.6*dpois(0,2.6)+.4*dpois(0,3.8)
## [1] 0.05351246
  • Given no errors, what is the probability it is from the second?
# Read pages 85-88 to understand Baye's Theorem.
.4*dpois(0,3.8)/(.6*dpois(0,2.6)+.4*dpois(0,3.8))
## [1] 0.1672192

21 Shipping Electronics part II

phyper(q=10,m=300,n=9700,k=200)
## [1] 0.961482
# p = m/N
pbinom(10,200,.03)
## [1] 0.9598723
# lambda = np
ppois(10,200*.03)
## [1] 0.9573791

22 Counting Events

Which of the four has the weakest case?