Probability: the numeric value of a drawn ball An urn contains N balls. Let $X$ be a random variable to specify the numeric value of a drawn ball twice for the first time (with replacement).
I would like to find the following probability: $P(X=k)$ for $ k \in \mathbb{N}$.
Can you help me, please? I don't know how to start.
Is the probability the same when $X$ is the numeric value of the drawing when a ball is drawn twice for the first time (with replacement)? (this is what I am actually looking for).
 A: Hint: One ball drawn equal to $i$:
$$P(\text{first ball} = i) = \frac{1}{N}.$$
This is true for any $i \in \{1, \ldots, N\}$.
Moreover, since there is replacement, notice that:
$$P(\text{second ball} = i) = \frac{1}{N}.$$
Again, this is true for any $i \in \{1, \ldots, N\}$.
Replacement is very important since:


*

*Each drawn is the same

*Each drawn is independent


Then, for the independence:
$$P(\text{first ball} = i ~\text{AND}~ \text{second ball} = i) = \frac{1}{N} \cdot \frac{1}{N} = \frac{1}{N^2}.$$
A: If the urn only contains $N=1$ ball, then $P(X=1)=1$.
If the urn contains $N=2$ balls, then what is $P(X=1)$? I claim that it is $1/2$, based on the following argument: What are the possible outcomes of drawing until the first repetition? It could be $11$, $121$, $122$, $211$, $212$, or $22$; half of these result in the number $1$ being the first repetition. Thus, $P(X=1)=P(X=2)=1/2$.
I don't think we need to go further (thankfully) in order to wrap our head around a construct that will illuminate the problem. We want to count the number of strings in an $N$ letter alphabet that don't have any repeats, starting from size $1$ all the way to size $N$. Each string that has a specific value $k$ in it will contribute to the count of the total number of ways to have $k$ be the first repetition, and then after dividing by the total number we will have our probability, since everything is uniformly random.
So how many strings are there of length $1$ in an $N$ letter alphabet that avoid repetition? There are $N$ of them. How about length $2$? There are $N(N-1)$ of them. Indeed, the number of such strings of length $L$ is $N!/(N-L)!$ So the total number of strings is $\sum_L N!/(N-L)!$.
How many of these strings contain the number $k$? ... Wait a second, the number $k$ doesn't matter! Whatever this count turns out to be for $1$ must be the same as the count for $2$ and the count for $3$, and so on. But then what can we see? All numbers have an equal probability of being the first repeat!
Thus, for an urn with $N$ balls in it, $P(X=k)=1/N$.
