Download Assignment 4 solution

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

Addition wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Transcript
MATH 460 2002/2003
Assignment 4
Due January 27, 2003
1. In how many ways can three 0’s, three 1’s, and three 2’s be arranged so that no three
adjacent digits are the same in an arrangements?
Solution: Let ai be the property that three i’s are together (i = 0, 1, 2).
s0 =
9!
= 1680
3!3!3!
N (a0 ) = N (a1 ) = N(a2 ) =
7!
= 140
1!3!3!
s1 = 3 × 140 = 420
5!
= 20
N(a0 a1 ) =
1!1!3!
s2 = 3 × 20 = 60
N (a0 a1 a2 ) = 3! = 6 = s3
e0 = 1680 − 420 + 60 − 6 = 1314
2. With three differently colored paints, in how many ways can the walls of a rectangular
room be painted so that color changes occur at (and only at) each corner? With two
colors?
Solution: We label the four walls 1, 2, 3, and 4 (in, say, clockwise order). Let ai be the
property that wall i has the same color as wall i + 1, i = 1, 2, 3 and a4 is the property
that wall 4 has the same color as wall 1.
s0 = N = number of ways to paint the four walls = 34 = 81.
N (a1 ) = number of ways to paint the four walls such that walls 1 and 2 have the same
color. = 33 = 27. Similarly, we have N (ai ) = 27 and s1 = 4 × 27 = 108.
N (a1 a2 ) = number of ways to paint the four walls such that walls 1, 2 and 3 have the
same color. = 32 = 9.
N (a1 a3 ) = number of ways to paint the four walls such
that walls 1, 2 have the same
color and 3, 4 have the same color. = 32 = 9. So s2 = 42 × 9 = 54.
N (a1 a2 a3 ) = 3 = N (ai aj ak ), so s3 = 43 × 3 = 12. We also have N (a1 a2 a3 a4 ) = 3 = s4 .
So the answer is N (a1 a2 a3 a4 ) = 81 − 108 + 54 − 12 + 3 = 18.
4
4
3
2
If there
are
only
2
colors,
then
s
0 = N = 2 = 16. s1 = 4 × 2 = 32. s2 = 2 × 2 = 24.
4
s3 = 3 × 2 = 8 and s4 = 2. The answer is N(a1 a2 a3 a4 ) = 16 − 32 + 24 − 8 + 2 = 2.
(Actually, it is easy to see that the only two ways to do it would be 1212 or 2121.) 3. Find the number of permutations of the letters α, α, α, β, β, β, γ, γ, and γ which are
such that no identical letters are adjacent.
Solution: Let a1 be the property that there are two α’s adjacent, a2 be the property
that there are two β’s adjacent, a3 be the property that there are two γ’s adjacent.
s0 = N =
9!
= 1680.
3!3!3!
Now we calculate N (a1 ). To count how many permutations are there such that two
8!
α’s are adjacent, we permute the pieces αα, α, β, β, β, γ, γ, γ. There are 1!1!3!3!
such
permutations. The problem is that we would count the permutations αα αβββγγγ
and α ααβββγγγ as two but actually it should be one. This double counting problem
only occurs when three α’s are together. So we have
8!
7!
−
= 980 = N(a2 ) = N (a2 )
1!1!3!3! 1!3!3!
= 3 × 980 = 2940
N (a1 ) =
s1
Now we calculate N(a1 a2 ). Again, to make sure that two α’s adjacent and two β’s
adjacent, we permute the pieces αα, α, ββ, β, γ, γ, γ. The number of permutation is
7!
. Again double counting occurs when three α’s or three β’s are together. Each
1!1!1!1!3!
6!
of them will occur in 1!1!1!3!
of the previously counted permutations. But if we subtract
6!
7!
2 × 1!1!1!3! from 1!1!1!1!3! , the permutations with three α’s and three β’s together will be
subtract twice. So
7!
6!
5!
−2×
+
= 620 = N (a1 a3 ) = N (a2 a3 )
1!1!1!1!3!
1!1!1!3! 1!1!3!
= 3 × 620 = 1860
N (a1 a2 ) =
s2
Similarly, we find
N (a1 a2 a3 ) = 6! − 3 × 5! + 3 × 4! − 3! = 426 = s3
So N (a1 a2 a3 ) = 1680 − 2940 + 1860 − 426 = 174.
4. The n integers 1, 2, ..., n are arranged around a circle. Let gn denote the number of
such arrangements in which no two adjacent integers are consecutive in clockwise order
(n and 1 are considered to be consecutive). Find an expression for gn , and show that
it satisfies the recurrence equation
gn + gn+1 = dn n ≥ 1.
Solution: Let ai be the property that the integers i and i + 1 are adjacent, i =
1, 2, ..., n − 1. and an be the property that the integers n and 1 are adjacent clockwise.
First we will calculate s0 = N , the number of ways to arrange those n numbers around
a circle. Take a number, say 1, out of the circle, the other n − 1 numbers are in a line.
Each permutation of these n − 1 numbers gives us a different arrangement around the
circle. Therefore s0 = (n − 1)!.
Now we calculate s1 . Consider N(a1 ). If 1 and 2 are adjacent on the circle, and we
take these two numbers away, the other n − 2 are in a line. Each permutation of these
n − 2 numbers gives us an arrangement around the circle that has property a1 . So
N (a1 ) = (n − 2)!. It is easy to
see that the same argument works for N(a2 ), N(a3 ),
n
. . . , N (an ). Therefore s1 = 1 (n − 2)!.
For s2 , we consider two cases: N(ai , ai+1 ) and N(ai , aj ) where j = i + 1. If i, i + 1
and i + 2 are adjacent, and we delete these 3 numbers, the other n − 3 are in a line.
So we have (n − 3)! arrangements that have property ai and property ai+1 . If i and
i + 1 are adjacent, and j and j + 1 are adjacent, and we delete i and i + 1, then there
are n − 2 numbers in a line. Among these n − 2 numbers, j and j + 1 have to be
adjacent.
So there are (n − 3)! arrangements that have property ai and aj . Therefore
s2 = n2 (n − 3)!.
In general, we would have
n
sj =
(n − j − 1)! j = 0, 1, ..., n − 1.
j
Since there is one arrangement that has properties a1 , a2 , · · · , an , we have sn = 1.
We have
gn =
N (a1 a2 ...an )
n
=
(−1)
(n − j − 1)! + (−1)n .
j
j=0
n−1
j
That also gives us
gn+1
n
j n+1
=
(−1)
(n − j)! + (−1)n+1 .
j
j=0
So we have
gn + gn+1 =
=
=
=
=
=
n−1
n
j n
n
j n+1
(−1)
(n − j − 1)! + (−1) +
(−1)
(n − j)! + (−1)n+1
j
j
j=0
j=0
n−1
n
j n
j n+1
(−1)
(n − j − 1)! + n! +
(−1)
(n − j)!
j
j
j=0
j=1
n−1
n−1
j n
i+1 n + 1
(−1)
(n − j − 1)! +
(−1)
(n − i − 1)! where i = j − 1
j
i+1
j=0
i=0
n−1
n
n+1
j
(−1)
−
(n − j − 1)! + n!
j
j
+
1
j=0
n−1
n
j+1
(−1)
(n − j − 1)! + n!
j+1
j=0
n
n
n n
n! −
(n − 1)! +
(n − 2)! − · · · + (−1)
(n − n)! = dn
1
2
n
5. A computer matching service has five male subscribers A, B, C, D and E and four
female subscribers a, b, c, and d. After analyzing their personalities and interests,
the computer decides that a should not be matched with C and D, b should not be
matched with A and E, c should not be matched with B and C, and d would quarrel
with E. Use a rook polynomial to find the number of ways in which the subscribers
can be matched.
Solution: We make a chessboard representing the
tions:
A B C D
a
× ×
b ×
c
× ×
d
permutation with forbidden posiE
×
×
The rook polynomial on the board consists of the forbidden positions is
R (x) = 1 + 7x + 16x2 + 13x3 + 3x4 .
Then we have
e0 =
n
(−1)j × rj × (n − j)!
j=0
= 5! − 7 (5 − 1)! + 16 (5 − 2)! − 13 (5 − 3)! + 3 (5 − 4)!
= 5! − 7 · 4! + 16 · 3! − 13 · 2! + 3
= 25
There are 25 ways the subscribers can be matched.