Probability of guessing 4-digit code

combinationscombinatoricsprobability

Super-simple question, I just want to be sure that I'm right. We want to find a 4-digit code, so we can choose numbers from 0 to 9, but repetition are not allowed and the order does not matter. We want to find the probability of guessing right the number after $t$ trials.

The probability in the first trial is

$\frac{1}{\frac{n!} {k!(n − k)!} } = 1/210$

can we say then that the probability in $t$ trials is $1/(210-(t-1))$? Does someone want to propose a more general formula? Thanks.

Best Answer

Failing the $k$ first trials has probability $$\frac{209}{210}\frac{208}{209}\dots\frac{209-k+1}{210-k+1}=\frac{210-k}{210}$$ So the probability to find the code in $k$ trials or less is $\frac{k}{210}$.