Statistics: Deriving a Joint Probability Function From a Definition of Other PDF's Here's a particular question I'm trying to understand from the lecture notes.
It says: 

Assume that $Y$ denotes the number of bacteria per cubic
  centimeter in a particular liquid and that $Y$ has a Poisson
  distribution with parameter $x$. Further assume that $x$ varies from
  location to location and has an exponential distribution with
  parameter $β = 1$. 
   -Find $f_{X,Y}(x,y)$, the joint probability function of $X$ and $Y$.

In the lecture slides, it says:
$$f_{X,Y}(x,y) = f_{Y\mid X}(y\mid x)f_X(x)$$
Where $f_{Y\mid X}(y\mid x)$ is the PDF for the Poisson distribution, and $f_X(x)$ is the PDF for the exponential with $\beta = 1$.
I'm not sure how $f_{X,Y}(x,y) = f_{Y\mid X}(y\mid x)f_X(x)$ came to be. Is there anything for me to look for in the question that would hint to using this form? 
Any help would be appreciated. 
Thanks.

This follows from definition of conditional probability. If there are two events $A,B$, then the probability of their joint occurrence is $P(A\cap B)$, conditional probability of occurrence of $B$ given that event $A$ has taken place is written as $P(B\lvert A)$, which is defined as
\begin{equation}
P(B\lvert A)=\frac{P(A\cap B)}{P(A)}
\end{equation}
Now if you map the elements of event space to real numbers, this mapping is called random variables. Then we can define distribution of these random variables. From the distribution we can define density of random variables. Let $f_X(x)$ be density of random variable $X$, $f_Y(y)$ of r.v. $Y$ then their joint density is written as $f_{X,Y}(x,y)$. Now following the definition of conditional probability, we can write conditional distribution of $Y\lvert X$ as
\begin{equation}
f_{Y\lvert X}(y\lvert x)=\frac{f_{X,Y}(x,y)}{f_X(x)}
\end{equation}
Hope this clears the doubt. This definition is quite general, hence holds for the scenario you have mentions. In nut shell, in the lecture series the author is just using definition of conditional distribution which follows from conditional probability definition.
