Finding the combination where p of the items are identical. Suppose we have $n$ objects in which $p$ items are identical. Of course, $n-p$ elements are distinct. Then what is the combination of $n$ objects taken $r$ at a time? That is, what is $C(n,r)$, but keep in mind all $n$ object are not distinct here?
For example, suppose a population consist of five values $1,3,3,4,5$. A random sample of $3$ values is drawn without replacement from this population. Then how many such samples of cardinality $3$ are possible? There are $7$, right? But what is the general formula?
 A: Without loss of generality, let our multiset of size $n$ be labeled as $\{\underbrace{a,a,\dots,a}_{p~\text{copies}},b_1,b_2,\dots,b_{n-p}\}$
We ask how many submultisets of size $r$ exist taking into account the fact that the $a$'s are identical.
Break into cases based on the number of copies of $a$ are used.  If we use $i$ copies of $a$, we will still need to select $r-i$ additional elements to be used from the $n-p$ non-$a$ elements.  There will be $\binom{n-p}{r-i}$ possible outcomes in this case.
Iterating over all possible values of $i$, the final total will be:
$$\sum\limits_{i=0}^{p}\binom{n-p}{r-i}$$
using the convention that $\binom{n}{r}=0$ for $r$ negative.
In your example, $\{1,3,3,4,5\}$ and $r=3$ there are $\binom{3}{3}+\binom{3}{2}+\binom{3}{1} = 1+3+3=7$ possibilities.

It is worth mentioning that for the purposes of probability arguments, if the elements are selected uniformly and independently at random without replacement, these possible outcomes will not be equally likely to occur.  $\{3,5\}$ will occur with probability $\frac{2}{\binom{5}{2}}=0.2$ whereas $\{3,3\}$ will occur with probability $\frac{1}{\binom{5}{2}}=0.1$
