Vous êtes sur la page 1sur 4

STA131AHW1

Rylan Schaeffer
September 29, 2015
1.
There are 11 letters in the string MISSISSIPPI. This means that there are 11! permutations.
total = factorial(11)
total
## [1] 39916800
Assuming we want only unique permutations (i.e. MiSSISSIPPI is considered the same as MISSiSSIPPI),
then we need to ensure we dont overcount. We do this by counting the number of ways that permuting the
various letters doesnt make a difference.
#'I'
repeatI = factorial(4)
#'S'
repeatS = factorial(4)
#'P'
repeatP = factorial(2)
The total number of unique permutations of MISSISSIPPI is therefore:
total/repeatI/repeatS/repeatP
## [1] 34650
2.
(a) 2n(n1)/2
(b) n(n 1)/2
3.
(a)
choose(12,5)*choose(7,5)/factorial(2)
## [1] 8316
We can also reach the same result by handling the group of two first:

choose(12,2)*choose(10,5)/factorial(2)
## [1] 8316
(b)
choose(12,4)*choose(8,4)/factorial(3)
## [1] 5775
4.
(a)
choose(52,13)
## [1] 635013559600
(b)
choose(52,13)*choose(39,13)*choose(26,13)
## [1] 5.364474e+28
(c)
Once player A has received their hand, the number of remaining cards remaining in the deck has been reduced
to 39. This means that there are fewer remaining combinations for players B, C and D. The same applies
once B has received their hand, leaving player C and player D with 26 remaining cards to draw combinations
from, and 13 determined cards for player D once player C has received their hand.
5.
Suppose we have a set of n elements. We know that the number of distinct subsets that can be generated
from this set is 2n . We also know that n Ck is the number of distinct subsets of n of size k. Therefore, if
we count the number of distinct subsets of n of size k, from k = 0 to k = n, we count the total number of
distinct subsets of all sizes of our initial set. These two methods count the exact same thing.
6.
The number of ways of ordering the three girls first is 3!. After the girls have been chosen, there are 3! ways
of ordering the boys last. The total number of ways of ordering 6 children is 6!. Thus, the probability that
the 3 eldest children are the 3 girls:
factorial(3)*factorial(3)/factorial(6)
## [1] 0.05
There is an 5% chance that the 3 eldest children are the 3 girls.
7.
j = 0:

(0.5^2)*choose(2,0)
## [1] 0.25
j = 1:
0
## [1] 0
j = 2:
(0.5^2)*choose(2,1)
## [1] 0.5
j = 3:
0
## [1] 0
j = 4:
(0.5^2)*choose(2,2)
## [1] 0.25
8.
(a)
#number of flushes
total_flush = choose(4,1)*choose(13,5)
total_flush
## [1] 5148
#number of royal flushes
royal_flush = choose(4,1)*choose(5,5)
The probability of a standard flush is therefore:
std_flush = (total_flush - royal_flush)/choose(52,5)
std_flush
## [1] 0.001979253
(b) Two pair (e.g., two 3s, two 7s, and an ace).

choose(13,2)*choose(4,2)*choose(4,2)*choose(11,1)*choose(4,1)/choose(52,5)
## [1] 0.04753902

Vous aimerez peut-être aussi