We’ll have every value of X be between 1 and k meaning that the number of options X can be is \[k^n\]. We know that \[1 = k^n - (k-1)^n\] Since \(k^n\) is the total number of possiblities and \((k-1)^n\) are the possibilites that aren’t equal to 1. If we want Y to equl any number (Y=j) we get \[(k-j+1)^n -(j-k)^n\] Making our distribution: \[\frac{(k-j+1)^n -(j-k)^n} {k^n}\]
Answer adapte from https://math.dartmouth.edu/archive/m20f10/public_html/HW5Solutions.pdf
paste("The probability the machine will fail after 8 years is",round(pgeom(8, .1, lower.tail = FALSE),2))## [1] "The probability the machine will fail after 8 years is 0.39"
paste("Expected value is",1/.1) ## [1] "Expected value is 10"
paste("Standard deviation is",round(sqrt((1-.1)/(.1^2)),2))## [1] "Standard deviation is 9.49"
paste("The probability the machine will fail after 8 years is",round(pexp(8, .1, lower.tail = FALSE),2))## [1] "The probability the machine will fail after 8 years is 0.45"
paste("Expected value is",1/.1) ## [1] "Expected value is 10"
paste("Standard deviation is",round(sqrt((1-.1)/(.1^2)),2))## [1] "Standard deviation is 9.49"
paste("The probability the machine will fail after 8 years is",round(pbinom(0, 8, .1 ),2))## [1] "The probability the machine will fail after 8 years is 0.43"
paste("Expected value is",.1*8) ## [1] "Expected value is 0.8"
paste("Standard deviation is",round(sqrt(8*.1*(1 - .1)),2))## [1] "Standard deviation is 0.85"
paste("The probability the machine will fail after 8 years is",round(pexp(8, .1, lower.tail = FALSE),2))## [1] "The probability the machine will fail after 8 years is 0.45"
paste("Expected value is",.1*8) ## [1] "Expected value is 0.8"
paste("Standard deviation is",round(sqrt(8*.1),2))## [1] "Standard deviation is 0.89"