Number of unique combinations of $k$ items from a set $S$ of $n$ items, with repetitions in S. ($k<n$)

35 Views Asked by At

What would be the formula for the number of unique combinations of $k$ items from a set $S$ of $n$ items, with repetitions in S. ($k<n$) (Order does not matter)

Example #1: $$ S=2,2,3,4,4,8 $$ $$ k=2 $$ $$(2,2)(2,3)(2,4)(2,8)(3,4)(3,8)(4,4)(4,8)$$

Example #2: $$ S=3,5,5,5,5,5,5,7,9,11,15,15$$ $$ k=2 $$ $$(3,5)(3,7)(3,9)(3,11)(3,15)(5,5)(5,7)(5,9)(5,11)$$ $$(5,15)(7,9)(7,11)(7,15)(9,11)(9,15)(11,15)(15,15)$$