Plot \[ F_X(x) = 1 - e^{-x^{2}}\]
curve(1 - exp(-x^{2}), from= 0, to=5)
Let’s if it is a pdf. It is positive for every \(x>0\) and \[\int_0^{\infty } \frac{2 x}{e^{x^2}} \, dx=1\]
Y is discrete because its support is countable (and finite) \(\{0,1\}\)
If \(c\) is median of \(X\), then \(c\) is equal to the \(x\) such that \[1/2=1- e^{-x^{2}}\] Therefore, \(c=x^{median}=\sqrt{log(2)}\)
Then \(Y\) becomes \[ Y=\begin{cases} 1 \quad if \ X>\sqrt{log(2)} \\0 \quad if \ X\leq \sqrt{log(2)} \end{cases} \] Note \(P(Y=1)=P(X>\sqrt{log(2)})=\frac{1}{2}\) and \(P(Y=0)=P(X\leq \sqrt{log(2)})=\frac{1}{2}\). Therefore the PMF is \(P_Y(y)=\frac{1}{2}\) \[ P_Y(y)=\begin{cases} 1/2 \quad for \ y=0 \\1/2 \quad for \ y=1 \end{cases} \]
\[ M_W(t)= \int_{-\infty}^{\infty} \frac{e^{-(x-\mu )^2/\left(2 \sigma ^2\right)}}{\sqrt{2 \pi } \sigma} e^{(x-\mu)^2t}dx\] \[ M_W(t)= \frac{1}{\sqrt{2 \pi } \sigma}\int_{-\infty}^{\infty} e^{-(x-\mu )^2/\left(2 \sigma ^2\right)} e^{(x-\mu)^2t}dx\]
\[ M_W(t)= \frac{1}{\sqrt{2 \pi } \sigma}\int_{-\infty}^{\infty} e^{-\frac{(x-\mu )^2}{2 \sigma^2} (1-2t)}dx\] Substitue \(u=(x-\mu)/\sigma\) take derivative on both side \(du=dx/\sigma\)
\[ M_W(t)= \frac{1}{\sqrt{2 \pi }}\int_{-\infty}^{\infty} e^{-\frac{u ^2}{2}(1-2t)}du\] Two methods: 1. Double Integral, Polar Coordinates. Steps: square, double integral, polar coordinate, integration by subsitution, integration by chain rule, square root. 2. Gamma Function.
\[ M_W(t)= \frac{1}{\sqrt{2 \pi }} \frac{\sqrt{2 \pi }}{\sqrt{1-2t}}=\frac{1}{\sqrt{1-2t}}\]
MGF uniquely determine the distribution. Chi Square with 1 degree of freedom
\[Cov(Y, W)= E(Y^3-2\mu Y^2+\mu^2 Y)-\mu\sigma ^2=\mu ^3+3 \mu \sigma ^2 -2 \mu \sigma ^2-2\mu^3+\mu^3-\mu\sigma ^2=0\]
Independent? No becuase W is function of Y
mu=2
sd=2
X <- rnorm(10000, mu,sd)
Y <- (X-mu)^2
EstDens <- density(Y/sd^2)
plot(EstDens)
x <- seq(0,50,.01)
lines(x, dchisq(x,1),col = 3)
plot(X,Y)
cor(X,Y)
## [1] 0.01551525
cov(X,Y)
## [1] 0.1772038
\[\frac{P(Y<1)+P(3<Y<5)}{P(Y<1)+P(Y>3)}=0.57/0.8\] )
(b)Integrate to 1: c=1/2 use the definition of gamma distribution with alpha=1; b= 32*24, alpha=5 (lambda is 1/2 in both case)
(c)expectatn alpha/lambda and variance alpha/lamda