b:head_first_statistics:permutation_and_combination
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
b:head_first_statistics:permutation_and_combination [2025/10/01 08:04] – [What if horse order doesn’t matter] hkimscil | b:head_first_statistics:permutation_and_combination [2025/10/01 08:36] (current) – [exercises] hkimscil | ||
---|---|---|---|
Line 202: | Line 202: | ||
{{: | {{: | ||
- | $\displaystyle | + | \begin{eqnarray*} |
- | $\displaystyle ^{n} P_{r} = \displaystyle \frac {n!} {(n-r)!}$ | + | \displaystyle ^{n} P_{r} = \displaystyle \dfrac {n!} {(n-r)!} |
+ | \end{eqnarray*} | ||
A **permutation** is the number of ways in which you can choose objects from a pool, and **where the order in which you choose them counts**. It’s a lot more specific than a combination as you want to count the number of ways in which you fill each position. | A **permutation** is the number of ways in which you can choose objects from a pool, and **where the order in which you choose them counts**. It’s a lot more specific than a combination as you want to count the number of ways in which you fill each position. | ||
- | + | \begin{eqnarray*} | |
- | $\displaystyle ^{n} C_{r}$ | + | \displaystyle ^{n} C_{r} & = & \displaystyle |
- | $\displaystyle ^{n} C_{r} = \displaystyle \frac {n!} {r! \cdot (n-r)!}$ | + | & = & \displaystyle \frac {n!} {r! \cdot (n-r)!} |
+ | \end{eqnarray*} | ||
A **combination** is the number of ways in which you can choose objects from a pool, **without caring about the exact order in which you choose them**. It’s a lot more general than a permutation as you don’t need to know how each position has been filled. It’s enough to know which objects have been chosen. | A **combination** is the number of ways in which you can choose objects from a pool, **without caring about the exact order in which you choose them**. It’s a lot more general than a permutation as you don’t need to know how each position has been filled. It’s enough to know which objects have been chosen. | ||
Line 221: | Line 224: | ||
<WRAP box> | <WRAP box> | ||
+ | $ {}_{52} P _{5} $ | ||
< | < | ||
# only combination function is available in r, choose | # only combination function is available in r, choose | ||
Line 226: | Line 230: | ||
> choose(52, | > choose(52, | ||
[1] 2598960 | [1] 2598960 | ||
- | > perm <- function(n, | + | > permute |
- | > perm(52, 5) | + | > choose(n,r) * factorial(r) |
+ | > } | ||
+ | > permute(52, 5) | ||
> [1] 311875200 | > [1] 311875200 | ||
+ | > # or | ||
+ | > factorial(52)/ | ||
+ | [1] 311875200 | ||
+ | > | ||
</ | </ | ||
</ | </ | ||
- | + | 답. 12명 중에서 순서는 상관없는 5명이므로 | |
+ | ${}_{12} C _{5} $ | ||
< | < | ||
## n! / r!(n-r)! | ## n! / r!(n-r)! | ||
Line 244: | Line 254: | ||
a | a | ||
b | b | ||
- | b/a | ||
</ | </ | ||
< | < | ||
Line 257: | Line 266: | ||
> b | > b | ||
[1] 36 | [1] 36 | ||
- | > b/a | ||
- | [1] 0.04545455 | ||
> | > | ||
</ | </ | ||
Line 336: | Line 343: | ||
< | < | ||
> # 6C4 * 4C3 * 7! | > # 6C4 * 4C3 * 7! | ||
- | > choose(6,4) * choose(4,3) * (4+3) | + | > choose(6,4) * choose(4,3) * factorial(4+3) |
- | [1] 420 | + | [1] 311875200 |
> | > | ||
</ | </ |
b/head_first_statistics/permutation_and_combination.1759273498.txt.gz · Last modified: by hkimscil