What is the probability of my cycling security code having the same six digits? In order to log in to some internal services where I work, it requires a security code in addition to my credentials. This security code is displayed on a mobile application and is comprised of six random digits 0-9. Every time I open it up, I secretly hope the planets align and I'll get all six of the same number. The code changes every 30 seconds.
Assuming this six-digit number is 100% random, what is the probability that at least one instance in the last year had all six matching digits? This combination does not have to be observed; I'd just like to know if there's a decent probability that it has ever happened.
 A: Since the code changes twice per minute, the number of codes generated in a year is $365.2422\times24\times60\times2\approx1051898.$  The expected number of occurrences of six matching digits in a year is therefore
$$\frac{10}{10^6}\times1051898\approx10.52.$$
The correct method for computing the probability of no occurrences was already given in turkeyhundt's answer, but before the information that the code changes twice per minute was added to the post.  This method gives
$$
\left(1-\frac{10}{10^6}\right)^{1051898}\approx\frac{27}{10^6}.
$$
One can see without calculation that the probability of no occurrences of six matching in a given year must be small since it equals
$$
\left[\left(1-\frac{1}{10^5}\right)^{10^5}\right]^{10.51898},
$$
which is approximately $e^{-10.51898}$ as
$$
\lim_{n\to\infty}\left(1+\frac{r}{n}\right)^n=e^r
$$
and $10^5$ is pretty large.
A: If there are 6 digits, there are one million codes.  There are 10 ways they can all be the same digit.  So each time you check there is a one in 100,000 chance of getting all digits the same.
If you checked it once a day for a year, the chance of none of them being 6 of the same digit is
$$\frac{99999}{100000}^{365}$$ 
and the chance of it happening at least once in that year is 
$$1-\frac{99999}{100000}^{365}$$
A: If you want an easy way to estimate this (instead of an exact answer that would require a computer program or fancy calculator to evaluate), note according to another answer that the chance that it happens once on a given day is $1/100000$. The chances that it happens at all in a given year is thus no more than $365/100000$, and since that is so small, it can be shown that this is a very good approximation because the probability of having 2 or more occurrences of having all the same digits in a year is so small.
A: There are already essentially correct answers to this question, but perhaps it bears a little more explanation.  There are ten possibilities out of a million for all six numbers in the code to be the same: 000000, 111111, ... 999999.  Assuming a uniform distribution on all million possible codes, ("100% random"), each time a new code is generated, the probability that all six digits will be the same is $$\frac{10}{1,\!000,\!000}=\frac{1}{100,\!000}.$$
Therefore the probability that all six digits will not be the same is $$\frac{999,\!990}{1,\!000,\!000}=\frac{99,\!999}{100,\!000}.$$
Let's assume that last year was not a leap year.  Then $365\times 24\times 60\times 2=1051200$ codes were generated last year, and we assume that each code is generated independently.  Then the probability that none of these codes had all six digits the same is $$\left(\frac{99,\!999}{100,\!000}\right)^{1051200}\approx 0.0000272$$
Therefore the probability that at least one of the codes that was generated last year had all six digits the same is $$1-\left(\frac{99,\!999}{100,\!000}\right)^{1051200} \approx 0.9999728$$
In other words the occurrence you are asking about very probably did happen.
