# Combinations
| Type | Repetition Allowed? | Formula |
| ---------------- | :-----------------: | ----------------------------- |
| $r$-combinations | No | $\frac{n!}{r!(n-r)!}$ |
| $r$-combinations | Yes | $\frac{(n+r-1)!}{r!(n-1)!}$ |
An **r-combination** of elements of a set is an *unordered* selection of $r$ elements from the set
$\prescript{}{n}{C}_k = \frac{n!}{k!(n-k)!} = {n \choose k}$
"The number of ways to choose $k$ number of items out of the set containing $n$ elements (all of which are distinguishable)."
> [!info]- Combinations vs Permutations
> The formula is essentially an *extension of the permutations formula*.
>
> Because order doesn't matter in combinations, we can take the amount of permutations for a given $n$ and $r$
With $n$ types of objects that aren’t unique within their type, choosing $r$ of them
### Combinations With Repetition
$C(n+r-1,r)=\frac{(n+r-1)!}{r!(n-1)!}$
note that if you try to plug in a number of boxes ($r$) that is greater than the number of elements within the set ($n$) into the original equation for combinations
this is technically still accurate since you would “run out” of elements to pick from before you can fill up every box
for some reason the sum of the number of elements within the set ($n$) and the number of possible boxes $r$ minus 1 can account for the repeated usage of
### Binomial Theorem
> [!summary] **The Binomial Theorem**
> Let $x$ and $y$ be variables, and let $n$ be a nonnegative integer.
> Then:
> $(x+y)^n = \sum^{n}_{i=0} {n \choose i}x^{n-1} y^i=$
>
---