Add factorial.

This commit is contained in:
Oleksii Trekhleb
2018-04-18 13:04:05 +03:00
parent 4434e96413
commit 77e897b3b9
5 changed files with 95 additions and 1 deletions

View File

@@ -11,8 +11,45 @@ its the same fruit salad.
## Combinations without repetitions
This is how lotteries work. The numbers are drawn one at a
time, and if we have the lucky numbers (no matter what order)
we win!
No Repetition: such as lottery numbers `(2,14,15,27,30,33)`
**Number of combinations**
![Formula](https://www.mathsisfun.com/combinatorics/images/combinations-no-repeat.png)
where `n` is the number of things to choose from, and we choose `r` of them,
no repetition, order doesn't matter.
It is often called "n choose r" (such as "16 choose 3"). And is also known as the Binomial Coefficient.
## Combinations with repetitions
Repetition is Allowed: such as coins in your pocket `(5,5,5,10,10)`
Or let us say there are five flavours of icecream:
`banana`, `chocolate`, `lemon`, `strawberry` and `vanilla`.
We can have three scoops. How many variations will there be?
Let's use letters for the flavours: `{b, c, l, s, v}`.
Example selections include:
- `{c, c, c}` (3 scoops of chocolate)
- `{b, l, v}` (one each of banana, lemon and vanilla)
- `{b, v, v}` (one of banana, two of vanilla)
**Number of combinations**
![Formula](https://www.mathsisfun.com/combinatorics/images/combinations-repeat.gif)
Where `n` is the number of things to choose from, and we
choose `r` of them. Repetition allowed,
order doesn't matter.
## References
[Math Is Fun](https://www.mathsisfun.com/combinatorics/combinations-permutations.html)