Math 7 Sprig 06 PROBLEM SET 5 SOLUTIONS Notatios. Give a real umber x, we will defie sequeces (a k ), (x k ), (p k ), (q k ) as i lecture.. (a) (5 pts) Fid the simple cotiued fractio represetatios of 6 37. Solutio. We perform the Euclidea algorithm as follows: 6 3 37 + 5, 37 5 + 7, 5 7 +, 7 7. This gives the cotiued fractio represetatio 6 37 3,,, 7. (b) (0 pts) Use (a) to fid a iteger solutio of 6x + 37y. Solutio. Note that gcd(6, 37) by the Euclidea algorithm performed above. The cotiued fractio obtaied i (a) has four etries, so by a propositio proved i lecture a iteger solutio of 6x + 37y is give by x ( ) q q, y ( ) 3 p p. The first few terms of (p k ) ad (q k ) ca be computed by p, p 0 3, p p 0 + p 7, p p + p 0 7, q 0, q 0, q q 0 + q, q q + q 0 5. Hece obtai a iteger solutio x 5, y 7.. (a) (0 pts) Covert the cotiued fractio, 5,, 4, 3 ito a ratioal umber i reduced form.
Math 7 Sprig 06 Solutio. The terms of (p k ) ad (q k ) are computed by p, p 0, p 5p 0 + p 6, p p + p 0 7, p 3 4p + p 34, p 4 3p 3 + p 09, q 0, q 0, q 5q 0 + q 5, q q + q 0 6, q 3 4q + q 9, q 4 3q 3 + q 93. Hece we obtai, 5,, 4, 3 p 3 q 3 09 93. (b) (0 pts) Covert the cotiued fractio,,, ito a quadratic irratioal umber. Solutio. Let θ,. The first two covergets of this cotiued fractio are ad, 3. Hece we ca write θ,, θ 3θ + θ +, which gives a quadratic equatio θ θ 0. We kow that θ > 0 as the first etry of its cotiued fractio is positive, so the quadratic formula gives θ + 3. We ow cosider the cotiued fractio,,,. The first two covergets are ad, 3. Hece we ca compute this cotiued fractio by,,,,, θ 3θ + θ + 3( + 3) + ( + 3) + 3 3 + 4 3 + 3 (4 + 3 3)( 3 3) ( 3 + 3)( 3 3) 6 3. 3 3. (a) (5 pts) Expad ito a simple cotiued fractio.
Math 7 Sprig 06 Solutio. The first few terms of (a k ) ad (x k ) are computed as follows: x 0, + 3 x, x 0 a 0 3 x x 3 x a x a 3 + 3, + 3. 3 a 0 [x 0 ] [ ] 3, [ ] [ + 3 [ ] [ ] ] + 3 3 + 3 a [x ] 3, [ ] a [x ] + 3 [ ] + 3 6, Sice x x 3, we obtai a cotiued fractio represetatio 3, 3, 6. (b) (0 pts) Use (a) to fid a ratioal umber r such that r < 0 6. Solutio. By a propositio proved i lecture, we have p <. I particular, if q > 0 3 the r p q will satisfy the coditio. We compute the first few terms of (p k ) ad (q k ) by q q p, p 0 3, p 3p 0 + p 0, p 6p + p 0 63, p 3 3p + p 0 99, p 4 6p 3 + p 57, p 5 3p 4 + p 3 3970, q 0, q 0, q 3q 0 + q 3, q 6q + q 0 9, q 3 3q + q 60, q 4 6q 3 + q 379, q 5 3q 4 + q 3 97. As q 5 > 0 3, we may take r p 5 q 5 3970 97. 4. Let be a positive iteger. (a) (5 pts) Fid the secod least positive solutio of x ( + )y.
Math 7 Sprig 06 Solutio. Let us first expad + ito a cotiued fractio. For this we compute x 0 +, a 0 [x 0 ] [ + ], x x 0 a 0 + + +, [ ] [ + + [ ] [ ] a [x ] + ] + +, x x a + + +, a [x ] [ + + ] [ + ] +, x 3 x a + + +. Sice x x 3, we obtai the cotiued fractio represetatio +,,. If, the miimum period of this cotiued fractio is, which is eve. Hece the positive solutios of x ( + )y are give by x p j, y q j for j,,. For, the miimum period is, ad the positive solutios are give by x p j, y q j for j, 4,. I either case, we fid the secod least positive solutio by x p 3, y q 3, which ca be computed as follows: p, p 0, p p 0 + p +, p p + p 0 4 + 3, p 3 p + p 8 + 8 +, q 0, q 0, q q 0 + q, q q + q 0 4 +, q 3 q + q 8 + 4. Hece the secod least positive solutio is x 8 + 8 +, y 8 + 4. (b) (5 pts) Prove that the equatio x ( + )y has o iteger solutios.
Math 7 Sprig 06 Solutio. To expad + ito a cotiued fractio, we compute x 0 +, a 0 [x 0 ] [ + ], x x 0 a 0 + + +, [ ] [ + + [ ] [ ] a [x ] + ] + +, x x a + + +, a [x ] [ + + ] [ + ] +, x 3 x a + + +. Sice x x 3, we obtai the cotiued fractio represetatio +,,. The miimum period is which is eve, which implies that the equatio x ( + )y has o iteger solutios. (c) (0 pts) Prove that the equatio x ( )y has ifiitely may iteger solutios if. Solutio. We see that x, y is a iteger solutio by ispectio. Hece by a theorem proved i class we coclude that the equatio has ifiitely may solutios. 5. (5 pts) Fid all positive itegers x, y with y 000 such that x y + 8xy + 0. Solutio. We ca write the equatio as (x+4y) 7y. This motivates us to itroduce ew variables a x + 4y, b y. () Sice we are oly iterested i positive solutios, a ad b are both positive. We ow study the egative Pell s equatio a 7b. We start by computig the cotiued fractio represetatio of 7 as follows: x 0 7, x x 7 + 4, x 0 a 0 7 4 7 + 4. x a 7 4 a 0 [x 0 ] [ 7] 4, [ ] a [x ] 7 + 4 [ 7] + 4 8, We fid that x x, thereby obtaiig the cotiued fractio represetatio 7 4, 8. The miimum period is which is odd, so the positive solutios of a 7b are give by a p j, b q j for
Math 7 Sprig 06 j 0,,,. We wat b y 000, so we oly eed to fid all q k 000. Now we compute p, p 0 4, p 8p 0 + p 33, p 8p + p 0 68, p 3 8p + p 77, q 0, q 0, q 8q 0 + q 8, q 8q + q 0 65, q 3 8q + q 58. Note that q 4 8q 3 + q > 000. Hece all positive solutios with b 000 are (a, b) (4, ), (68, 65). From () we obtai x a 4b, y b, which yields the correspodig solutios (x, y) (0, ), (8, 65). Hece we fid that x 8, y 65 is the oly positive solutio with y 000. 6. (5 pts) Prove that there exist ifiitely may positive itegers such that the sum of the first positive itegers is a perfect square. Solutio. The sum of the first positive itegers is give by itegers, m with + ( + ) +. Hece we seek positive m. This equatio ca be writte as + m, or equivaletly ( + ) 8m. () Let (s, t) be a positive solutio to the Pell s equatio x 8y. Note that s must be odd, so each solutio gives rise to a positive iteger solutio of () by s, m t. Sice the Pell s equatio x 8y has ifiitely may positive solutios, so does the equatio (). This completes the proof. 7. (0 pts) Let x be a real umber with the cotiued fractio represetatio x a 0, a, a,. Prove that the cotiued fractio represetatio of x is give as follows: a 0,, a, a, a 3, if a > x a 0, a +, a 3, a 4, if a. (Hit: Compare a 0, a ad a 0,, a to show that x a 0,, a, a, a 3,.)
Math 7 Sprig 06 Solutio. The first coverget a 0, a is computed as follows: p, p 0 a 0, p a p 0 + p a a 0 + q 0, q 0, q a q 0 + q a Sice x a, a 3,, we obtai x a 0, a, x p x + p 0 q x + q 0. (3) Let (p k ) ad (q k ) be the sequeces for covergets of a 0,, a, a, a 3,. The first few terms are computed by p, p 0 a 0, p p 0 + p a 0, p (a )p + p 0 a a 0 q 0, q 0, q q 0 + q, q (a )q + q 0 a. I particular, we ote that p p 0, p p, q q 0, q q. Hece we deduce a 0,, a, a, a 3 a 0,, a, x p x + p q x + q Comparig this with (3) yields x a 0,, a, a, a 3. (p x + p 0 ) q x + q 0. If a >, this is the simple cotiued fractio represetatio. If a, we further compute x a 0,, 0, a, a 3 a 0 + a 0 + + + a + a 3 + 0 + a + a 3 + a 0, a +, a, a 3,, which is the simple cotiued fractio represetatio. This completes the proof. Extra Credit Problem. I baseball, a player s battig average is defied by the umber of hits divided by at-bats. The battig average is usually rouded to the earest thousadth. (0 pts) Solve the followig problem, which is kow as Gosper s battig average problem:
Math 7 Sprig 06 If a player s battig average is 0.334, what is the smallest possible umber of times that this player has bee at bat? Solutio. Let us begi with the followig lemma: Lemma. Let a 0, a, a,, b 0, b, b,, c 0, c, c, be (possibly fiite) simple cotiued fractios satisfyig b 0, b, b, a 0, a, a, c 0, c, c,. The we have b 0 a 0 c 0. Proof. The give iequality yields [ b 0, b, b, ] [ a 0, a, a, ] [ c 0, c, c, ], where each Gauss fuctio yields b 0, a 0, c 0 respectively. Hece the desired iequality follows. Let p ad q be the umber of hits ad at-bats, respectively. For the battig average to be 0.334, we must have 0.3335 p 3335 3345 < 0.3345. Applyig the Euclidea algorithm to 0.3335 ad 0.3345 q 0000 0000, we fid 0.3335 0,,, 666 ad 0.3345 0,,, 94,,, 3. Write p q a 0, a,, a for the cotiued fractio represetatio of p. The we have q 0,,, 666 a 0, a,, a 0,,, 94,,, 3, which yields a 0 0 by Lemma. Now we ca rewrite the above iequality as or equivaletly 0 +,, 666 0 + a, a,, a 0 +,, 94,,, 3,,, 94,,, 3 a, a,, a,, 666. The Lemma implies that a, so this iequality ca be rewritte as, 666 a, a 3,, a, 94,,, 3, which implies that a by Lemma. The we further reduce this iequality to 94,,, 3 a 3, a 4,, a 666, (4) deducig that 94 a 3 666 by Lemma. If a 3 94, this iequality further yields 666 94 0, 57 a 4, a 5,, a,, 3,
Math 7 Sprig 06 implyig a 4 by Lemma as a 4 > 0. Now we ca compute p, p 0 0, p p 0 + p, p p + p 0, p 3 a 3 p + p a 3 +, q 0, q 0, q q 0 + q, q q + q 0 3, q 3 a 3 q + q 3a 3 +. If a 3 95, we have q 3 3 95 + 97. Sice the sequece (q k ) is icreasig, we deduce q q 3 97. If a 3 94, the a 4 as see above. The q 3 3 94 + 94 ad q 4 a 4 q 3 + q 97. Agai, we deduce q q 4 97 as the sequece (q k ) is icreasig. Hece we have q 97 i either case. I fact, we see 0,,, 666 0,,, 95 < 0,,, 94,,, 3 by ispectio. The middle cotiued fractio 95 + is give by 3 95 + 96. Hece the miimum value q 97 is achieved whe p 96. 97