1-pnorm((100-100)/(0.5*sqrt(365-1)))
## [1] 0.5
1-pnorm((110-100)/(0.5*sqrt(365-1)))
## [1] 0.1472537
1-pnorm((120-100)/(0.5*sqrt(365-1)))
## [1] 0.01801584
We start with the probability mass function for a binomial random variable
n is the number of independent Bernoulli trials
p is the probability of success and (1 - p) is the probability of failure
C(n, x) is the combinations of n elements chosen x at a time
\[ f (x) = C(n , x)px(1 – p) ^{n-x} \] The probability mass function is used to generate the moment generating function
\[ M(t) = Σx = 0^{n} e^{tx}C(n,x)p^{x}(1 – p)^{n - x} \]
We can combine terms:
\[ M(t) = Σx = 0^{n}(pe^{t})xC(n,x)(1 – p)^{n - x} \]
\[ M(t) = [(1 – p) + pe^{t}]^{n} \]
To find the mean and variance we need to find the first and second movement. We take the first and second derivatives and evaluate at t = 0
\[ M’(t) = n(pe^{t})[(1 – p) + pe^{t}]^{n - 1} \] When we evaluate at t = 0 we get:
\[ M(0) = n(pe^{0})[(1 – p) + pe^{0}]^{n - 1} = np \] To find the variance we take the second derivative \[ M’’(t) = n(n - 1)(pe^{t})^{2}[(1 – p) + pe^{t}]^{n - 2} + n(pe^{t})[(1 – p) + pe^{t}]^{n - 1} \] \[ M’’(0) = n(n - 1)p^{2} +np \] \[ σ2 = M’’(0) – [M’(0)]^{2} = n(n - 1)p2 +np - (np)^{2} = np(1 - p) \]
For the exponential distribution, the probability density function(PDF) is: \[ λe^{−xλ} \] The movement generating function(MGF) is: \[ E(e^{tx}) \] \[ M(t)=∫_∞^{0}e^{tx}λe^{−xλ}dx \] We can simply this by pulling out lambda, because we are integrating in terms of x \[ λ∫_∞^{0}e^{−x(λ−t)} \] \[ −λ(e^{−x(λ−t)}/(λ−t)) \] \[ λ/(λ−t) \] Now to get the first movement: \[ M′(t)=λ/(λ−t)^2 \] We solve for t = 0 and get a result that looks familiar! \[ M′(0)=λ/λ^{2}=1/λ \] For the second movement we take the derivate again \[ M′′(t)=2λ/(λ−t)^3 \] Solve for t = 0 again \[ M′′(0)=2λ/λ^{}3=2/λ^2 \] We have one last step, we have to remove the influence of the first movement \[ E(X2)−E(X)^{2}=2λ^{2}−1/λ^{2}=1/λ^2 \]