Download Math 475 Fall 1999 Wilson Here are some solutions to the problems

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

History of the function concept wikipedia , lookup

Location arithmetic wikipedia , lookup

Law of large numbers wikipedia , lookup

Functional decomposition wikipedia , lookup

Abuse of notation wikipedia , lookup

Georg Cantor's first set theory article wikipedia , lookup

Big O notation wikipedia , lookup

Factorization wikipedia , lookup

Non-standard calculus wikipedia , lookup

Sequence wikipedia , lookup

Series (mathematics) wikipedia , lookup

Fundamental theorem of algebra wikipedia , lookup

Large numbers wikipedia , lookup

Factorial wikipedia , lookup

Elementary mathematics wikipedia , lookup

Collatz conjecture wikipedia , lookup

Recurrence relation wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Transcript
Math 475
Fall 1999
Wilson
Here are some solutions to the problems assigned on chapter seven. This is not to claim that these are the
only, or even the best, possible ways to solve the problems!
Problem 3, page 246:
Prove the following about the Fibonacci numbers:
(a) fn is even if and only if n is divisible by 3.
This is done in the text as an example on pages 196-7.
(b) fn is divisible by 3 if and only if n is divisible by 4.
(Note that f = 0 is divisible by any number, so in this and the next several items we need to see
how often divisibility by a particular number recurs after that.)
For part (b) we are interested in what happens every 4 numbers in the sequence, so we rst establish
a relationship between what happens at fn and what happens at fn . Since other parts of this
problem will require knowing what happens every 5 or 6 numbers in the sequence I will go ahead
and develop relations for those as well: Applying the basic recurrence relation fn = fn + fn
repeatedly, we get fn = fn + fn = [fn + fn ] + fn = 2fn + fn = 2[fn + fn ] + fn
= 3fn + 2fn = 3[fn + fn ] + 2fn = 5fn + 3fn = 5[fn + fn ] + 3fn = 8fn + 5fn
= 8[fn + fn ] + 5fn = 13fn + 8fn .
Now suppose that f k is divisible by 3 but f k , f k , and f k are not. In particular this is true
if k = 1, by looking at the rst ve numbers in the sequence as given on page 196 in the text. If we
can show that the same pattern holds starting at f k then by induction we will have the desired
result. We have f k = f k = 5f k + 3f k using the relations above with n = 4k + 4. The
rst term is divisible by 3 since f k is, while the second term is clearly divisible by 3. Hence we have
that f k is divisible by 3. Using the same relation on f k
= f k , which amounts to taking
the version for f k and subtracting one from each subscript, we get f k
= 5f k + 3f k .
The second term is divisible by 3, so if 3 divided the sum it would have to divide 5f k . Since 3
and 5 are relatively prime, that would require 3 to divide f k which by assumption it does not.
Hence f k
is not divisible by 3. This same argument can be repeated to show that f k
and f k
are not divisible by 3 and we are through.
0
4
1
3
4
6
2
4
7
2
5
3
4
6
2
4
6
2
5
3
5
3
6
5
1
2
4
3
5
6
7
4
4
1
4
2
4
3
4( +1)
4 +4
4( +1)
4
4
1
4
4( +1)
4( +1)
4 +3
1
4( +1)
4( +1)
4
1
4
4
4( +1)
4( +1)
1
4
2
1
1
1
4( +1)
2
3
(c) fn is divisible by 4 if and only if n is divisible by 6.
Again we use induction and the relations above. Looking at the rst seven numbers in the sequence
we see that if k = 1 then f k is divisible by 4 but f k ; : : : ; f k are not. Using n = 6(k +1) = 6k +6
in the relations above, f k = 13f k + 8f k and since f k is divisible by 4, so is this combination.
To do the remaining ve pieces all at once, let j represent any number from 1; : : : ; 5 and look at
f k
j : We use the relations above to get f k
j = 13f k j + 8f k j . For each value
j =f k
of j the rst term is not divisible by 4 but the second one is, so f k
j is not divisible by 4, and
by induction we are through.
6
6
6 +6
6
6
5
1
6 +6
6( +1)
6
1
6
6 +6
6
6
1
6( +1)
(d) fn is divisible by 5 if and only if n is divisible by 5.
This goes the same way as (b) and (c). Again we note that for k = 1 we have f k divisible by 5
but none of f k ; : : : ; f k . Using n = 5(k + 1) we get by the relations above f k = f k =
8f k + 5f k . Since f k is by assumption divisible by 5, so is f k . Letting j be any number
1; : : : ; 4, f k
and for each value of j the rst term is not
j = 8f k j + 5f k j
j = fk
divisible by 5 but the second is. Again this makes the induction work to nish the proof.
5
5
5
5
4
1
5
1
5( +1)
5
5( +1)
5 +5
5( +1)
5 +5
5
5
1
(e) By examining the Fibonacci sequence, make a conjecture about when fn is divisible by 7 and then
prove your conjecture.
The list on page 196 does not go far enough to make the pattern very clear. Extending it we nd
that f = 21, f = 987, f = 46; 368, and f = 2; 178; 309 are all divisible by 7 while others
8
16
24
32
1
do not seem to be. Hence I conjecture that fn is divisible by 7 if and only if n is divisible by 8.
Extending the relations derived above two more steps we get fn = 34fn + 21fn . The proof
works as in the cases above: If k = 1 we have f k divisible by 7 but not f k ; : : : ; f k . Using
n = 8k + 8 we get f k = f k = 34f k + 21f k is divisible by 7. For any j = 1; : : : ; 7,
f k
j = 34f k j + 21f k j is not divisible by 7. Hence by induction the same pattern is true
for all positive integers k and the proof is complete.
8
8
8 +8
8( +1)
8
8( +1)
8
8
9
8
8
7
8
1
1
1
Consider a 1-by-n chessboard. Suppose we color each square of the chessboard
with one of the two colors red and blue. Let hn be the number of colorings in which no two squares that
are colored red are adjacent. Find and verify a recurrence relation that hn satises. Then derive a formula
for hn .
I think of the squares of the board laid out in a row, so that one legitimate coloring of a 1-by-4 board could
be represented as RBBR where each letter denotes the color of one square. If n = 1, a board with just one
square, there are two ways to color it, either R or B. For a 1-by-2 board we can have BB, BR, or RB, so
there are three ways to color the board. For convenience I will say there is one way to color the \empty"
board, so if hn in general is the number of ways to color the 1-by-n board we have h = 1, h = 2, and
h = 3 so far. Consider any coloring of the 1-by-n board: Either the left-most square is blue or it is red.
If it blue, Bxx : : : x, the n 1 x's can be any allowed coloring of the remaining squares. If that left-most
square is red, then the next square must be blue to avoid two adjacent red squares, so the coloring looks
like RBxx : : : x. This time there are n 2 x's, and since the square next to them is blue they can be any
allowed coloring of the remaining n 2 squares. Thus the total number of colorings is hn = hn + hn for
n 2. Now that is the same recurrence relation as for the Fibonacci numbers, but the initial conditions
h = 1 and h = 2 are dierent from the standard Fibonacci numbers. Thus we can use the work in the
text on pages 197 and 198 to solve the Fibonacci recurrence, up to the point of solving for c and c . We
have in general
Problem 6, page 246:
0
1
2
1
0
2
1
1
p
1+ 5
2
hn = c
1
!n
p
1
+c
2
2
5
!n
2
:
Using n = 0 and n = 1 and the corresponding values above, c + c = 1 (from n = 0) and
c
1
p
1+ 5
2
!n
Substituting c = 1
c =
1
p
1
+c
2
2
p
2
5
1
!n
2
= 2 (from n=1).
c in the second equation we can solve for
1
3 5+5
; and then
10
p
3 5+5
:
10
c =1
2
Hence
p
3 5+5
hn =
10
!
p
1+ 5
2
!n
+ 1
p
3 5+5
10
!
1
p
2
5
!n
:
(Checking what that gives for the rst several values of n we do get 1,2,3,5,8. . . .)
Problem 12, page 247:
h = 1 and h = 0.
0
Solve the recurrence relation hn = 8hn
1
16hn , (n 2) with initial values
2
1
Assume to begin with that hn can be given by the nth power of a constant, hn = qn . Writing the recurrence
as hn 8hn + 16hn = 0 and substituting, qn 8qn + 16qn = 0. Factoring, qn (q 8q + 16) = 0.
The choice q = 0 clearly does not t the sequence, so q 8q + 16 = 0. Factoring that, (q 4) = 0. Hence
1
1
2
2
2
2
2
2
2
the only root is q = 4, with multiplicity 2. Thus we write our solution as hn = c 4n + c n4n = 4n (c + nc ).
Substituting the given values for h and h we get the equations c 1 + 0 c = 1 and 4(c + 1 c ) = 0,
which can be easily solved to get c = 1 and c = 1. Thus we get hn = 4n (n 1). (You can then check
this against the rst few numbers in the sequence as produced by the recurrence, 1; 0; 16; 128; 768; 4096;
and nd that it works.)
1
0
1
1
1
2
1
2
1
2
2
2
Solve the following recurrence relations by examing the rst few values for a
formula and then proving your conjectured formula by induction.
Problem 15, page 246:
(a) hn = 3hn , (n 1); h = 1
Since each entry is just 3 times the previous, starting with 1, it is pretty obvious that this is the
seqence of powers of 3. A formal proof by induction could work this way: We prove that hn = 3n
for each nonnegative integer n. The statement is true for n = 0 by checking the initial value given.
If the statement is assumed true for some value of n, then hn is by the recurrence 3hn which is by
the inductive hypothesis 3 3n = 3n , conrming the inductive step.
1
0
+1
+1
(b) hn = hn
n + 3, (n 1); h = 2
Using the recurrence, the sequence starts o 2; 4; 5; 5; 4; 2;
1;
5;
10;
16; : : :. I am
not sure that looking at those numbers directly will lead you to a useful conjecture! If you take the
dierence from one to the next you get 2; 1; 0;
1;
2;
3;
4;
5;
6; : : : which has
more apparent pattern. Since the dierences lie on a straight line, by analogy with the fact that a
derivative which is linear implies a function which is quadratic, you might conjecture that there is a
quadratic polynomial hn = an + bn + c which gives the sequence. Using the values for h ; h , and
h , one can then write equations to be solved for a; b, and c: From n = 0 we get 2 = a 0 + b 0 + c
so c = 0 and the polynomial becomes an + bn + 2. From n = 1 we have a + b + 2 = 4, so a + b = 2.
Using n = 2 we get 4a + 2b + 2 = 5 which we can rewrite as 2a + 2(a + b) = 3, and then substitute
a + b = 2 to get 2a + 4 = 3. That gives us a =
and then from a + b = 2 we have b = . Hence
we have a formula to test and possibly prove correct: Trying hn = n + n + 2 for the values of
n = 0; 1; 2; 3; 4; : : :, etc., it seems to work.
Since we know this formula works for small values of n, to prove it works for all we only need
to verify that if it works for a value n then it also works for n + 1. Assume it works for n, i.e.
hn = n + n + 2. By the recursion we have hn = hn (n + 1) + 3, and using the assumed
n + n + 4. If
formula for hn we get hn = n + n + 2 (n + 1) + 3. That simplies to
we evaluate the polynomial at n + 1 we get (n + 1) + (n + 1) + 2 which simplies to the same
thing. Hence the polynomial works for all n.
1
0
2
0
1
2
2
1
5
2
1
2
1
2
2
5
2
2
5
2
+1
2
1
+1
2
2
5
2
1
1
2
2
5
2
2
3
2
2
(c) hn = hn + 1, (n 1); h = 0
The rst several items in the sequence are 0; 1; 0; 1; 0; : : :. I conjecture the sequence alternates 1
and 0 forever. There are several ways to express that. One is to say that hn = 0 for all even n and
hn = 1 for all odd n. Another is to say hn = (1 ( 1)n ). The rst is easier to see, the second
actually easier to deal with using induction. But I will go ahead and do the proof in the rst form.
It certainly works for small values of n, so we only have to get from n to n + 1: Assume it works for
n. If n + 1 is even, n is odd, and vice versa. If n + 1 is even so n is odd, hn = 1 by assumption.
Then by the recursion hn = hn + 1 = 1 + 1 = 0 which is what our conjecture says for even
numbered terms. If n + 1 is odd and so n is even, the assumption makes hn = 0 and the recursion
gives hn = 0 + 1 = 1 as the conjecture predicts for an odd term. Hence the conjecture is proved.
1
0
1
2
+1
+1
(d) hn = hn + 2, (n 1); h = 1
The values of this sequence are all 1. The inductive step in the proof is this: If hn = 1, then
hn = hn + 2 = 1 + 2 = 1 also.
1
0
+1
3
(e) hn = 2hn + 1, (n 1); h = 1
The initial terms of the sequence are 1; 3; 7; 15; 31; 63; : : :. Those numbers look like one less than
powers of two but we have to gure out which power goes with what subscript. For h we have 2 1
so the power appears to be one greater than the subscript, i.e. hn = 2n
1. It is pretty straight
forward to prove that by induction using algebraic notation, but here is another way to view the
induction that may make sense to those of you who program a lot: If I write the number 2n
1 in
binary I get 111 : : : 1 with a total of (n + 1) 10 s. Using the recursion we double that, which shifts it
left one bit and puts a 0 on the right so we have 111 : : : 10 with one more digit. Now the recursion
says to add 1, giving 111 : : : 11 with (n + 2) 10 s. But that is exactly one less than the next power of
2, as needed.
1
0
1
0
+1
+1
Problem 20, page 248:
Solve the nonhomogeneous recurrence relation
(n 1)
hn = 2hn + n;
1
h =1
0
First we solve the homogeneous recurrence hn = 2hn . You can do this `brute force' but it is pretty clear
that doubling each time corresponds to some multiple of powers of two, hn = c 2n for some constant c.
Now we look for some particular solution of the nonhomogeneous relation. In the notation of the textbook,
page 216, the non-homogeneous part bn is just n. Referring to the table on the lower part of that page,
this is case (a)(ii) where bn is of the form dn + e, so we try hn = rn + s for some constants r and s. Using
the recurrence, hn = rn + s = 2hn + n = 2(r(n 1) + s) + n = n(2r + 1) 2r + 2s. Equating the
multiples of n gives r = 2r + 1, so r = 1. From the constant term we get s 2r + 2s = 2 + 2s, so s = 2.
Thus we use hn = n 2 as the particular solution, and combining that with the general solution we get
hn = c 2n n + 2. Using h = 1 gives c 0 2 = 1 so c = 3, giving hn = 3 2n n 2. You can check
that this does give the correct values for the rst terms in the sequence, 1; 3; 8; 19; 42; : : : :
1
1
0
Problem 23, page 248:
Determine the generating function for each of the following sequences:
(a) c = 1; c; c ; : : : ; cn : : : :
The series for the generating function is 1 + cx + c x + c x + : : : = 1 + (cx) + (cx) + (cx) + : : :.
That is geometric with ratio cx and so the generating function is the `sum' of that series (the actual
sum if cx is such that the series converges) given by cx .
0
2
2
2
3
3
2
3
1
1
(b) 1; 1; 1; 1; : : : ; ( 1)n ; : : : :
This time the series 1 x + x
x = x.
1
1
1
(
2
x + : : : is geometric with ratio x, so the generating function is
3
1+
)
(c) ; ; ; : : : ; ( 1)n n ; : : : ; ( is a real number.)
x + : : : + ( 1)n xn + : : : is exactly the series on the lower part of page
The series n
147 for (1 + z ) with z = x. Hence the generating function is (1 x) .
0
1
2
0
1
2
(d) 1; ; ; : : : ; n ; : : : :
1
1
1!
2!
1
!
1
X
xn
. This sequence is exactly the list of coeÆcients in this
n!
series, so the generating function is just ex .
Recall the Maclauren series for ex ,
0
; ; : : : ; ( 1)n n ; : : : :
(e) 1;
Refer to part (d): If we change x to x we will have the series for e x and the coeÆcients will match
this sequence, so the generating function is e x .
1
1
1!
2!
1
!
4
Solve the recurrence relation by using the method of generating functions as
described in section 7.5:
hn = 8hn
16hn , (n 2); h = 1; h = 0
Suppose g(x) is the generating function for the sequence hn described by this recurrence. We can rewrite
the relation as hn 8hn + 16hn = 0. Then
Problem 25(d), page 249:
1
2
0
1
g(x) = h
8xg(x) =
16x g(x) =
2
0
1
2
+h x +h x
8h x 8h x
16h x
1
2
2
0
1
0
2
2
+ : : : +h n x n
+:::
: : : 8hn xn
:::
n
+ : : : +16hn x + : : :
1
2
Adding these three lines we get
g(x) 8xg(x) + 16x g(x) = h + (h
2
0
1
8h )x + additional
0
where all those additional terms have the form (hn 8hn + 16hn )xn and hence are zero because of the
recurrence relation. Factoring and rearranging, and using the given values for h and h , g(x)(1 8x +
16x ) = 1 + (0 8 ( 1))x = 8x 1. Dividing,
1
2
0
1
2
g(x) =
8x 1
8x 1
=
1 8x 16x
(1 4x)
2
2
That denominator has one root x = , with multiplicity two, so using partial fractions we can write
1
4
g(x) =
1
8x 1
8x 1
c
c
=
=
+
8x 16x
(1 4x)
1 4x (1 4x)
1
2
2
2
2
for some constants c and c . Multiplying by (1 4x) we get 8x 1 = c (1 4x) + c = 4c x + (c + c ).
Equating the x coeÆcients from the two sides gives 4c = 8 so c = 2. The constant terms give
c + c = 1, so c = 1. Thus we have
1
2
2
1
1
1
2
g(x) =
2
1
1
2
1
2
1
2
+
1 4x (1 4x)
2
Using series formulas for the geometric series and/or Newton's
extended binomial theorem (see the example
k
on page 231 or Equation 7.47) and the fact that k = k + 1, we can rewrite these as
1
1 2 + k 1!
1
1
1
X
X
X
X
X
k
k
k
k
k
k
g(x) = 2 (4x) +
(4x) = ( 2 4 )x + [(k + 1) 4 ]x = (k 1)4k xk
+1
k=0
k=0
k
k=0
k=0
k=0
Now we can read o the terms of the sequence from the coeÆcients in the series expansion of the generating
function,
hn = (n 1)4n :
5