How many times do you have to pick a card to get 3 times the same card? Imagine you have a deck of 52 different playing cards and you are picking random cards with putting them back into the deck. How many times would you have to pick in average until you had the same card three times (any card, not consecutively, but in total)?
I know that the maximum amount would be 105 times and I ran a python script to determine the result more or less accurate (which gave me a value of about 26).
Additionally:
How would you solve this for other values than 3 and 52?
I am currently in tenth grade so please expain, what you are doing.
 A: This is essentially the Birthday Problem where the "year" has 52 days and we want the expected number of trials until three people have the same birthday.  The general solution for the expected number of trials until $b$ persons have the same birthday on a planet with a year of $r$ days is
$$I(r,b) = \int_0^{\infty} e^{-t} e_{b-1}\left(\frac{t}{r}\right)^r \; dt$$
where
$$e_b(x) = \sum_{i=0}^b \frac{1}{i!} x^i$$
Reference: Analytic Combinatorics by Philippe Flajolet and Robert Sedgewick, p. 116, equation (29).
We have the case $b=3$, $r=52$.  Numerical integration via Mathematica yields
$$I(52,3) \approx 25.9401$$
which agrees with the Monte Carlo result of "about 26" in the OP.
A: As a rough but close approach, if you draw $n$ times from a $k$ card deck the chance you have drawn a particular card exactly three times is ${n \choose 3}\frac {(k-1)^{n-2}}{k^n}$  The chance you have not drawn any card three times is then $\left(1-{n \choose 3}\frac {(k-1)^{n-2}}{k^n}\right)^k$.  This is not quite right as it ignores the chance you have drawn a card four times and the correlations between the cards.  To get the number of draws to have $50\%$ chance of drawing a card three times, you can set this to $\frac 12$ and solve for $n$ numerically.  Getting the average number is harder because the correlations are ignored.  This would not say there was any number of draws that guarantees three of a kind, but $2k+1$ does guarantee that.  Alpha says for a $52$ card deck you hit the $50\%$ mark at $24.2$ cards.
