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 [2020/10/15 19:37] – [What if horse order doesn’t matter] hkimscil | b:head_first_statistics:permutation_and_combination [2024/10/01 22:40] (current) – [e.g.] hkimscil | ||
---|---|---|---|
Line 72: | Line 72: | ||
b, a2, a1 | b, a2, a1 | ||
- | n! / p! x q! | + | $$ \frac {n!} {p! * q!} $$ |
+ | < | ||
{{: | {{: | ||
+ | |||
6 horses | 6 horses | ||
2 groups 3 horses per each group | 2 groups 3 horses per each group | ||
Line 95: | Line 96: | ||
<WRAP box> | <WRAP box> | ||
- | __<fc # | + | X = {a a b c c c} 라면? |
+ | n(X) = 6 이므로 총 6! | ||
+ | a가 둘, c가 셋으로 묶이므로 | ||
+ | 6! / (2! * 3!) | ||
+ | = 6*5*2 = 60 | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | <WRAP box> | ||
+ | __<fc # | ||
1. How many ways are there of finishing the race if we’re interested in individual animals? | 1. How many ways are there of finishing the race if we’re interested in individual animals? | ||
Line 160: | Line 171: | ||
\end{eqnarray*} | \end{eqnarray*} | ||
+ | Among the two, the order doesn' | ||
2 representatives | 2 representatives | ||
A B | B A | A B | B A | ||
Line 167: | Line 178: | ||
\begin{eqnarray*} | \begin{eqnarray*} | ||
- | _{3}C_{2} * 2! & = & _{3}P_{2} \\ | + | \text{Answer we want} & = & \frac {_{3}P_{2}}{2!} \\ |
- | _{3}C_{2} & = & \frac {_{3}P_{2}}{2!} \\ | + | \text{We call this} & = & _{3}C_{2} \\ |
_{3}C_{2} & = & \frac {\frac{3!}{(3-2)!}} {\frac {2!} {1}} \\ | _{3}C_{2} & = & \frac {\frac{3!}{(3-2)!}} {\frac {2!} {1}} \\ | ||
_{3}C_{2} & = & \frac {3!}{2! * (3-2)!} = 3 | _{3}C_{2} & = & \frac {3!}{2! * (3-2)!} = 3 | ||
Line 206: | Line 217: | ||
2. The coach classes 3 of the players as expert shooters. What’s the probability that all 3 of these players will be on the court at the same time, if they’re chosen at random? | 2. The coach classes 3 of the players as expert shooters. What’s the probability that all 3 of these players will be on the court at the same time, if they’re chosen at random? | ||
</ | </ | ||
+ | |||
+ | <WRAP box> | ||
+ | < | ||
+ | # only combination function is available in r, choose | ||
+ | # for permutation | ||
+ | > choose(52, | ||
+ | [1] 2598960 | ||
+ | > perm <- function(n, | ||
+ | > perm(52, 5) | ||
+ | > [1] 311875200 | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | |||
< | < | ||
## n! / r!(n-r)! | ## n! / r!(n-r)! | ||
Line 244: | Line 269: | ||
A flush is where all 5 cards belong to the same suit. What’s the probability of getting this? | A flush is where all 5 cards belong to the same suit. What’s the probability of getting this? | ||
</ | </ | ||
+ | {{https:// | ||
+ | see [[wp> | ||
+ | {{https:// | ||
< | < | ||
## 52장의 카드 중에서 5장 고를 조합은 | ## 52장의 카드 중에서 5장 고를 조합은 | ||
factorial(52)/ | factorial(52)/ | ||
- | all <- factorial(52)/ | + | all2 <- factorial(52)/ |
+ | all2 | ||
+ | # or | ||
+ | all <- choose(52, 5) | ||
+ | all | ||
## royal flush = 10, 11, 12, 13, 1 각 문양 | ## royal flush = 10, 11, 12, 13, 1 각 문양 | ||
## 즉, 4가지. 따라서 전체 조합 중 4가지만 해당됨 | ## 즉, 4가지. 따라서 전체 조합 중 4가지만 해당됨 |
b/head_first_statistics/permutation_and_combination.1602758239.txt.gz · Last modified: 2020/10/15 19:37 by hkimscil