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 [2024/09/30 00:28] – [Arranging by individuals is different than arranging by type] hkimscilb:head_first_statistics:permutation_and_combination [2024/10/01 22:40] (current) – [e.g.] hkimscil
Line 217: 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>
Line 262: Line 275:
 ## 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.1727623732.txt.gz · Last modified: 2024/09/30 00:28 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki