tute03s

7
7/25/2019 tute03s http://slidepdf.com/reader/full/tute03s 1/7 The University of Sydney School of Mathematics and Statistics Solutions to Tutorial 3 (Week 4) MATH2069/2969: Discrete Mathematics and Graph Theory Semester 1, 2012 1.  Prove by induction that, for all n 0, (a)  n 3 + 5n  is a multiple of 3 (i.e.  n 3 + 5n = 3 for some integer  ℓ). Solution:  The  n  = 0 case holds because 0 3 + 0 = 0 is a multiple of 3 (it is 3 × 0). Suppose that  n 1 and that the result is known for  n 1, i.e. (n 1) 3 + 5(n 1) = 3ℓ,  for some integer  ℓ. Then 3 =  n 3 3n 2 + 3n 1 + 5 n 5 =  n 3 + 5n 3(n 2 n + 2)  , so  n 3 + 5n = 3(+ n 2 n + 2) is a multiple of 3, establishing the inductive step and completing the proof. (b) 5 n 4n 1 is a multiple of 16. Solution:  The  n  = 0 case holds because 5 0 4 × 0 1 = 0 is a multiple of 16. Suppose that  n 1 and that the result is known for  n 1, i.e. 5 n1 4(n 1) 1 = 16ℓ,  for some integer  ℓ. This equation can be rewritten as 5 n1 = 4n 3 + 16ℓ. So 5 n 4n 1 = 5(4n 3 + 16) 4n 1 = 16(n 1 + 5 )  , which is a multiple of 16, establishing the inductive step and completing the proof. 2.  Use the characteristic polynomial to solve the following recurrence relations: (a)  a n  = 5a n1 6a n2  for  n 2, where  a 0  = 2,  a 1  = 5. Solution:  The characteristic polynomial is x 2 5x + 6 = (x 2)(x 3) with roots 2 and 3, so the general solution is  a n  =  C 1 2 n + C 2 3 n for some constants  C 1 ,  C 2 . In our case we have 2 = a 0  =  C 1  + 2  and 5 = a 1  = 21  + 3 2 . Solving yields  C 1  =  C 2  = 1, so the solution is a n  = 2 n + 3 n . Copyright c  2012 The University of Sydney  1

Upload: gavan-corke

Post on 25-Feb-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: tute03s

7/25/2019 tute03s

http://slidepdf.com/reader/full/tute03s 1/7

The University of Sydney

School of Mathematics and Statistics

Solutions to Tutorial 3 (Week 4)

MATH2069/2969: Discrete Mathematics and Graph Theory Semester 1, 2012

1.   Prove by induction that, for all n ≥ 0,

(a)   n3 + 5n  is a multiple of 3 (i.e.  n3 + 5n = 3ℓ  for some integer  ℓ).

Solution:   The  n = 0 case holds because 03 + 0 = 0 is a multiple of 3 (itis 3× 0). Suppose that  n ≥ 1 and that the result is known for  n− 1, i.e.

(n− 1)3 + 5(n− 1 ) = 3ℓ,   for some integer  ℓ.

Then

3ℓ   =   n3 − 3n2 + 3n− 1 + 5n− 5 =   n3 + 5n− 3(n2 − n + 2)  ,

so  n3 + 5n = 3(ℓ + n2 − n + 2) is a multiple of 3, establishing the inductivestep and completing the proof.

(b) 5n − 4n− 1 is a multiple of 16.

Solution:   The  n = 0 case holds because 50 − 4 × 0 − 1 = 0 is a multipleof 16. Suppose that  n ≥ 1 and that the result is known for  n− 1, i.e.

5n−1 − 4(n− 1)− 1 = 1 6ℓ,   for some integer  ℓ.

This equation can be rewritten as

5n−1 = 4n− 3 + 16ℓ.

So5n − 4n− 1 = 5(4n− 3 + 16ℓ)− 4n− 1 = 16(n− 1 + 5ℓ) ,

which is a multiple of 16, establishing the inductive step and completing theproof.

2.   Use the characteristic polynomial to solve the following recurrence relations:(a)   an  = 5an−1 − 6an−2   for  n ≥ 2, where  a0 = 2,  a1 = 5.

Solution:   The characteristic polynomial is x2 − 5x + 6 = (x − 2)(x − 3)with roots 2 and 3, so the general solution is  an   =  C 12n + C 23n for someconstants C 1,  C 2. In our case we have

2 = a0 =  C 1 + C 2   and 5 = a1 = 2C 1 + 3C 2.

Solving yields  C 1 =  C 2 = 1, so the solution is

an = 2n

+ 3n

.

Copyright   c  2012 The University of Sydney   1

Page 2: tute03s

7/25/2019 tute03s

http://slidepdf.com/reader/full/tute03s 2/7

(b)   an  = 4an−1 − 3an−2   for  n ≥ 2, where  a0 = −1,  a1 = 2.

Solution:   The characteristic polynomial is x2 − 4x + 3 = (x − 1)(x − 3)with roots 1 and 3, so the general solution is  an   =  C 11n + C 23n for someconstants C 1,  C 2. In our case we have

−1 = a0 = C 1 + C 2   and 2 = a1 =  C 1 + 3C 2.

Solving yields  C 1 = −5/2 and C 2 = 3/2, so the solution is

an = 3n+1 − 5

2  .

(c)   an  = 4an−1 − 4an−2   for  n ≥ 2, where  a0 = 3,  a1 = 8.

Solution:   The characteristic polynomial is  x2 − 4x + 4 = (x − 2)2 withrepeated root 2, so the general solution is   an   =   C 12n + C 2n2n for some

constants C 1,  C 2. In our case we have

3 = a0 = C 1   and 8 = a1 = 2C 1 + 2C 2,

yielding C 1 = 3 and  C 2 = 1, so the final solution is

an  = 3× 2n + n2n = (n + 3)2n.

(d)   an  = 6an−1 − 9an−2   for  n ≥ 2, where  a0 = 2,  a1 = −3.

Solution:   The characteristic polynomial is  x2 − 6x + 9 = (x − 3)2 withrepeated root 3, so the general solution is   an   =   C 13n + C 2n3n for someconstants C 1,  C 2. In our case we have

2 = a0 = C 1   and   − 3 = a1 = 3C 1 + 3C 2,

yielding C 1 = 2 and  C 2 = −3, so that the final solution is

an  = 3n(2 − 3n).

*(e)   an  = 6an−1 − 11an−2 + 6an−3   for  n ≥ 3, where  a0 = 3,  a1 = 5,  a2 = 11.

Solution:   The characteristic polynomial is x3−6x2+11x−6 = (x−1)(x−

2)(x− 3) with roots 1, 2, 3, so the general solution is

an  =  C 1 + C 22n + C 33n

for some constants  C 1,  C 2,  C 3. In our case we have

3 = a0 = C 1 + C 2 + C 3,   5 = a1 = C 1 + 2C 2 + 3C 3,   11 = C 1 + 4C 2 + 9C 3,

yielding C 1 = 2,  C 2 = 0 and  C 3 = 1, so the final solution is

an = 3n + 2.

2

Page 3: tute03s

7/25/2019 tute03s

http://slidepdf.com/reader/full/tute03s 3/7

*(f)   an  = 6an−1 − 12an−2 + 8an−3   for  n ≥ 3, where  a0 = 2,  a1 = 4,  a2 = 16.

Solution:   The characteristic polynomial is x3 − 6x2 + 12x− 8 = (x− 2)3

with repeated root 2, so the general solution is

an  = C 12n + C 2n2n + C 3n22n

for some constants  C 1,  C 2,  C 3. In our case we have

2 = a0 = C 1,   4 = a1 = 2C 1 + 2C 2 + 2C 3,   16 = a2 = 4C 1 + 8C 2 + 16C 3,

yielding C 1 = 2,  C 2 = −1 and  C 3 = 1, so the final solution is

an = 2n(2− n + n2).

3.   Companies  A  and  B  control the market for a certain product. From one year to

the next,  A  retains 70% of its custom and loses to  B  the remaining 30%, while  Bretains 60% of its custom and loses to  A   the remaining 40%. Let  an  denote themarket share of company A after n years (thus, that of company B  is 1−an).

(a) Write down a recurrence relation expressing an  in terms of  an−1, for  n ≥ 1.

Solution:   For  n ≥ 1, we have

an   =  7

10an−1 +

  4

10(1 − an−1) =

  3

10an−1 +

  4

10.

(b) Solve the recurrence relation, in the sense of giving a closed formula for an,in terms of  a0.

Solution:   Unravelling the recurrence relation, we get:

an =  3

10an−1 +

  4

10 =

  3

10

 3

10an−2 +

  4

10

+

  4

10

=

 3

10

2

an−2 +  3

10

4

10 +

  4

10 =

 3

10

2  3

10an−3 +

  4

10

+

  3

10

4

10 +

  4

10

=

 3

10

3

an−3 +

 3

10

2 4

10 +

  3

10

4

10 +

  4

10...

=

 3

10

n

a0 +  4

10

 3

10

n−1

+ · · ·+  3

10 + 1

=

 3

10

n

a0 +  4

10

  3

10

n− 1

3

10 − 1

=

a0 −

 4

7

 3

10

n

+ 4

7.

Here the second-last equality uses the formula for the sum of a geometric

progression.

3

Page 4: tute03s

7/25/2019 tute03s

http://slidepdf.com/reader/full/tute03s 4/7

(c) Hence prove that the market share of company  A   in the long run (i.e. thelimit of  an  as  n→∞) is independent of its initial market share  a0.

Solution:   As n →∞, the power (   310

)n tends to 0, so an  →  4

7. So whatever

the initial situation, the market tends to a stable situation where company

A has a  4

7  market share and company  B  has a  3

7   market share.

4.   Let  bn  be the number of ways of forming a line of  n  people distinguished only bywhether they are male (M) or female (F), such that no two males are next to eachother. For example, the possibilities with 3 people are FFF, FFM, FMF, MFF,and MFM, so  b3  = 5. Write down a recurrence relation for  bn. Do you recognizethe sequence?

Solution:   We have   b0   = 1,   b1   = 2, and   bn   =   bn−1 + bn−2   if   n  ≥   2. To seethis notice that in a line of  n  people with  n  ≥ 2, if the last person is female thenthere are  bn−1  possibilities for the line of the first  n − 1 people, whilst if the last

person is male then the second last person must be female, so that there are  bn−2possibilities for the line of the first  n − 2 people. We get the Fibonacci sequencewith the first two terms deleted, so  bn = F n+2.

5.   Define a sequence recursively by a0 = 1, a1 = 2, and an  = an−1an−2 for n ≥ 2.

(a) Find a2,  a3,  a4,  a5  and  a6.

Solution:   a2 = 2,  a3 = 4 = 22,  a4 = 8 = 23,  a5 = 32 = 25,  a6 = 28.

(b) Prove that an  = 2F n, where  F 0, F 1, F 2, · · ·   is the Fibonacci sequence.

Solution:  As seen in lectures, we only need to show that 2

F n

satisfies thesame initial conditions and recurrence relation as  an. The initial conditionshold because 2F 0 = 20 = 1 and 2F 1 = 21 = 2. The recurrence relation holdsbecause for  n ≥ 2,

2F n = 2F n−1+F n−2 = 2F n−12F n−2,

by the Fibonacci recurrence relation  F n  = F n−1 + F n−2.

6.   Imagine a 2n×2n array of equal-sized squares, where n is some positive integer. Wewant to cover this array with non-overlapping L-shaped tiles, each of which exactly

covers three squares (one square and two of the adjacent squares, not opposite toeach other). Since the number of squares is not a multiple of 3, we need to removeone square before we start. Prove by induction that no matter which square weremove, the remaining squares can be covered by these L-shaped tiles.

Solution:   The base case is clear, because removing a square from a 2× 2 arrayleaves 3 squares which can be covered by a single tile. We now prove the claimfor  n  ≥ 2, assuming its truth for  n − 1. Let  G  be the 2n × 2n array with exactlyone square missing. Denote the quarters of  G  by UL   for upper left,  UR   for upperright, LL  for lower left and  LR  for lower right. Each quarter is a 2n−1×2n−1 array,

except that one of the quarters has one square missing. By rotating  G  if necessary,we may suppose that the missing square is in  LL. Let T  be the L-shape formed bythe lower-rightmost subsquare of  UL, the lower-leftmost subsquare of  UR and the

4

Page 5: tute03s

7/25/2019 tute03s

http://slidepdf.com/reader/full/tute03s 5/7

upper-leftmost subsquare of  LR. Then removing  T   from  G   produces a union of four 2n−1×2n−1 arrays each with one square missing, and each of these can be tiledby L-shapes, by the induction hypothesis. Hence G  is tiled by all these L-shapestogether with  T , establishing the inductive step and completing the proof.

*7.   The following argument ‘proves’ that whenever a group of people is in the sameroom, they all have the same height. There must be an invalid step; find it.

We argue by induction on the number   n   of people in the room. Then  = 1 case is obviously true. Suppose that  n  ≥  2 and that the claimholds for rooms with  n − 1 people. Let  P 1, P 2, . . . , P  n   be the  n  peoplein this room. If  P n  were to leave the room we would have a room withn−1 people, so by the inductive hypothesis, P 1, P 2, . . . , P  n−1 all have thesame height. We can apply the same reasoning with P 1 leaving the room,so  P 2, . . . , P  n−1, P n   all have the same height. But  P 2   is in both these

collections, so all of  P 1, P 2, . . . , P  n have the same height. This establishesthe inductive step, and so the claim holds for all  n by induction.

Solution:   Since the claim is false even when n = 2, the proof must fail alreadyin this case; when you run through the argument with  n  = 2, the error emerges.The invalid step is the assertion that “P 2 is in both these collections”, because thisignores the convention governing the way these collections were written out. Whenyou start with  n  people  P 1, P 2, . . . , P  n   and remove  P n, it is reasonable to list theremaining people as “P 1, P 2, . . . , P  n−1”, but you have to bear in mind that if  n  = 2,this list will just consist of  P 1  and will not in fact include  P 2.

*8.   For which  n   is the Fibonacci number  F n  even, and for which  n   is  F n   odd? Proveyour answer by induction.

Solution:   Examining the first few terms, one is led to guess that  F n   is evenwhen  n   is a multiple of 3, and odd when  n   is not a multiple of 3. To prove thisby induction, we first observe that the  n  = 0 and  n  = 1 cases are true (becauseF 0  = 0 is even and  F 1  = 1 is odd). Then in proving the result for n  ≥ 2, we canassume it for  n − 1 and for  n− 2. Recall that we have

F n  =  F n−1 + F n−2.

There are now three cases, depending on the remainder of  n  after division by 3.

If  n ≡ 0 (mod 3) (i.e. n is a multiple of 3), then  n − 1 and n − 2 are not multiplesof 3, so  F n−1  and  F n−2  are odd, so  F n  is even as required.

If  n  ≡  1 (mod 3), then n − 1 is a multiple of 3 but  n − 2 is not, so  F n−1   is evenand  F n−2  is odd, so  F n   is odd as required.

If  n ≡ 2 (mod 3) then n − 1 is not a multiple of 3 but  n − 2 is, so  F n−1 is odd andF n−2  is even, so  F n   is odd as required.

This completes the inductive step, and the claim follows by induction.

5

Page 6: tute03s

7/25/2019 tute03s

http://slidepdf.com/reader/full/tute03s 6/7

**9.   Suppose we want to solve a recurrence relation which is almost a kth-order homo-geneous linear recurrence relation, but with an extra constant term  C :

an = r1an−1 + r2an−2 + · · ·+ rkan−k + C,   for all  n ≥ k.

Let p(x) = xk

−r1xk−1

−···−rk be the characteristic polynomial of the homogeneousrecurrence relation obtained by omitting  C .

(a) Show that any solution  an  also satisfies the (k + 1)th-order linear homoge-neous recurrence relation with characteristic polynomial (x− 1) p(x).

Solution:   Suppose that the sequence   an   is a solution of our recurrencerelation. Then for any  n ≥ k + 1, we have

an = r1an−1 + r2an−2 + · · ·+ rkan−k + C   and

an−1 =  r1an−2 + r2an−3 + · · ·+ rkan−k−1 + C.

Subtracting the second equation from the first gives

an − an−1 =  r1(an−1 − an−2) + r2(an−2 − an−3) + · · ·+ rk(an−k − an−k−1)

for all  n ≥ k + 1, which can be rearranged as

an  = (r1 − 1)an−1 + (r2 − r1)an−2 + · · ·+ (rk − rk−1)an−k + (−rk)an−k−1.

This is the homogeneous recurrence relation with characteristic polynomial

xk+1 − (r1 − 1)xk − (r2 − r1)xk−1 − · · · − (rk − rk−1)x + rk

= (x− 1)(xk − r1xk−1 − · · · − rk−1x− rk) = (x− 1) p(x),

as claimed.

(b) Hence describe the general solution an   in terms of the roots of  p(x). (Theanswer will depend on whether 1 is a root of  p(x) or not.)

Solution:   Let the different roots of  p(x) be  λ1, · · · , λs  with multiplicitiesm1, · · ·  , ms  (where the multiplicity of a non-repeated root is 1).

First suppose that none of the   λi’s equals 1; then (x  − 1) p(x) has rootsλ1, · · · , λs, 1 with multiplicities  m1, · · ·  , ms, 1. By the general solution of homogeneous recurrence relations given in lectures, (a) implies that

an = (C 11 + C 12n + · · ·+ C 1,m1nm1

−1)λn1 + · · ·

+ (C s1 + C s2n + · · ·+ C s,msnms−1)λns  + D,

for some constants C ij, D. Conversely, any sequence an of this form is a solu-tion of the homogeneous recurrence relation with characteristic polynomial(x−1) p(x). This is not quite enough to imply that it satisfies our recurrencerelation: but the additional requirement is just the  n  =  k  case, namely

ak  = r1ak−1 + · · ·+ rk−1a1 + rka0 + C,

because, as we saw in the previous part, the difference between this equationand the n  =  k + 1 case is a case of the homogenous recurrence relation, as isthe difference between the  n  =  k + 1 case and the n  =  k + 2 case, and so on.

6

Page 7: tute03s

7/25/2019 tute03s

http://slidepdf.com/reader/full/tute03s 7/7

It is easy to see that the  n =  k  case reduces to a constraint on the constantD, namely

D =  r1D + · · ·+ rkD + C,

so the general solution is given by the above formula but with  D   specified

to equal  C 

1− r1 − · · · − rk . (The denominator is  p(1), which we assumed to

be nonzero.)

Now suppose that 1 is a root of  p(x); without loss of generality, λs = 1. Then(x−1) p(x) has roots λ1, · · · , λs−1, 1 with multiplicities m1, · · · , ms−1, ms+1.Solving the homogeneous recurrence, we obtain

an = (C 11 + C 12n + · · ·+ C 1,m1nm1−1)λn1  + · · ·

+ (C s−1,1 + C s−1,2n + · · ·+ C s−1,ms−1−1nms−1−1)λns−1

+ (C s1 + C s2n + · · ·+ C s,ms−1nms−1 + Dnms),

for some constants  C ij, D. As in the previous case, we have one extra con-straint on the constant  D  in order that the  n =  k  case of the desired recur-rence relation should hold, namely

Dkms = r1D(k − 1)ms + · · ·+ rk−1D + C,

so the general solution is given by the above formula but with  D  specified to

equal  C 

kms − r1(k − 1)ms − · · · − rk−1. (The denominator is nonzero, because

it is what you get when you substitute  x   = 1 in the polynomial obtainedfrom  p(x) by applying  ms   times the operator  x   d

dx

; each application reducesthe multiplicity of the root 1 by 1, so it is no longer a root at the end.)

7