Download Math 574 Review Exam 3 2008 Solutions

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

System of polynomial equations wikipedia , lookup

Fisher–Yates shuffle wikipedia , lookup

System of linear equations wikipedia , lookup

Transcript
Math 574 – Review Exam 3
Recurrence Relations
1. Let an = an!1an !2 + 2an !3 + 1 with a1 = 4, a2 = 6, a3 = 31.
Find the value of a0 and a4 .
Solution: a0 = 3 and a4 = 195
2. Find a recurrence relation for the number c n of n-digit numbers using just the digits 1,
2, 3, 4, 5, 7 such that the sum of the digits is even.
Solution: c 0 = 1, and for n ≥ 1, c n = 2an !1 + 4(6 n !1 ! cn !1 ) = 4 "6 n !1 ! 2c n !1 .
3. Find a recurrence relation for the number bn of strings of length n using the digits 0, 1,
2, 3, 4, 5 in which no 2 or 3 appears to the right of a 1.
Solution: b0 = 1 and for n ≥ 1, bn = 5bn !1 + 4 n !1
4. Find a recurrence relation for the number bn of strings of length n using the letters a, b,
c, d, e in which no two consecutive letters are both from {a, b}.
Example: a c d b c is OK but not a c d b a d or a c b b d e or c d a a d a.
Solution: b0 = 1, b1 = 5 and for n ≥ 2, bn = 3bn !1 + 6bn ! 2
5. How many ways are there to express 10 as a sum of 1’s, 2’s and 3’s?
(where order matters)
Solution: 274
Just use the recurrence relation in the next problem.
6. Let c n denote the number of strings of any length using 1’s, 2’s and 3’s that add
up to n. Find a recurrence relation for c n .
Example: For n = 4, there are 7 ways: 1 1 1 1, 1 1 2, 1 2 1, 2, 1 1, 1 3, 3 1, 2 2
Solution: c1 = 1, c 2 = 2, c 3 = 4 and for n ≥ 4, c n = c n !1 + c n ! 2 + c n ! 3
We can either start with a 1 in which case there are c n!1 ways to continue, if we start
with a 2 there are c n! 2 ways to continues and if we start with a 3 then there are c n! 3
ways to continue.
7. Let bn denote the number of strings of length n using the digits 0, 1, and 2 that contain
at least one occurrence of three consecutive 0’s.
e. g., 0 1 1 0 0 1 0 0 0 1 1 0 0 0 1 0 1 is such a sequence.
Solution: b1 = 0, b2 = 0, b3 = 1, and for n ! 4, bn = 2bn "1 + 2bn " 2 + 2bn " 3 + 3n " 3
8. Find two different recurrence relations that determine the sequence
! n$
defined by dn = # & .
" 2%
"$ n%
'
# 2&
dn
n
n
=
=
( dn =
d and so we get the
Solution: First note that
dn!1 "$ n ! 1%' n ! 2
n ! 2 n !1
# 2 &
n
recurrence d2 =1, and for n ! 3, dn =
dn "1 .
n"2
Or
d2 =1, and for n ! 3, dn = dn "1 + n " 1 .
9. Find a recurrence relation for the number bn of strings of length n using the letters a b c
d e f have an even total number of a’s and b’s?
Example: a c d d b b a c a b or a b c d c b d a e a f a.
Solution: b0 = 1, and for n ! 1, bn = 2(bn !1 + 6n !1 ) .
If we start with a c,d ,e, or f, then there are bn!1 ways to continue, while if we start with
an a or b, then there must be an odd total number of a’s and b’s in what’s left and so we
can continue in 6 n!1 ! an!1 ways. So we get, bn = 4bn!1 + 2(6 n!1 ! an !1 ) = 2(bn!1 + 6 n!1) .
10. Let bn denote the number of strings of length n using the digits 1, 2, 3, 4, 5, 6, 7, 8 in
which the digit 1 is always followed immediately by an even integer. Find a recurrence
relation for bn along with appropriate initial conditions.
Solution: b0 = 1,!b1 = 7,! and for n ! 2,!bn = 7bn "1 + 4bn " 2 .
11. How many ways are there to form a walkway of length 12 using red, blue and green
tiles where the red tiles are of length 1 inch, and the blue and green are of length 2
inches and each blue and green tile must be followed by a red tile?
Solution: Let wn denote the number of ways to form a walkway of length n. Then we
get w1 = 1, w 2 = 1, w 3 = 3, and for n ! 4, wn = wn "1 + 2w n " 2 .
Derangements
1. How many permutations of the numbers 1, 2, 3, …, n have at most three numbers in
their proper position?
" n%
" n%
Solution: Dn + nDn !1 + $ ' Dn ! 2 + $ ' Dn ! 3
# 2&
# 3&
2. Express the number of permutations of the numbers 1, 2, 3, …, n that have at most
one number in its proper position in terms of just Dn .
Solution: 2Dn + (!1)n +1 .
3. How many derangements are there of 7 numbers?
Solution:
D5 = 5D4 ! 1 = 5 " 9 ! 1 = 44
D6 = 6D5 + 1 = 6 " 44 + 1= 265
D7 = 7D6 ! 1 = 7 " 265 ! 1= 1854
4. How many permutations of the digits 1, 2, 3, 4, 5, 6, 7, 8 have exactly four digits in
their proper position?
! 8$
Solution: # & D4 = 630 .
" 4%
5. Let qn denote the probability that a permutation of the numbers 1, 2, 3, …, n has
exactly three numbers in their proper position. Find an expression for qn and
evaluate lim qn .
n!"
! n$
# & Dn ' 3
" 3%
n(n ' 1)(n ' 2)Dn ' 3 1 Dn ' 3
Solution: qn =
=
=
n!
6n!
6 (n ' 3)!
1
Hence, lim qn =
.
n! "
6e
6. What is the probability that a random permutation of 1, 2, 3, 4, 5, 6, 7, 8 has no even
number in its proper position?
Solution: Use inclusion-exclusion to get the number of permutations of 1, 2, 3, 4, 5, 6,
7, 8 that have no even number in its proper position. For each even number 2, 4, 6, 8
use the set Ai of all permutations that have 2i in its proper position. Then Inclusion
Exclusion gives,
A1 ! A2 ! A3 ! A4 = N 0 " N1 + N 2 " N 3 + N 4 = 8!!"!4 # 7!!+!6 # 6!!"!4 # 5!!+!4! . So,
the answer is
8!!!!4 " 7!!+!6 " 6!!!!4 " 5!!+!4!
.
8!
7. How many derangements of 1, 2, 3, 4, 5, 6, 7, 8, 9 are there in which every even
number is in an even position?
Solution: D4 ! D5 = 9 ! 44 = 396
8. How many ways are there to hand out 6 distinct books to 6 distinct people, then
take then back and hand them out again so that no person gets the same book twice?
Solution: 6!! !! D6 = 720 ! 265
9. How many permutations of 1, 2, 3, 4, 5 are there in which 1 is not in position 2, 2 is
not in position 3, 3 is not in position 4, 4 is not in position 5 and 5 is not in position
1?
Solution: D5 = 44
10. How many permutations of 1, 2, 3, 4, 5, 6 are there in which at least one digit is in
its proper position?
Solution: 6!!!! D6 = 720 ! 265 = 455 .
11. Show that the number of derangements of n objects is even if and only if n is odd.
Solution:
If n is even, then Dn = nDn !1 + (!1) n which must be odd. But then If n is odd, then
n
nDn !1 is the product of two odd integers and so it is odd. Hence, Dn = nDn !1 + (!1) is
even.
12. Be able to verify the recurrence relation Dn = (n ! 1) ( Dn !1 + Dn ! 2 )
Be able to verify the recurrence Dn = nDn !1 + (!1)n by induction.
D
Be able to derive the generating function for pn = n .
n!
k
!
x
Be able to use the fact that " = e x .
k = 0 k!
Inclusion Exclusion
1. How many integers between 0 and 1000 are not divisible by any of 2, 3 or 7?
Solution: Let A, B, C denote the set of integers between 0 and 1000 that are divisible by
2, 3, or 7 respectively. Let S denote the 1001 integers 0, 1, 2, …, 1000.
Then we want the value of A ! B ! C . Inclusion-exclusion gives us
A ! B ! C = N 0 " N1 + N 2 " N 3 =
= 1001" (501 + 334 + 143) + (167 + 72 + 48) " 24 = 286
2. Using Inclusion-Exclusion find an expression for the number of permutations of
1, 2, …, n in which no even number is in its proper position.
Hint: Consider the cases where n is even (i.e., n = 2m for some integer m and when n is
odd say n = 2m+1) .
Solution:
For each number i = 1, 2, 3, …, m let Ai be the set of all permutations that have 2i in its
proper position. Then Inclusion Exclusion gives,
m
m
k
k $ m'
A1 ! A2 ! A3 !!! Am = # ("1) N k = # ("1) & ) (2m " k )!
% k(
k =0
k =0
3. How many solutions in non-negative integers are there to x1 + x 2 + x 3 + x 4 = 16 with
each x i ! 5 ?
Solution:
Let S denote the set of all solutions (with no restrictions) and for each i = 1..4, let Ai
denote the set of all solutions with x i ! 6 . Then
# 19 &
# 13&
# 7&
A1 ! A2 ! A3 ! A4 = N 0 " N1 + N 2 " N 3 + N 4 = % ( " 4 % ( + 6 % ( .
$ 3'
$ 3'
$ 3'
4. How many permutations of a, b, c, d, e, f, g contain none of the strings
abc, bcde, ade, defg?
Solution: 7!!!!( 2 " 4!!+!2 " 5!)!+!( 2 " 3!!+!2 " 2!)!!!1 .
5. What is the probability that a randomly dealt 5-card hand contains at least one card of
each suit?
!# 52$
! 39
! 26
! 13
& ' 4 # $& + 6# $& ' 4# $&
"5%
" 5%
"5%
" 5%
Solution:
.
!# 52$
&
" 5%
The numerator was determined by using Inclusion-Exclusion.
6. How many 5-digit numbers using the digits 1, 2, 3, 4, 5, 6, 7, 8, 9 have no three
consecutive digits the same?
Solution: 9 5 ! 9(225) .
7. How many ways are there to put r distinct objects into 5 distinct boxes with no empty
boxes?
Solution: Let S denote the set of all distributions of the r objects (with no restrictions)
and for each i = 1…5, let Ai denote the set of all such distributions with box i empty.
Then
A1 ! A2 ! A3 ! A4 ! A5 = N 0 " N1 + N 2 " N 3 + N 4 " N 5 =
= 5 r " 5 # 4 r + 10 # 3r " 10 # 2 r + 5
8. How many arrangements of 2 x’s, 2y’s 2 z’s and 2 w’s have no two consecutive letters
the same? Example: x y w z x w y z .
Solution:
Let X denote the set of all arrangements in which xx appears and define Y, Z, and W
8!
7!
6!
5!
similarly. Then X ! Y ! Z !W =
" 4 # + 6# " 4 # + 4!.
16
8
4
2
Pigeon Hole Principle
1. Suppose that there is a group of 13 people in which each person has one of the first
names Bob, Bill, or Jane and each of them has one of the last names Jones, Smith,
Johnson, or Cliberski. Show that there are at least two people in the group that have the
same first and last name.
2. If a drawer contains 100 red socks, 100 blue socks, 100 green socks and 100 yellow
socks, then how many socks must be drawn at random in order to guarantee that at least
two of them have the same color?
Solution: 5.
3. Show that for every 2-coloring of the points in the plane, there exists a pair of points
having the same color and a unit distance apart.
Hint: Consider any three points that form the vertices of an equilateral triangle of side
length 1.
4. Show: For every integer N, there exists a multiple of N that contains only
the digits 0 and 7.
Hint:
1. Consider the numbers 7, 77, 777, 7777, 77777, …
2. If two integers n and m leave the same remainder when divided by N, then their
difference is divisible by N.
5. Show that any string go length 8 using the letters a, b, c must contain a substring in
which every letter appears an even number of times.
Hint: Consider any string using a, b, c Define the type of the string to be
(e, e, e) if each letter appears an even number of times.
Define the string to be of type (e, o, o) if a appears an even number of times, and b, c
each appear an odd number of times.
For example the string accbaba if of type (o, e, e) since b and c appear an even number
of times and a appears an odd number of times.
Suppose that the string is x1 x2 x3 !x8 . Consider the 8 substrings
x1 ,!!x1 x2 ,!!x1 x2 x3 ,!x1 x2 x3 x4 ,!!x1 x2 x3 x4 x5 ,!!x1 x2 x3 x4 x5 x6 ,!!x1 x2 x3 x4 x5 x6 x7 ,!!x1 x2 x3 x4 x5 x6 x7 x8
We may as well assume that none of these has each letter appearing an even number of
times. Now appeal to the Pigeon Hole Principle.