$n+k-1 \choose k$
${{n+k-1}\choose{k-1}}$
${{n+k-1}\choose{n}}$
So I've been using $n+k-1 \choose k$ to r pick k objects from n objects allowing repetitions. In the following question though
How many ways are there to pick r objects from n objects when
repetitions are allowed and either both the first and the second
objects appear exactly once or both do not appear?
I was told that
If you want to select r objects from n and the order doesn't matter and each object can be reapeted than the general formula is: ${{n+k-1}\choose{k-1}}$ or ${{n+k-1}\choose{n}}$
and now I'm just a bit confused on the difference between them, and the usage cases. I am a beginner so a simple explanation would be appreciated!
To make it clearer... I am going to avoid using either of $n$ or $k$.
If you have $\#Ball$ number of identical balls and $\#Bin$ number of distinct bins then the number of ways in which you can distribute these is:
$$\binom{\#Ball + \#Bin - 1}{\#Bin - 1}$$
This can be seen via a stars and bars argument, using barriers to break the ball into groups, those balls to the left of the first barrier go to the first bin, the next group going to the second bin, and so on... you will need $\#Bin-1$ number of barriers.
Recognize that since $\binom{n}{r} = \binom{n}{n-r}$ (seen easily by noting that to select $r$ people from $n$ to "keep" you could instead have selected $n-r$ people from $n$ to "remove" instead and had the same result) the above is also equal to:
$$\binom{\#Ball + \#Bin - 1}{\#Ball}$$
Now... some authors prefer to refer to the number of balls as $n$ and the number of bins as $k$. Other authors prefer to refer to the number of balls as $k$ and the number of bins as $n$. This is why you will sometimes see the formula written as $\binom{n+k-1}{k-1}$ and at other times as $\binom{n+k-1}{k}$, because the author of the first formula intends $k$ to be the number of bins while the author of the second formula intends $k$ to be the number of balls instead.