Solution (source code)

= Solution

The waiting time is geometric with mean $1/p$.