Professional Documents
Culture Documents
Chapter 5
Chapter 5
26 * 26 * 26 * 10 * 10 * 10 = 17,576,000
There are 17,576,000 different license plates that can be made using this
format
3. Counting Functions: How many functions are there from a set with
m elements to a set with n elements?
There are n^m functions from a set with m elements to a set with n
elements. This is because for each of the m elements in the domain,
there are n choices for its image in the codomain. Since the choices for
each element are independent, we can multiply the number of choices
for each element to get the total number of functions.
a) 4
The number of one-to-one functions from a set with 5 elements to a set
with 4 elements is 4!/(4-5)! = 4!/(-1)! = 0, since there are no one-to-one
functions from a larger set to a smaller set.
b) 5
The number of one-to-one functions from a set with 5 elements to a set
with 5 elements is 5!/(5-5)! = 5!/0! = 120.
c) 6
The number of one-to-one functions from a set with 5 elements to a set
with 5 elements is 5!/(5-5)! = 5!/0! = 120.
d) 7
The number of one-to-one functions from a set with 5 elements to a set
with 7 elements is 7!/(7-5)! = 7!/2! = 2520.
15. How many bit strings of length seven either begin with two 0s or end
with three 1s?
There are 2^5 bit strings of length seven that begin with two 0s
There are 2^4 bit strings of length seven that end with three 1s.
There are 2^2 bit strings that both begin with two 0s and end with three
1s.
The total number of bit strings of length seven that either begin with two
0s or end with three 1s is 2^5 + 2^4 - 2^2 = 44.
16. How many bit strings of length 10 either begin with three 0s or end
with two 0s?
There are 2^7 bit strings of length 10 that begin with three 0s.
There are 2^8 bit strings of length 10 that end with two 0s.
There are 2^5 such bit strings that both begin with three 0s and end with
two 0s.
The total number of bit strings of length 10 that either begin with three
0s or end with two 0s is 2^7 + 2^8 - 2^5 = 320.
17. How many bit strings of length 8 begin with 11 or end with 00?
There are 2^6 bit strings of length 8 that begin with 11.
There are 2^6 bit strings of length 8 that end with 00.
There are 2^4 such bit strings that both begin with 11 and end with 00.
The total number of bit strings of length 8 that either begin with 11 or
end with 00 is 2^6 + 2^6 - 2^4 = 112.
18. Let B be the set {a, b, c}. How many functions are there from B2 to
B?
Since B has 3 elements, B^2 has 3^2 = 9 elements. A function from B^2
to B assigns an element of B to each element of B^2. Since there are 3
choices for the value of the function at each element of B^2, there are
3^9 = 19683 functions from B^2 to B.
19. How may bit strings with length 10 that has exactly three 1s and end
with 0?
The number of ways to do this is given by the binomial coefficient “9
choose 3”, which is equal to 9!/(3!6!) = 84. Therefore, there are 84 bit
strings of length 10 that have exactly three 1s and end with 0.
20. A game consisting of flipping a coin ends when the player gets two
heads in a row, two tails in a row or flips the coin four times. In how
many ways can the game end?
1. The player gets three heads in a row: There are two possibilities for
this to happen: HH, THH,HTHH.
2. The player gets three tails in a row: There are two possibilities for
this to happen: TT, TTH, THTT.
3. The player flips the coin four times without getting two heads or
two tails in a row: There are two possibilities for this to happen:
HTHT, THTH.
Therefore, there are a total of 3 + 3 + 2 = 8 ways for the game to end.
7.1 Recurrence Relations
1. a) Find a recurrence relation for the number of permutations of a set
with n elements.
A permutation of a set with n elements can be obtained by choosing one
of the n elements to be the first element and then permuting the
remaining n-1 elements. Therefore, we have the recurrence relation P(n)
= n * P(n-1) for n >= 1