Conditional PDF of X, given random variable Y based on the PDF of X

probabilityrandom variables

X is a random variable with PDF: $F_X(x)=\frac{1}{2}sin(x)$ on the interval $[0,\pi]$
If $X\in[0,\frac{\pi}{3}],Y=3$
If $X\in(\frac{\pi}{3},\frac{2\pi}{3}],Y=2$
If $X\in(\frac{2\pi}{3},\pi],Y=1$
What is the conditional probability density function of X given Y =2?
$f_{X|Y}(x|Y=2)=?$
I tried starting by calculating $P(Y=2)$, but could not figure out how to do that from the way thay Y is defined

Best Answer

Since $F_X$ is a probability density function (not CDF as is usually indicated by use of capital lettering): $$\begin{align}\mathsf P(Y{=}2)~&=~\mathsf P(\tfrac\pi 3{\lt} X{\leqslant}\tfrac{2\pi}{3})\\[1ex]&=~\int_{\pi/3}^{2\pi/3} F_X(x)~\mathrm d x\end{align}$$And so using Bayes' Rule: $$F_X(x\mid Y{=}2)=\dfrac{F_X(x)\mathbf 1_{\pi/3<x\leqslant 2\pi/3}}{\mathsf P(Y=2)}$$