For 1≤j≤k,
\(P(Y=y) = \frac{(k−y+1)^n − (k - y)^n}{k^n}\)
the number of possible combinations of \(X_i\)’s is \(k^n\) (choosing \(n\) values out of \(k\) options with replacement).
Consider number of combinations with at least one \(1\). It is equal to all combinations (\(k^n\)) minus all combinations with values between \(2\) and \(k\) (\((k-1)^n\)). So \(P(Y=1) = \frac{k^n-(k-1)^n}{k^n}\).
Consider number of combinations with at least one \(2\) and no \(1\). It is euqal to all combinations (\(k^n\)) minus all combinations with at least one \(1\) (see above: \(k^n-(k-1)^n\)) and minus all combinations with values between \(3\) and \(k\) (\((k-2)^n\)). So \(P(Y=2) = \frac{k^n-(k^n-(k-1)^n)-(k-2)^n}{k^n}= \frac{k^n-k^n+(k-1)^n-(k-2)^n}{k^n}= \frac{(k-1)^n-(k-2)^n}{k^n}\).
Like-wise for Y=3 which is all combinations without \(1\) or \(2\) and with at least one \(3\),
\[ \begin{split} P(Y=3) &=\frac{k^n - (k^n-(k-1)^n)-((k-1)^n-(k-2)^n)-(k-3)^n}{k^n}\\ &=\frac{k^n - k^n+(k-1)^n-(k-1)^n+(k-2)^n-(k-3)^n}{k^n}\\ &= \frac{(k-2)^n-(k-3)^n}{k^n} \end{split} \].
In all and all, we can see that \(P(Y=a) = \frac{(k-a+1)^n-(k-a)^n}{k^n}\).
p = P(machine will fail after 10 years) = .1
P(machine will not fail after 10 years) = 1 - p = .9
Probability that the machine will fail after 8 years
p = 1/10
q = 1-p
n <- 8
pgeom(8,p,lower.tail = F)
## [1] 0.3874205
Expectation Value:
geo_EV = (q)/(p)
paste("E(X) = ", geo_EV)
## [1] "E(X) = 9"
Standard Deviation:
# sd = sqrt(q/p^2)
sd <- sqrt((.9)/(.1^2))
paste("sd = ", sd)
## [1] "sd = 9.48683298050514"
The probability following an exponential distribution is 0.449329
lambda <- 1/10
k = 8
exp(-lambda*k)
## [1] 0.449329
Expected Value && Standard deviation both are 10
ex_val <- 1/lambda
sd <- sqrt(1/lambda^2)
ex_val
## [1] 10
sd
## [1] 10
The probability following a binomial distribution is 0.4304672
n <- 8
p <- 1/10
q <- 1-p
k <- 0
dbinom(k, n, p)
## [1] 0.4304672
Following binomial distribution, Expected Value = 0.8 && Standard deviation = 0.8485281
ex_val <- n*p
sd <- sqrt(n*p*q)
ex_val
## [1] 0.8
sd
## [1] 0.8485281
The probability following a poison distribution is 0.449329
lambda <- 8/10
ppois(0, lambda = 0.8)
## [1] 0.449329
Following Poisson distribution Expected Value is 0.8 and Standard deviation is 0.8944272
lambda <- 8/10
Exp_val <- lambda
Exp_val
## [1] 0.8
sd <- sqrt(lambda)
sd
## [1] 0.8944272