A balls and urns model for a hashing problem Fix $N \in \mathbb{N}$. Suppose we throw $N$ numbered balls into $N$ numbered urns, so that for each $b \in \{1,\ldots,N\}$, ball $b$ lands in urn $j$ with equal probability $1/N$. Choose a number $c \in \{1,\ldots, N\}$ uniformly at random. Then choose further $b_1, \ldots, b_r \in \{1,\ldots, N\}$, so that $b_i$ is chosen uniformly at random from 
$\{1,\ldots,N\} \backslash \{b_1,\ldots,b_{i-1}\}$, stopping as soon as ball $b_r$ and ball $c$ are in the same urn.

What is the expected value of $r$?

I can get some fairly crude upper and lower bounds. I would like an asymptotically correct answer.
One possible approach to the problem is to approximate the number of balls in urn $j$ by a Poisson random variable with mean $1$. So I would also be interested in the answer to the following question.

Let $B_1,\ldots, B_N$ be independent Poisson random variables with mean $1$. What is the expected value of $r$ if we start with $B_j$ balls in urn $j$, for each $j$? 

Motivation. Suppose $\{1,\ldots, N\}$ are permitted passwords, and that passwords are hashed using an idealized hash function $h : \{1,\ldots, N\}\rightarrow \{1,\ldots, N\}$, constructed so that each $h(b)$ is chosen uniformly at random from $\{1,\ldots, N\}$. Then $r$ is the expected number of hashes we must compute to obtain a password $b \in \{1,\ldots,N\}$ with the same hash as a randomly chosen $c \in \{1,\ldots, N\}$. 
Very possibly the answer to my question is out there in the cryptography literature, but if so, I'm finding it hard to find among all the papers dealing with the birthday paradox or other types of hash collision.
 A: Let $X$ be the number of balls other than the special ball sent to the same urn as the special ball. The distribution of $X$ is close to a Poisson distribution with mean $1$. Condition on $X=x$. There are $x+1$ balls including the special ball sent to the same urn as the special ball. The expected first among $x+1$ objects out of $N$ is about $N/(x+2)$. So (glossing over some details in the double limit) to get the asymptotics, you want to calculate $NE[1/(Y+2)]$ where $Y$ has a Poisson distribution with mean $1$. $E[1/(Y+2)] = 1/e$ so the expected number of balls it takes to get a ball in the special ball's urn is asymptotically $N/e$.
$$\begin{eqnarray}E\left[ \frac{1}{Y+2}\right] &=& \frac{1}{e} \sum_{n=0}^\infty \frac{1}{n+2} \frac{1}{n!}\newline &=& \frac{1}{e} \sum_{n=0}^\infty \frac{n+1}{(n+2)!} \newline &=&\frac{1}{e}\sum_{n=0}^\infty \left[\frac{n+2}{(n+2)!} - \frac{1}{(n+2)!}\right] \newline &=& \frac{1}{e} \left[ \sum_{m=1}^\infty \frac{1}{m!} - \sum_{k=2}^\infty \frac{1}{k!} \right] \newline &=& \frac {1}{e}.\end{eqnarray}$$
A: General solution:
assume there are $n$ passwords, $k$ hashes and $x_i$ passwords hashing to $i$. The expected time (drawing without replacement) for the drawing of the first password
with hash $i$ is ${n+1 \over x_i +1}$. the probability that a randomly chosen $c$ hashes to $i$ is ${x_i \over n}$. Thus
$$\mathbb{E}(r)={n+1 \over n}\sum_{i=1}^k {x_i \over 1+x_i}$$
If the hash function is a random mapping from $[n]$ to $[k]$ each $X_i$ is $Bin(n,{1 \over k})$, and
$$\mathbb{E}(R)={k \over n}\big(n+1-k+k(1-{1 \over k})^{n+1}\big)$$
A: I think I missed something in the model. It seems to me that $r$ is uniform in $\{1,\dots,N\}$.
$$
\mathbb{P}(r=x)=\frac{N-1}{N}\times \frac{N-2}{N-1} \times \dots \frac{N-(x-1)}{N-x+2}\times \frac{1}{N-(x-1)}
$$
which simplifies in $1/N$.
