Birthday line to get ticket in a unique setup At a movie theater, the whimsical manager announces that a free ticket will be given to the first person in line whose birthday is the same as someone in line who has already bought a ticket.  You have the option of choosing any position in the line. Assuming that you don't know anyone else's birthday, and that birthdays are uniformly distributed throughout the year (365 days year), what position in line gives you the best chance of getting free ticket?
 A: Let $p_n$ be the probability that the $n$th person in line wins, and let $q_n$ be the probability that the first $n$ persons have different birthdays. Then for a generic $n$ we have
$$ p_{n+1} = q_n \frac{n}{365} \\ p_{n+2} = q_n \frac{365-n}{365} \frac{n+1}{365} $$
and therefore
$$ \frac{p_{n+2}}{p_{n+1}} = \frac{(365-n)(n+1)}{365n} $$
This is larger than $1$ if and only if
$$ (365-n)(n+1) > 365n $$
which rearranges as
$$ n(n+1) < 365 $$
Initially the $p_n$s grow steadily, but eventually they start to fall steadily towards $0$. The last $n$ for which $n(n+1)<365$ is $18$, so the largest $p_n$ will be $p_{20}$.
A: The probability, $p(n)$, of getting a free ticket when you are the $n_{th}$ person is line is:
(probability that none of the first $n−1$ people share birth dates) * (probability that you share birthday with one of the first $n−1$ people)
So, $p(n) = [1 *(\frac{364}{365})*(\frac{363}{365}) * ... *(\frac{(365−(n−2))}{365})] * [\frac{(n−1)}{365}]$, 
Here, $0 <n \leq 365$.
Now the least $n$ such that $p(n) > p(n+1)$, or $\frac{p(n)}{p(n+1)} > 1$.
Now, 
$\frac{p(n)}{p(n+1)} = \frac{365}{(366−n)} * \frac{(n−1)}{n}$
$\implies 365n − 365 > 366n − n^2 $,
$\implies n^2 − n - 365 > 0$
$\implies (n - \frac{(1+\sqrt(1461)}{2})*(n - \frac{(1-\sqrt(1461)}{2}) > 0$
$\implies n = \frac{(1+\sqrt(1461)}{2} = 19.6115148536 $ ($\because n>0$)
$\implies n = 20$ (ceiling of computed value)
Hence the $20^{th}$ position maximizes the chances.
Note: See my first comment below if you don't want to solve quadratic equation using discriminant method.
A: Suppose you stand in slot $n$.  In order for you to get the free ticket you need two things:  first, that no duplicate has happened before your turn and second, that you are a duplicate.  
The probability that there is no duplicate amongst the first $n-1$ is $$\frac {365!}{365^{n-1}\times (365-(n-1))!}$$
Given that no duplicate has occured amongst the first $n-1$, the probability that the $n^{th}$ is a duplicate is then $$\frac {n-1}{365}$$
The probability that the $n^{th}$ position is the winner is the product of these.  
It is easy to compute these directly (at least with mechanical assistance) and we see that $n=20$ is optimal  with $$p_{20}=\fbox {0.032319858}$$
For comparison, we have $p_{19}=0.032207108$ and $p_{21}=0.032249952$.  But you have some room here...$p_{15}=0.029798808$ and $p_{25}=0.030355446$, say.
