Assignment 7

N Nedd

2017-10-16


Question 1

Question 2

Let X represent the number of years until the machine fails.

Part A

For geometric distribution:

\(f(x) = P(X=x) = (1 - p)^{x-1}p\)

In this case: \(P(X=8) = (\frac{9}{10})^7 * \frac{1}{10}\)

Ans <- dgeom(8,0.1)
Ans
## [1] 0.04304672

Expected value = \(\frac{1}{p}\)

Ans = 1/(1/10)
Ans
## [1] 10

standard deviation = \(\sqrt(1-p)/p^2\)

Ans = sqrt((1 - (1/10))/((1/10)^2))
Ans
## [1] 9.486833

Part B

For exponential distribution

Rate = 1/10

Failure after 8 years: 1 - P(X <= 8)

Ans <- 1 - pexp(8,0.1)
Ans
## [1] 0.449329

Expected Value - 1/0.1

Ans = 1/0.1
Ans
## [1] 10

Standard Deviation = 1/(0.1)^2

Ans = 1/((0.1)^2)
Ans
## [1] 100

Part C

For Binomial Distribution

X ~ B(8, 0.1) P(X = 0)

Ans = dbinom(0, size=8, prob=0.1) 
Ans
## [1] 0.4304672

Expected Value = n * p

Ans = 8 * 0.1
Ans
## [1] 0.8

Standard Deviation = \(\sqrt(np * (1-p)\)

Ans = sqrt((8 * 0.1) * (1 - 0.1))
Ans
## [1] 0.8485281

Part D

X ~ P(0.8)

P(X=0)

Ans = ppois(0,0.8)
Ans
## [1] 0.449329

Expected Value = Variance = 0.8 Standard Deviation:

Ans = sqrt(0.8)
Ans
## [1] 0.8944272