Math Outside the Classroom [1 ed.] 1527505022, 9781527505025

This book takes readers on a fascinating journey through various mathematical concepts, including geometry, calculus, pr

149 51 89MB

English Pages 257 [258] Year 2023

Report DMCA / Copyright

DOWNLOAD FILE

Polecaj historie

Math Outside the Classroom [1 ed.]
 1527505022, 9781527505025

Citation preview

Math Outside the Classroom

Math Outside the Classroom By

Lide Li

Cambridge Scholars Publishing

Math Outside the Classroom By Lide Li This book first published 2023 Cambridge Scholars Publishing Lady Stephenson Library, Newcastle upon Tyne, NE6 2PA, UK British Library Cataloguing in Publication Data A catalogue record for this book is available from the British Library Copyright© 2023 by Lide Li All rights for this book reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior permission of the copyright owner. ISBN (10): 1-5275-0502-2 ISBN (13): 978-1-5275-0502-5

To Quanyi, Sherrie and Janice

Contents INTRODUCTION

1

1

6

LIMITS

1.1

Limits and Sequences . ...... Limits of Functions . . ...... Find Limits or Extrema: Examples

1.2 1.3 1.4 Misuse of Limit . . . .......

2

SEQUENCE AND SERIES

2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9

3

Sequences and Series Arithmetic Series .. Geometric Series .. Ratio of Consecutive Terms . Calculating Sum of Series Convergence Tests . . . . The Fibonacci Sequence Pascal's Triangle Appendix ....

7 11

19 23 28 29 32 34 36 40 45 53 58 63

GEOMETRIC SHAPES

66

3.1 3.2 3.3 3.4 3.5 3.6

66 73

Basic Geometric Shapes and Their Areas Linear Functions ... Circle ......... Pythagorean Theorem . Beyond Pythagorean

77

83 85 89

Volume ........ vii

Contents

viii

3.7

4

5

100

4.1 4.2 4.3 4.4 4.5 4.6 4.7

100

Why Hexagon . . . . . . . . . Strategies of the Young Swan . Testing Divisibility . . . . . . Binary Search . . . . . . . . . Tower of Hanoi and Recurrence Relation Balance Puzzle . . . . . . . . . . . . Time Complexity in Problem Solving . .

102 104 109 113 119

126

UNDERSTANDING DIFFERENTIATION AND INTEGRATION

133

5.1 5.2 5 .3 5.4 5 .5

135 148

Rates and Derivatives .. . Products and Integrals . . . . . . . . . The Fundamental Theorem . . . . . . . Antiderivatives and Related Techniques Applications . . . . . . . . . . . . . . . 5.5.1 Indeterminate Forms and L'Hopital's Rule. 5.5.2 Geometric Measures and Integration. Appendix . . . . . . . . . . . . . . . . . . .

157 161 166 166 . 170 . 179 188

TOPICS FROM OTHER FIELDS

6.1 6.2 6.3 6.4 6.5

7

89 91 95

STRATEGIES IN PROBLEM SOLVING

5.6

6

3.6.1 Prism . . . . 3.6.2 Conic Solid . Appendix . . . . . .

Moments . . . . . . . . The Duration of a Bond . . The Motions of Objects From Interest Rates to Euler's Number . Appendix

. 188

. . . .

215

PROBABILITY

7 .1 7 .2 7 .3 7.4 7 .5

The Monty Hall Problem Counting All Possibilities . . Some Probability Examples . Geometric Probability: Buffon's Needle Probability and Sets . . . . . . . . . . .

195 200 205 212

. . . . .

216 218 222 226 229

Contents 7.6

Independent Events and Conditional Probability .

ix . 232

Bibliography

. 242

Index. . . . . . . . . . . . . . . . . . . . . . . . . . .

. 244

INTRODUCTION

Amy and Ben are playing dominoes after school. Amy aligns the tiles in a line and then triggers their cascading effect, while Ben seems engrossed in solving a puzzle. "Today, we learned about Mathematical Induction. It's similar to playing dominoes," says Amy. "How so?" Ben inquires. "Mathematical Induction allows us to prove that a statement holds true for all natural numbers, n. It involves two steps. First, we prove that the statement holds for the base case, which is typically n = 1. Then, we show that if the statement holds for n = k, it also holds for n = k + 1. In dominoes, this translates to ensuring that the first tile will fall, and if any tile falls, the 1

2

INTRODUCTION

next one will follow suit." "Did you use induction for today's math homework?" Ben asks. "Yes, we were tasked with proving that the sum of the first n odd numbers is equal to n2 . Then-th odd number is 2n -1, and we needed to prove the following: 1 +3+5+•··+ (2n-1) = n2

for all n. The steps were as follows: Step 1: 1 = 12 ; Step 2: Assume 1 + 3 + 5 + • • • + (2n-1) = n2 . The (n+ 1)-th odd number is 2n + 1, so we have 1 +3+5+•·· + (2n-1) + (2n+ 1) =n2 + (2n+ 1) = (n+ 1) 2 . And that's it." "But, I was going to share something new," Ben says, before Amy cuts him off. "I know, another new idea," Amy interjects with a smile. Ben then arranges four rows of dominoes, each representing the numbers 1, 3, 5, and 7. He splits them into two parts and flips one over, before joining them to form a square (as shown in Figure 2).

I Ill 11111 1111111

I 111 11111 1111111

Figure 1: Sum of the first 4 odd numbers

INTRODUCTION

3

1111 1111 1111 1111 Figure 2: Rearrangement: a square of 4 x 4 "Look, The first n odd numbers can always be represented in this way." Ben explains. "Can this process be explained algebraically?" asks Amy. "I'll try. We can simply divide every odd number into two parts:

1=1+0, 3=2+1, 5=3+2,···,2n-l=n+(n-1). This also cuts the original series into two series:

1 +3+5+•··+ (2n-1) = (1 +2+3+···+n) + (0+ 1 +2+-··+n-1) = (1 +2+3+···+n) + (n-1 +··· +2+ 1 +0) = (1 +n-1) + (2+n-2) +···+ (n-1 + 1) + (n+0) =n+n+···+n =n2 This demonstrates that why we can arrange dominoes into a square." "That sounds right, but you didn't use mathematical induction." Amy reminds him of the teacher's instructions. Ben responds, "Do I have to? I'm not comfortable with induction because of an example that still bothers me • • • 11

"Wait a second, how? Could you explain?" Amy asks, surprised. "Let me demonstrate how to use mathematical induction to prove a false statement: 'all dominoes have the same number of pips.' First, starting with one domino, it has a number. Now consider k + 1 dominoes, assuming that any k dominoes have the same number of pips. If all dominoes are placed in

4

INTRODUCTION

a line, the assumption is that the first k dominoes have the same number of pips; similarly, the last k dominoes have the same number of pips. Because there must be a domino in both groups, all k + l dominoes must have the same number of pips." "Something must be wrong with your proof. Let's figure out which part of using mathematical induction was incorrect."

Amy and Ben are two student characters in this book, who may be familiar to you as classmates, colleagues, or even yourself. Many students are like Amy, who follows her teacher's instructions in class and completes her homework in the traditional manner. This is a highly efficient way of meeting the requirements of the school and class, and these students are often pleased with their academic performance. However, it is important for them to understand that the traditional education system only focuses on a limited aspect of mathematics, and that being a good student involves more than just getting good grades. It requires a deep understanding of the subject and the ability to apply it in real-world situations. In the real world, students will encounter problems that are not covered in textbooks and will require them to think creatively and outside the box. After leaving school and entering the workforce, students are expected to solve real-world problems that require innovative thinking. One way to overcome the limitations of traditional education is to ask more questions and challenge your thinking. By asking "Are there any other options?" and "What would happen ifl didn't take this step?" students can explore different solutions to a problem and see which one is most effective. This questioning approach helps students to deepen their understanding of the subject. On the other hand, a student like Ben, who is constantly seeking new ideas and pursuing what interests them, can sometimes face challenges in the classroom. They may not always follow the teacher's instructions for problem-solving, which can lead to difficulty finding a solution. Additionally, some teachers may only award credit for solutions that strictly follow their guidelines. However, having a diverse range of perspectives should be encouraged, as it enriches the understanding of various concepts. Creativity is a crucial skill for students who plan to pursue careers in science

INTRODUCTION

5

or engineering where creativity and innovative problem-solving skills are highly valued, but it's more than just having a curious mind. These students must also learn how to effectively and efficiently achieve their goals. This can be accomplished by reading various sources beyond just textbooks and learning from others. It's important to avoid aimless searching without a clear objective. For students who struggle with math, the subject can feel overwhelming and uninteresting. However, it's important to remember that there are ways to overcome these obstacles and find a renewed appreciation for math. One approach is to seek out resources that are more accessible and cater to different learning styles. Reading books and articles, watching educational videos, and exploring online math learning communities can help you discover new ways of thinking about math and develop a deeper understanding of its concepts. Another way to appreciate the beauty of math is by exploring its real-world applications. Math is used in fields such as science, engineering, and finance, and understanding its role in these areas can help you see its relevance and importance. You must be willing to explore it in new and meaningful ways. With persistence, creativity, and a willingness to learn, you can overcome your challenges and discover the excitement and wonder of this fascinating subject. This book aims to provide a different approach to learning mathematics, one that is designed for all types of readers, including those who have already graduated but want to improve their problem-solving skills. The author intends to offer readers a new perspective on the world of mathematics by emphasizing the interdependence of various mathematical concepts, including those students may not have encountered in the classroom, and providing alternative approaches to problem-solving. With this book, readers will have the opportunity to learn new concepts and have fun while doing so, as they discover the exciting and interesting world of mathematics. Albert Einstein once said, "Education is not the learning of facts; it is rather the training of the mind to think." This book aligns with this philosophy, as it strives to assist students in developing their problem-solving skills and strengthening their grasp of mathematics.

CHAPTER

1

LIMITS

"Have you heard the story of the Tortoise and the Hare?" Ben asks Amy one day. "Of course, the hare lost " Amy responds. "Do you know why the hare was defeated? " "Because the hare was napping when he reached the halfway point " "It's more of a joke than a story, in my opinion. Achilles and the Tortoise is an ancient Greek story that I enjoy. In the story, the quick-footed hero lost the race against the tortoise. No, I mean the tortoise presented a logical argument that Achilles was unable to defeat or refute. "What was the argument? Did they expect Achilles to take a nap?" "No, let me tell you a story." Ben then tells his version of the ancient

legend. Achilles and a tortoise engaged in a race. Achilles realized that even if he won, people would not think he did so fairly. So he proposed to the tortoise: "Because you are slow, I will let you run first, and I will start after you have run 10 meters. " "Well, before you begin," the tortoise said, "I will let you know that you cannot catch me. " "Why?" The tortoise explained his reason slowly, "Assume you move 10 times as quickly as I do. When you start, I am already 10 meters ahead. When you finish these 10 meters, I will have finished another 1 meter. Then you cover this 1 meter gap, but by then 1 have advanced another 1/10 meter••• The point is that there is always a gap between you and me. I am always right in 6

1.1.

7

LIMITS AND SEQUENCES

front of you. Got it?" Achilles: " · · · " "I see. The story creates a sequence of positive numbers that approaches the limit, zero," Amy says.

1.1

Limits and Sequences

What is a limit? This is a critical concept in mathematics. Following Ben's story, the distance between the tortoise and Achilles changes and can be represented as a sequence as follows: 1 1 lO, l, 10' 100 ...

(1.1)

You can write this sequence for as long as you want and can get the number as close to zero as you like. This sequence is said to be approaching zero, or its limit is zero. Here is another example:

1 2 3

3' 5' 7' ···,

n 2n+l'

It is not difficult to see intuitively that the limit of this sequence is

(1.2)

1 2.

In general, a sequence is denoted as (an) =a1,a2,···

(1.3)

The fact that "the limit of a sequence (an) is L," simply denoted by an-+ L, means that the distance between the terms of this sequence andL, Ian -LI, can be arbitrarily close to zero. How can something be described as "arbitrarily close" ? One way to put it is: "no matter how small the positive number you choose, Ian - LI will always be smaller than your number whenever n is large enough. In mathematics, people use so-called "t: -N definition" to describe the limit of a sequence. Here is this formal definition. Definition 1.1.1. A sequence (an) has the limit Las n goes to infinity, or limn-too an = L, which means that for each real number £ > 0, there is an integer N, such that if n > N, then Ian - LI< £. Students learning the "e - N definition" for the first time may find it is unfamiliar. We will demonstrate how it works with an example and then extend on the concept of the limit.

8

1.1.

LIMITS AND SEQUENCES

Example 1.1.1. lim-nn+ 1

=1

(1.4)

n--+=

Proof. By definition, we only need to show that for each an integer N such that whenever n

£

> 0, there exists

> N, we have 1-n- - 11 < n+l

n

n

£.

Since

I

- - < 1, the last inequality is equivalent to 1 - - - < £, or n > - - 1. It n+l n+l e 1 is now clear that if N is an integer such that N > - - I, then for each n > N, £

we have 1-n- -11 n+l



< £. This proves (1.4).

In the case of the sequence in (1.1), an= 102 -n and L = 0. The "e -N definition" for this limit, limn-+= an = 0, is that for each £ > 0, there is an integer N such that if n > N, then 1102-n - OI < £. In fact, the last inequality is equivalent ton> 2 - log 10 £. So choose any integer N > 2 - log 10 £, we have that if n > N, then I102 -n - 0 I< £. In this case, an =/- L for all n, but this is not a necessary condition for defining the limit. Readers can try to prove the limit of sequence (1.2) using an e -N definition.

Example 1.1.2. lim cos nn does not exist

n--+=

In fact, (an)= (cosnn) is a simple sequence: -1, 1, -1, 1,

···,(-It,···

Clearly, it will not approach to any number as n ➔ oo. How can we state this fact formally? By definition, if its limit, say L, exists, then for any £ > 0, there exists an N, Ian - LI< e whenever n > N. What we need to show is there is a number £, no matter how large N is, we can al ways find n > N such that Ian -Ll2'. £.

Proof. Let £ = 1/2. If the limit exists, say L, then there is N, such that Ian - LI< ½whenever n > N. If an = I, then an+ 1 = -1. We have 2=an-an+l = lan-L+L-an+1I::; lan-Ll+IL-an+tl< This implies that we cannot have both Ian -LI 0, such

~ for all n > N.

m

That is, channel C ( L, ~) contains tail TN

and thus it is a bound channel. This proves that (1) implies (3). Assume 1 (3) holds. For any £ > 0, we can find a natural number m such that - < £. m

Since C ( L, ~) is a bound channel by (3), it contains a tail, say TN. That is, for all n > N, we have L- £ ::::; an ::::; L + £, or Ian - LI< £. This proves that (an) converges to L. □ In Lemma 1.1.3, the way one chooses the bound channels is not important. We can replace them with

where (£1, £2, • • • , e,n, •••) can be any positive-termed decreasing sequence and Em --+ 0. What was the issue with the Tortoise's argument? The trick here is that in Ben's story, he artificially records the distance between the two into an infinite sequence and does not allow it exceed the limit. The sequence is well-defined but he overlooks an important factor in the real problem -time. If the time required to travel each distance in the sequence has a lower bound, then it would take forever, since the sequence has infinite terms. However, in this race, the time required to complete each term in the sequence can be listed as: 1 second, 1/10 second, 1/100 second • • • (assume Achilles ran 10 meters per second.) We add all of these time periods to see how long it takes: 1 1 1 T =I+ 10 + 100 + · .. + 10n-l + · .. This is a geometric series with the common ratio 1/ 10. We will discuss it later. The sum of this series is

1 1-fcj

10

T=--=-

9

As a result, Achilles only needs 10 /9( ~ 1.11) seconds to catch the tortoise. Ben's statement is correct only from 0 to 10/9 seconds. Then, from this point, it is essentially the start of a new game - the tortoise and Achilles are both starting from the same line. The outcome is obvious.

1.2.

LIMITS OF FUNCTIONS

11

Exercises 1. Using "e -N definition" prove

lim sinn+n

=0

n2

n--+=

2. Using "e - N definition" show that a sequence can have at most one limit. 3. Prove that 1,

> 1; ifa = 1;

0,

if lal< 1;

oo,

liman

n--+=

=

(What is the correct way to say an --+

{

oo

ifa

as n --+ oo ? )

1.2 Limits of Functions An infinite sequence {an} may have a limit as n goes to infinity. Similarly, the limit of a function f (x) as x goes to infinity, can be defined. For example, lim ___::_ = 1 1 We can make the same argument as in the previous section. However, the limit of a function may also exist as x approaches a number. We say that f(x) is arbitrarily close to L as x approaches a number. The formal definition is as follows. x--+=x+

Definition 1.2.1. Let f(x) be a function that is defined on an open interval containing a, except possibly at a. f(x) has the limit Las x approaches a, or limx--+a f(x) = L, means that for every real number e > 0 there exists a D > 0, such that if0 < Ix-al< D, then lf(x)-LI< e. The condition "open interval" ensures that a is an interior point of an area where f(x) is defined (except possibly at a itself). It allows x to approach a from any direction. The inequality If (x) - LI < e indicates that the distance between f(x) and Lis less thane, which can be as small as desired. The inequality 0 < Ix - al< D denotes a condition that x differs from a and is located in a's "neighborhood," which consists of all numbers with a distance

12

1.2.

LIMITS OF FUNCTIONS

frmn a less than D. Why not use Ix- al< D instead? This would strengthen the definition's condition because it requires that If(x) - LI< e be valid when x = a. In fact, we consider which number f(x) approaches as x approaches a, rather than /(a), which is not even necessary defined. Geometrically, a function y = f(x) can be represented in the xy-plane. We present the following definition to help you better understand the concept of the limit.

Definition 1.2.2. A box B( (a, b), D, e ), where D, e > 0, is a rectangle bordered by lines x = a - D, x=a+o, y=b-e, y=b+e. B((a,b),D,e) is also called a bound box for the function f (x) if all points (x, f (x)) are located within the interior region of the rectangle whenever O< Ix - al< D. The formal definition 1.2.1 then can be interpolated as: limx---+af(x) = L means that for every e > 0, there is a bound box B( (a, L), D, e) for f for some

o >0. y

Y = f(x) 1- -

-

-

-

-

-

-

-

-1

I

b-e1

I

- - - - - - - - - -B((a,b),01,£1)

X

Figure 1.2: Bound boxes of f(x)

Lemma 1.2.3. Let f (x) be a real function. The following conditions are equivalent. (1) limx---+af(x) = L; (2) There is an infinite sequence of bound boxes for f(x):

1.2.

LIMITS OF FUNCTIONS

13

The proof of this Lemma is similar to that of Lemma 1.1.3, and we will leave as an exercise for the reader. As an example, we will show that some functions do not meet the criterion in Lemma 1.2.3 at a certain point, and thus the limit of the function does not exist at this point. Example 1.2.1. . sm . -1 does not exist 11m

x➔ O

X

We will first examine this function graphically. To see more clearly, we begin with the graph of 1 . y = - (Figure 1.3). When x ap-

y

x

==:::=---~--=====~x

proaches 0 from the right, y -+ oo; when x approaches 0 from the left, y-+ -oo. Assume x move from 1 to 0. Then 1/x will rapidly grow and covers all real numbers greater than 1. This causes the sine function's value oscillates between -1 and 1 indefinitely.

Figure 1.4 shows that the magnitude of y is not squeezed as x apFigure 1.3: y = ½ proaches 0. That is, if e is small enough (e < 1 in this case), no boxB((a,b), 8, e) can hold the curve y =sin½ where x E (-8, 8). This is a visual intuition. Formally, we will show that there exists a £ > 0 such that for any 8 > 0, we can always find ax such that 0 < Ix - 0I < 8 and lsin~-LI >£

(1.5)

. 2 . 1 Note that 1f x = ( ) , where n 1s any natural number, then - = 2n+ 1 1t" X

14

1.2.

LIMITS OF FUNCTIONS

n 1 nn + 2 and sin~ is either -1 or 1, depending on whether n is odd or even. Suppose 8 is chosen, to find such x, let X=

2

(2n+ l)n

1

~

- - . Now we can make same argument as

When x approaches a number a, it can approach a from the left or the right. The outcome may vary. Thus, the concept of the one-sided limit must be introduced. The one-sided limit has the same formal definition as the limit, except instead of O < Ix - al< 8, we write O < x - a < 8 (right-handed) or 0 < a -x < 8 (left-handed.). Writing x--+ a- and x--+ a+ for "x approaches a from the left" and "x approaches a from the right," respectively. It is clear that limx--,af(x) = L if and only iflimx➔a-/(x) =Land limx--,a+ f(x) = L. Consider the following function: f(x)={x x~a x+ 1 x> a

1.2.

15

LIMITS OF FUNCTIONS

This is a pair of linear functions. The function is discontinuous at a. The (one-side) limit exists if x approaches a from one side, but the limits differ in different directions. Namely, lim f(x) = a

x------ta-

lim f(x) = a+ I x--+a+ Even two one-sided limits are equal, that is, if the limit exists at this point, the limit is not necessarily the same as the function's value. For instance,

f(x) = { 1 x =/- a 0 x=a

(1.6)

Obviously, limx➔af(x) = I but f(a) = 0. This example demonstrates that even if a function is "disconnected" at one point, the function's limit can still exist. In other words, the existence of the limit is not sufficient for continuity.

Definition 1.2.4. [Continuity] The function f(x) is said to be continuous at a if 1. limx--,af(x) = Lfor some real number L; 2.f(a)=L We will now summarize the relationship between the continuity and the existence of a function's limit at a given point.

x~_f(x) exists f(x) is continuous at a

{cc}

lim f (x) exists x--+a

{cc}

{ lim f(x) exists x--+a+ lim f(x) = lim f(x) x➔ax--,a+

limf(x) = J(a) x--+a Consider the function

. 1

f(x) = xsm -

X

Figure (1.5) show the graph. Since the magnitude of a Sine function is bounded by 1, the function approaches O as x approaches 0. To prove

16

1.2.

LIMITS OF FUNCTIONS

it formally, that is, for each £ > 0, we need to find a D > 0, such that Ix sin~ I < £ whenever 0 < lxl < D. In this case, for a given £, we simply choose

o =£,then

This demonstrates the existence of limx➔O f (x). However f is not continuous at 0 since f is not defined at 0. y

X

1 Figure 1.5: y = xsinx

There are many limit theorems, but we won't go through all of them here. Instead, let's focus on the "Squeeze Theorem", which we can use later. Imagine a bottle floating in the sea. The height of the bottle changes as the waves come and go, but it always remains somewhere between the crest and the trough of the waves. Now, suppose that when the ocean becomes calm, the height of the crest and trough approach each other, as does the height of the bottle. This idea can help us understand the squeeze theorem.

1.2.

17

LIMITS OF FUNCTIONS

Theorem 1.2.5 (Squeeze Theorem). Let f,g,and h be functions defined on some interval except at a, and g(x) ~ f(x) ~ h(x)

limg(x)

=

x➔a

limh(x)

=

L

x➔ a

then limx--,af(x) = L Proof. By assumption, there is 81 > 0 such that

Given£> 0, there are ch,, 0;3 > 0, such that 0 N. We have

2.4.

38

RATIO OF CONSECUTIVE TERMS

laN+2I::::: laN+1lb::; laNlb2 laN+3 I::; laN+2 lb ::; laNlb 3 Compare following two series:

S1 = laNl+laNlb+ laNlb 2 + laNlb3 + ··· S2 = laNl+laN+1l+laN+21+1aN+31+··· S1 is a geometric series with ratio lbl < 1, it is convergent.

Then S2 is also convergent by the comparison test which will be stated in Section 2.6. Using comparison test again, the series r,;=Nan is convergent, so is r,;= 1 an. This proves the first part. The proof for the case IR(n)I~ b reader.

~

1 is similar and we leave it to the □

Let limn➔oo

1-3!!.._ I = r. As a corollary of this lemma, we conclude that lln-1 if r < 1 then the series r,;= 1 an converges; if r > 1, then it is diverges. In fact, if r < 1, then there is b > 0 such that r < b < 1. By the definition of limit, there is N > 0 such that Ian/ an-1 I< b for all n > N. Thus we can apply Lemma 2.4.1 to get conclusion. The case that r > 1 is similar. This result is known as Ratio Test which we will state later. (Rule 2.6.9) Example 2.4.1. Consider the series

r,;=l

(-3?n! n . n

This concludes that this series is divergent. Aside from these extreme cases, there are many different type of series whose ROCT approaches 1 as n approaches infinity. For example, as n approaches infinity, R(n) of an arithmetic series approaches 1 from the right; R(n) of a harmonic series approaches 1 from the left; the absolute value of an alternating harmonic series' R(n) approaches -1 from the left; and the absolute value of an alternating arithmetic series' R(n) approaches -1 from the right. (Figure 2.2). The ROCT contains information of each series and can be used in certain test rules. The reader will find more useful results in Section 2.6.

2.4.

39

RATIO OF CONSECUTIVE TERMS

Arithmetic 1 ------------------· ---·--- ·--------

Harmonic n Alt. Harmonic

t----------------------➔

-1

• ----------

I

-

-

-

I

-

-

-



-

-

-■-

-

-

J -

-

-

-

-

-

-

.

Alt. Arithmetic

Figure 2.2: Ratio of consecutive terms

Exercise 1. Write terms of the series E:;'= 1 an explicitly where a1 = 1 and its ROCT R(n)

=

(n: lr-1

2. Prove the following convergence test rules: Assume both E:;'= 1 an and E:;'= 1 bn are positive termed series with ROCT R1 (n) and R2(n), respectively, and there is N > 0 such that the inequality R1 (n) :::; R2 (n) holds for n > N. then

L bn converges

==}

n=l

L an diverges

L, an converges n=l

==}

n=l

L, bn diverges n=l

3. Which series on the list of this section must be convergent according to Lemma 2.4.1? 4. Discuss the convergency of series (2.13) with respect tor. . a sequence such that hmn--+oo . lan+ll 1 . Is each 5. Suppose that (an ) 1s ---;;;- = 2 of the following series convergent?

a) E:;'= 1 n2 an

b)E;;'= 1 3nan

40

2.5.

2.5

CALCULATING SuM OF SERIES

Calculating Sum of Series

Some techniques can be used to compute the sums of series. The sum of an infinite series, of course, makes sense only if it is convergent. We have seen how to find the sums of arithmetic series and geometric series. Now we will go over a few more complex series. The simplest "quadratic" series is as follows: n

r/ = 12+22+···+n2

(2.15)

i=l Let Ln = E?=l i and Qn = E?=l i 2 • We are familiar with Ln and will attempt to find an expression for Qn. If we can discover the relationship between Ln and Qn, the latter will be easily induced. Here are the two sequences, as well as the ratio of each corresponding term:

1,3,6,10,···, 1,5,14,30,···,

3 3 1

1 - - - ... '5'7'3' .

If we rewnte

3

3

1

.

.

3 for 1 and 9 for 3, an obvious guess 1s that

This can be proved formally using mathematical induction, which we will leave as an exercise for the reader. The next step is straightforward: Qn =

tP i=l

=

Ln

=

3/(2n+ 1)

n(n+ 1). 2n+ 1 2

=

n(n+ 1)(2n+ 1) (l.l 6)

3

6

Now we will look at the finite version of series (2.13).

Sn = 1 + 2r + · · · + nr'- 1 A technique similar to the one used previously can be used to solve the equation:

2.5.

CALCULATING SuM OF SERIES

41

Sn -Snr= 1 +r+?+---+~- 1 -n~ 1-~ =---n~ 1-r

As a result,

1-~ s - -,-------,--,,--n~ 2 n -

(1 - r)

1- r

For infinite series (2.13), we assumer< 1 and take the limit as n goes to oo. Since limn-+= rn = 0, we have S = lim { 1 - ~ - n~ } n--+= (1-r) 2 1-r

=

1 (1-r) 2

Like series (2.14 ), each term of a certain series can be decomposed into a difference of two terms. This enables us to simplify them. Example 2.5.1. n 1 1 1 1 1 Sn= tik2 +8k+15 = 24 + 35+ 48 +···+ n2 +8n+15

Since

We have

42

2.5.

CALCULATING SuM OF SERIES

n(9n+41) 40(n+4)(n+5) We can also calculate the infinite version of this series by finding the limit as n approaches infinity.

. . n(9n+41) S = n--+= hm Sn= n--+= hm 40 (n + 4)( n + 5)

9

40

In the following example, we will see how a problem can be solved in various ways. Example 2.5.2. Find the sum E;:'= 1

;n.

We will solve this problem with different appoaches. 1 [Solution l].

n 1 1 1 Note that 2n = 2n + 2n + · · · + 2n (n terms). We list them in a twodimensional infinite array: 1 2 1

1

22

22

1 23

1 23

1 23

Now sum up numbers in each column, the sum of m-th column is

1 S ome methods involve derivatives and integrals which will be covered in Chapter 5, the reader may choose to read these parts later.

2.5.

43

CALCULATING SuM OF SERIES

Thus we get result by adding all columns: n - '\""' 1 1 '\""' -2 i... 2n - i... 2m-l - --1 n=l m=l 1- 2 00

[Solution 2].

Let S = E:;'= 1 ; . then n

00

2S =

00

n

00

00

L 2n-l = l + n=2 L 2n-l = l + n=2 L n=l

n-1+1 2n-l = l +

m+ 1 n 2S-S=1+[--Em=l 2m n=l 2n 00

00

1

00

=1+ '\""' i... 2n n=l 1 -

2 - =2 = 1+1 1-2 [ n=l .!!:.._ 2n = 2

Thus

00

[Solution 3]. (Use derivative)

Write a geometric series

where lxl < 1. Then take derivatives on both sides 00

n~ ~ - 1

Letx =

1

2,

1

= (1-x)2

00

m+l

L~ m=l

44

2.5.

CALCULATING SuM OF SERIES

The derivative is required for the last solution. Similarly, some problems can be solved by using integration, which we will discuss in another chapter. Example 2.5.3. Find the sum E:;'= 1 n~n

We also start with the formula for sum of geometric series, and briefly derive to a general result. oo 1 [.tn = n=O 1- t

==}

Loolox tndt = lox -1d t n=O O

==}

O

1- t

1-x"+ 1 = -ln(l-x)

[

-

n=O

n+ 1

1 [.-x"'=-ln(l-x) 00

==}

m=lm

1 Letx = 2 , we have 00

1

1

L m2m = -ln2 = ln2 m=1 Exercises 1. Find the formula for the following sum:

4. Evaluate

1111111

1

1

1

s = 1 + 2 + 3 + 4 + 6 + 8 + 9 + 12 + 16 + 18 + 24 + ·.. 1 where each term has the form - - , m, n E Z, m, n > 0. 2m3n

-

2.6.

2.6

45

CONVERGENCE TESTS

Convergence Tests

It is always important to know whether or not an infinite series is convergent. The only goal of this section is to determine whether an infinite series is convergent rather than to find the sum if it is. As a result, deleting or adding a finite number of terms has no effect on the outcome. Many test rules have been developed by mathematicians. We will go over a few of them in this section. Augustin-Louis Cauchy (1789-1857), a French mathematician, developed useful rules for testing the convergence of sequences and series.

Rule 2.6.1 (Cauchy's Criterion). The sequence (sn) is convergent if and only iffor every£ > 0, there exists N such that lsk - Sm I< £ for all k, m > N. The proof for this rule can be found in the Appendix of this chapter. Since a series is convergent if and only if its corresponding sequence, which is formed by the partial sums, is convergent, we can immediately obtain the series version of Cauchy's Criterion.

Rule 2.6.2 (Cauchy's Criterion). The series E:;'= 1 an is convergent iffor every£> 0, there exists N such that

if and

only

lak+ak+l

+ ··· +ak+pl< £

for all k > N, and p ::::: 0.

1

As an example, consider the series (2.8). The partial sum Sn = E?=l --:- . l

1 1 1 S2n-Sn= --+--+•·•+n+l n+2 2n

1

1

1

1 >-+-+··•+=2n 2n 2n 2

If the given series was convergent, then by Cauchy's Criterion, for£=

1 2,

k = 2n, and m = n, we would have

if n is large enough. Because this is never true, we conclude that the series (2.8) is divergent. We can immediately deduce from Rule 2.6.2 that if E:;'= 1 Ian I converges, then E:;'= 1 an converges. This is because

46

2.6.

CONVERGENCE TESTS

Rule 2.6.3 (Monotone Convergence Theorem). Ifa sequence ofreal numbers is increasing and bounded above, or decreasing and bounded below, then it is convergent. The proof of this test rule is in the Appendix. For a positive termed series E:;'= 1 an, since the sequence of its partial sums is increasing, it is convergent if and only if it is bounded according to Rule (2.6.3). Consider a Alternating Series (2.17)

> 0 for all n.

If an

> an+ 1 for all n, and an ➔ 0, the partial sum

= a1 -a2 + · · · -

a2m

= (a1 -

where an

+ · · · + (a2m-l -

a2m)

S2m = a1 -a2 + ··· - a2m = a1 - (a2 -a3) - (a4 -as) - · · · - a2m

< a1

S2m

a2) + (a3 - a4)

Series S 2m is increasing and bounded above, it is convergent to a limit L according to Rule (2.6.3). Since

we have lim S2m+ 1 = lim S2m + lim a2m+ 1 = L + 0

m~oo

m~oo

m~oo

=L

As a result, series (2.17) is convergent. It is easy to see that the conclusion also holds if the alternating series is in the following form:

We obtain the following rule.

Rule 2.6.4 (Leibniz's rule). The alternating series 00

00

L, (-It+lan or L, (-I tan n=l

n=l

where an > 0, is convergent if 1. an+l < an for all n, and 2. limn➔oo an = 0

According to Rule 2.6.4, the alternating harmonic series

1

1

1

H=l-2+3-4+··· is convergent.

2.6.

47

CONVERGENCE TESTS

Rule 2.6.5 (Comparison Test). Let O :San :S bnfor all n. Then [. bn converges n=l

==}

[. an diverges n=l

==}

[.

an converges

n=l [.

bn diverges

n=l

Example 2.6.1. [;;'= 1 2n sin 31n converges since

I

I (2)n 3

. n 2n sm- 1

L, an diverges

==}

n➔oo

n=l

Example 2.6.4. Determine the convergence or divergence of the series 2

E:;'= 1 (1-1/nf . Applying the root test,

as n-+

2

oo.

We conclude that series E:;'= 1 (1- 1/nf converges.

Rule 2.6.9 (Ratio Test). Suppose E;;'= 1 an is a series and

lim I an+ 1 I = R

n ➔ oo

an

Then R

I, orR = oo

L, an

==}

diverges

n=l

nn Example 2.6.5. Examine the convergence of the series E:;'= 1 (n! ) 2 •

Thus this series converges by ratio test. Rule 2.6.10. Suppose both E;;'= 1 an and E;: 1 bn are positive termed series, a b and there is N > 0 such that the inequality _n_ ::; - b n holds for n > N. an-1 n-1 then

L, bn converges

==}

n=l

L, an diverges n=l

L, an converges n=l

==}

L, bn diverges n=l

50

2.6.

CONVERGENCE TESTS

In section (2.4) we listed the ROCTs for some series. Compare that of the p-series and the harmonic series, The former is ( 1 - ~) P and the latter

. 1 1s 1 - - . When p < 1 we have n

Therefore, the p-series is divergent when p < 1. Rule 2.6.11. Suppose f(x) is a continuous, positive and decreasing function defined on [k, 00 ). Then

L f(n)

converges

~

n=k

l'"

f(x)dx converges

1 Example 2.6.6. Consider p-series E:;'= 1 nP.

r= _!_dx = t--+=}1 lim f1 _!_dx = lim - 1-x 1-P]~ = lim - 1-(t 1-P t--+= 1- p t--+= 1- p

J1

xP

1)

xP

As a result, the integral is convergent only if p > 1, so is the p-series. Let E:;'= 1 an be a convergent series. If E:;'= 1 Ian I is also convergent, then we call it absolutely convergent. Otherwise, it is called conditionally convergent. According to the comparison test, an absolutely convergent series must be convergent. Absolutely convergent series have some interesting properties, for example, changing the order of its terms will not change the sum. However, this may not be true for conditionally convergent series. For example, the alternating harmonic series is a conditionally convergent series. If we change the order in the following way,

1 1 1 1 1 2 3 4 5 6 1111111 1 = 1-- - -+- - - --+- - - --••· 2 4 3 6 8 5 10 12

S=l--+---+---+···

= (1 1 2

-~)-i+ (i-i)-i+ 1 4

1 6

1 8

1 10

1 12

=---+---+---+···

(i-/0)-/2 ...

2.6.

51

CONVERGENCE TESTS

=~( -~+i-i+i-i+···) 1

1

2s.

we would have S =

We view the terms of a series or a sequence as functions of n. It is helpful to compare the growth properties of some well-known functions. If f(n) and g(n) are two positive-valued functions, we denote f(n) 1. 5. Explain why this is wrong: 1 1 A= 1+-+-+···

3

5

2.7.

53

THE FIBONACCI SEQUENCE

1 1 1 B= 2+4+6+··· 1

1

1

1

1

A-B=(l- 2 )+( 3 - 4 )+( 5 - 6 )+··· >0 1 1 1 2B=1+ 2 + 3 + 4 +-·· =A+B

==?A>B ==?A=B

6. Find the domains of x where the series converges.

2.7

The Fibonacci Sequence

Problem 2.7.1. Suppose there is a newborn pair of rabbits, one male and one female, in a field. They will mature in one month and produce another pair of rabbits at the end of their second month. Assume that a pair of rabbits always produces one new pair every month from the second month on. How many pairs of rabbits can be produced from that pair in a year?

This question was raised by Italian mathematician Leonardo Fibonacci in his book, Liber Abaci, which was published in 1202. It is not difficult to list the number of pairs at the start of the first few months:

I

month pair

I

1

1

I

2 1

I

3 2

I

4 3

I

5 5

I

6 8

I

7 13

I

8 21

I

The resulting sequence is known as the Fibonacci Sequence. Let Fn be the number of pairs at n-th month (called n-th Fibonacci number). The rabbit pairs at n-th month consist of two groups: the old rabbits and the newborn rabbits. The number of old rabbit pairs equals the number of pairs at last month, Fn-1, and the number of young rabbit pairs equals the number of pairs at two months ago, Fn-2· This gives us the basic relationship of the Fibonacci Sequence:

F1=F2=l; Fn =Fn-1 +Fn-2

(2.19)

We may consider equation (2.19) as the definition of the Fibonacci Sequence. From the definition, it is clear that 0 < Fn < Fn+ 1 for all n 2". 2.

54

2.7.

23 2 1.5

n

4 1.666..

THE FIBONACCI SEQUENCE

5 1.6

6 1.625

7 1.615..

8 1.619..

9 1.617..

10 1.618 ..

There is a geometric way to depict the Fibonacci Sequence. That is, we create a series of squares and let the side of i-the square equal the i-th Fibonacci number. Figure 2.3 depicts how these squares are connected. The spiral formed from these squares is known as the Fibonacci Spiral. Actually, one can start with two unit squares that form a rectangle, then use the longer side as the side of a new square, and so on. Then a series of squares with the Fibonacci numbers as their sizes is created.

Figure 2.3: Fibonacci Spiral

F~:

The Fibonacci Sequence has many interesting properties. If we denote rn

=

1,

then we find that rn

::::0:

1 and rn narrows as n is increases:

A reasonable question is whether rn has a limit as n approaches to infinity. From Definition (2.19), we have

That is, rn-1 If the limit exists, let limn-+= rn

1

= 1+-rn-2

= r, and then apply this to the above equation,

we have

1 r

r=l+-

(2.20)

Equivalently, this is

?-r-1=0 and the only positive solution is

r= l+Js,:::: 1618 2

.

2.7.

55

THE FIBONACCI SEQUENCE

Remember that we have not proven that limn--+oo rn exists. What we proved is "If the limit exists, then it is equal to r." Now we will prove the existence of the limit as n does to infinity. Suppose r is the positive solution of (2.20).

lrn - rl =

I( +rn~J - ( +~)I 1

1

= lrn~l

-~I

=1r-rn-ll Tn-lr 1 S: - lrn-1 r

(2.21)

-rl

11

S:--lrn-2-rl

rr

1

< rl - ... < - -11rn-1 It is clear that lrn - rl approaches zero as n approaches infinity. The reader may use e - N language to formally verify that limn--+oo rn = r. As a well-known number, r is also known as "the golden ratio." Consider a rectangle with a longer side a and a shorter side b. If one designs it so that a/b = r, then we have (a+b)/a = a/b. a Many artists and architects believe that the golden ratio creates the most beaua b tiful shapes and use it in their work. We have various ways of representing the golden ratio. Equation (2.20) can be used recursively:

r=

Figure 2.4: The golden ratio

1

l+

1+

l

1 1+-1+···

Since ( 2.20) is equivalent to

r= v'f+r,

2.7.

56

THE FIBONACCI SEQUENCE

we can also apply this recursively:

The sum of all Fibonacci Numbers is infinity. Things may change if we give each number a small weight. For example, Let (2.22) We will show that the new series is convergent. Let S = E:;'= 1 an where lln = 10-(n+l)pn· Then

According to Lemma 2.4.1, this series is convergent. We can also find the sum of this series. The sum of the first few terms is as follows:

0.01 0.001 0.0002 0.00003 0.000005 0.0000008 0.00000013 0.000000021

0.01123595 · · ·

From (2.22) we have

and

2.7.

THE FIBONACCI SEQUENCE

57

Thus

9S = 10- 1F1 + 10-2(F2 -F1) + · · · + 10-n(Fn -Fn-1) + · · ·

= 10- 1F1 +0+10- 3 F1 +···+lO-nFn-2+··· 9S- 10- 1s = 10- 1F1 89 1 1 That is, 10 S = 10 . Therefore, S = 89 .

Exercises Derive an explicit formula for the Fibonacci Numbers in the following steps. 1. Consider power series 00

f(x) =

L,Fn~ n=1

where Fn is then-th Fibonacci number. Find the domain of x where the series converges. [Hint: Use Rule 2.6.9] 2. Prove that

X

f(x) = 1-x-x2 [Hint: Try f(x)-xf(x)-x2f(x)] 3. Let 0, there exists N1 such that lsn; - LI< 2 for n; > N1. Next, by e the criterion, there exists N2 such that lsk - Sm I< 2 for k, m > N2. Let N

= max(N1 ,N2). Fork> N, choose some Sn; such that n; > N. Then

This proves that (sn) is convergent.



Definition 2.9.1 (Least Upper Bound). Let A be a non-empty set of real numbers. A real number x is called an upper bound for A if x 2'.'. a for all a in A. A real number x is the least upper bound (or supremum) for A if x is an upper bound for A and x : 0, k < m, we have lak -aml< lak-bkl- By Cauchy's Criterion, the sequence (a1 ,a2, · · ·) is convergent. Similarly, the sequence (b1, b2, • • •) is also convergent. Clearly they converge to the same number, say L. L must be an upper bound of A, otherwise there is x E A such that x > L. Then there must be a k such that bk < x since bn ➔ L. This contradicts bk as an upper bound. L must be the least upper bound of A, otherwise there is an upper bound u and u < L. Then there is m such that am > u since an ➔ L. This is also impossible. □ Theorem. 2.1.2(Boundedness Theorem) If a function f(x) is continuous on a closed interval [a,b], then it is bounded on [a,b]. Proof. If f is not bounded above, then there existx1 ,x2, • • • E [a,b] such that

By the Bolzano-Weierstrass Theorem, there is a subsequence (x;j) such that x;j ➔ a E [a,b]. Since f is continuous, f(x;j) ➔ f(a), contradicting that f (x;j) is unbounded. □ Theorem. 2.1.3(Extreme Value Theorem) If f(x) is continuous on [a,b], then there are two numbers c,d E [a,b] such that c

'5: f (x) '5: d for all x

E

[a, b]

Proof. According to the Boundedness Theorem, f is bounded on [a,b]. Let M be the least upper bound of f(x) on [a,b]. If f(x)-=/- M for all x E [a,b],

let g(x) = M-~(x). It is clear that g is continuous on [a,b]. Again, by the Boundedness Theorem, g has an upper bound, say N, such that

1 g

= M-

f(x) N, we have IL - Sn I< e since (Sn) is increasing. This proves that limn-too Sn = L. In other words, the sequence converges to its least upper bound. □

CHAPTER

3

GEOMETRIC SHAPES

3.1

Basic Geometric Shapes and Their Areas

Amy and Ben walk into a chamber music concert. There are 4 rows, each with 7 seats. The music will begin in 15 minutes. Amy starts to talk about geometry. "Look, these chairs form a perfect rectangle with length 7 and width 4. If each seat takes up one unit of space, then total area of this rectangle is 28

square units. I believe that is how people use the grid to figure out the area of rectangles. 11

"What if the lengths of the sides are not integers?" Ben asks. "That is a broad statement. The formula remains length times width or base times height. Anyway, the grids inspired the original concept. 11

"Now I understand why the area of a parallelogram is equal to the product of its base and height. Simply arrange the rows of chairs to form a parallelogram 11

"However, that will never be a perfect parallelogram.

11

Figure 3.1: Rectangle and parallelogram "That's not an issue. We can make a drawing. The left edge was used to cut out some triangles that will fill in the empty space on the right. (Figure 66 11

3.1.

BASIC GEOMETRIC SHAPES AND THEIR AREAS

67

3.1) The music is about to begin while they are talking. Amy is listening and enjoying herself. But Ben just feels like there's something he hasn't finished. He tells Amy that he has discovered something interesting shortly after the music stops. "Take another look at these chairs. I can push and pull each row in an irregular manner and the result remains the same." "What is this supposed to mean?" Amy asks. "For example," Ben draws a diagram on paper (Figure 3.2), "since the number of chairs does not change, the area should remain the same. We don't even need straight lines on the left and right sides as long as each row is the same length. Figure 3.2: A new shape In other words, the area of a geometric figure is always equal to the product of base and height as long as any horizontal segment between two sides is the same length." "Can you demonstrate that this is true in general?" "No. I'm not sure what to call this shape either."

Actually Ben extended the parallelogram shape by allowing two sides to be curves while remainI •x ing "parallel." We could think about I I this more broadly. Since a rectan:h gle, parallelogram, or triangle are w(x) ' all special cases of a trapezoid, a generalization of a trapezoid shape would be interesting. Image a modFigure 3.3: A curved trapezoid ified trapezoid with two parallel bases and two curved sides (where "curve" does not excludes a straight line). We also require that any line parallel to the bases intersects each side at no more than one point. Let's call this a "curved trapezoid." (Figure 3.3) A curved trapezoid has bases and height. If a line is parallel to and between

3.1.

68

BASIC GEOMETRIC SHAPES AND THEIR AREAS

the bases, it intersects both sides with two points. Let h be the height of the curved trapezoid. For any x, 0 :s; x :s; h, we can find a segment parallel to the bases with the distance x to the upper base. As a result, every such x corresponds to a segment length. Let w(x) denote the length of the corresponding segment. Thus, w(x) is a well-defined function, called the width function of the curved trapezoid. According to previous discussions, we have the following observation. Proposition 3.1.1. Two curved trapezaids have equal area if 1. They have equal heights; 2. They have same width function.

We will calculate the area of more general shapes in Chapters 5. The area in our case is represented by Jtw(x)dx. The area of a parallelogram can be seen by cutting the parallelogram and rearrange it, as shown in Figure 3.4, where the area of rectangle EFCD is equal to the area of parallelogram ABCD.

A

C

b

D

E

B

F

Figure 3.4: Parallelogram and rectangle The formula for the area of rectangle and parallelogram is A=bh

(3.1)

where b is for the base and h is for the height. When we cut parallelogram ABCD by segment BD, we get two congruent triangles ABD and CDB. The area of each triangle equals half of the area of the original parallelogram. Conversely, if we have a triangle with base b and height h, we can add an identical one and combine them to form a parallelogram with the same base and height. This gives us a clear idea that the area of a triangle with base b and height h is 1 (3.2) A= -bh 2

3.1.

69

BASIC GEOMETRIC SHAPES AND THEIR AREAS

= EB, as shown in Figure 3.5 left, we get two congruent trapezoids. Consider the trapezoid AEFD. The sum of its two bases, b1 + b2, is equal to the base length of parallelogram ABCD. Thus the area of the trapezoid is If we cut parallelogram ABCD by the segment EF such that DF

(3.3) This formula can be derived from triangle formula. On the right, DE cuts trapezoid AEFD into two triangles. Thus the area of the trapezoid is the sum of the areas of two triangles. A=

1

1

2b1h+ 2b2h 1

= 2 (b1 +b2)h D

F

C

T

A

E

Figure 3.5: The relationship between trapezoids, parallelograms, and triangles A trapezoid is a special type of quadrilateral with two parallel sides. The other shapes we discussed earlier can be thought of as special cases of trapezoids. As a result, the formula (3.3) is applicable to all other shapes. For example, if b2 = 0, you get formula (3.2); if b1 = b2, you get formula (3.1). It is helpful to visualize the relationships using charts (Figure 3.6). Figure 3.6 can be thought of as a family tree. The trapezoid is in its second generation. Starting from this, we have the concept of height. Assume a trapezoid family has a special gene that causes everyone in the family has height h. Let's draw two parallel lines with distance h. Then add few members between two lines, as shown in Figure 3.7. What is the sum of the areas of these shapes? Since every shape is either a trapezoid or a special case of trapezoid, Equation (3.3) can be used for calculation. However, in this case, a is the sum of all the lower bases and b is the sum of all the upper bases.

70

3.1.

BASIC GEOMETRIC SHAPES AND THEIR AREAS

I2 equal

♦ sides

13 equal

lright angles



lright angles 4 equal sides I I





sides

L___J

Figure 3.6: Exploring the Relationships between different geometric shapes

We can see that many common geometric shapes, such as triangles and parallelograms, can be thought of as special cases of the trapezoid. Additionally, when a group of trapezoids share the same height, their combined area can be calculated using a simple formula.

-----·r --h

...____________ - - _!_ - - Figure 3.7: Geometric shapes share the same height

Let a1,a2, ... ,an be all upper bases and b1,b2, ... ,bn be all lower bases. Then the sum of areas A=

1

1

1

2(a1 +b1)h+ 2(a2 +b2)h+ ... + 2(an +bn)h 1

= 2 [(a1 +b1)+(a2+b2)+ ... +(an+bn)]h

3.1.

71

BASIC GEOMETRIC SHAPES AND THEIR AREAS

1

= 2 [(a1 +a2+··•+an)+(b1 +b2+ ... +bn)]h 1

= 20+~h

0~

A disk can be cut along its diameter. In theory, you can evenly cut a disk into 2, 4, 8, ... , as many pieces as you like. Then arrange them regularly as in Figure 3.8. Imaging that as number of pieces increases, these arcs become increasingly close to a straight line. In other words, we can approximate the area of the disk by the sum of the areas of these triangles (see the proof of Equation (1.12)). As the number of pieces approaches infinity, the sum of "bases" is the circumference of the original circle. Applying Equation (3.4), the area of a circle is

--rr

~~~~~---~- J_ Figure 3.8: Sectors cut from a disk

Exercises 1. Find the areas of the following two figures. Is this magic?

_,,,...,..-

_...... ...,.

~.,,,,.. 1......

~i.---

.....

.,,,,.. .,,,,..

..........

-.,,,,..

-.,,,,.. Figure 3.9

2. Given any quadrilateral ABCD. Find a mid point of each side, say E,F,G,H. (Figure 3.10)

72

3.1.

BASIC GEOMETRIC SHAPES AND THEIR AREAS

a) Prove that EFGH is a parallelogram. b) Find the ratio r = area of EFGH I area of ABCD. C

A

E

B

Figure 3.10 3. ABC is a triangle and D is any point on AB. Line l 1 passes through A and line h passes through B, and both lines are parallel to CD. The length of CD ism and the distance between l1 and Ii is n. Find the area of triangle ABC. (Figure 3.11)

Figure 3.11

3.2.

73

LINEAR FUNCTIONS

4. In triangle ABC, AB= AC, L'.A = 90°. DC=

1

1

3AC, and AE = 3AB.

(Figure 3.12) Prove

a) Area of MED=

1

3 Area of l':.EBC;

b) LADE= LECB.

C

D

E

A

B

Figure 3.12

3.2 Linear Functions Don't you think it's similar to combining two identical trapezoids when young Gauss (Section 2.2) added numbers for each pair? Write their formulas: an arithmetic sequence's sum is (a1 + an)n/2, and a trapezoid's area is (a + b) h/ 2. Do you notice any similarities? In fact, they have one thing in common: the terms of an arithmetic sequence (with respect to their indices) or the "widths" of a trapezoid (with respect to their distances from the base) change "linearly." A linear function y = f (x) is a function that can be written as (3.5) f(x) =ax+b where a, b are constants. Let a(i) be i-th term of an arithmetic sequence and d the common difference. Then a(i) can be represented as a(i)

= a1 + (i - 1)d

(3.6)

74

3.2.

LINEAR FUNCTIONS

This can be written as (3.7)

a(i) =di+(a1 -d)

Equation 3.7 indicates that a(i) is a linear function of i. D

A

C

G

B

Figure 3.13: The "width" as a function of x Similarly, we can define w(x) as the width function of a trapezoid with respect to the segment which has the distance x from the upper base. As displayed in Figure 3.13, w(x) is the length of EF, and x is the distance between DC and EF. To prove that w(x) is a linear function of x, we draw a segment DG such that G is on AB and DG is parallel to CB. Let DC = b1 and AB= b2. fu Figure 3.13, LDEH and LDAG are similar and therefore we have x EH EF-HF w(x)-b1 (3.8) h AG AB - GB b2 - b1 Now we can write w(x) as a function of x

b2-b1 w(x) = -h-x+b1

(3.9)

It is clearly a linear function of x. Based on their similarity, the sum of an arithmetic sequence can be related to the area of a trapezoid. Suppose we have an arithmetic sequence (a 1, a2, • • • , an). For each term a;, we draw a rectangle with the length a; and the width 1, and arrange them as displayed in Figure 3.14. They combine to form a polygon. Two dashed lines indicate that we can "smoothen" the polygon into a trapezoid by cutting n triangles, or by adding n triangles. Let d be the common difference of the sequence and A be its sum. Then, the area of these two trapezoids are

3.2.

a1

- - - -



a2

- - - -



a3

- - - -



a4

---- ➔

LINEAR FUNCTIONS

75

Figure 3.14: The relationship between a arithmetic sequence and a trapezoid

nd I A+ 2 = 2 (a1 +an+d)n This way, we also get the formula for the sum of an arithmetic sequence:

A trapezium is a quadrilateral with no parallel sides. By the way, the definitions of trapezoid and trapezium are switched in UK.

Figure 3.15: A pantograph

Figure 3.15 shows one type of pantograph. There are four "rulers" working together and AF = FC. Each white circle is a pivot. Node A is pined down to the table. A needle is held at B, pointing to the original graph,

76

3.2.

LINEAR FUNCTIONS

and a pencil is held at C, drawing a new graph. How do we configure the instrument so that the resulting graph is the size we desire? First, choose D so AD that AF = r where r is the desired rate of conversion from the original to the enlarged size. Then attach the rulers so that BD =AD= EF and BE= DF. The quadrilateral DBEF is clearly a parallelogram. If we connect A and B, then B and C with two lines, then LABD = ~(180° -LA.DB)= ~(180° -LAFC)

Similarly, LEBC = ~(180° -LBEC) = ~(180° -LAFC)

Therefore, LABD+LDBE +LEBC = ~(180° - LAFC) +LAFC+ ~(180° -LAFC)

= 180° That is, A, B and C are on one line. Since LABD and !::ACF are similar, AB AD -=-=r AC AF

Now it is easy to prove the following linear relationship: y=rx

where xis the length of any segment in the original graph and y is the length of the corresponding segment in the new graph. The detail is left to the reader. (Use the properties of similar triangles.)

Exercises 1. A clock has a long arm and a short arm. It's now 12 o'clock. At

what time are they going to meet again? What angle has the short arm changed? 2. De.CAB is a right triangle with sides a and b. (Figure 3.16). Now, vertex A is moving east to position A'. Let t = AA' be the increment. Write the following functions with independent variable t: 1. The perimeter of De.CA' B;

3.3.

77

CIRCLE

2. The area of L'-.CA'B; 3. The circumference of the inscribed circle. Which one is a linear function? B

a

C

A

b

A'

Figure 3.16: A right triangle and its inscribed circle

3.3

Circle

Figure 3 .17: A young swan and a fox

Problem 3.3.1. A young swan is in the center of a circular pool, and a hungry fox is watching her from outside. Unfortunately, the young swan has not learned to fly from the water. She can't fly unless she touches down on the ground. If the fox runs at 8 meters per second, the swan swims at 2 meters per second, and the pool radius is 20 meters, can the swan escape the fox?

The swan must first determine how long it takes to swim from the center

78

3.3.

CIRCLE

to the land in a straight line, as well as how far the fox can run along the border in the same amount of time. The question appears to concern only the fundamental properties of a circle. A circle, unlike other geometric shapes, is the set of all points in a plane that are a fixed distance (radius) from a given point (center). The circumference and the diameter are proportional, which means their ratio is a constant, called 'JC. They have a linear relationship: C=dn=2nr

(3.10)

where C is the circumference, d is the diameter and r is the radius. Equation (3.10) indicates that the circumference is a linear function of the radius. The constant coefficient in this case is 2'1C. The radius r=20 (meters) in Problem 3.3.1, so the time required by the swan is 20/2 = 10 (seconds). The fox must run half the circumference to 1 catch the swan. This is 22nr = nr R=j 62.8 (meters). The time he works is 62.8/8 R:j 7.85 (seconds). The fox arrives earlier than the swan. Of cause, this is not the end of the story. We can assist this young swan in Chapter 4. Perhaps the simplest relationship in mathematics is that between radius and circumference. Even so, the intuition may not always agree with it. Here is another example. Problem 3.3.2. Suppose our planet is a perfect sphere that is tightly bound with a rope along its equator. We now add one meter to the rope's length (circumference). What is the average distance between the rope and the ground?

You might think the difference is insignificant because the earth is so large--its circumference is approximately 40 thousand kilometers. So a single meter change would not allow you to feel anything. Now perform a quick calculation. Let R be the earth's radius and R' be the radius of the rope (after adding one meter). C and C' represent the earth's and rope's circumferences, respectively. Thus C = 2nR and C' = 2nR'

Therefore C' -C = 2n(R' -R)

and

C'-C 1 R'-R= - - = - R:j0.16 2n 2n

3.3.

CIRCLE

79

The rope has been loosened, and its distance from ground is large enough to pass a cat! The calculation shows that the size of the earth is irrelevant. So, why not just let R = 0? The outcome is the same. That is, if we draw a circle with circumference equal one meter, the radius, 1/(2:ir), is what we want to find. Same phenomena can be seen from other linear functions. A central angle is an angle with its vertex in the center of a circle. It is obvious that the length of an arc in a circle is proportional to the central angle it subtends. As a result, when the radius is fixed, we use the length of the arc to calculate the central angle. It should be noted that the arc length is not used to replace degrees; rather, it is a measure of the percentage of the full circle, just as the light-year is used for distance between stars, not time. To eliminate the radius factor, we define the length of a unit circle's arc as the measurement of the central angle it subtends. This measurement is known as the radian system, which was created by Roger Cotes, and the term "radian" was first mentioned by James Thomson. For example, the full angle in a unit circle is subtended by the whole circle whose circumference is 2:ir. In general, if a circle of a radius r has a central angle e that is subtended by an arc of length l, then in the radian system, l l 0=2:ir- = 2nr r This gives us l

= re

(3.11)

The circle shape is very common. Dishes on the dining table, transportation tools such as car wheels and train wheels, planet profiles, and even the profile of a UFO (really? maybe.) When you open a mechanic clock or a mechanic watch, you' 11 find a lot of gears organized in a manner based on the ratio of the radii of the connected gears. Assume you have a bicycle with two wheels of different sizes. The radius of the smaller wheel is R, while the radius of the larger wheel is 2R. You ride the bicycle for a few seconds. If the larger wheel rotates 5 times, then the smaller wheel must rotate 10 times. Consider the following not-so-obvious question. You have two coins, say coin X and coin Y, each with a radius of 2r and r. Fix coin X to the wall and allow it to be surrounded by coin Y. Now you roll coin Y alongside coin X until it returns to its original position, as shown in Figure 3.18. How many rotations has coin Y completed? If you answered "2," then think about it once again. In contrast to the bicycle case, the "road" is not a flat surface. Assume their

80

3.3.

CIRCLE

radius is R and r, respectively, for a more general case. The center of coin Y, C1, is moved to a new position C2 in Figure 3.18, and point Ai on coin Y is moved to A2. This coin has rotated by a+ f3 degrees. Assume Bis the new tangent point.

X

Figure 3.18: Rotation of a coin

r/3 = arc A2B = arc A1B = Ra

R

R

a+f3=a+-a=(l+-)a r r That is, when

a reaches 27r, the coin Y has completed ( 1 + ~) times 27r,

R

or 1 + - rotations. In our example, R = 2r, and coin Y rotates 3 times. r Where did the extra rotation come from? Imagine that there is no friction between two coins, and we make point A 1 on coin Y touch coin X all the way. In this case, /3 = 0 and a changes as C2 moves. When coin Y returns to its original position, it has completed one rotation. The radius of coin X is not relevant in this process. This explains where extra rotation comes from.

Exercises 1. We now pose an equally interesting question to the reader: How many rotations has coin Y made when it returns to its original position if

3.3.

81

CIRCLE

coin Y is inscribed rather than circumscribed to coin X? Figure 3.19 shows the starting position. In this case, coin Y also rotates, but in the opposite direction - it rotates clockwise.

X

Figure 3.19: Rotation of a inscribed circle 2. Prove the Central Angle Theorem: The measure of inscribed angle of a circle is always half the measure of the central angle. Consider two separate cases (Figure 3.20)

''

''

''

''

'

Figure 3.20: Proof of Central Angle Theorem: two cases

3. ABCD is a inscribed quadrilateral of circle O (Figure 3.21). Prove that

AB· CD+ AD· BC= AC· BD

82

3.3.

CIRCLE

4. Segments AC and DB intersect at P (Figure 3.21). Prove A,B,C and D lie on a circle if and only if AP-PC=BP-PD

D

Figure 3.21: A,B,C, and Dare concyclic

5. (Aristotle's Wheel Paradox) Assume that a wheel completes one complete revolution on a straight line with a smooth roll, so that the point on the wheel that was initially in contact with the line at A1 lands on A2. Meanwhile, the inner circle on the wheel completes one revolution. Obviously, A1A2 equals the circumference of the wheel, should B 1B 2 also equal the circumference of the inner circle?

Figure 3.22: Aristotle's Wheel Paradox

3.4.

83

PYTHAGOREAN THEOREM

3.4 Pythagorean Theorem A right triangle is a triangle with a right angle (90°). It has a variety of interesting and useful properties. Trigonometry is built on the relationship between its sides and angles. Pythagorean Theorem is introduced in all B

a

C

b

A

Figure 3.23: A right triangle geometry textbooks as one of the most fundamental theorems. It states that for any right triangle with legs a and band a hypotenuse c, (3.12) The Pythagorean Theorem can be proven in a variety of ways. We will present some novel approaches. First, we look at the image with all solid lines in Figure 3.24. The equation a2 + b2 = c2 means that adding the areas of two smaller squares equals the area of the largest. Extend segment F G and IH, and theyintersectatl. FindK onH/ and Lon GI such thatK/ =LI= a. It is easy to see that all triangles, MK/, 6CJH, 6JCG, 6LBF, and MBC are congruent. Thus LAKL and LBLK are right angles and therefore BLKA is a square with side equal to c. As a parallelogram, the area of CJKA is b2 , and the area of BLJC is a2 . By removing triangle 6KLJ and adding triangle MBC, we can see that the sum of two areas, a2 + b2 , equals to the area of square BLKA, which is c2 . We will now provide another proof. Figure 3.25 depicts a right triangle MBC and a segment CD perpendicular to AB. Let AD = Ct and DB = c2. Since MCD is similar to MBC,

C

Ct = ~.

Similarly, c2 a

b

c

b2

a2

b2+a2

C

C

C

=ct+ C2 = - + - = - - -

= ~.

c

Therefore,

84

3.4.

PYTHAGOREAN THEOREM

E

D

F

B I I

G•I

q

I

b

I I

I

I /

I

L ,,

... ,

I

'{

I I

I

I

a'I

'

I

I /

J

I

I

I

I

I

~-----H

a K

I

Figure 3.24: A proof of Pythagorean Theorem

Multiplying c both sides, we have

C

A

C

D

B

Figure 3.25: Another proof of Pythagorean Theorem

3.5.

85

BEYOND PYTHAGOREAN

Exercises 1. When you finish the following puzzle, you should be able to come up with a new way to prove Pythagorean Theorem. Puzzle: Cut the area in Figure 3.26 into three pieces and reassemble them into a square.

a

a

b b

Figure 3.26: A puzzle for proving Pythagorean Theorem 2. A 50-inch TV screen is being designed by an engineer. This means that the rectangular screen's diagonal is 50 inches. He desires that the width and height meet the "golden ratio." That is, the width to height ratio is approximately 1.618. What is the size of his television screen? The engineer has a backup plan. Instead of the golden ratio, he prefers that the width be 10 inches more than the height. In the second plan, how big is the screen?

3.5

Beyond Pythagorean

Pythagorean Theorem provides a straightforward method for calculating the hypotenuse of a right triangle: (3.13) It also makes sense to increase the number of terms. For example,

H= ✓a2 +b2 +c2

86

3.5.

BEYOND PYTHAGOREAN

could be used to calculate the length of the "space diagonal" connecting two opposite vertices of a rectangle box as shown in Figure 3 .27.

C -

-

-1

,- - - - - - - -~ b2 I --J. __ +c2 I

----

r-----------------I

I

a Figure 3.27: A space diagonal

Figure 3.28 also shows another way to extend Equation (3.13). The method is applicable to any finite number of terms.

b

a Figure 3.28: An extension of Pythagorean Theorem

We are always interested in the right triangles with integer sides. This is equivalent to finding a positive integer solution for Equation (3.12). The simplest example is (3,4, 5). Table 3.1 lists all such triples (mutually prime)

3.5.

BEYOND PYTHAGOREAN

87

up to 50. Since multiplying each number of a triple in the table by a positive integer yields a new triple that also fulfills Equation (3 .12), there are infinitely many such triples. Naturally, we might wonder if there is any positive integer solution if a 3 5 7 8 9 12 20

b

C

4 12 24 15 40 35 21

5 13 25 17 41 37 29

Table 3.1: List of triples satisfying a2 + b2 = c2 we replace the exponent 2 in Equation (3.12) with a different integer. For instance, is there any triple of positive integers a, band c that satisfy a3 + b3 = c3 ? This was questioned by famous French mathematician Pierre de Fermat, who first conjectured in a more general form in 1637, known as Fermat's Last Theorem. Theorem 3.5.1. [Fermat's Last Theorem] No three positive integers a, b, and c can satisfy the equation an + bn = en for any integer value of n greater than two. Fermat stated in the margin of a copy of Arithmetica that he had a proof that was too large to fit in the margin. Since then, many mathematicians have worked hard to prove or disprove the conjecture. None succeeded until 357 years later, when a British mathematician Andrew Wiles released the first successful proof in 1994, which was formally published in 1995.

Exercises 1. 6CABis aright triangle, in which BC= a, CA =b, andAB= c(Figure

3.29). The points D,C,A,E are collinear, and DA= AE = c. Let x = CE and y = DC. Prove the following without using Pythagorean Theorem:

1) LDBE = 90°;

88

3.5.

2)

x;y ~ fo

BEYOND PYTHAGOREAN

(A well-known inequality)

[Hint: Write expression for a, b and c in terms of x and y]

3) a2 +b2 = c2 ; (Pythagorean Theorem!)

B

D

E

C b A Figure 3.29

2. A unit circle O has an arc AB in the first quadrant (Figure 3.30). C is any point on arc AB. D is on OA and CD l_ OA. Find the maximum value of CD+ OD. [Hint: Let L =CD+ OD and x = OD. Determine the relationship between L and x. The following fact can be used to solve this problem: B

D

0

Figure 3.30

A

3.6.

VOLUME

89

A quadratic equation

has a real solution if and only if b2 -4ac~0

3. A spherical solid made of metal will be cut into a cube with the maximum volume. The remaining metal will then be melted and formed into a second cube. If the radius of the original sphere is R, what are the sizes of the two cubes (Figure 3.31)?

Figure 3.31: A spherical solid and cubes

3.6 3.6.1

Volume

Prism

The cube is perhaps the most fundamental three-dimensional solid. A cube has 6 square faces, 12 edges, and 8 vertices. Each pair of opposing faces is parallel, and each face has four perpendicular edges. Starting with a cube, we select a group of four parallel edges and extend each of them to the same length. The resulting solid retains the same characteristics, with the exception of some faces being changed from squares to rectangles. It can be extended in the same way with another set of edges. These are known as right rectangular prisms. Here are some examples: Hexagonal Prism: A hexagonal prism has two parallel hexagonal bases and six rectangular sides.

90

3.6.

VOLUME

Pentagonal Prism: A pentagonal prism has two parallel pentagonal bases and five rectangular sides and five triangular ones. Right prisms are common in everyday life, such as in a box. It can be measured in three dimensions: length l, width w, and height h. H l, w, and h are integers, it can be cut by lwh "unit cubes." That is the original concept behind why the volume of a right prism equals lwh. Naturally, we can generalize the right prism in various ways. We assume that the two bases are parallel and congruent, as well as congruent to any intersection with plane parallel to the bases. One generalization is to remove the requirement that the lateral face (non-base) be perpendicular to the base. Furthermore, we can remove the requirement that the base be a rectangle. Rather than providing a formal definition of prisms, we describe them intuitively. The solid in question is depicted below. Take a h-height paper box. Punch a "hole" in the top face of the desired shape. Apply a parallel light beam source so that the light passes through the hole and lands on the bottom base. If the hole is a polygon, the "solid" formed by light, namely the visible shape between the box's bases, is usually referred to as an prism. (or right prism if the light beam is perpendicular to the base). Otherwise, we call them generalized prism. (Figure 3.32 ).

.======?', \

h

Figure 3.32: A prism

3.6.

VOLUME

91

To calculate the volume of a prism, consider the following idea. Suppose it has the base area A and height h. We divide it into n equal pieces by planes parallel to the base. Each pieces has the base A and the height hjn. When n increases, the volume of each piece approaches Ahjn, or the volume of the prism approaches f,Ahjn = Ah. If we let n approach to infinity, we get the accurate volume: Ah. This is a rough outline of integration, which will be covered in Chapter 5. Consider a further extension, like we mentioned in the two-dimensional space. You may remove the limits on the side-faces, but one criterion remains: any intersection with a plane parallel to the bases must be congruent to the base. Image a water-filled box with a hole in the bottom. When the water starts to fall to the ground, it looks like a prism in the air. If you move the box horizontally at first, the water on the air changes shape, but the intersection with any horizontal plane remains the same, and the total volume of the water on the air remains the same because the pace of water dropping remains constant. This suggests that the volume of prism, including the extended shapes, is (3.14) V=Ah where A is the base area and his the prism's height.

3.6.2

Conic Solid

Amy and Ben have learned in school that the volume of any conic solid is one third of the product of its base area, A, and the height, h. That is,

1 V=-Ah 3

(3.15)

They try to figure out where this 1/3 comes from. Unlike a triangle in the twodimensional plane, which is half of a parallelogram, the three-dimensional solid is not immediately apparent. Amy suggests buying some plasticine, but Ben tells her that he has a large block of cheese in his house that they can cut into any shape they want. When they get the cheese, it appears to be a perfect right prism. (a rectangular cuboid). This is a rectangular prism with length, width, and height of l, m and n, respectively. The project is to cut it into three conic pieces of equal volume. This necessitates a proof after cutting. The only assumption they can make is that if two conic solids have the same base area and height, they must have

92

3.6.

VOLUME

B

A

Figure 3.33: A cheese block

the same volume. They cut the cheese as shown in Figure 3.34 after drawing on paper several times.

G

E

E

C

partX

D

partY

partZ

Figure 3.34: Cut into three conic solids

C

3.6.

93

VOLUME

All three pieces, X, Y, and Z, resemble pyramids, except that their bases 1 are not perfectly square. It is clear that the volume of each piece is 3zmn when (3.15) is used. Amy is pleased with the outcome, but Ben believes it was not their original goal. All three pieces, X, Y, and Z, resemble pyramids, except that their bases 1 are not perfectly square. It is clear that the volume of each piece is 3zmn when (3.15) is used. Amy is pleased with the outcome, but Ben believes it was not their original goal. "Can we prove the same volume of each piece without using the volume formula?" Ben asks, "We assume two conic solids have the same volume if they have the same base area and height." Amy shakes her head, "We can't because these three pyramids have different base areas and heights. But I'd like to try." They draw on the papers again and discover that if they cut each piece by half, something interesting happens. Note that each "pyramid" has a rectangle base. There is a edge vertical to the base, such as AE in part X. The idea is to cut each piece with a plane through this vertical edge and the base's diagonal. Thus the resulting two sub-pieces have the same volume since they have same base area and height. Figure 3.35 depicts two sub-pieces from X and Y, X1 and Y1. They have the same base area (lm/2), and height (n), so they have the same volume. This means that the volume of X and Y are equal. We can also show that Y and Z have the same volume.

n

E

E C

n

partX1

partY1

Figure 3.35: Sub-pieces from X and Y

94

3.6.

VOLUME

A cone is another common shape. By shining a flashlight toI\ I \ ward the floor in the dark, you can see the cone shape. Some of the hats worn by people in southern h Asia look like cones. When sand is slowly dropped from one point into the floor, it forms a cone shape. Everyone is probably familiar with this example: an ice cream cone! The cone is regular geometrically, in the sense that the intersection of Figure 3.36: Form of a cone the cone and a plane parallel to the base is always similar to the base. (Note the distinction: it is "congruent" in the prism case.) A cone can also be defined as a solid geometric shape bounded by a base in a plane and a surface formed by all straight line segments connecting the virtex to the perimeter of the base. As with the prism, we will not limit the base shape to a circle alone. It could be a triangle or a rectangle. As a result, a pyramid is also a cone.

I 1

\

Remember, we're just using a box and a light beam to demonstrate a prism. A cone can also be formed using similar equipment. The light beam in Figure (3.36) comes from a single point. All light beams that pass through the box form the cone. The hole on the top base has a similar but not identical shape to the base shape. The height of the cone is the distance between the vertex and the base plane. It is greater than the height of the box.

Exercise

I

1 I

30 10

...!...

A

B

Figure 3.37: Two buckets

3. 7.

95

APPENDIX

1. There are two buckets, A and B, both of which are shaped as "truncated cone". The radius of the top circle is 20 inches, and that of the bottom circle is 10 inches for both buckets. A is 30 inches tall and B is 15 inches tall. Bucket A contains water and covered by bucket B (Figure 3.37). Measure the water vestige on the bucket B, it is 2 inches. How much water is in bucket A? 2. A right solid cone is cut by a plane into two pieces (Figure 3.38). The cone's base diameter is 2 and its slant high is also 2. Assume the plane passes through a point B on the base circle and is perpendicular to the slant AC. What is the volume of each part? (Remember, the intersection in this case is an ellipse.) A

C

B

Figure 3.38: A right solid cone is cut by a plane

3.7 Appendix A History of 'Jr Around four thousand years ago, people realized that the circumference of a circle is proportional to its diameter. However, the use of the Greek letter 7r as the circumference-to-diameter ratio began in the 1700s. In

96

3. 7.

APPENDIX

the nineteenth century BC, the Babylonians calculated the area of circles. According to their table, they used 3.125 for n. In 1650 BC, the Egyptians calculated the area of a circle using a formula that yielded the approximation of n as 3.16. Archimedes (287-212 BC), a great ancient mathematician, used the Pythagorean Theorem to calculate the areas of the inscribed and circumscribed polygons of a circle, and obtained the upper and lower bounds for the area of this circle. His best estimate for n was between 3.1408 and 3.1428. A Chinese mathematician and astronomer named Zu Chongzhi (429-501 AD) calculated the value of n and determined that it is between 3.1415926 and 3.1415927, a 6 decimal place accuracy in today's knowledge. He also provided two fractions, "approximate ratio" and "accurate ratio." The former is 22/7, while the latter is 355/113. The significance of 355/113 (3.1415929 ... ) is that there is no better fraction approximation for ppi unless its denominator is 27678 or larger. Zu's book has been lost. Nobody knows the specifics of his work. If he was using polygons, he must be working on a regular 24576-gon! Fibonacci calculated his value for n more than 700 years later. The fact that his number was only three decimal places accuracy indicates that there was no communication between the east and west of the world at the time. Madhava of Sangamagrama was probably the first to use infinite power series to approximate n. The formula is now known as the Leibniz formula for n. There have been many mathematicians involved in the calculation of n throughout history, including Isaac Newton. His contribution was significant-maybe not when compared to his other contributions to Physics and Mathematics. Since the 1950s, the pace of calculating n has been accelerating. People no longer calculate by hand, particularly in the computer age. Today, the precision of n has exceeded 1.3 x 10 13 decimal places. Other than calculating the value of n, people want to know what type of number n is. In 1761, Swiss scientist Johann Heinrich Lambert proved that n is irrational. This means that n cannot be expressed as a fraction. Some mathematicians have used fractions to approximate n, but no fraction exactly equals n. Adrien-Marie Legendre, a French mathematician, proved in 1794 that n2 is also irrational. Furthermore, in 1882, German mathematician Ferdinand von Lindemann proved that n is transcendental. In other words, it is not a root of a nonzero polynomial equation with integer (or, equivalently, rational) coefficients. Finally we list some mathematical representations of n. Since a unit circle has the diameter which equals 2, n is equal to the half of its perimeter.

3. 7.

97

APPENDIX

As can be seen in Calculus,

n=

f

l

dx

-1

✓ 1 -x2

In 1841, Karl Weierstrass adopted this integral as the definition of 7r. Using the area of the unit circle is a similar idea. The area of a unit circle is 7r. This is represented by the following integration:

-n = 2

fl

Jl-x 2 dx

-1

'JC is closely related to some well known probability distributions. We list them here without further explanation, for example:

Normal Distribution. The density function is 1

f(x) = - - e -

(x-11,f 2cr

cr../ln

where µ is the mean and cr is the standard deviation of the distribution . Since the total probability is 1, integrating over the set of real numbers, after changing the variables yields

f

=

2

-= e-u

du= -.jn

Cauchy Distribution. Its density function is 1

1

f ( x ) = -2 · n x +1 Since the total probability is 1,

Thus

f=

~

-=X

1

+1

dx=n

Because 'JC is not a rational number, it cannot be represented by a fraction. However, mathematicians discovered some continued fraction repre-

3. 7.

98

APPENDIX

sentations. For instance, 4

n=-----~---12 1 + -----,,----32 2+------52 2+----72 2+ 92 2+-2+··· It can be also represented as

4

lf:=

1+

12 22 3+ 32 5+ 42 7+ 52 9+ 11+···

It was also discovered in Europe in 16-17th century that 7r can be represented by infinite product. French mathematician Franc;;ois Viete found that

2

y'2. V2H2

✓2+V2H2

n

2 2 2 English mathematician John Wallis discovered another infinite product:

n

2 2 4 4 6 6 8 8

2

13355779

7r can also represented by an infinite series. For example, GregoryLeibniz series: 4 4 4 4 4 4 n=y-3+5-7+9-u+···

Indian astronomer Nilakantha Somayaji discovered the following series for 7r:

4 4 4 4 lf:=3+-------+-------+•·· 2x3x4 4x5x6 6x7x8 8x9x10

3. 7.

99

APPENDIX

In 1914, the Indian mathematician Srinivasa Ramanujan published fast iterative algorithms. One of his formulas is _!_ 7r

= 2v'2 ~ (4k)! (1103+26390k) 9801

f::o

k! 4 (3964k)

They were remarkable for their elegance and quick convergence. In the 1980s and 1990s, new infinite series were discovered. One of them is the well-known The Bailey-Borwein-Plouffeformula (1995):

Emma Haruka Iwao and a Google team computed decimal places in 2019.

n

to 31.4 trillion

CHAPTER

4

STRATEGIES IN PROBLEM SOLVING

"To divide each ofthe difficulties under examination into as many parts as possible, and as might be necessary for its adequate solution. " - Descartes "To conduct my thoughts in such order that, by commencing with objects the simplest and easiest to know, I might ascend by little and little, and, as it were, step by step, to the knowledge ofthe more complex; assigning in thought a certain order even to those objects which in their own nature do not stand in a relation of antecedence and sequence." - - Descartes

Our planet has been around for 4.5 billion years. There are reasons why the world appears as it does. Every living thing, including humans, employs survival strategies on a daily basis. There are reasons why their actions are as we have observed. They frequently work to improve living conditions in their own environment. While real-world problem solving necessitates math knowledge, the tools we employ may not be restricted to a single field. In this chapter, we will look at some intriguing problems and explain why and how they can be solved.

4.1

Why Hexagon

The Regular Hexagon is commonly used in decorations, diamond cuts, tiles, and a variety of other applications. Snowflakes are also profiled as regular hexagons in nature. One of the most fascinating phenomena is the formation of honeycombs. Bees "artificially" construct them out of wax. From the top, each cell is a regular hexagon - but why, have you ever considered this? We will concentrate on mathematical reasoning regardless of biological factors. Assume bees want to build a honeycomb out of regular polygons of the same 100

4.1.

WHY HEXAGON

101

size so that everyone works in the same way without conflict. (Figure 4.1)

Figure 4.1: Honeycombs

For bees, the first question is what kind of polygons can form a honeycomb. That is, the regular polygons must cover the entire area. This implies that 360° must be a multiplier of the interior angle of the regular polygon of choice. If a regular polygon has n sides, it can be cut into n - 2 triangles through any vertex. As a result, the sum of all interior angles is 180° (n - 2), and each interior angle equals

a=

n- 2 180°

n

(4.1)

2n 4 Since 360° / a = - - = 2 + - - must be an integer greater than 2, the n-2 n-2 only numbers that qualify for n are 3, 4 and 6. The bees must now determine which normal polygon shape for honeycomb is the most advantageous. Each polygon cell must have enough space for a young bee to grow. If the area is fixed, the question now becomes which normal polygon requires the least wax to build. Each wall (edge) is shared by two polygons because these normal polygons are perfectly connected to one another. As a result, the question is which normal polygon has the smallest perimeter given a fixed area A. Assume we have a regular hexagon, a square, and an equilateral triangle. Each of these has an area A and three sides a, b,

102

4.2.

STRATEGIES OF THE YOUNG SWAN

andc. 1 y'3 triangle: A = -a-a 2 2 '

square:

A = b2 ,

a __ ~4A 3

b = v'A

hexagon: A=6 (~cf c),

c=

{&

Compare the perimeters: perimeter(triangle) = 3a ~ 4.56v'A perimeter(square) = 4b ~ 4v'A perimeter(hexagon) = 6c ~ 3.72v'A The conclusion: Making each cell a regular hexagon shape is the most cost-effective way to build a honeycomb!

4.2

Strategies of the Young Swan

In Chapter 3 we posted a problem: Problem 3.3.1 A young swan is in the center of a circular pool, and a hungry fox is watching her from outside. Unfortunately, the young swan has not learned to fly from the water. She can't fly unless she touches down on the ground. If the fox runs at 8 meters per second, the swan swims at 2 meters per second, and the pool radius is 20 meters, can the swan escape the fox?

And we've seen that the young swan can't escape by taking the shortest path. She requires a new thought. In order to develop a better strategy, we may investigate what potential we have overlooked. In this problem, the optimal position for the swan at any time is when the swan, the center of the pool, and the fox are all on a straight line (the swan and the fox are on the opposite sides with respect to the center). Let us refer to this as a "safe" position. The swan should not abandon its safe position too soon. This means that once the swan begins to move, she must change direction immediately and continue to change in order to maintain a safe position. The swan must have

4.2.

103

STRATEGIES OF THE YOUNG SWAN

the same angular speed (the angle change per unit time) as the fox while running. Figure 4.2 shows that after leaving the center, the swan's instant speed, v, has two components: the speed towards the border vl (for the final result) and the speed in the perpendicular direction v2. (in order to keep the safe position). As the distance from the center increases, the speed of the second component must also increase to match the fox's angular speed. Because the swan's speed is lower, the distance between the center and the safe position is limited. That is, there is a maximum distance (from the center) at which the swan can still move with the same angular speed as the fox, but cannot move any further away from the center. Let R be the radius of the pool and r be the maximum radius of a circle so that the swan and the fox can move with the same angular speed, and ss and SF be the swan and fox's speeds, respectively. We now have

S1

V2 V

_____R_ __ I

1

Figure 4.2: The swan and the fox

ss r

So ssR 2 x 20 r- -SF --8 - -5

A simple strategy consists of two steps: (1) Move to a "safe" location far enough from the center; (2) Proceed straight toward the border. We've established that the limit is 5 meters. That is, along with any circle with a radius less than 5, the swan can move with a greater angular speed than the fox and reach a safe position. Assume that in the first step, the swan found a safe position S1 4.9 meters from the center, and the fox is at Fi at the time. The swan's target is S2, and S1S2 = 20- 4.9 = 15.1. The required time is 15.1/2 = 7.55 (seconds). Meanwhile, the fox has run 8 x 7.55 = 60.4 (meters). The fox arrives at F2, which is 2.4 meters away from the swan, because half of the circumference is 20:ir ~ 62.8 (meters).

104

4.3.

TESTING DIVISIBILITY

The above strategy is effective. We'd like to pose two questions to the reader: 1. Can the swan reach a safe position 5 meters away from the center? 2. Assume the swan has completed the first step and is at S1. Is there a path better than S1S2?

4.3

Testing Divisibility

Due to a powe,ful storm, a pirate ship at sea began to sink. The ship contained 300 sailors. The captain told them to form a line and began counting. The sailors who received an odd number would be tossed into the water, and this would carry on until the ship was in a safe place. A wise sailor quickly realized that there was a "optimal" position in which he could outlast all other sailors. Can you locate the "best position?" To solve this problem, we can try a small set of counting numbers ranging from 1 to 10: List of all numbers: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 After first round: 2,4,6,8, 10 After second round: 4,8 After third round: 8 It is clear that after the first round, all numbers divisible by 2 ( even numbers) remain; after the second round, all numbers divisible by 4 remain; and after the third round, all numbers divisible by 8 remain. This is because if a number is n, its order after the first round is n/2. It can survive the first round if it is divisible by 2 or n /2 is an integer. It can survive the next round if n/4 is an integer, and so on. As a result, the sailor should seek a number that is divisible by 2m, with m as large as possible. For integers ranging from 1 to 300, 256 was chosen because 256 = 28 and no other number n, 256 < n ::; 300, is a power of 2. Knowing divisibilities can sometimes aid in problem solving. For example, suppose we want to know whether a certain integer contains a specific factor. Although a straightforward approach may yield a result, we may have better strategies. For any two positive integers a and b, there exist non-negative integers q and r such that a=bq+r,

r< b

4.3.

TESTING DIVISIBILITY

105

where q is the quotient and r is the remainder. This relationship can be extended to integers. If there is an integer q such that the above equation holds, then we write a= r (mod b). When r = 0, we say that a is divisible byb. Many people are aware that to determine whether an integer is divisible by 3, one only needs to check the sum of all digits. 12345, for example, is divisible by 3 because 1 + 2+ 3 +4+5 = 15 is divisible by 3. To understand why, consider any power of 10, such as 10, 100, or 1000. When you divide any of them by three, the remainder is always 1. As a result, dividing any klOn by 3, where k, n are integers and 1 ::; k::; 9, yields the same remainderas dividing k by 3. The reason is obvious because any integer is a sum of powers of ten. For instance, 12345 = 104 + 2 x 103 + 3 x 102 + 4 x 10 + 5 x 10°. We need only check 1 + 2 + 3 + 4 + 5. The divisibility by 9 is similar. That is, a number is divisible by 9 if and only if the sum of its digits is divisible by 9. The divisibility by 4 is straightforward. When a number is less than 100, it is easy to see. Otherwise, it can be written as a sum of two integers. The first part is a multiple of 100 and the second part is the remainder of dividing the number by 100. Because 100 is divisible by 4, only the second part determines the divisibility. For example, 12345 is not divisible by 4 because 45 is not. The same reasoning can be applied to the divisor 8. Because 8 divides 1000, we only need to test the last three digits.

If a number is divisible by 5, the last digit must be either O or 5. This fact leads to a simple rule. What are the characteristics of a number divisible by 7 ? In this case, there is no simple solution. However, if the problem can be reduced to a relatively simple one, it is worthwhile to try. An integer w can be written as w = 10a + b where bis the last digit in w. Instead of directly testing w, we will try a combination of a and b, say a+ kb where k is a constant we will figure out now. Let us use the symbol {cc} to represent "equivalent," which means that the left and right sides have the same divisibility by 7. It is important to note that an integer x is divisible by 7 if and only if lOx is divisible by 7. We have

a+ kb {cc} 10a + 10kb = 10a + b + 10kb - b = w + ( 10k - 1)b {cc} w if ( 10k - 1) is divisible by 7. That is, if we choose k such that ( 10k - 1) is divisible by 7, then a+ kb and w are "equivalent." k = - 2 and k = 5 are two obvious candidates. Now we will set k = -2 and test with the numbers

4.3.

106

TESTING DIVISIBILITY

12345 and 12341: 12345 {c} 1234- 2 X 5 = 1224 {c} 122- 2 X 4 = 114 {c} 11- 2 X 4 = 3 12341

{c}

1234- 2 X 1 = 1232 {c} 123 - 2 X 2 = 119 {c} 11- 2 X 9 = - 7

So, while 12345 is not divisible by 7, 12341 is. Now we consider the divisibility by 11. Note that for n 2'.'. 2, 10n = 10n- 2 (mod 11). This is because 10n = 100 X 10n- 2 = 99

=

X

10n-2 + 10n-2 = 10n- 2

=

(mod 11)

=

So either 10n 1 (mod 11) or 10n 10 (mod 11) -1 (mod 11) for all n 2'.'. 2 depending on whether n is even or odd. Then klOn = k (mod 11) or klOn = -k (mod 11). For an integer with n digits, d110n +d21on- 1 -· · +dn

= d1 -d2 +d3 · · · +dn

(mod 11) if n is even

or

In other words, an integer is divisible by 11 if the number that is the difference of the sum of digits at even and odd places is divisible by 11. Because sum=x and sum=-x are equivalent, "even" and "odd" can be swapped in the preceding statement. For example, 12345 is not divisible by 11 since 1 - 2 + 3 - 4 + 5 = 3 12342 is divisible by 11 since 1 - 2 + 3 - 4 + 2 = 0 Because 6 = 2 x 3, an integer is divisible by 6 if and only if it is divisible by both 2 and 3. For example, 123456 is divisible by 2 and 3, it is also divisible by 6. Similarly, an integer is divisible by 12 if and only if it is divisible by 3 and 4, and we can check the divisibility by 3 and 4, respectively. At the end of this section, we will present one of the most famous unsolved problems in mathematics, known as the Collatz conjecture, named after the German mathematician Lothar Collatz. To begin, take a positive integer x, and determine the next number in the sequence using the Collatz function: if x = 0 (mod 2) x/2 f(x) = { 3x+ 1 if x = 1 (mod 2)

4.3.

TESTING DIVISIBILITY

107

Applying the function f(x) repeatedly generates a Collatz sequence. For example: (10,5, 16,8,4,2, 1,4,2, 1, · · ·) (7,22, 11,34, 17,52,26, 13,40,20, 10,5, 16,8,4,2, 1, · · ·) Once the sequence contains 1, it becomes stuck in a loop. The Collatz conjecture states that for any positive integer, the sequence will eventually enter this loop, which is equivalent to saying that every Collatz sequence contains 1. Although the problem is simple to understand, it has baffled mathematicians for decades. Since Collatz posed the problem in 1937, many mathematicians have made significant efforts to prove or disprove the conjecture. Using logarithmic density, the prominent mathematician Terence Tao made significant progress towards solving the problem in 2019. He showed that almost all Collatz orbits are descending below any given function of the starting point, as long as this function diverges to infinity, regardless of how slowly. Examples of such functions include n, yin, and Inn. While the conjecture has been proven to hold true for all numbers up to 268 , no one has been able to prove it for all positive integers. It remains one of the most famous unsolved problems in mathematics, with a 120 million JPY prize offered by BAKUAGE in 2021 to anyone who can solve it. Hungarian mathematician Paul Erdos was one of the most prolific mathematicians and producers of mathematical conjectures of the 20th century. Here's what he had to say about the Collatz conjecture. "Mathematics may not be ready for such problems. "

Exercises 1. Explain: Take any 5 integers, there is a subset of 3 numbers whose sum is divisible by 3. 2. 2016 is a year in which the surn of the digits is a factor of the year itself. Find next two years with the same property. 3. "Magic" number 142857 has some interesting properties. Verify and explain the following facts: (a)

2 X 142857 = 285714

4.3.

108

TESTING DIVISIBILITY

3 X 142857 = 428571 4

X

142857 = 571428

5 X 142857 = 714285 6 X 142857 = 857142 7

X

142857 = 999999

(b) Thenumberofintegersin [1,10] thataredivisibleby7: 1 The number of integers in [1,102 ] that are divisible by 7: 14 The number of integers in [1,10 3 ] that are divisible by 7: 142 The number of integers in [1,10 6] that are divisible by 7: 142857 (c)

142857 2 = 20408122449 20408 + 122449 = 142857

(d)

~ = 142857 30

31

32

33

34

= 10 + 102 + 103 + 104 + 105 +···

4. Explain the following facts: (a) If you randomly choose an odd number n, there is a 50% chance that n will decrease in three steps in the Collatz sequence. Additionally, there is a 25% chance that n will be reduced to less than half of its initial value after four steps. (b) Let x be a positive odd integer. Define T(x) as the first odd number obtained by repeatedly applying Collatz function on x, and H(x) = 4x+ 1. For positive odd integers x and y, where x > y, prove that: T(x) = T(y) if and only if x = Hn(y) for some integer n

4.4.

BINARY SEARCH

109

4.4 Binary Search

Figure 4.3: A searching game

Amy and Ben are playing dominoes once more. One of them chooses 50 dominoes and arranges them in a line with the odd number of pips on the left and the even number of pips on the right. A special domino (without pips) is placed between them. The goal of the game is to quickly find the special tile and flip it over. All tiles are turned down so that the player cannot see them. After Ben has finished arranging all of the tiles, it is Amy's turn to search. Amy explains how she intends to do so. "I have two approaches in mind: A. a "naive way," checking each domino one by one until the target domino is found; B. a "binary search,' checking the middle one. As a result, half of the dominoes will be removed. Repeat the process until the target is found." "Ready? Let's see how both approaches work." Ben smiles as he places all of the tiles. Amy starts with the "naive" method and finds the special domino in only two steps. Then she tries the binary search, which requires her to check the 25th, 12th, 6th, 3rd, 1st and 2nd dominoes, for a total of 6 steps. "It appears that your simple method outperforms the advanced one." Ben devised this ruse to demonstrate to Amy that the naive method is not always the worst.

"Well, that is not a fair comparison. First and foremost, this is a deliberate special case. There are more instances where the naive method fails miserably. For example, if the target is the last one, the naive method would require 50 steps, whereas binary search requires only 7. You have to believe that this is the worst-case scenario for the binary search. Furthermore, I believe that the performance of two methods should not be based on a fixed problem size (50 in this game), but rather on how the size increases, say 500, 5000, ... " Amy has made two critical points. We use the term "algorithm." to mean

110

4.4.

BINARY SEARCH

a process, an ordered strategy to be followed in problem-solving operations. The performance comparisons focus on how quickly a solution can be obtained, or "no solution" can be confirmed. There are several different cases to consider, including the worst case, best case, and average case. Another critical point is that, while we design algorithms to solve specific types of problems (such as searching in the preceding example), the problems should not be limited to a fixed size. In other words, the algorithm should be applicable to any size. "The algorithm solves this problem of size n in no more than f(n) steps," one could say. f is a function of n (also known as "time") and must be determined in analysis. This is more accurate than "The algorithm solves the problem with 50 dominoes in 6 steps." Let us now determine the time functions for the algorithms in our example. We start with the worst-case scenario. Assume we have n dominoes. Obviously, a naive search requires n steps. It is constrained by f(n) = n. Let n = 2k for some integer k to see how the binary search works. The search process reduces the problem size to 2k-l after one step, 2k- 2 after two steps, etc. It reduces size to 1 in k steps. The total time required is k + 1 = log2 n + 1. If 2k- l < n < 2k, then the process reduces the size to 1 in less than k steps. However, this number of steps cannot be less than k - 1 because a problem with size 2k- l requires k - 1 steps to be reduced the size to 1. As a result, in the case of 2k- l < n < 2k, it takes k - 1 steps to reduce the size to 1. In general, the time required is llog2 nJ+ 1, where the notation l J means "rounding to the next smaller integer." As n grows, the logarithmic function grows much slower than a linear function, and we see that the binary search outperforms the naive sequential search. How well do these algorithms perform on average? Assume the target tile is evenly distributed. That is, the target has an equal chance in any position. Let the problem size be n = 2k for some integer k. If the target is in the last position, it takes k + 1 steps. The remaining 2k - 1 positions have the property that after checking the middle position, it reduces the size to an odd number (ignore the last one). And so on until the process is completed. This means that one position requires one step (the middle one), two positions require two steps, four positions require three steps, • • •, 2k-t positions require k steps. The total number of required steps is

1-1 +2· 2+3 -22 +4· 23 + · · · +k-2k-l + (k+ 1) n Let T

= 1 · 1 + 2 · 2 + 3 · 22 + 4 · 23 + ... + k. 2k- l

4.4.

BINARY SEARCH

111

Then 2T

= 1 · 2 + 2 · 22 + 3 · 23 + 4 · 24 + · · · + k · 2k

-T

= 1 +2+22 +23 + · · · +2k-l -k- 2k = 1-2k -k-2k 1-2

= 2k - 1-k-2k T

= 2k (k - I) + 1

The average number of steps is

n

n n(Iog2 n - 1) + log2 n+ 2

n log2 n 2 = log2 n - I + - +n n

As n approaches infinity, the last two terms approach zero. This means that the average time of the binary search is also bounded by a logarithmic function of the input size. The reader should be able to easily calculate the time function for the average case using naive sequential search. These bounding functions, namely the time complexities for different algorithms in problem solving, are important measures. Many problems necessitate much greater time complexities. For example, an n-digit combination lock requires a secret key (an n-digit number) to open. If a stranger tries to open it, no algorithm is better than a naive exhaustive search. For this naive search, the time complexity is f(n) = 10n, which is an exponential function. The time required to find all subsets from a set of n elements is also an exponential function. We've seen a few different types of time functions, such as logarithmic, linear, and exponential. Two distinct linear functions can be distinguished. When compared to an exponential function, the difference is considered insignificant as the input size grows. "Big O" notation is a method of classifying functions in computer science. Definition 4.4.1. Two real functions f and g have the relationship f(x) = O(g(x)) if and only if there is M > 0 such that

IJ(x) I::; Mlg(x) I

4.4.

112

BINARY SEARCH

for all sufficiently large x.

According to this definition, multiplying a constant or even adding a "slower glowing" function to a function does not change the complexity class of the original function. For example, 100 · 2x

= 0(2x)

3x2 + lOx- 7 = O(x2) It is important to note that Big O notation does not represent a single value

but rather a set of functions. As a result, two functions equal to the same Big O function are "bounded" by the same function. When emphasizing the function's dominant components, the Big O notation can be used. For example,

x2

x3

~=l+x+-+-+··· 2! 3! = 1 +x+O(x2 )

as

x-+ 0

The binary search is typically explained using a problem with a sorted list (for example, n sorted numbers). Our example with "odd/even" dominoes appears to be much simpler. In fact, the complexities of any search algorithm are the same in both cases. This is due to the fact that only the search direction is important in the process. The numbers that appear during the process provide no additional information. The following is a comparison of the complexity of sequential search and binary search.

best case worst case average

sequential 1

O(n) O(n)

binary 1 O(lnn) O(lnn)

A binary search can also be used to solve some real equations. Consider the following equation, (4.2) X* sin(x) + 1 = 0 Although it appears to be a simple equation, there are no algebraic solutions for it. We can, however, solve it numerically by using a binary search. Let f(x) = x * sin(x) + 1. It is obvious that f(0) > 0 and f(5) < 0. Because f(x) is a continuous function, we know that there is a number xo E (0,5)

4.5.

TOWER OF HANOI AND RECURRENCE RELATION

113

such that f(xo) = 0. (See Chapter 5) It is important to note that our goal is not to obtain an exact number xo (which may never be expressed), but rather an approximation of xo as long as the error is less than a desirable number e. The search algorithm is as follows: 1. LetL = 0, andR = 5; 2. Letc= (L+R)/2; 3. If If( c) I< £, stop and return c; Otherwise, if f(c) > 0, then L = c; if f(c) < 0, then R = c; Go to step 2. We set£= 0.01 and list all values of L and R in the first few rounds: round I L=0, R=5 round 2 c = 2.5, f(c) 2.4962, L=2.5, R=5 round3 c= 3.75, f(c) = -1.1434, L=2.5, R=3.75 round 4 c = 3.125, f(c) = 1.0518, L = 3.125, R = 3.75 round 5 c = 3.4375, IJ(c)I= 0.0024, Return c = 3.4375.

2 -

01---------~----1

-2 -

y=xsinx+ 1

Figure 4.4: Binary search

The search process is terminated in round 5 because the error is less than the required £. It is worth noting that the error does not always decrease at each step. However, as in the preceding example, it ensures that the searching domain is reduced by half in each iteration, and thus the process is completed relatively quickly.

4.5

Tower of Hanoi and Recurrence Relation

If you have nothing to do and don't mind doing the same thing over and over, playing Tower of Hanoi is a good way to pass the time. It is made up

114

4.5.

TOWER OF HANOI AND RECURRENCE RELATION

of three rods and a variety of disks of varying sizes. The rules are fairly straightforward: 1. At all times, all disks must be placed on one of three rods, with only the smaller disk on top of the larger one; 2. Only the top disk can be removed from any stack. Initially, all disks are placed on the first rod. The goal is to move the entire stack into another rod (Figure 4.5 ). What is the most effective strategy for playing this game? Assume that the total number of disks is n. Consider this in reverse. We must have one step that moves the largest disk from the first rod (say, rod 1) to another rod (say rod 2). To do so, we must stack other n - l disks in a different rod, rod 3 (Figure 4.6). This is equivalent to playing another Tower of Hanoi game of size n - 1. While doing so, the procedure is not constrained by the largest disk, as if it does not exist. To complete the game with n - 1 disks, we must now complete the game with n - 2 disks, • • •. Finally, or first and foremost, we must move the smallest disk. We've seen that each of the preceding steps is required. As a result, no other algorithm is more efficient. We can also see that this is a recursive process, which means that we are repeating the same procedure throughout the process.

Figure 4.5: The Tower of Hanoi

I

~

()

........... c ____..)

Figure 4.6: Move n - 1 disks

4.5.

TOWER OF HANOI AND RECURRENCE RELATION

115

This gives us a simple way to describe the algorithm:

1. Move the stack of smallest n - 1 disk from rod 1 to rod 3; 2. Move the largest disk to rod 2; 3. Move the stack of smallest n - 1 disk from rod 3 to rod 2. Let T (n) be the total number of steps required to move the entire stack with n disks. According to the above algorithm,

T(n)=2T(n-1)+1

(4.3)

Let's see how T(n) changes with the first few natural numbers: T(l) = 1 T(2)=2T(1)+1=3 T(3) = 2T(2) + 1 = 7

T(4) = 2T(3) + 1 = 15

It is obvious that adding 1 to the number of each row results in a power of 2. To be more specific, we have

(4.4) We call (4.3) a recurrence relation, and (4.4) its solution. It is not strange because we have seen them before: Arithmetic Sequences {

al= C an= an-1

+d

Geometric Sequences {

Fibonacci Sequences

=C 8n = 8n-1r 81

116

4.5.

TOWER OF HANOI AND RECURRENCE RELATION

With some initial conditions, a general recurrence relation can be written as (4.5)

It's intriguing to learn how to solve recurrence relations. However, solving recurrence relations in general is a complicated process. We'll look at some specific examples. Consider the following recurrence relation: an= an-1

+ f(n)

where f(n) is a function of integer n. an= an-1

+ f(n)

an-1 = an-2 + f(n- 1) a2

= a1 + f(2)

Add each side of these equation together, it is simplified as n

an= a1

+ L,f(i)

(4.6)

i=2

For example, if f(i) = d for some constant d, it is an arithmetic sequence, the above equation is an=a1+(n-l)d If f(i)

= i for all i, then n

an= a1 + L, i i=2

= a1 + n(n+ 1) -1 2 n2 +n-2 =a1+---2

The method used to obtain Equation 4.6 is known as telescoping. It does not always work. For example, an= 3an-1 - 7. We require more general techniques. Let us concentrate on the following type of recurrence relations (second-order linear homogeneous) (4.7)

4.5.

TOWER OF HANOI AND RECURRENCE RELATION

117

Remember how we used iterations to solve for a relation based on the Tower of Hanoi? It is not homogeneous because the recurrence relation has a constant 1. Otherwise, T(n) is an nth power of 2, T(n-1) is an (n- l)th power of 2, • • •. If an= r' is a solution of (4.7), then we have

r' = c1 ,.n-1 + c2r'-2 and vice versa. This is equivalent to the following equation

?- = c1r+c2

(4.8)

It is referred to as characteristic equation of the recurrence relation (4.7),

and its roots are referred to as characteristic roots. The solutions for the recurrence relation (4.7) are shown in the theorem below:

Theorem 4.5.1. Assume that the recurrence relation

has the characteristic roots r1 and r2, where c1 and c2 are real numbers and c2 -=/-0, 1.

Jf r1-=/- r2 then

2.

Jf r1

=

r2 = r then an

= Cr' + Dnr'

where C and D are determined by the initial conditions. Let us now apply Theorem 4.5.1 to the Fibonacci Sequence.

The characteristic equation for this recurrence relation is

or r2 -r-1=0 We have characteristic roots after solving this quadratic equation.

l+Js

r1=--2

118

4.5.

TOWER OF HANOI AND RECURRENCE RELATION

According to Theorem 4.5.1, Fn can be written as

Now we apply the initial conditions,

{:(:2:~),1:~1~-:v'Sr ~, When we solve this linear system, we get C = Finally, F.

=

1

Js

and D =

_1 (1 +Js)n - _1 (1-Js)n 2 J5 2

nJs

Now we have another chance to find limn-+oo Fn/ Fn-1 ·

-1

Js. (4.9)

4.6.

BALANCE PuzzLE

l+v'S 2

It is the Golden Ratio!

Exercises 1. Prove Equation (4.4) using mathematical induction. 2. Find the solution to the recurrence relation: {

a1

=3

an= 2an-1 + I

3. Find the solution to the recurrence relation:

=1 a2 = 25

a1 {

an= an-1 + 12an-2

4.6

Balance Puzzle

Figure 4.7: A balance Puzzle

A wise man was involved in the production of counterfeit coins and faced the death penalty. The king was furious at him. He intended to humiliate the wise man by using counterfeit coins. He gave the wise man a balance and 12 "gold" coins. They were identical. However, 11 of them are genuine gold coins. One is a forgery with a different weight. The king instructed the

119

120

4.6.

BALANCE PuzzLE

wise man to use the balance to identify the counterfeit coin. He could only use weighings three times. Because the wise man knew how the counterfeit coins were made, he could tell the fake one was heavier than the others and quickly identified it after three weighings.

Amy thinks the story intriguing. She closes the book and tells Ben about the story. "I can figure it out!" Ben responses right away. "How do you do it?" Amy enquires. "Name 12 coins as 1, 2, 3, • • •, 12. The first weighing will be

{1,2,3,4,5,6} vs {7,8,9, 10, 11, 12} One side must be heavier, say {1,2, 3,4, 5, 6}. The second weighing is

{1,2,3} vs {4,5,6} If { 1, 2, 3} is heavier, measure 1 and 2. If it is unbalanced, we know the heavier is the forgery one. Otherwise, 3 is a forgery.

"That makes sense. Let's see how the wise man fared." Amy opens the book and continues reading. "Aha, he did something different." Amy then explains to Ben how the wise man solved the problem. "He put four coins on each pan. If it was unbalanced, the fake coin must have been on the heavier side; otherwise, it must have been one of the remaining four coins. Next, he placed one coin on each pan; if it was unbalanced, he was finished; otherwise, he measured again for the remaining two coins. I believe his algorithm is superior to yours." "Why? Both methods require three weighings." "The reason is that in your algorithm, each weighing reduces the size by half, whereas his algorithm reduces it by two-thirds. For example, if the number of coins is 16 rather than 12, your method requires four weighings, whereas his method can handle 27 coins in three weighings." "I suppose you're correct. Did the king pardon him?" "Well," the king was unimpressed, saying "Iforgot you know the counterfeit coin is heavier. You have it far too easy. Tell me

4.6.

BALANCE PuzzLE

121

how you will solve the problem if you don't know whether the counterfeit coin is heavier or lighter. " "Yes your Majesty!" The wise man began to describe his solution to the problem. "Hold! Don't tell me, I want to figure it out." Ben interrupts Amy's story and begins to think. After a while, he tells Amy, "My first weighing is

{1,2,3,4} vs {5,6,7,8} If they balance, the problem can be solved using a decision tree." He then describes his decision tree

({1,2,3,4} vs {5,6, 7,8}) If {1,2,3,4}

= {5,6, 7,8}: {9} = {10}:

({9} vs {10})

({ 1} vs { 11 }) { { 1} = {11} : 12 is fake { 1} # { 11} : 11 is fake {9} # {10}: ({ 1} vs {9 }) { { 1} = {9} : 10 is fake {1} # {9}: 9 is fake

"You are absolutely correct," Amy says. "Unfortunately, this is only the beginning. What if they don't balance at the first try?" "Well, I haven't figured it out yet. If you give me some more time to think about it, I might be able to solve it." "Okay, see you tomorrow. Don't forget to bring your answer!" When they meet the next day, Amy suspects Ben has already found a solution based on his happy expression. "How is it going?" Amy inquires. "Finally! The most important idea that wise man gave me was to not weigh all coins. If they balance, we can turn our attention to the remaining coins. Another thing I noticed is that on the new problem, the strategy is not to determine which group is heavier or lighter, but who causes the balance to shift-"

122

4.6.

BALANCE PuzzLE

"Why don't you just tell me how you do it?" Amy wants to see the answer first. "Let us continue from yesterday's result." Ben then drew his decision tree on paper. Assume {1,2,3,4} > {5,6,7,8} (the case {1,2,3,4} < {5,6,7,8} can be solved symmetrically):

{1,6, 7, 8} = {5, 10, 11, 12}: {2} = {3}: 4 is fake

({2} vs {3}) { {2} > {3}: 2 is fake {2} < {3}: 3 is fake {1,6, 7, 8} > {5, 10, 11, 12}: {1, 6, 7, 8} vs {5, 10, 11, 12}

({ 1} vs { 12}) { { 1} = {12} : 5 is fake {1} > {12}: 1 is fake {1,6, 7, 8} < {5, 10, 11, 12}: {6} = {7}: 8 is fake

({6} vs {7}) { {6} < {7}: 6 is fake {6} > {7}: 7 is fake Ben's strategy is to divide 1, 2, • • •, 8 by 3 parts: 1 and 5 remain in their original pans; 6, 7 and 8 are moved from the right pan to the left pan; and 2, 3 and 4 are removed from the balance. To make the balance work, he places three "standard" coins on the right pan (10, 11 and 12). There are three possible outcomes. If they balance, the counterfeit coin is one of 2, 3 or 4; if it remains the previous status (" > "), the counterfeit coin did not change its position (1 or 5); if the balance changes its previous status (from" > " to " < "), the counterfeit coin has changed its position (6, 7 or 8). As a result of the second weighing, the search size is reduced to 3 or 2. The final weighing is straightforward. "Well done!" Amy is supporting Ben. "I'm also curious about how the wise man fared. "Ben adds. "As far as I can tell, the strategy is similar, though he used different orders." "I suppose the king has nothing to say this time except to pardon the wise

4.6.

BALANCE PuzzLE

123

man." "You underestimate the king. He was also very intelligent. Let me finish the story for you." · · · The wise man finished his presentation about his solution and bowed before the king. The king's harsh expression, however, remained unyielding. "The problem you solved is at an ordinary person's level. To obtain my forgiveness, you, so-called wise man, must solve a more difficult problem. This is your chance. You make a list of your weighing orders. You cannot go back in time. You tell me which one is the counterfeit coin after three weighings." "Oh no! The king was resolute in his decision to kill him. How could he possibly determine which coins to weigh in the second round without any information from the first?" Ben feels sympathy for the wise man. "Do you want to try for this difficult one?" Amy inquires. "No. I believe the last one is the best I can do. You are unable to create a decision tree at this time. I don't think this is even possible. Maybe the king gave him an unsolvable problem. " "You will be surprised. Let's see how the wise man responded." The wise man quietly took a pen and numbered each coin. Then he scribbled down the weighing procedure on paper. After a few minutes, the paper was presented to the king. It looked like this: {1,2, 3,4} vs {5,6, 7, 8} {1,2, 5, 9} vs {3,4, 10, 11} {3, 7, 9, 10} vs {1,4, 6, 12} The king then directed a waiter to perform the weighing in accordance with the wise man's instructions. As everyone could see, the results of three weighings were "left side heavier", "right side heavier" and "even." All eyes were now on the wise man. The wise man bowed slowly in front of the king and said, "The counterfeit coin must be number 5, which is lighter, your Majesty!"

124

4.6.

BALANCE PuzzLE

The king ordered a check, and the results were in: the wise man was correct, the number 5 coin was fake and lighter!

"Amazing! What's the gimmick here?" Ben is excited and wants to find why. "I understand. The heavier sides on the first and second weighings were the left and right, respectively." Amy explains. "This implies that either 3 or 4 was heavier; symmetrically, the lighter sides were the right and left, so 5 could be lighter. The fake coin was not participating the third weighing because it was even. As a result, the only viable option was number 5 coin." They also look for other coins as well. For example, if number 1 is heavier, then the weighing results must be the left, left and right (heavier). No other coin can produce these results. Amy and Ben get excited and set their next challenge - - to figure out how to make such a "weighing plan". The issue is becoming clear as a result of the discussion. Each weighing must result in one of three outcomes: "left side heavier", "right side heavier", or "even". Let us refer to them as L,R, and E, respectively. For example, the event series RRL denotes that the first and second weighing results are both right side heavier, while the third is left side heavier. The goal is to identify a special coin based on three events. There are total 3 • 3 • 3 = 27 possible outcomes. On the other hand, there are total 24 possible solutions: "1 is lighter", "2 is lighter", • • •, "12 is lighter", "1 is heavier", "2 is heavier",•••, "12 is heavier". Let us call them IL, 2L, • • • , 12L, IH, 2H, • • • , 12H. It should be noted that if "n is heavier" can be identified by an event series, then "n is lighter" must be identified by its "mirror" series. For example, if LRE means "2 is heavier," then RLE must mean "2 is lighter." The key to success is to establish a one-to-one mapping between the set of possible solutions and the set of event series. The latter has 27, of which we must remove 3. Because EEE denotes that some coin is never weighted, even if it is identified, we have no idea whether it is lighter or heavier. It should be removed. In addition, a pair of mirror event series, such as RRR and LLL, must be eliminated. We only need to define a one-to-one mapping between IH, 2H, • • •, 12H and 12 event series, where no mirror pair appears, to take advantage of symmetry . For example, if we select LRL, then RLR is not selected. To make the balance work, the number of event series beginning with the letter L must equal the number of event series beginning with the letter R. The second and third letters are subject to the same restrictions. This can be adjusted by switching between two mirror events. The right side of Figure 4.8 shows an example of such a

4.6.

125

BALANCE PuzzLE

mapping. L

R -

-

/

-

/

1

-----

/

/

I I I

,'

I I

/

I

/

I

/ /

I

/

I

/

1

'?

I

/ /

/

,, I

/

I

)'

-----,'

I

I

I

I

1

lH -+LLR 2H -+LRR 3H --tRLE 4H --tRER 5H -+ELE 6H -+ERR 7H -+LLE SH -+LRL 9H -+REL lOH-+ REE llH--tERL 12H-+EEL

Figure 4.8: Making a weighing plan

The weighing plan becomes simple after we define a mapping between the set of possible solutions and the set of event series. Figure 4.8 shows that 1 is already put on the pans according to the mapping 1 -+ LLR, and 2 is going to be on the pans: left, right, and right. Finally, we have the following "weighing plan":

{1, 2, 7, 8} vs {3,4, 9, 10} {1,3,5, 7} vs {2,6,8, 11} {8,9, 11, 12} vs {1,2,4,6}

Exercises 1. Create your own "weighing plan" for 12 coins.

2. Identify the counterfeit coin among 6 coins in 2 weighings. You are also told that number 1 is a genuine gold coin. 3. In some cases, a decision tree can be helpful in determine the best strategy. You could use the Tic-Tac-Toe game to practice making the decision tree. Assume you are the first player ("x"). Then you have

126

4.7.

TIME COMPLEXITY IN PROBLEM SOLVING

Figure 4.9: A decision tree for playing Tic-Tac-Toe three options: taking a corner, an edge or the center. The decision tree begins here. Figure 4.9 shows an incomplete tree, which you will finish. To make the tree more efficient, we eliminate symmetric choices. If one move leads to a guaranteed winning path, we eliminate the other moves as well. By completing this decision tree, you will determine the best strategy for playing this game as the first player. If you are the second player, your goal is to tie the game rather than

win, assuming your opponent is not the worst player.

4.7

Time Complexity in Problem Solving

Amy and Ben are playing a new game today. They take white paper and cut it into 20 small square pieces. Then they write a positive integer on each square at random. Amy's task is finding a way to divide them into two groups so that the sum of the numbers in each groups is the same, while Ben's role is to ensure Amy's work is correct. Of cause, there is a chance that the solution does not exist, such as if the sum of all 20 numbers is an odd number. Amy has never played this game before. The first thought that comes to mind is "sorting." She shorts these 20 numbers from smaller to larger and alternatively distributes them into the two groups , which may be a fair way to separate. The outcome is disappointing - two groups are far apart, because the sum of the second group is always greater, or much greater, than

4.7.

TIME COMPLEXITY IN PROBLEM SOLVING

127

the sum of the first. Amy then takes a different approach, which she refers to as "pairing." She joins two numbers if they appear close and makes ten pairs, then divides each pair into two groups. Unfortunately, this method is still ineffective. Even after switching them several times, the results are never satisfactory. Ben says he's going to do something else and will return later. Amy recognizes that this problem is not as simple as it appears, and she requires a new approach. Amy finally succeeds after many failed attempts, though it takes a long time. Let the 20 numbers they wrote be a1,a2, · · · ,a20, and M = Ef~ 1 a;. The goal is is to find a subset of these 20 numbers so that the sum of all numbers in the subset is M /2. The important thing Amy needs to know is that given any subset, what numbers can this subset create by addition. Let S; be the set of numbers that {a1, a2, •••,a;} can generate. Assume the numbers in the problem look like {5, 1, 9, 12- •-},then {5} creates S1 = {0,5} {5, 1} creates S2 = {0,5, 1,6} {5, 1,9} creates S3 = {0,5, 1,6,9, 14, 10, 15} {5, 1, 9, 12} creates S4 = {0,5, 1,6, 9, 14, 10, 15, 12, 17, 13, 18,21, 26,22, 27} The number O is always added to the right side (meaning no number is chosen). We can see from the preceding list how to write the next number set from the previous one. It is divided into two parts: the first is the previous set, and the second is formed by adding the new number to each number in the previous set. Of course, it should be discarded if the resulting number is a duplicate or greater than M /2. If a number equaling M /2 is discovered during the process, we conclude that there is a partition that solves the problem, and a solution can be found by backward tracing. In the preceding example, if M /2 = 18, we know the solution set is 12, 1, 5 for 18 = 12+6 = 12+ 1 +5. Ben has returned to confirm Amy's solution. "That is correct. You spent over an hour looking for a solution, while I only took two minutes to verify." After finishing, Ben says. "This problem is simple to verify (the solution), but difficult to solve." Amy responds. People use the term "easy" to describe a task that can be completed quickly. In computer science, this means that it can be completed in "polynomial time," which means that the time is in O(f(n)), where f(n) is a

128

4.7.

TIME COMPLEXITY IN PROBLEM SOLVING

polynomial and n is the input size. Otherwise, the task is described as "hard." So far, we've described two types of problems: those that are simple to solve and those that are simple to verify the solution for. The former, such as the searching problem, is known as a P-problem, while the latter, such as the partition problem, is known as an NP-problem. "NP" stands for "nondeterministic polynomial time," which means you can guess a solution and verify it in polynomial time. We also use the notations P and NP to refer to the corresponding problem sets. Obviously, P g(a), or there is ax E (a,b) such that g(x) < g(a). If the former is true, then the Extreme Value Theorem (Theorem 2.1.3) states that there is a c E ( a, b) such that g( c) is the maximum value of g on [a, b]. According to theorem 5.1.4, g'(c) = 0. Similarly, we arrive at the the same conclusion if the latter is true. □

One might wonder why the conditions in the theorem are required. To demonstrate this, consider the following simple counterexamples. Let h1(x) = x, which is continuous on [0, 1] and differentiable on (0, 1), but h1 (0)-=/- h1 (1). Clearly, (x) = 1 for all x E (0, 1). As another example, define xifx-=/-1 h2 () X = { 0ifx= 1

h;

h2 is differentiable on (0, 1) and h2(0) = h2(l), but h2 is not continuous on [0, 1]. We also have that h;(x) = 1 for all x E (0, 1).

5.1.

RATES AND DERIVATIVES

143

Consider this: starting frorn borne, a car drove straight and eventually returned borne. According to Rolle's Theorem, the velocity of this car rnust have been zero at sorne point. A rnore general conclusion can be obtained by extending x in the Mean Value Theorem to a function g(x). Augustin-Louis Cauchy proved this. Theorem 5.1.7 (Cauchy's Formula). Let functions f and g be continuous on [a,b] and differentiable on (a,b), and g'(x)-/- Ofor all x E (a,b). Then

there is a number w E ( a, b) such that f(b)- f(a) g(b) - g(a)

J'(w) g'(w)

(5.5)

Proof First, we note that g(a)-/- g(b), because otherwise there would be a c E ( a, b) such that g' (c) = 0 according to Rolle's Theorem. We define a function h(x) = (f(b) - f(a))g(x) - (g(b) - g(a))f(x) It is obvious that h(a) = h(b). Since his continuous on [a,b] and differentiable on (a,b), andaccordingtoRoll's Theorem, there is anurnberw E (a,b) such that h' (w) = 0. That is,

(f(b)- f(a))g'(w)- (g(b)-g(a))J'(w) = 0 This is equivalent to equation (5.5).



When g(x) = x, g(a) = a and g(b) = b. This is exactly the Mean Value Theorem. In rnany cases, a function can be compounded (nested) by two or rnore simpler functions. The derivatives of this type of function can be found using a very useful tool known as "the Chain Rule." To understand how it works, let's start with a simple example. An object A is moving counterclockwise around a circle with radius r. What is the velocity function of the projection of A on the x-axis if the angular speed is a constant k? Let z be the x-axis projection of A. Then z is a function of 0: z = rcos(0). And 0 is also a function of tirne t: 0 =kt

144

5.1.

RATES AND DERIVATIVES

y

z

Figure 5.4: An example of applying the Chain Rule

Before we get started, consider the following theorem.

Theorem 5.1.8 (The Chain Rule). If y dy du derivatives du and dx exist, then dy dx

=

f(u) and u = g(x), and both

= dy. du= J'(u)g'(x) du dx

Proof. Let Ax be an increment of x. Then we have the corresponding Au= g(x+Ax) - g(x) and

Ay = f(g(x+Ax))- f(g(x)) Since g(x) is differentiable at x, it is continuous at x. Thus

Ax-t O =;,- g(x+Ax) By definition,

dy dx

. Ay 1Im ~---+OAx



g(x) =;,- Au ➔ 0

5.1.

RATES AND DERIVATIVES

= lim Ax---+O

145

(LiLiuy. Liu) Lix

Liy) ( 1l. mLiu) Liu Ax---+O Lix . Liy) ( hm. Liu) = ( InnAu---+O Liu Ax---+0 Li.x -

. ll( 1l Ax---+0

_ dy ·du _ J'( ug ) '(X ) -du dx

This completes the proof.



We can now solve the problem which we stated earlier. The projection's velocity is dz= dz• d() = (-rsin0)(k) = -rksin(kt) dt d0 dz

Exercises 1. A ladder is 10 feet long, with one end A touching the wall and the other end Bon the floor (Figure 5.5). If Bis moving to the left at a

speed of 2 ft/ sec, what is the speed of A towards the ground when A is 8 feet above the ground?

+-- B Figure 5.5: A ladder is resting against a vertical wall

146

5.1.

RATES AND DERIVATIVES

2. Answer the same question as in Exercise 1. In this case, however, the wall is not perpendicular to the ground. Instead of the rectangle, the wall is shaped as a right trapezoid. Figure 5.6 shows all dimensions. 2

+-- B 3

Figure 5.6: A ladder is resting against a sloped wall

,,,,

,,

------30

Figure 5. 7: Pouring water into a bucket

5.1.

147

RATES AND DERIVATIVES

3. A water-filled bucket has the shape of a truncated cone. It is 30 inches tall. The radii of the top and bottom circles are 20 inches and 10 inches, respectively. The water level in the bucket is half its height. If the speed of water flow from the tap is 10 in3 / sec, what is the speed at which the water level raises at this moment? 4. An ellipse is defined by the equation x2

a2

y2

+ b2 = 1

a) A line AB is tangent to the ellipse in the first quadrant and intersects the y-axis and x-axis at A and B, respectively (Figure 5.8). What is the shortest length AB can have? b) The ellipse intersects y and x-axis at C and D, respectively. Pis a point on the ellipse in the same quadrant with CD (Figure 5.8). What is the largest possible area for l:,.DCP? y

Figure 5.8: The shortest tangent line and the largest triangle

5. Define a function ifx#0 ifx=0 a) Prove that f(x) is continuous everywhere; b) Find the derivative for f(x), including case x # 0 and x c) Show that f' (x) is not continuous at 0.

= 0;

148

5.2.

5.2

PRODUCTS AND INTEGRALS

Products and Integrals

From equation (5.1) we have d=vt

(5.6)

In other words, the displacement is the product of the (average) velocity and time. We left the question at the beginning of this chapter: could we find the displacement if we had instantaneous velocities all the way instead of an average velocity? The area of a rectangle is the product of its length and width. A=lw

y

a

b

Figure 5.9: Area under a curve

(5.7)

Can we still find its area if one of its sides is replaced by a curve? Equivalently, assume a function f(x) ~ 0 is defined on [a,b] (Figure 5.9). If f(x) is constant on [a,b], then the area under y = f(x) (and above xaxis) from a to b is f(a)(b- a). What is the area under y = f(x) if f(x) is not constant, such as

f(x) =x2-?

In the differentiation process, we first use approximation through average rates, which are simpler, and then take the limit. A function could be complex in this case, but we can partition it and approximate each part with a simple function. Like some solar systems (Figure 5.10), it reflects the sunlight into a single point. A parabolic surface would be ideal. In practice, the surface is formed by many small plane mirrors which are much easier to make. To put it another way, it is "piecewise linear." Assume f(x) is continuous on [a, b]. ltis important to note thatitis a closed interval rather than (a, b).

Figure 5.10: Piecewise linear

5.2.

149

PRODUCTS AND INTEGRALS

This assumption is sufficient to express the idea we are working on. We may later relax the conditions for general cases. The idea is to divide the area undery = f(x), say A, into many pieces and replace the function with a simple linearfunctiononeachpiece. (Figure5.ll). If we divide interval [a,b] evenly into n parts (so called regular partition), a= co < c1 < c2 < ••• < Cn = b, and draw a vertical line through each point, we get a partition for A: A 1 , A 2, • • • , An. The area of each piece is approximated by the area of a trapezoid, Tk.

Tk =

1

b-a

2(f(ck_i) + f(q))-n-

Then repeat the same process with more pieces, • • •. As n -+ oo, the length of each subinterval on the x-axis goes to zero. We obviously hope that the approximations approach A. It is written as lim

n

1

b-a

L, -2 (f(ck_i) + f(q))- =A

n--+oo k=l

n

(5.8)

y

An ' '--------'---'-----'------'---..__---'------'------+ X

co

Figure 5 .11: The limit of area sum is the area under the curve

Clearly, Yk

1

= 2(f(ck_i) + f(ck)) is between f(ck_i) and f(ck)- Ac-

cording to the futermediate Value Theorem, (see Appendix) there exists a

150

5.2.

PRODUCTS AND INTEGRALS

wk E [ct-1, ct] such that f(wk)

b-a

= Yk. Let Ax= - - . We need to confirm: n

(5.9)

Before we proceed, we will broaden the definition of Wk to include any number in the subinterval [ck-t,ck]- This means we'll be proving a more general case. Let Mk= max{J(x)lx E [ct-1,ctl} and mk = min{J(x)lx E [q_ 1, ct]} for each k, 1 :S k :S n. Because

we have mkAx::; f(wk)Ax :S MkAx

Add all together for k = 1, 2, • • • , n, n

n

n

[, mkAx::; [, f(wk)Ax :S [, MkAx k=l k=l k=l

If we can show that the leftmost and rightmost terms go to the same limit as Ax ➔ 0, then the middle term has the same limit as well, according to the Squeeze Theorem. Is it sufficient to simply show that the difference between the leftmost and rightmost terms approaches zero? No. (For example, consider: sinn - 1/n < sinn < sinn + 1/n). However, since A is also bounded by these two terms, n

n

k=l

k=l

L, mkAx :S A :S L, MkAx and A is a constant, it suffices to show that the difference between two ends approaches zero. Let n

hn =

n

L, MkAx- L, mkAx = k=l

k=l

n

Ax

L, (Mk -

mk)

(5.10)

k=l

We need to show that hn ➔ 0 as Ax ➔ 0. In other words, for a given£ > 0, we can find a D > 0 such that hn < e whenever Ax< D. Since Ax is proportional to 1/n, it suffices to show that Lk=l (Mk-mk) < ne. It may appear to be true because, as long as Ax sufficiently small, Mk - mk < e since f is continuous. Here is the problem: The number D we find depends not only on £, but also

5.2.

PRODUCTS AND INTEGRALS

151

on a specific x E [a,b]. Compare the following two properties off to better understand this concept: (1) For x E /, for any e > 0, there exists a o > 0 such that for any y E /,

lx-yl< o ⇒ IJ(x)- f(y)I< e

(2) For any e > 0, there exists a o > 0, such that for any x,y E /,

lx-yl< o * IJ(x)- f(y)I< e

where I is the domain off. You are not alone if you are perplexed at this point. Let's see how Ben and Amy discuss these properties. "I don't get it," Ben says. " Except for the order in which they are stated, they appear to be similar." "It appears to me that if property (1) holds, then for any x, a o can be found, but it does not state that there is a o that works everywhere on I. If property (2) is true, such a o exists. Perhaps we should find an example that meets (1) but not (2)."

"We can take temperature t as a function of locations," Ben says later, " it is continuous: if you fix any point in space, the temperature difference between this fixed point and any other point can be as small as you ask if the distance between two points is small enough. In other words, if you give me 'e degree', I can find a 'o meter', such that for any pointy, lt(x) - t(y) I< e, as long as y is not more than o meter away from x. If we take another point x', the same o may not work, perhaps a smaller o is required. In an infinite space, we cannot find an uniform o that works everywhere." "Good, except I'm not sure the last statement holds true for the universe." "I believe this is correct, but I have no way of proving it." "I have an idea. What is the opposite of property (2)? That is, for some e, no matter how small is, you can always find somewhere that Ix - YI< but IJ(x) - f(y)I> e. So, what about f(x) = x2 ? Let's see what happens, for X > 0,

o

o

lf(x) - J(y)I> (x+ o)2-x2 = 2xo + 0 2 Do you see it? The right side can always be greater than 1 if I choose a large enough x -I meant you can't find a o that works everywhere." "Right, you allow x to be arbitrarily large. If we let x be bounded, this may never happen••• Wait a second, it can still happen for some functions: Consider f(x) = 1/x, which is continuous on (0, 1). As x approaches 0, the

152

5.2.

PRODUCTS AND INTEGRALS

slope of the tangent line goes to infinity. This means that, according to the mean value theorem, If (x) - f (y) I can be greater than any number if Ix - YI is fixed (less than o) and x is close enough to 0. 11

You may now have a better understanding of property (1) and (2) for continuous functions as a result of their discussions. Property (1) means "f is continuous at any point on /, and Property (2) means "f is uniformly continuous on I. Clearly, the conditions for uniform continuity are stronger because the choice of o depends solely on epsilon. Ben believes that the function f(x) = 1/x is not uniformly continuous on (0, 1); the reader may complete the proof as an exercise. Returning to the previous discussion on (5.10), uniform continuity is exactly what we require here. Fortunately, since f(x) is continuous on a closed interval, it is uniformly continuous on this interval. More information is available in the Appendix for interested readers. Now we'll finish the proof. 11

11

Using the uniform continuity of f(x) on [a,b], we can say that for any

e > 0, there exists a natural number N, such that for any n >Nanda partition which evenly divides [a,b] into n subintervals, (or, equivalently, there exists a o > 0, such that if Ax < o), e b-a

IMk-mkl < - wherekE {1,2,--·,n}. Thus b-a

hn

=-

n

L,(Mk-mk)

n k=l b-a n

e 0, such that

lf(x) - g(x)l:S lf(x) -h(x)lfor all a- D< x < a+ D Theorem 5.6.2. The graph ofy = f(x) has a tangent line lat A= (a,f(a)) if and only if f' (x) exists at a and is equal to the slope of l.

Proof. Assume that line l is tangent to the graph of f(x) at A= (a,f(a)) with slope m. We can write the equation for l as follows: g(x) =f(a)+m(x-a) We need to prove this: lim f(x) - f(a) x-a

x-+a

=m

180

5.6.

APPENDIX

For any £ > 0, we define two lines that pass through A with slopes m - £ and m +£,respectively (Figure 5.27): h1(x) =f(a)+(m-e)(x-a) and h2(x) =/(a)+(m+e)(x-a)

y

I

I I

I

y= f(x)

---~~ --a ----------x a-8 Figure 5.27: Tangent line By definition, there is D > 0 such that 1/(x)-g(x)I:::; lf(x)-h1(x)I and 1/(x)-g(x)I:::; lf(x)-h2(x)I for all a-8 0 such that for all O
1 on (0.5, 1). The answer to the problem is as follows : if p = 0.5 or p = 1 (unlikely), the two systems are equally good; if p < 0.5, the judge-only system is superior; if p > 0.5, the jury system is superior.

Exercises 1. There are 10 students in the class. What are the chances that two

students in the class share the same birthday? 2. You enroll in a class of 50 students. What is the probability that another student shares your birthday?

226

7.4.

GEOMETRIC PROBABILITY. BUFFON'S NEEDLE

3. There are 128 men's singles players and 128 women's singles players competing in the Wimbledon tennis tournament. The tournament employs a seeding system to avoid having the top players compete against each other in the early rounds. What is the chance that the second-best player gets the runner-up title if we assume that the best player can always win against the other players and the second-best player can always win against all other players except the best player, and that the schedule is made by a random pick with no seeding priority? 4. You are taking part in a party game. A bucket is filled with marbles, one-fifth of which are green and four-fifths of which are red. You pick a marble at random and continue until you have two consecutive green marbles--you win and receive the gift; or you have two consecutive red marbles--you are out and the next person begins to play. The marble will be returned to the bucket after each pick. What is your chance of winning?

7.4

Geometric Probability: Buffon's Needle

This question was posed by French mathematician Georges-Louis Leclerc, Comte de Buffon. Assume we have a wood floor. They are parallel strips of the same width w. What is the probability that a needle of length d (d ~ w) will lie across a line between two strips if we drop it onto the floor? r r

a

I

- - - -.- - - - - - - - - - - - - - r - - - -

Figure 7.4: A coin lands within a square

7.4.

227

GEOMETRIC PROBABILITY. BUFFON'S NEEDLE

These types of probability questions involve geometry, also known as Geometric Probability which was first studied in 18th century. Let's start with a simpler question. Suppose we have a floor tiled with congruent squares. What is the probability that a small coin will land within a single square if we throw it? If the length of each side of a square is a and the radius of the coin is r, the probability in the question is (a - 2r) 2 / a 2 , considering the ratio of overall "favorite" to "unfavorite" area. This is because the position of the coin is solely determined by its center. (We do not care about either heads or tails, or any orientations). Figure 7.4 shows a tile square and a square formed by dashed lines. The coin lands within this tile if and only if the center lands on its inner square. The probability is then simply the ratio of the areas of the two squares. Now we return to Buffon's problem. Unlike a disk, the orientation of the needle also matters. Assume the width of each strip is w and the length of the needle is d, as shown in Figure 7.5. Two factors will determine the outcome of a trail: The position of the needle's lower end and the needle's orientation, which is indicated by an angle, 0. The first step in solving the problem is to consider the probability under the condition that 0

n = 2 (vertical). In this

w-d case, the probability that the needle will not touch the line is - - . So w w-d d the probability that the needle will lie across a line is 1 - - - = - . If 0

w

w

= 0, then the probability in the question is O if we neglect the thickness

of the needle. These are two extreme cases. In general, 0 is between 0 and n. The needle has a projection on the vertical axis, say d'. Clearly d' = d • sin( 0). Note that the needle lying across a line is equivalent to that the projection lies across the line. Therefore, if 0 is fixed, the conditional .. . . . . d' d-sin(0) . probab1hty that the needle will he across a lme 1s - = - - - . Smee

w

w

the variable 0 is distributed evenly on [0, n], the density function for 0 is 1/n. An intuitive way to think about this is to divide [0, n] into n parts: 0o, 01, (h, ... , 0n, where 0o = 0, 0n = n and 0;- 0;-1 = A0 for i = l,2, ... ,n. A0 The probability that 0;-1 :