# Problem 36

# Expected time to find a Delawarean

**Due**: February 9

**Points**: 3

The State of Delaware sports 3 representatives in the U.S. Congress, out of a total of 541 voting and non-voting members. Based on this, we might expect, on average 3 in every 541 Midshipmen to be from Delaware.

(*The number is probably even higher than this, based on the vice president and the general quality of people who grew up in Delaware. If this ratio of approximately 0.55% seems small, compare it to the total population of the state compared to the entire country, which is 917092/315487000, or about 0.29%. Take that, Texas!)

Consider the following algorithm to find a Delawarean midshipman:

```
def findBlueHen():
M = chooseRandomMidshipman()
if M is from Delaware:
return M
else:
return findBlueHen()
```

**Part 1**: Write a recurrence to describe the running time of the recursive algorithm. There should be 2 cases, and a probability for each case.

**Part 2**: Solve your recurrence to determine the *expected running time* of the algorithm.