probability of guessing a k-digit number sequentially from n trials I recently encountered the following problem.
Assume that we need to guess a $k$-digit number. We guess it digit by digit and there are $n$ guesses in total. What is the probability of success?
Say, $k=5$, and $n=25$. We can spend, e.g., 9 trials guessing the first digit, then guess the second digit from the 3rd trial etc. But we cannot make more than 25 guesses in total.
I believe we should proceed as follows:

*

*guessed from 5 trials: $p=1/10^5$; -- we cannot make less than 5 trials when guessing step by step

*guessed from 6 trials: $p=1/10^4\cdot(1-1/10)\cdot 1/9\cdot 5$

*guessed from 7 trials: $p=1/10^3\cdot(1-1/10)^2\cdot 1/9^2\cdot \binom{5}{2}+1/10^4\cdot(1-1/10)\cdot(1-1/9)\cdot 1/8\cdot 5$, etc.

but I'm failing to generalize this scheme. And there is an additional problem that we have to set an upper bound to the number of trials at some point...
UPDATE (09.02): As @JMoravitz suggested, one can write an iterative scheme for computing the probability of guessing exactly $\kappa$ digits from $\eta$ trials, $f(\kappa,\eta)$. I believe that this scheme can be written as
$$f(\kappa,\eta)=\frac{1}{10}\sum_{i=1}^{10}f(\kappa−1,\eta−i),$$
where we use the fact that the probability of guessing the digit from $1\le \kappa\le 10$ guesses is always the same:
$$p(i=1)=\frac1{10},\quad p(i=2)=\frac{9}{10}\frac{1}{9}=\frac{1}{10},...$$
We also need to add boundary conditions $$\begin{cases}f(\kappa,\eta)=0,&\eta<\kappa\mbox{ (we cannot guess $\kappa$ digits from less than $\eta$ trials)},\\
f(1,\eta)=\frac{1}{10},&0<\eta\le 10\mbox{ (probabilities of guessing the first digit from $\eta$ trials)},\\
f(1,\eta)=0,&\eta=0\mbox{ or }\eta>10.\end{cases}$$
The final probability is to be found as the sum $$p^*=\sum_{i=k}^n f(k,i)=\sum_{i=5}^{25} f(5,i).$$
This scheme looks pretty neat and can be easily computed numerically.
However, I wonder if there is any chance to solve this problem analytically? Perhaps there exists a different approach?...
 A: May I try to offer an approach to have some estimation to this problem (and my apology in advance if what I am writing is trivial or wrong):
Let $X_i$ denote the number of guesses required to find the $i$ digit. Hence, lets denote $X = X_1+..+X_k$ as the total number of guesses. $X$ is sum of independent random variables.
It can be calculated that $\mathbb{E}X = 5.5k \; V[X] = 8.25k$
And if we denote $n = t + \mathbb{E}X$ ($t$ is not necessarily natural number, or you can take a floor of this equation) then we can have some estimation by Chevishev ineq.:
$$\mathbb{P}(|X-\mathbb{E}X|>t)\leq \frac {8.25k}{t^2}$$
Then we can get some conclusions about the problem, for instance, that for large enough numbers if the number of guesses allowed is in order of $O(k^{0.5+\epsilon})$ then we get that $$\mathbb{P}(|X-\mathbb{E}X|>t)\leq \frac {8.25k}{(k^{0.5+\epsilon})^2}$$
is small as we wish, and hence we get good lower bound to the probability of success:
$$1- \mathbb{P}(|X-\mathbb{E}X|>t) = \mathbb{P}(\mathbb{E}X - t\leq X\leq\mathbb{E}X+t = n) \leq \mathbb{P}(X\leq n)$$
