How likely is it that in five randomly-generated single-digit numbers there will be three of the same in a row? A random number generator creates five single-digit numbers. It produces the numbers 7, 5, 2, 2, 2.
How likely is it that in any set of five randomly generated single-digit numbers (0-9) there will be three or more identical ones? How likely is it that there will be three or more in a row?

There are $10^5$ equally likely strings of length $5$. We count the favourables, for the two problems.
First problem: The "special" number can be chosen in $\binom{10}{1}$ ways. We count the number of patterns with $3$ or more $7$'s, and multiply the result by $\binom{10}{1}$. 
Three $7$'s: They can be placed in $\binom{5}{3}$ ways, and the remaining slots can be filled in $9^2$ ways.
Four $7$'s: They can be placed in $\binom{5}{4}$ ways, and the remaining slot can be filled in $9^1$ ways.
Five $7$'s: They can be placed in $\binom{5}{5}$ ways, and the "rest" can be filled in $9^0$ ways. Of course, that's just a fancy way of saying there is only one way to have five $7$'s, but for symmetry the more convoluted form is useful. 
Putting things together, we find that the required probability is
$$\frac{\binom{10}{1}\left[\binom{5}{3}9^2+\binom{5}{4}9^1+\binom{5}{5}9^0   \right]}{10^5}.$$
Second problem: The basic strategy is the same, the count details slightly different. 
