User Tools

Site Tools


b:head_first_statistics:permutation_and_combination

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
b:head_first_statistics:permutation_and_combination [2020/10/15 19:41] hkimscilb: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! q! +$$ \frac {n!} {p! q!} $$
  
 +<BOOKMARK:arranging_group>
 {{:b:head_first_statistics:pasted:20191015-075959.png}} {{:b:head_first_statistics:pasted:20191015-075959.png}}
  
Line 81: Line 81:
  
 {{:b:head_first_statistics:pasted:combination.arranging.duplicates.png}} {{:b:head_first_statistics:pasted:combination.arranging.duplicates.png}}
-<BOOKMARK:arranging_group>+
 <code> <code>
 factorial(6)/(factorial(3)*factorial(3)) factorial(6)/(factorial(3)*factorial(3))
Line 96: Line 96:
  
 <WRAP box> <WRAP box>
-__<fc #ff0000><fs xx-large>Q:</fs></fc>__ The Statsville Derby have decided to experiment with their races. They've decided to hold a race between 3 horses, 2 zebras and 5 camels, where all the animals are equally likely to finish the race first.+X = {a a b c c c} 라면? 
 +n(X) = 6 이므로 총 6!  
 +a가 둘, c가 셋으로 묶이므로 
 +6! / (2! * 3!) 
 += 6*5*2 = 60 
 + 
 + 
 +</WRAP> 
 + 
 +<WRAP box> 
 +__<fc #ff0000><fs xx-large>Q:</fs></fc>__ The Statsville Derby have decided to experiment with their races. They've decided to hold a race between <fc #ff0000>3 horses, 2 zebras and 5 camels</fc>, where all the animals are equally likely to finish the race first.
  
 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 161: Line 171:
 \end{eqnarray*} \end{eqnarray*}
  
-Among the two, the order doesn't matter. Then, we follow the same logic as [[#arranging.group|the above]]+Among the two, the order doesn't matter. Then, we follow the same logic as [[#arranging_group|the above]]
 2 representatives 2 representatives
 A B | B A A B | B A
Line 168: 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 207: 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> </WRAP>
 +
 +<WRAP box>
 +<code>
 +# only combination function is available in r, choose
 +# for permutation
 +> choose(52,5)
 +[1] 2598960
 +> perm <- function(n,r) { choose(n,r)*factorial(r)}
 +> perm(52, 5)
 +> [1] 311875200
 +</code>
 +</WRAP>
 +
 +
 <code> <code>
 ## n! / r!(n-r)! ## n! / r!(n-r)!
Line 245: 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?
 </WRAP> </WRAP>
 +{{https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Piatnikcards.jpg/1920px-Piatnikcards.jpg?800}} 
 +see [[wp>List_of_poker_hands]] 
 +{{https://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/A_studio_image_of_a_hand_of_playing_cards._MOD_45148377.jpg/1024px-A_studio_image_of_a_hand_of_playing_cards._MOD_45148377.jpg?400}}
 <code> <code>
 ## 52장의 카드 중에서 5장 고를 조합은 ## 52장의 카드 중에서 5장 고를 조합은
 factorial(52)/(factorial(5)*factorial(52-5)) factorial(52)/(factorial(5)*factorial(52-5))
-all <- factorial(52)/(factorial(5)*factorial(52-5))+all2 <- factorial(52)/(factorial(5)*factorial(52-5)) 
 +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.1602758460.txt.gz · Last modified: 2020/10/15 19:41 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki