for f(x) = \(x^2 + e^x +2x^4+1\) to be convex then \(f(\alpha x+\beta y)≤\alpha f(x)+\beta f(y),∀x,y∈Ω,\alpha ≥0,\beta ≥0,\alpha +\beta =1\) or if the function’s second derivative is always positive.
\(f'(x)=2x + e^x +8x^3\) then \(f''(x)=2 + e^x +24x^2\) which is always positive since \(e^x\) is always positive and so is \(24x^2\). Therefore the function is convex.
\(\mu = E[X] = \int ^\infty _0 x \lambda
e^{-\lambda x}dx\)
\(= \lambda (-x
\frac{-1}{\lambda}e^{-\lambda x} - \int -\frac{1}{\lambda}e^{-\lambda x}
\vert ^\infty _0)\)
\(= \lambda (x \frac{1}{\lambda}e^{-\lambda
x} -\frac{1}{\lambda ^2}e^{-\lambda x}\vert ^\infty _0)\)
\(=\lambda (\lim_{x \to \infty}x
\frac{1}{\lambda}e^{-\lambda x} -\frac{1}{\lambda ^2}e^{-\lambda x} -
(0) \frac{1}{\lambda}e^{-\lambda (0)} -\frac{1}{\lambda ^2}e^{-\lambda
(0)})\)
\(=\frac{1}{\lambda}\)
To find the variance then \(\sigma^2 = E[X^2]-E[X]^2\)
\(E[X^2] =\int^\infty_0x^2\lambda e^{-\lambda x}dx\)
\(\left[-x^2 \frac{1}{\lambda} e^{-\lambda x}\right]_0^{\infty} + v = -\frac{2}{\lambda^2} e^{-\lambda x}\)
lambda <- 4
four_typos <- dpois(4, lambda)
zero_typos <- dpois(0, lambda)
(four_typos)
## [1] 0.1953668
(zero_typos)
## [1] 0.01831564
samples <- rpois(1000, lambda)
hist(samples, breaks=seq(-0.5, max(samples)+0.5, 1), col="lightblue", xlab="Number of Typos", main="Histogram of 1000 Samples with Lambda = 4")
The probability of 4 typos is 19% and for 0 typos is 1.8%