12. A movie theater sells tickets at 5 yuan each. There are 10 people, 5 of whom have 5-yuan bills, and the other 5 have 10-yuan bills. Assuming the ticket booth has no money at the start, these 10 people queue up to buy tickets in a random order. The probability that the ticket booth will not encounter a situation where it cannot make change is $\qquad$
12. $\frac{1}{6}$.

Consider the positions of 5 people holding 5-yuan bills in the queue, there are $\mathrm{C}_{10}^{\mathrm{s}}=252$ equally probable ways to queue up.

Let $p(m, n)$ denote the number of valid queue arrangements for $m$ people holding 5-yuan bills and $n$ people holding 10-yuan bills.
Then $p(m, 0)=1$.
When $m<n$, $p(m, n)=0$, and
$$
p(m, n)=p(m, n-1)+p(m-1, n) \text {. }
$$

As shown in Figure 3, $p(5,5)$
is equal to the number of paths from $A$ to $B$ that do not
cross the diagonal, i.e., $\square$
$$
p(5,5)=42 \text {. }
$$

Therefore, the required probability
$$
\text { is } \frac{42}{252}=\frac{1}{6} \text {. }
$$