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 [2023/10/11 08:15] – [e.g.] hkimscilb:head_first_statistics:permutation_and_combination [2024/10/01 22:40] (current) – [e.g.] hkimscil
Line 106: Line 106:
  
 <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.+__<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 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 258: Line 271:
 {{https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Piatnikcards.jpg/1920px-Piatnikcards.jpg?800}} {{https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Piatnikcards.jpg/1920px-Piatnikcards.jpg?800}}
 see [[wp>List_of_poker_hands]] 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}}]+{{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.1696979754.txt.gz · Last modified: 2023/10/11 08:15 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki