How is the number of $r$-permutations of $n$ objects including $n_1, n_2, n_3, \dotsc$ identical objects calculated? For example, what is the number of ways in which $3$ yellow balls, $2$ red balls and $4$ green balls can be put in $5$ baskets, each in one basket, using five of the balls. (in this example, $n = 9$, $n_1 = 3$, $n_2 = 2$, $n_3 = 4$ and $r = 5$.)
What is the number of r-combinations of such objects (where order does not matter at all, even between different groups)? For example, the number of ways in which five of the $3$ yellow balls, $2$ red balls and $4$ green balls can be chosen and then left in a basket.