# Homework Help: Conditional probability for a random vector

Tags:
1. Oct 7, 2016

### TheSodesa

1. The problem statement, all variables and given/known data
The probability density function for a random vector $(X,Y)$ is $f(x,y) = 3x$, when $0 < y< x < 1$. Calculate the conditional probability
$$P(X> \frac{1}{2} | Y > \frac{1}{3})$$

2. Relevant equations

Conditional probability:

P(A | B) = \frac{P(A \cap B)}{P(B)}

Random vector density function:

P(A) = P((X,Y) \in A) = \int \int_{A} f(x,y) dx dy = \int \int_{A \cap \Omega} f(x,y) dx dy

Marginal density function(s):

f_1(x) = \int_{-\inf}^{\inf} f(x,y) dy\\
\text{ and }\\
f_2(y) = \int_{-\inf}^{\inf} f(x,y) dx

3. The attempt at a solution

Here $P(X> \frac{1}{2} | Y>\frac{1}{3}) = \frac{P(X> \frac{1}{2} \cap Y>\frac{1}{3})}{P(Y>\frac{1}{3})}$.

The numerator is a part of a triangle below the line $y = x$ (area A in the picture below), whereas the denominator's domain is the entire triangle (A + B). The reason is that presumably $f(x,y) = 0$ above the line $y = x$.

Now we calculate the numerator and denominator separately:

\begin{align*}
P(X> \frac{1}{2} \cap Y>\frac{1}{3})
&= \int_{1/2}^{1} \int_{1/3}^{x} 3x dy dx\\
&= \int_{1/2}^{1} \left[ 3xy \right]_{1/3}^{x} dx\\
&= \int_{1/2}^{1} 3x^2 - x dx\\
&= \left[ x^3 - \frac{1}{2}x^2\right]_{1/2}^{1}\\
&= 1/2
\end{align*}

For the denominator we need the density function of the marginal distribution of $Y$, since the probability is only observed from its perspective:

\begin{align*}
f_2(y) = \int_{y}^{1} 3x dx = \left[ \frac{3}{2}x^2 \right]_{y}^{1} = \frac{3}{2} - \frac{3}{2}y^2
\end{align*}

Then
\begin{align*}
P(Y > \frac{1}{3})
&= \int_{1/3}^{1} \int_{1/3}^{x} \frac{3}{2} - \frac{3}{2}y^2 dy dx\\
&= \int_{1/3}^{1} \left[ \frac{3}{2}y - \frac{1}{2}y^3 \right]_{1/3}^{x} dx\\
&= \int_{1/3}^{1} \frac{3}{2}x - \frac{1}{2}x^3 - \frac{1}{2} + \frac{1}{54} dx\\
&= \left[ \frac{3}{4}x^2 - \frac{1}{8}x^4 - \frac{26}{54}x \right]_{1/3}^{1}\\
&= \frac{3}{4} - \frac{1}{8} - \frac{26}{54} - \frac{1}{12} + \frac{1}{216} + \frac{26}{162}\\
&= 73/324
\end{align*}
Now it's obvious that if I calculate the assigned conditional probability, it will be greater than $1$. Where did I go wrong with this one?
\begin{align*}
\end{align*}

2. Oct 7, 2016

### andrewkirk

No, the calculation of the denominator $P(B)$ is exactly the same as that of the numerator, except that the lower outer integration limit is $1/3$ instead of $1/2$.

3. Oct 8, 2016

### TheSodesa

Yeah, that was it. The result (of the entire calculation, not just the denominator) was $\frac{27}{28}$. The thing is, I tried doing that at first, but must have made a mistake doing it somewhere I couldn't spot, because the answer I got then was $\frac{27}{29}$.

The bigger problem now is that the electronic hand-in system of my school, in giving out a hint on how to solve this, suggested that I calculate it the way I suggested in the OP. Would it be possible to do it using a marginal distribution function for the denominator? When does one actually need to calculate the marginal distribution? My course handout is skimping out on practical examples...

Last edited: Oct 8, 2016
4. Oct 8, 2016

### Ray Vickson

When you compute the marginal density $f_X(x)$ you are already integrating $f_{X,Y}(x,y)$ with respect to $y$. Then when you find $P(a < X < b)$ by integrating $f_X(x)$ over $a \leq x \leq b$; you really are doing a 2-dimensional integration of $f_{X,Y}(x.y)$ over some $(x,y)$-region. In essence, you are doing the same work either way.

However, what matters is how to prevent errors and to make calculations clear and easily documented. I, personally, find it cleaner to first compute $f_X$ and then do an $f_X$-integral, but others prefer the opposite method. Take your choice and use whatever works best for you.