Density and distribution functions exercise

1.2k Views Asked by At

Exercise :

Let $X$ be a random variable and $f(x)$ the function :

$$f(x) = \begin{cases} c, -4<x<0 \\ 0.25, 2 < x < 4 & \\ 0, \text{anywhere else} \end{cases}$$

(a) Find such $c$, so that the function $f(x)$ is a density probability function of $X$.

(b) Find the distribution function of the random variable $X$.

(c) Let a random sample $X_1, \dots, X_{100} $ be under the same distribution. Find the probability of their Sample Mean to be no greater than $1$.

Solution-Attempt :

(a) For $f(x)$ to be a density probability function, it has to be :

$$\int_{-4}^{0}c dx =1 \Leftrightarrow \big[cx\big]_{-4}^0 = 1 \Leftrightarrow 4c = 1 \Leftrightarrow c = \frac{1}{4}= 0.25$$

So we have :

$$f(x) = \begin{cases} 0.25, -4<x<0 \\ 0.25, 2 < x < 4 & \\ 0, \text{anywhere else} \end{cases}$$

(b) Suppose that $X$ is a real-valued random variable. The (cumulative) distribution function of $X$ is the function $F$ given by :

$$F(x) = P(X \le x), \quad x \in \mathbb R$$

Although I know this is the definition of the distribution function, I cannot seem how to produce it in this particular example, so I would really appreciatea thorough explanation.

I also know you can calculate the distribution function of a continuous random variable $X$ by :

$$F(x)=\int_{-\infty}^x f(t)dt$$

for $- \infty < x <\infty$.

(c) Cannot grasp on how to proceed for solving this one at all, so please elaborate thoroughly if possible.

Any help will be really, really appreciated. I missed most of the semester due to illness so I am doing my best to get my self ready for an upcoming exam and I'm trying to get all the help and knowledge possible.

1

There are 1 best solutions below

2
On BEST ANSWER

For part (a), as pointed out in a comment, you need the integral of the whole distribution to be $1$. $$ \int_{-\infty}^\infty f(x)\, dx = \int_{-\infty}^{-4} f(x)\, dx + \int_{-4}^0 f(x)\, dx + \int_{0}^2 f(x)\, dx + \int_{2}^4 f(x)\, dx + \int_{4}^\infty f(x)\, dx = \\ 0+\int_{-4}^0 c\, dx +0+\int_{2}^4 \frac14\, dx+0= 4c+\frac12\\ 4c+\frac12 = 1 \implies c=\frac18 $$ For part (b), the easy way is indeed to use $F(x) = \int_{-\infty}^x f(x) \, dx$ but you can do it in pieces; in places where $f(x)=0$, the CDF does not grow. Thus

  • $x<-4 \implies F(x) = 0$.
  • $-4 \leq x < 0 \implies F(x) = c (x-(-4)) = \frac{x}8+\frac12$.
  • $0 \leq x < 0 \implies F(x) = F(0) = \frac12$.
  • $2 \leq x < 4 \implies F(x) = \frac12 + \frac14 (x-2) = \frac{x}4$.
  • $x>4 \implies F(x) = F(4) = 1$.

For part (c), the sample mean $\hat{x}$ will be (by definition of mean) $$ \hat{x} = \frac1{100} \left( x_1+x_2+\cdots+x_{99}+x_{100}\right) $$ so we want to find $ P(\left( x_1+x_2+\cdots+x_{99}+x_{100}\right) \leq 100\times 1 = 100. $

Now let's say $x_1+x_2+\cdots+x_{99}= y$; then we would need to have $x_{100} \leq 100-y$. But we know that is just $F(100-y)$ because that's exactly what the CDF tells you.

But what is $y$? Well, a given value of $y$ could come about by quite a few possible combinations of the $x_n$, but whatever combination you have, it must be the case that $x_{99} = y-( x_1+x_2+\cdots+x_{98})$. And so on down the line. In each case, we integrate probabilities using the pdf.

So the probability wanted is $$ P\left( \sum_{n=1}^{100} x_n \leq 100 \right) = \\ \int_{x_1 = -\infty}^{\infty} f(x_1) \int_{x_2 = -\infty}^{\infty} f(x_2) \cdots \int_{x_{99} = -\infty}^{\infty} f(x_{99}) F\left(100- \sum_{n=1}^{99} x_n\right) \, dx_{99} \,dx_{98} \cdots dx_1 $$ You can see how this is done by doing the integral over $dx_{99}$ first; that gives you a function of the first $98$ $x_n$s, and next you do the integral $dx_{98}$ and so forth. You will see a pattern soon enough.