En una simple lotería, todos los $z$ elemento subconjuntos de la caja de los boletos tienen las mismas posibilidades de ser dibujado. Cuando hay $x$ entradas de tipo "X" e $y$ entradas de tipo "Y", el número de estos subconjuntos se escribe $\binom{x+y}{z}$ (leer " $x$ $y$ elija $z$"). Este coeficiente binomial tiene un simple, conocida fórmula,
$$\binom{x+y}{z} = \frac{(x+y)(x+y-1)\cdots(x+y-z+1)}{z(z-1)\cdots(2)(1)}.$$
This is the $k^\text{th}$ entry (counting from $0$) in the $x+y^\text{th}$ row of Pascal's Triangle.
Each $k$ from $0$ through the smaller of $x$ and $z$ is a possible number of the "X" tickets drawn. The number of ways to draw $k$ tickets from category "X" and the remaining $z-k$ tickets from category "Y" is the product $\binom{x}{k}\binom{y}{z-k}$. Whence the chances of drawing exactly $k$ tickets from category "X" are the ratio of this number and the total number of $z$ element subsets:
$$\frac{\binom{x}{k}\binom{y}{z-k}}{\binom{x+y}{z}}.$$
This is known as "the" hypergeometric distribution. (For every combination of $x$, $y$, and $z$ describing such a lottery, there is a hypergeometric distribution giving the chances for all possible numbers of tickets $k$ that can be drawn from category "X".)
For example, with $x=80$, $y=120$, and $z=20$, the chances for $k=0, 1, \ldots, 20$ are
0.000018, 0.000289, 0.0021, 0.0097, 0.0304, 0.0705, 0.1247, 0.1724, 0.1894, 0.1668, 0.1184, 0.0679, 0.0314, 0.0116, 0.0034, 0.00078, 0.000137, 0.000018, 1.57e-6, 8.62e-8, 2.2e-9
Here is a plot of these chances:
The exact chances are shown by the heights of the black dots. For reference, the red curve plots the density function for the normal distribution with the same expectation ($8$) and same variance ($864/199$). It can be used (with a so-called "continuity correction") to approximate the chances. Those approximate values are indicated by the heights of the thin red lines. A close look shows that the red lines are a tiny bit short to the left of $k=8$ and a tiny bit tall to the right--but the approximation looks quite good. Using this normal approximation sometimes is easier than doing the calculations, but its chief virtue is in allowing us to use our experience with and intuition about normal distributions to understand this one. (The normal approximation will be reasonable provided both $x$ and $y$ are $5$ or greater and neither is large compared to the other.)
With these chances in hand, the probability of any stipulated event can be computed by adding the chances of its components. For instance, the chance that five or fewer of the tickets are drawn from the "X" pool is the chance that $k$ is one of $0, 1, 2, 3, 4,$ or $5$. The sum of those component chances is
$$0.000018+ 0.000289+ 0.0021+ 0.0097+ 0.0304+ 0.0705 = 0.1130,$$
or about $11$%.