0

How many ways are there (in both case where order matters (permutations) and order does not matter (combinations) ) if one

pick $k$ candidates from $n$ elements of $p$ different kinds where:

$n_1$ are alike, $n_2$ are alike, … , $n_p$ are alike?

Here $\sum_{i=1}^p n_i = n$.

--

e.g. pick 3 balls from bag of 10 balls, where 1 is red, 2 is blue, 3 is purple, 4 is black. How many permutations and combinations?

--

Special case:

If $k = n$, in other words, one pick all the elements, then there is clearly 1 combination, and exactly: $$\frac{n!}{\Pi_{i=1} (n_i !) }$$ permutations.

Book Book Book
  • 625
  • 3
  • 8
  • If $k = n$, in other words, one pick all elements, then there is 1 combination, and exactly: $\frac{n!}{\Pi_{i=1} (n_i !) }$ permutations. – Book Book Book Sep 13 '23 at 06:09
  • 1
    Combinations: https://math.stackexchange.com/questions/553960/ Permutations: https://math.stackexchange.com/questions/2372/how-to-find-the-number-of-k-permutations-of-n-objects-with-x-types-and-r – Mike Earnest Sep 13 '23 at 06:10

1 Answers1

0

Combinations

Since order does not matter, it only matter how many copies of each object you take. Let $x_1,\dots,x_p$ be the number of objects of each kind you took, then $$ x_1+\dots+x_p=k,\\ 0\le x_i\le n_i $$ So, you are counting integer solutions to the above constrained equation. This is answered at Extended stars-and-bars problem(where the upper limit of the variable is bounded), and I give an algorithmic solution here: https://math.stackexchange.com/a/4270328/177399

Mike Earnest
  • 75,930