Calculating Odds: $1-10$, $15$ times If a program selects a random number between 1 and 10, and does so 15 times, what are the odds of it picking the same number twice or more, and how many times on average would it pick the same number?
From running this program I can see that it chooses the same number twice or more 100% of the time, and averages ~3 of the same number.
But I need something more mathematical to show the powers that be.
Can anyone help me out? Is there a good formula for this kind of thing I can use in the future?
 A: Assuming that you mean integers between $1$ and $10$, the same number must come up at least once since you’re making more than ten choices: if no duplicates have come up after ten, the next pick has to be a duplicate since you’ve run out of distinct numbers. For the second question, you’ll need to define more clearly what you mean, per Soke’s comment.  
Note that it’s easy to compute the expected number of times that any specific number will get chosen. That’s just the expectation of the number of successes in repeated Bernoulli trials, which is in this case $\frac1{10}\cdot15=1.5$, unsurprisingly.
A: I think the question you're asking is the same as this question that was asked over at Mathoverflow.
From the looks of it, there’s no closed-form answer that you can just plug the numbers $k=10$ and $n=15$ into.
A Mathematica expression for the expected highest number of repeats when numbers from $1$ to $10$ are chosen $n$ times is this:
Dot[Max @@@ 
 Keys[CoefficientRules[(a + b + c + d + e + f + g + h + i + j)^n]], 
 Values[CoefficientRules[(a + b + c + d + e + f + g + h + i + j)^n]]]

Maybe there’s a quicker way to find the result, but for $n=15$, it takes longer than I was willing to wait. Here are the results for $n=1$ through $9$, first as reduced fractions, then decimals.
$$1,\frac{11}{10},\frac{129}{100},\frac{767}{500},\frac{17879}{10000},\frac{100983}{50000},\frac{222019}{100000},\frac{1199659}{500000},\frac{51447519}{20000000}$$
$$1, 1.1, 1.29, 1.534, 1.7879, 2.01966, 2.22019, 2.399318, 2.572376$$
For $k=2$, which is like flipping a coin, there’s a sequence in the Online Encyclopedia of Integer Sequences.
A: Not a sufficing answer, but a long comment + comments don't support formatting well.
I made a program that ran this problem 1,000,000 times and this was the result:
Results:

Number chosen 0 times in a row: 231934
Number chosen 1 times in a row: 357143
Number chosen 2 times in a row: 255615
Number chosen 3 times in a row: 112538
Number chosen 4 times in a row: 34018
Number chosen 5 times in a row: 7335
Number chosen 6 times in a row: 1220
Number chosen 7 times in a row: 178
Number chosen 8 times in a row: 19
Number chosen 9 times in a row: 0
Number chosen 10 times in a row: 0

Another run gave this result:
Results:

Number chosen 0 times in a row: 231651
Number chosen 1 times in a row: 356585
Number chosen 2 times in a row: 256375
Number chosen 3 times in a row: 112532
Number chosen 4 times in a row: 33983
Number chosen 5 times in a row: 7509
Number chosen 6 times in a row: 1196
Number chosen 7 times in a row: 154
Number chosen 8 times in a row: 14
Number chosen 9 times in a row: 0
Number chosen 10 times in a row: 1

Running this program multiple times just resulted in minor changes in the result, no surprises at all.
This does however disprove that "it chooses the same number twice or more 100% of the time"
Code can be found here. (Qt C++)
Edit: 
Just realized just how sloppy that code-snippet is...
