A large number of people are waiting in line at Espresso Royale (as it often happens at around noon). The barista announces that he will start asking for each person's birthday, one by one, and the first person in the line whose birthday happens to coincide with one of the previous people will receive a free drink. Which position in the line has the highest chance of success?
Make the usual assumptions about independence of birthdays and 365 days in a year. If, e.g., you think that the third person in the line has the highest chance of success, enter 3 as your answer. (Hint: if n?2 is an integer, find a formula for the probability that the n-th person in the line will have the first duplicate birthday. Then write a simple program to find where the maximum is.)