709
Calculus and Modeling for the Biological, Health, and Earth Sciences Brent Young Version 4.1

Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Calculus and Modeling for theBiological, Health, and Earth Sciences

Brent Young

Version 4.1

Page 2: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Acknowledgements

I would like to thank all of the members of the Wilkes University Departmentof Mathematics and Computer Science for their unfailing support. I wouldespecially like to thank Drs. John Harrison, Fanhui Kong, Fred Sullivan, andPeggy Sullivan for reading this text and making so many helpful suggestions.I am also deeply indebted to Peggy Sullivan who, in addition to thoroughlyreading the entire book, provided the portions of the appendix dealing withthe TI83/84 and the answers to selected exercises. Finally, I would like tothank all of students at Wilkes University who have read through the materialand pointed out numerous typos and mistakes.

i

Page 3: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Prerequisites

This text was developed from lecture notes for a one semester course in ap-plied mathematics focusing on the use of mathematics to describe and predictthe behavior of systems that occur in nature – especially systems arising inthe biological sciences. As such, this text is intended for an audience that hascompleted a traditional one semester course in differential and integral calcu-lus. In particular, the text assumes familiarity with basic function concepts,properties of the usual transcendental functions (exponential, logarithmic,and trigonometric functions), as well as standard results about differentia-tion and integration (up to and including integration by substitution).

ii

Page 4: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Contents

Acknowledgements i

Prerequisites ii

Contents iii

0 Introduction 1

1 Discrete Dynamical Systems 51.1 Introduction to Discrete Dynamical Systems . . . . . . . . . . 51.2 Cobweb Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . 121.3 Equilibria and Stability . . . . . . . . . . . . . . . . . . . . . . 191.4 Stability and the Derivative . . . . . . . . . . . . . . . . . . . 271.5 Examples of Discrete-Time Dynamical Systems . . . . . . . . 31

1.5.1 The Mutant vs. Wild-Type Model . . . . . . . . . . . 311.5.2 A Simple Disease Model . . . . . . . . . . . . . . . . . 351.5.3 A Simple Model of the Heart . . . . . . . . . . . . . . 381.5.4 The Discrete Logistic Map . . . . . . . . . . . . . . . . 47

1.6 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

2 Techniques of Integration 592.1 Integration by Substitution . . . . . . . . . . . . . . . . . . . . 602.2 Integration by Parts . . . . . . . . . . . . . . . . . . . . . . . 642.3 Integration by Partial Fraction Decomposition . . . . . . . . . 722.4 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

3 Applications of Integration 833.1 Areas Between Curves . . . . . . . . . . . . . . . . . . . . . . 833.2 Volumes of Solids of Revolution . . . . . . . . . . . . . . . . . 95

iii

Page 5: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CONTENTS iv

3.3 Improper Integrals . . . . . . . . . . . . . . . . . . . . . . . . 1083.3.1 Type I Improper Integrals . . . . . . . . . . . . . . . . 1083.3.2 Type II Improper Integrals . . . . . . . . . . . . . . . . 118

3.4 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

4 Continuous Dynamical Systems 1244.1 Introduction to Differential Equations . . . . . . . . . . . . . . 1244.2 Solutions to Differential Equations . . . . . . . . . . . . . . . 1264.3 Separable Differential Equations . . . . . . . . . . . . . . . . . 1294.4 First Order Linear Differential Equations . . . . . . . . . . . . 1354.5 Application: Newton’s Law of Cooling . . . . . . . . . . . . . 1394.6 Application: Selective Diffusion . . . . . . . . . . . . . . . . . 1434.7 Application: Exponential Growth and Decay . . . . . . . . . . 1484.8 Application: Logistic Growth . . . . . . . . . . . . . . . . . . 1534.9 Application: Single Compartment Mixing . . . . . . . . . . . . 1594.10 Autonomous Differential Equations, Equilibria, and Stability . 167

4.10.1 Equilibria of Autonomous Differential Equations . . . . 1684.10.2 Phase Lines and Stability . . . . . . . . . . . . . . . . 1704.10.3 Equilibria and Stability for Important Autonomous Equa-

tions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1804.11 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184

5 Systems of Autonomous Differential Equations 1895.1 Equilibria and Nullclines . . . . . . . . . . . . . . . . . . . . . 1905.2 Stability of Equilibria . . . . . . . . . . . . . . . . . . . . . . . 1965.3 Predator–Prey Models . . . . . . . . . . . . . . . . . . . . . . 2055.4 Competing Species Models . . . . . . . . . . . . . . . . . . . . 2095.5 Disease Modeling . . . . . . . . . . . . . . . . . . . . . . . . . 215

5.5.1 The SIR Model . . . . . . . . . . . . . . . . . . . . . . 2155.5.2 The SIRS Model . . . . . . . . . . . . . . . . . . . . . 2185.5.3 The SEIR Model, Covid-19, and Social Distancing . . . 222

5.6 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229

6 Discrete Probability 2336.1 Introduction and Basic Terminology . . . . . . . . . . . . . . . 2336.2 Discrete Random Variables . . . . . . . . . . . . . . . . . . . . 2386.3 Independent Events . . . . . . . . . . . . . . . . . . . . . . . . 2426.4 Basic Combinatorics and the Computation of Probabilities . . 245

Page 6: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CONTENTS v

6.5 Conditional Probability and the Law of Total Probability . . . 2556.6 Application: The Hardy–Weinberg Principle . . . . . . . . . . 2656.7 Bayes’ Formula and Medical Testing . . . . . . . . . . . . . . 2716.8 Expected Value, Variance, and Standard Deviation . . . . . . 2806.9 A Catalog of Important Discrete Random Variables . . . . . . 286

6.9.1 The Bernoulli Random Variable . . . . . . . . . . . . . 2866.9.2 The Binomial Random Variable . . . . . . . . . . . . . 2876.9.3 The Geometric Random Variable . . . . . . . . . . . . 2916.9.4 The Poisson Random Variable . . . . . . . . . . . . . . 294

6.10 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298

7 Continuous Random Variables 3057.1 Probability Density Functions . . . . . . . . . . . . . . . . . . 3067.2 Expected Value, Variance, and Standard Deviation . . . . . . 3177.3 A Catalog of Important Continuous Random Variables . . . . 324

7.3.1 Uniform Random Variables . . . . . . . . . . . . . . . 3257.3.2 Exponential Random Variables . . . . . . . . . . . . . 3287.3.3 Beta Random Variables . . . . . . . . . . . . . . . . . 3327.3.4 Normal Random Variables . . . . . . . . . . . . . . . . 341

7.4 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348

8 A Primer on Matrices and Vectors 3538.1 Systems of Linear Equations . . . . . . . . . . . . . . . . . . . 354

8.1.1 Basic Results for Systems of Linear Equations . . . . . 3558.1.2 Augmented Matrices and Row Reduction . . . . . . . . 3608.1.3 Reduced Row Echelon Form . . . . . . . . . . . . . . . 366

8.2 Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3708.3 Linear Independence . . . . . . . . . . . . . . . . . . . . . . . 3778.4 Matrices as Linear Transformations of Vectors . . . . . . . . . 3818.5 Inverse Matrices and Determinants . . . . . . . . . . . . . . . 3948.6 Eigenvalues and Eigenvectors . . . . . . . . . . . . . . . . . . 4078.7 Transposition and Eigenvalues . . . . . . . . . . . . . . . . . . 4248.8 Diagonalization . . . . . . . . . . . . . . . . . . . . . . . . . . 4268.9 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432

8.9.1 Systems of Linear Equations . . . . . . . . . . . . . . . 4328.9.2 Basics of Vectors and Matrices . . . . . . . . . . . . . . 4338.9.3 Inverse Matrices and Determinants . . . . . . . . . . . 4358.9.4 Eigenvalues and Eigenvectors . . . . . . . . . . . . . . 436

Page 7: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CONTENTS vi

8.9.5 Diagonalization . . . . . . . . . . . . . . . . . . . . . . 436

9 Analysis of Linear Systems 4379.1 Linear Systems of Differential Equations . . . . . . . . . . . . 437

9.1.1 Homogeneous Systems with Real Eigenvalues . . . . . 4419.1.2 Homogeneous Systems with Complex Eigenvalues . . . 4459.1.3 Solutions to Inhomogeneous Systems . . . . . . . . . . 451

9.2 Application: Multiple Compartment Mixing Problems . . . . . 4599.3 Application: Spring–Mass Systems . . . . . . . . . . . . . . . 4659.4 Analysis of 2 ˆ 2 Homogeneous Systems . . . . . . . . . . . . 4719.5 Partial Derivatives and Linearization of Non–linear Systems . 482

9.5.1 Partial Derivatives . . . . . . . . . . . . . . . . . . . . 4829.5.2 Linearization . . . . . . . . . . . . . . . . . . . . . . . 484

9.6 Analysis of Particular Models . . . . . . . . . . . . . . . . . . 4919.6.1 The Predator–Prey Model . . . . . . . . . . . . . . . . 4919.6.2 The Competing Species Model . . . . . . . . . . . . . . 4939.6.3 The SIR Model . . . . . . . . . . . . . . . . . . . . . . 4979.6.4 The SIRS Model . . . . . . . . . . . . . . . . . . . . . 4999.6.5 Chemostats . . . . . . . . . . . . . . . . . . . . . . . . 502

9.7 A Word on Chaotic Systems . . . . . . . . . . . . . . . . . . . 5069.8 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514

10 Discrete–Time Stochastic Processes 52210.1 Markov Chains . . . . . . . . . . . . . . . . . . . . . . . . . . 52410.2 The Chapman–Kolmogorov Equations . . . . . . . . . . . . . 52910.3 Transient and Recurrent States . . . . . . . . . . . . . . . . . 53610.4 Application: The Gambler’s Ruin Problem . . . . . . . . . . . 54210.5 Properties of Transition Matrices . . . . . . . . . . . . . . . . 55010.6 Limiting Probabilities . . . . . . . . . . . . . . . . . . . . . . . 56010.7 Application: Shape of Epithelial Cells . . . . . . . . . . . . . . 56710.8 Random Walks . . . . . . . . . . . . . . . . . . . . . . . . . . 571

10.8.1 Random Walks in One Dimension . . . . . . . . . . . . 57210.8.2 Random Walks in Two Dimensions . . . . . . . . . . . 57710.8.3 Random Walks in Three and Higher Dimensions . . . . 585

10.9 Markov Chain Monte Carlo Methods . . . . . . . . . . . . . . 58810.10Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603

Page 8: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CONTENTS vii

Appendix A Complex Numbers 610A.1 Basic Operations . . . . . . . . . . . . . . . . . . . . . . . . . 612A.2 The Fundamental Theorem of Algebra . . . . . . . . . . . . . 617A.3 Euler’s Formula and Polar Form . . . . . . . . . . . . . . . . . 619A.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623

Appendix B Basic Derivatives and Integrals 625

Appendix C Positive Infinite Series 628C.1 Definitions of Sequences and Series . . . . . . . . . . . . . . . 628C.2 Geometric Series . . . . . . . . . . . . . . . . . . . . . . . . . 630C.3 Positive Series . . . . . . . . . . . . . . . . . . . . . . . . . . . 632

Appendix D Standard Normal Probabilities 637

Appendix E TI–83/84 and TI–89 Material 639E.1 Cobweb Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . 639

E.1.1 Cobweb Plots on the TI–83/84 . . . . . . . . . . . . . 639E.1.2 Cobweb Plots on the TI-89 . . . . . . . . . . . . . . . . 641

E.2 Piecewise Functions . . . . . . . . . . . . . . . . . . . . . . . . 646E.2.1 Piecewise Functions on the TI–83/84 . . . . . . . . . . 646E.2.2 Piecewise Functions on the TI–89 . . . . . . . . . . . . 649

E.3 Producing Vector Plots on the TI–89 . . . . . . . . . . . . . . 653E.4 Probability . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657

E.4.1 Probability on the TI–83/84 . . . . . . . . . . . . . . . 657E.4.2 Probabilty on the TI–89 . . . . . . . . . . . . . . . . . 659

E.5 Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664E.5.1 Matrix Operations on the TI–83/84 . . . . . . . . . . . 664E.5.2 Matrix Operations on the TI–89 . . . . . . . . . . . . . 668

Appendix F Answers to Selected Exercises 678F.1 Chapter 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678F.2 Chapter 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680F.3 Chapter 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681F.4 Chapter 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681F.5 Chapter 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683F.6 Chapter 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684F.7 Chapter 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685

Page 9: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CONTENTS viii

F.8 Chapter 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687F.9 Chapter 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690F.10 Chapter 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693

Bibliography 695

Index 697

Page 10: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Chapter 0

Introduction

The unifying topic in this text is the concept of dynamical system. Adynamical system is any mathematical model which attempts to predict thechanges in some object (or objects) over time. The object under study isassumed to have some number of states that it can be in at any given time(typically labeled by some set of numbers), and the job of the dynamicalsystem is to predict the future state of the object given its past history.

As an example, suppose we are interested in modeling the populationsize of some group of animals. The first thing to do is to give a nameto the quantity we want to model. So, we let P ptq represent the size ofthe population at time t. In the real world, the population of a group ofanimals is a natural number, N “ t0, 1, 2, 3, 4, . . .u, while the time t can beany real number (the real numbers are given the symbol R). Quite often,we are interested in the size of the population after some initial time whichwe typically (and arbitrarily) label as t “ 0. In such a case, the time is anon-negative real number (the set of which is represented by Rě0), and ourdynamical system is modeled by a function of the form

P : Rě0 Ñ N.

In words, it is a function taking a non-negative real number (the current time)as an argument and returning a natural number (the size of the population).Quite often, we make the simplifying assumption that the population size canalso be any positive real number; this allows us to think of our populationmodel as a function

P : Rě0 Ñ Rě0.

1

Page 11: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 0. INTRODUCTION 2

While it would be silly to say there are 410,605.73 animals in a group, thisconvenient fiction will allow us to apply some powerful mathematical toolsto the problem.

As another example, suppose we want to model the speed of a skydiverfalling from an airplane. Let vptq be the function which returns the speed ofthe skydiver t seconds after leaving the plane. Since speeds are non-negativereal numbers, our function in this case is clearly

v : Rě0 Ñ Rě0.

In other words, our speed function takes a non-negative real number (thecurrent time) as an argument and returns a non-negative real number (thespeed of the skydiver).

Notice that in both cases we need two types of information to make anyprogress. First, we need to know how the current state and the past historyof the system determines its state for future times. We will have much moreto say about this later. We also need to know the actual state of the systemfor some amount of time in the past. In many cases, the future state of thesystem is completely determined once we know its state at one arbitrary time(typically the state at time t “ 0). This type of information is referred to asinitial data for the dynamical system.

So far, all we have done is give a name to the quantity we want to study.Quite often, we only have indirect information about how the system willevolve with time. For instance, we may know that a certain populationdoubles in size every 5 hours (think bacteria). In the case of the skydiver, weknow that gravity near the surface of the earth causes an object to accelerateat a nearly constant rate; in other words, we have information about thederivative v1ptq rather than having direct information about vptq. Our goalwill be to develop tools that allow us to predict the future state of a systemgiven these indirect sorts of information.

Before diving in, we need to discuss some basic terminology. Dynami-cal systems can be divided into categories depending on how future statesare influenced by past states and on how we view time. If the future stateof the system is completely determined by its past history, we say that thedynamical system is deterministic. If the past history only tells us theprobability that the system will be in some future state, we say that thesystem is stochastic (think of stochastic as a fancy word for random). Ourprevious examples, the population which doubles every 5 hours and the sky-diver falling from an airplane, were both deterministic. An example of a

Page 12: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 0. INTRODUCTION 3

stochastic dynamical system would be the outcome of throwing a fair, six-sided die. We will focus on deterministic dynamical systems in the early partof the book. After a discussion of the basics of probability, the text ends witha discussion of some basic stochastic systems. As a note, we usually refer todeterministic dynamical systems simply as dynamical systems (only addingthe word “deterministic” for emphasis). If we wish to talk about systemswith some degree of randomness, we always add the descriptor “stochastic.”

The next natural division of dynamical systems depends on how we in-corporate time into the system. In many systems, time can take on any valuefrom the non-negative real numbers. In such a case, we say that the systemis a continuous-time dynamical system. The model of a skydiver fallingfrom an airplane is clearly a continuous dynamical system as the time, t,since the diver left the plane can be any real number in the range 0 ď t ă 8.On the other hand, in many systems it is natural to treat time as comingin discrete, integer amounts, i.e. t “ 0, 1, 2, 3, 4, . . . . For the population thatdoubles every 5 hours, it would be natural to mark time in 5 hour periods.So, t “ 1 would indicate the end of the first 5 hour period, t “ 2 wouldindicate the end of the second 5 hour period (so 10 hours since the start ofthe experiment), etc. If time is treated as an integer quantity, the system issaid to be a discrete-time dynamical system.

These basic divisions give us four types of dynamical systems:

1.) Discrete-Time (Deterministic) Dynamical Systems: dynamicalsystems which are deterministic and for which time comes in integeramounts.

2.) Continuous-Time (Deterministic) Dynamical Systems: dynam-ical systems which are deterministic and for which time can be anypositive real number.

3.) Discrete-Time Stochastic Dynamical Systems: dynamical sys-tems which have some degree of randomness and for which time comesin integer amounts.

4.) Continuous-Time Stochastic Dynamical Systems: dynamicalsystems which have some degree of randomness and for which timecan be any positive real number.

Stochastic dynamical systems (discrete or continuous) are also referred to asstochastic processes. In this text, we will have something to say about the

Page 13: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 0. INTRODUCTION 4

first three of these types of dynamical systems. The last type (continuous-time stochastic processes) requires the use of some rather sophisticated math-ematical tools and is beyond the scope of this introductory text.

The material in this book can be covered in many different orders. Tomake charting a course to particular material easier, the chapter dependenciesare diagrammed below.

Chapter 1 Chapter 2

Chapter 3

Chapter 4

Chapter 5

Chapter 6

Chapter 7

Chapter 8

Chapter 9Chapter 10

Discrete Dynamical Systems

Probability andStochastic Processes

Integration andContinuous Dynamical Systems

Matrices

Figure 0.0.1: Chapter Dependencies

Page 14: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Chapter 1

Discrete Dynamical Systems

1.1 Introduction to Discrete Dynamical Sys-

tems

Recall that a discrete-time dynamical system is a deterministic dynam-ical system where time is assumed to come in integer amounts. In otherwords, we can assume that t is a natural number (t “ 0, 1, 2, 3, 4, . . .). It iscustomary to write qt for the state of the system at time t instead of qptqwhen t is an integer. Also, since t is assumed to be a natural number, weoften write qn where n “ 0, 1, 2, 3, . . . rather than qt.

Since the system is deterministic, it must be possible to predict the futurestate in terms of its past history. This means that the state one step in thefuture, qn`1, must be a function of the present state and possible some of thestates that came before: qn, qn´1, qn´2, . . . , q0. It could also be a function ofthe time n. As such, there must be an updating function which tells uswhat the next state will be:

qn`1 “ f pn, qn, qn´1, qn´2, . . . , qn´mq .

Notice that the updating function only depends on the current state, qn,together with a fixed number of past states (qn´1, ¨ ¨ ¨ , qn´m). While wecould imagine a circumstance where the next state depends on the entire pasthistory, that would make the mathematical description far more challenging.

Example 1.1.1 (The Fibonacci Numbers). Consider the discrete-time dy-namical system with updating function

qn`1 “ qn ` qn´1

5

Page 15: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 6

and initial dataq0 “ 0 and q1 “ 1.

We get the following list of values

q0 “ 0

q1 “ 1

q2 “ q1 ` q0 “ 1` 0 “ 1

q3 “ q2 ` q1 “ 1` 1 “ 2

q4 “ q3 ` q2 “ 2` 1 “ 3

q5 “ q4 ` q3 “ 3` 2 “ 5

q6 “ q5 ` q4 “ 5` 3 “ 8

q7 “ q6 ` q5 “ 8` 5 “ 13

...

Note that the updating function for the Fibonacci numbers does not directlydepend on the time n, but the next state depends on the current state aswell as the state one unit of time in the past. �

Example 1.1.2. Consider the discrete-time dynamical system with updatingfunction

qn`1 “ n` qn ` qn´1,

and initial dataq0 “ 0 and q1 “ 1.

We get the following list of values

q0 “ 0

q1 “ 1

q2 “ 1` q1 ` q0 “ 1` 1` 0 “ 2

q3 “ 2` q2 ` q1 “ 2` 2` 1 “ 5

q4 “ 3` q3 ` q2 “ 3` 5` 2 “ 10

q5 “ 4` q4 ` q3 “ 4` 10` 5 “ 19

q6 “ 5` q5 ` q4 “ 5` 19` 10 “ 34

q7 “ 6` q6 ` q5 “ 6` 34` 19 “ 59

...

Page 16: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 7

Just as with the Fibonacci numbers, the updating function depends on thecurrent state as well as the state one unit of time in the past. However, thisupdating function directly depends on the current time! �

In order to keep the mathematics tractable, we will only consider a specialclass of discrete-time dynamical systems. First, we will assume that ourdynamical system is autonomous which means that the time variable t orn does not appear explicitly in the updating function. This restricts theupdating function to the form

f “ fpqn, qn´1, . . . , qn´mq.

The dynamical system giving the Fibonacci Numbers is an example of anautonomous system while the second example above is not.

Second, we will assume that our discrete-time dynamical system is mem-oryless. This means that the future state qn`1 can only depend on the cur-rent state qn (and so the updating function can only depend on qn). Memory-less systems are often described as systems where the future depends on thepast only through the present. Notice that neither of our first two examplesis memoryless (since they depend on both the current and previous value ofthe system).

Example 1.1.3. Consider the dynamical system given by

qn`1 “ 3qn ` n,

q0 “ 1.

Notice that this system is memoryless but not autonomous. The systemtakes on the following values:

q0 “ 1

q1 “ 3q0 ` 0 “ 3p1q ` 0 “ 3

q2 “ 3q1 ` 1 “ 3p3q ` 1 “ 10

q3 “ 3q2 ` 2 “ 3p10q ` 2 “ 32

q4 “ 3q3 ` 3 “ 3p32q ` 3 “ 99

... �

Page 17: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 8

In general, an autonomous, memoryless discrete-time dynamicalsystem is a dynamical system of the form

qn`1 “ fpqnq

q0 “ some initial value

Since this is the only type of discrete-time dynamical system we will considerin this text, we will simply call them discrete-time dynamical systems fromthis point forward.

Example 1.1.4. Consider the dynamical system given by

Ln`1 “ 2Ln ´ 1

L0 “ 3.

The system takes on the following values:

L0 “ 3

L1 “ 2L0 ´ 1 “ 2p3q ´ 1 “ 5

L2 “ 2L1 ´ 1 “ 2p5q ´ 1 “ 9

L3 “ 2L2 ´ 1 “ 2p9q ´ 1 “ 17

L4 “ 2L3 ´ 1 “ 2p17q ´ 1 “ 33

... �

For some discrete-time dynamical systems, it is possible to find a directformula for qn`1 without referencing the updating function. This can beuseful for answering certain questions about future values of the system.

Example 1.1.5. Consider the following dynamical system.

qn`1 “ 3qn,

q0 “ 1.

Looking at the values of the system, we see a pattern:

q0 “ 1 “ 30

q1 “ 3q0 “ 3p1q “ 3 “ 31

q2 “ 3q1 “ 3p3q “ 9 “ 32

q3 “ 3q2 “ 3p9q “ 27 “ 33

q4 “ 3q3 “ 3p27q “ 81 “ 34

...

Page 18: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 9

This suggests (and it can be shown to be true) that

qn “ 3n. �

Example 1.1.6. Consider the dynamical system from Example 1.1.4:

Ln`1 “ 2Ln ´ 1

L0 “ 3.

To see a pattern, we try to get a formula using L0

L0 “ 3

L1 “ 2L0 ´ 1 “ 2p3q ´ 1 “ 5

L2 “ 2L1 ´ 1 “ 2p2L0 ´ 1q ´ 1 “ 4L0 ´ 3 “ 9

L3 “ 2L2 ´ 1 “ 2p4L0 ´ 3q ´ 1 “ 8L0 ´ 7 “ 17

L4 “ 2L3 ´ 1 “ 2p8L0 ´ 7q ´ 1 “ 16L0 ´ 15 “ 33

...

What we see isLn “ 2nL0 ´ p2

n´ 1q. �

So far, all of our dynamical systems have been time reversible. Thismeans that given qn`1 we can recover qn. In other words, given the currentvalue of the system, we can figure out the value of the system in the previoustime step.

Example 1.1.7. Consider again the dynamical system from Example 1.1.5.If we know that q5 “ 54, we can determine q4 by solving q5 “ 3q4 for q4:

q4 “1

3q5 “

1

3p54q “ 18.

So q4 must have been 18. In general, we see that

qn “1

3qn`1. �

In this example, the fact that we can solve for qn in terms of qn`1 showsthat the system is time reversible.

Page 19: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 10

Example 1.1.8. Suppose in the dynamical system from Example 1.1.4 weknow that L6 “ 67. Solving the equation L6 “ 2L5 ´ 1 for L5 gives

L5 “1

2pL6 ` 1q “

1

2p67` 1q “ 34.

We can see that in general

Ln “1

2pLn`1 ` 1q. �

The next example is a famous dynamical system that is not time reversible(as well as the source of an unsolved mathematical conjecture).

Example 1.1.9. (The Collatz Function) Consider the function on the posi-tive integers given by

Cpxq “

"

12x, if x is even

3x` 1, if x is odd

So, even numbers are divided by two while odd numbers are multiplied bythree and then have a one added.

Consider the dynamical system whose states are positive integers andwhose updating function and initial data are given by

qn`1 “ Cpqnq

q0 “ 7.

Page 20: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 11

Then we get the following sequence of numbers

q0 “ 7

q1 “ Cp7q “ 3p7q ` 1 “ 22

q2 “ Cp22q “1

2p22q “ 11

q3 “ Cp11q “ 3p11q ` 1 “ 34

q4 “ Cp34q “1

2p34q “ 17

q5 “ Cp17q “ 3p17q ` 1 “ 52

q6 “ Cp52q “1

2p52q “ 26

q7 “ Cp26q “1

2p26q “ 13

q8 “ Cp13q “ 3p13q ` 1 “ 40

q9 “ Cp40q “1

2p40q “ 20

q10 “ Cp20q “1

2p20q “ 10

q11 “ Cp10q “1

2p10q “ 5

q12 “ Cp5q “ 3p5q ` 1 “ 16

q13 “ Cp16q “1

2p16q “ 8

q14 “ Cp8q “1

2p8q “ 4

q15 “ Cp4q “1

2p4q “ 2

q16 “ Cp2q “1

2p2q “ 1

Note that this system is not time reversible! Suppose that we knowqn`1 “ 16. Is it possible to determine what qn (the previous state) must havebeen? The answer is no – all we can say is qn “ 32 or qn “ 5 since these arethe only numbers that solve Cpnq “ 16. Without more information, we haveno idea which of these two possibilities was the actual previous state.

Page 21: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 12

In an unrelated note, the (in)famous Collatz Conjecture claims that nomatter what positive integer you choose for initial data, the dynamical systemabove will eventually reach the number 1. While this conjecture has beenstudied intensely since it was first posed in 1937 and a lot of evidence pointsto it being true1, no one has been able to completely prove or disprove it!�

1.2 Cobweb Plots

Before we study some specific discrete-time dynamical systems, we need aconvenient way to visualize the evolution of the system. Perhaps the easiestway to display the dynamical system is simply to plot the points pn, qnq asdots in the xy-plane. Such a graph is referred to as a sequential plot.

Example 1.2.1. Consider the discrete-time dynamical system given by

qn`1 “ 2qn ´ 1

q0 “ 2

The first few values of the system are

q0 “ 2,

q1 “ 3,

q2 “ 5,

q3 “ 9,

q4 “ 17,

q5 “ 33.

This gives us the following list of ordered pairs:

p0, 2q; p1, 3q; p2, 5q; p3, 9q; p4, 17q; p5, 33q.

If we plot these points, we obtain the plot below.

1Every number between 2 and roughly 1020 has been tried an initial datum. In everycase, the system eventually reaches 1.

Page 22: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 13

Figure 1.2.1: Sequential Plot for Example 1.2.1

While a sequential plot seems the most natural way to display the evo-lution of a discrete-time dynamical system, it turns out there is a bettermethod – a cobweb plot.

Page 23: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 14

Cobweb PlotsTo produce a cobweb plot of the system qn`1 “ fpqnq with some initial dataq0, we go through the following steps:

1.) Produce a plot displaying both y “ fpxq (a plot of the updating func-tion) and the line y “ x.

2.) Mark the value of q0 on the x-axis.

3.) Move vertically from q0 in the direction of the graph y “ fpxq, andstop once you intersect it. The y-value of the point you end at will beq1 “ fpq0q.

4.) Move horizontally in the direction of the graph y “ x, and stop onceyou intersect it. Both the x- and y-values of the point you end at willbe q1.

5.) Starting at the point from step 4.) (which will be pq1, q1q), move ver-tically towards y “ fpxq and then horizontally to y “ x. You will endup at the point pq2, q2q.

6.) Repeat the vertical and horizontal moves from step 5.) to build upq3, q4, q5, . . . for as many steps as needed or required.

Example 1.2.2. Consider the discrete-time dynamical system given by

qn`1 “ 2qn ´ 1

q0 “ 2.

To produce a cobweb plot of this dynamical system, we begin by graphingy “ 2x´1 (the updating function) together with y “ x. We plot the updatingfunction in blue below.

Page 24: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 15

Figure 1.2.2: First Step of Cobwebbing

Starting from x “ 2 (the value of q0), we move vertically until we intersectthe graph of the updating function, and then horizontally until we intersecty “ x.

Figure 1.2.3: Steps 2, 3, and 4 of Cobwebbing

Notice that the point we have stopped at is p3, 3q. This tells us thatq1 “ 3. Repeating the horizontal and vertical moves gives us the point p5, 5q,

Page 25: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 16

and so q2 “ 5.

Figure 1.2.4: Cobweb Plot up to q2

Repeating again, we wind up at the point p9, 9q which gives q3 “ 9.

Figure 1.2.5: Continuation of Cobweb Plot

We could continue this process to find q4, q5, etc.

Page 26: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 17

Example 1.2.3. As a second example, consider the discrete-time dynamicalsystem

qn`1 “1

5q3n ´ qn ` 1

q0 “ 2.

First, we plot y “ 15x3 ´ x` 1 and y “ x.

Figure 1.2.6: Setup for Cobweb Plot of Example 1.2.3

Starting at x “ 2, we move vertically to the graph of the updating func-tion and then horizontally to y “ x.

Page 27: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 18

Figure 1.2.7: First Step in Cobweb Plot of Example 1.2.3

This moves us to the point with x- and y-coordinates equal to q1 “35.

Moving from this point takes us to the point with x- and y-coordinates equalto q2 “

277625

.

Figure 1.2.8: Second Step in Cobweb Plot of Example 1.2.3

As we continue to build up the cobweb plots, the values of q3, q4, etc.continue to become more complicated rational expressions. However, thecobweb plot reveals some interesting behavior.

Page 28: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 19

Figure 1.2.9: Cobweb Plot of Example 1.2.3

It appears that the system is closing in on one of the points where theupdating function intersects y “ x. We will have more to say about this inthe next section!

Building up an accurate cobweb plot depends heavily on having a precisegraph of the updating function and y “ x. To avoid faulty conclusions frominaccurate graphs, cobweb plots are often generated by graphing calculatorsor mathematics software packages. Even with technology, care must be takenin interpreting results (especially with graphs where the axes have differentscales).

1.3 Equilibria and Stability

As we saw in Example 1.2.3, there is a special role played by points wherethe updating function crosses the line y “ x. These points are known asequilibria. More precisely, an equilibrium value of a dynamical system isany initial datum for the system such that the system remains at this valuefor all future times.

Example 1.3.1. Consider the discrete-time dynamical system given by

qn`1 “ 2qn ´ 1

q0 “ 1.

Page 29: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 20

Notice that

q0 “ 1,

q1 “ 2q0 ´ 1 “ 2p1q ´ 1 “ 1,

q2 “ 2q1 ´ 1 “ 2p1q ´ 1 “ 1,

q3 “ 2q2 ´ 1 “ 2p1q ´ 1 “ 1,

...

This shows that 1 is an equilibrium value of the system described by qn`1 “

2qn ´ 1 �.

It turns out there is a very simple way to find the equilibria of discrete-time dynamical systems.

Theorem 1.3.1 (Equilibria of Discrete-Time Dynamical Systems). A valueq˚ is an equilibrium of the discrete-time dynamical system qn`1 “ fpqnq ifand only if q˚ satisfies

q˚ “ fpq˚q.

In other words, the equilibria of a discrete-time dynamical system areprecisely the solutions to the equation x “ fpxq. The solutions to thisequation are also known as fixed points of the function f .Proof:Suppose that q˚ is a solution to x “ fpxq. Taking q0 “ q˚, we find

q0 “ q˚,

q1 “ fpq0q “ fpq˚q “ q˚,

q2 “ fpq1q “ fpq˚q “ q˚,

q3 “ fpq2q “ fpq˚q “ q˚,

...

and we see that q˚ is an equilibrium of the dynamical system.Now suppose that q˚ is an equilibrium value for the dynamical system.

Then for initial data q0 “ q˚, we must have all subsequent values q1, q2, etc.equal to q˚. In particular q1 “ fpq0q gives

q˚ “ fpq˚q,

which means that q˚ satisfies the equation x “ fpxq. �

Page 30: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 21

Example 1.3.2. The dynamical system

qn`1 “ 2qn ´ 1

has updating function fpxq “ 2x ´ 1. Setting this equal to x and solvinggives

2x´ 1 “ x

2x´ x “ 1

x “ 1,

which shows that the only equilibrium value for this system is 1. �

Example 1.3.3. The dynamical system

qn`1 “1

4q2n

has updating function fpxq “ 14x2. Setting this equal to x and solving gives

1

4x2“ x

1

4x2´ x “ 0

x

ˆ

1

4x´ 1

˙

“ 0,

giving equilibria values of q˚ “ 0 and q˚ “ 4. �

As we noted in the theorem, the equilibria of a dynamical system areprecisely the solutions to x “ fpxq. Graphically, these are the x-coordinatesof the intersection points of y “ fpxq and the line y “ x which we can clearlysee in the cobweb plot!

Consider the cobweb plot for the dynamical system in the example above.

Page 31: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 22

Figure 1.3.1: Cobweb Plot for Example 1.3.3

We have shown the plots for two different initial data – one just smallerthan the equilibrium at 4 and one just larger. Notice that both trajectorieslead away from the equilibrium. In this case, we say that the equilibriumq˚ “ 4 is unstable. The exact definition is a bit technical, but essentiallyan equilibrium point is unstable if there is a small interval centered on theequilibrium such that we can find initial data points arbitrarily close to theequilibrium (and on either side of it) whose trajectories eventually leave theinterval.

If we look at the equilibrium at q˚ “ 0, we see different behavior.

Page 32: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 23

Figure 1.3.2: Cobweb Plot for Example 1.3.3

The equilibrium at 0 is said to be asymptotically stable. In general, if ini-tial data sufficiently close2 to and on either side of an equilibrium point launchtrajectories that move closer to it, then the equilibrium is asymptotically sta-ble. In other words, all initial data relatively close to an asymptotically stableequilibrium give us sequences that converge to the equilibrium.

For both of the equilibria above, nearby initial data points moved eitherdirectly away or directly toward the equilibrium. Some equilibria have morecomplicated behavior. Consider again the equilibrium from Example 1.2.3.

2“Sufficiently close” is more than a little vague. It can be made precise using ε–δdefinitions similar to the formal definition of limits or more generally using the notion ofneighborhood from point-set topology.

Page 33: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 24

Figure 1.3.3: Cobweb Plot for Example 1.2.3

The equilibrium near 0.5 is asymptotically stable, but instead of movingdirectly toward the equilibrium value, the trajectory circles around it. Wesay that this equilibrium is an asymptotically stable spiral point.

The opposite behavior is also possible. Consider the dynamical systemgiven by

qn`1 “ 2´ q2n.

By solving the equation x “ 2´ x2, we find that the equilibria of the systemare q˚ “ ´2, 1. Looking at the equilibrium at 1 shows the following behavior.

Page 34: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 25

Figure 1.3.4: Cobweb Plot for qn`1 “ 2´ q2n

This type of equilibrium is an unstable spiral point.There are a few other types of equilibria to mention. If we consider the

dynamical system given by qn`1 “ 1 ´ qn, we see the following behavioraround the only equilibrium at q˚ “ 1

2.

Figure 1.3.5: Cobweb Plot for qn`1 “ 1´ qn

Notice that for any choice of initial data q0, the system cycles betweenq0 and 1´ q0, and the trajectory circles the equilibrium for all time without

Page 35: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 26

getting any closer to it. Such equilibria are said to be stable. More precisely,an equilibrium point is stable if for any interval centered on it all initial datasufficiently close to and on either side of it launch trajectories that stayin that interval for all future times. Technically speaking, asymptoticallystable equilibria are also stable equilibria. However, we should always useasymptotically stable in cases where all trajectories in some region aroundthe equilibrium get progressively closer to it.

Finally, the dynamical system qn`1 “ ´q2n`3qn´1 has a single equilibrium

at q˚ “ 1. If we look at trajectories on either side of the equilibrium, wefind that the system seems to be asymptotically stable from one directionbut unstable from another.

Figure 1.3.6: Cobweb Plot for qn`1 “ ´q2n ` 3qn ´ 1

An equilibrium is said to be semi-stable (or is sometimes called a node)if all initial data on one side of the equilibrium that are sufficiently closelaunch trajectories that leave the vicinity of the equilibrium while all suffi-ciently close initial data on the other side launch trajectories that approachthe equilibrium. For the example above, we could be more specific and saythat q˚ “ 1 is a semi-stable equilibrium which is asymptotically stable fromthe right and unstable from the left.

Page 36: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 27

1.4 Stability and the Derivative

Now that we have defined the various kinds of stability that equilibria canenjoy, we need to develop a test that will identify the type of equilibriumdirectly from the updating function. That is accomplished by the followingtheorem.

Theorem 1.4.1 (Stability of Equilibria in discrete-time dynamical Systems).Suppose that q˚ is an equilibrium of the discrete-time dynamical system

qn`1 “ fpqnq

(that is q˚ “ fpq˚q), and suppose that the updating function, f , is differen-tiable in some open interval containing q˚. Then the number f 1pq˚q can beused to classify the behavior near q˚. Specifically,

� if ´1 ă f 1pq˚q ă 1, q˚ is an asymptotically stable equilibrium;

� if f 1pq˚q ă ´1 or f 1pq˚q ą 1, q˚ is an unstable equilibrium;

� if f 1pq˚q “ ˘1, the test is inconclusive.

Moreover if f 1pq˚q ă 0, the system will exhibit spiraling behavior in the vicin-ity of the equilibrium. If f 1pq˚q ą 0, the values of the dynamical system willmove directly toward or away from the equilibrium depending on the size ofthe derivative. Note that equilibria that are semi-stable or stable without be-ing asymptotically stable can only occur when the derivative of the updatingfunction is ˘1.

A proof of this theorem can be found in [HK91, pp.73 – 75], and we willnot give a rigorous treatment here. Instead, we will offer a few diagramsthat will hopefully convince you that the theorem is true. While we will notlook at every possible scenario, we will examine the four primary cases of thetheorem.

From basic results in calculus, we know that near the equilibrium point,the updating function will be well approximated by its tangent line:

fpxq « fpq˚q ` f 1pq˚qpx´ q˚q.

So, we can convince ourselves that the theorem is correct by looking at linearfunctions with various slopes.

Page 37: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 28

Figure 1.4.1: Nearly Linear Behavior Near Equilibrium

Starting with a slope that is between 0 and 1 (i.e. 0 ă f 1pq˚q ă 1 ) wecan see that the behavior of the equilibrium will be asymptotically stablewithout spiraling.

Figure 1.4.2: Asymptotic Stability for 0 ă f 1pq˚q ă 1

Similarly, if the slope is greater than 1 (1 ă f 1pq˚q), we can see that the

Page 38: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 29

equilibrium is unstable (without spiraling).

Figure 1.4.3: Instability for f 1pq˚q ą 1

When ´1 ă f 1pq˚q ă 0, we can clearly see the asymptotically stablespiraling behavior.

Figure 1.4.4: Asymptotic Stability for ´1 ă f 1pq˚q ă 0

Similarly, the behavior when f 1pq˚q ă ´1 is clearly an unstable spiral.

Page 39: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 30

Figure 1.4.5: Instability for f 1pq˚q ă ´1

Note that when f 1pq˚q “ 0, the equilibrium will certainly be asymptoti-cally stable, but trajectories could either spiral inwards or move in directly.

We will now revisit a few of the dynamical systems from the previoussection.

Example 1.4.1. The dynamical system

qn`1 “ 2qn ´ 1

has updating function fpxq “ 2x ´ 1 and a single equilibrium at q˚ “ 1.Taking the derivative yields f 1pxq “ 2 and so in particular f 1p1q “ 2. Thus,q˚ “ 1 is an unstable equilibrium. �

Example 1.4.2. The dynamical system

qn`1 “1

4q2n

has updating function fpxq “ 14x2 and equilibria q˚ “ 0, 4. The derivative

of the updating function is f 1pxq “ 12x. Since f 1p0q “ 0, this equilibrium

must be asymptotically stable. For q˚ “ 4, f 1p4q “ 2 and this equilibrium isunstable. Note that these results confirm what we saw in the cobweb plot. �

Example 1.4.3. The dynamical system

qn`1 “ 2´ q2n

Page 40: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 31

has updating function fpxq “ 2´x2 and equilibria q˚ “ ´2, 1. The derivativeof the updating function is f 1pxq “ ´2x. Since f 1p´2q “ 4, this equilibriummust be unstable. For q˚ “ 1, f 1p1q “ ´2 and this equilibrium is an unstablespiral point. �

Example 1.4.4. The dynamical system

qn`1 “ ´q2n ` 3qn ´ 1

has updating function fpxq “ ´x2`3x´1 and an equilibrium at q˚ “ 1. Thederivative of the updating function is f 1pxq “ ´2x ` 3. Since f 1p1q “ 1, thederivative test is inconclusive. Fortunately, our earlier cobweb plot showedus that this equilibrium is semi-stable. �

1.5 Examples of Discrete-Time Dynamical Sys-

tems

Now that we have developed the tools to discuss and analyze discrete-timedynamical systems, we will examine a few systems that have some real worldsignificance.

1.5.1 The Mutant vs. Wild-Type Model

Example 1.5.1. We are interested in the population growth of two speciesof bacteria both living in the same culture. One group is the wild-type (thebacteria that are typically found in nature) which double in number every 6hours. The second group is a mutant strain which reproduce at a faster rate– tripling in size during the same 6 hour period. We will let bn be the size ofthe wild-type population and mn the size of the mutant population. Givenour data, we have

bn`1 “ 2bn

mn`1 “ 3mn

where n measures the number of 6 hour blocks of time since the beginningof the experiment.

It is rather unlikely that we will know exactly how many of each kindof bacteria we have. What we can more readily estimate is the fraction of

Page 41: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 32

bacteria that are mutants. Let pn be the fraction of the bacteria that aremutants at time n. That is

pn “number of mutants at time n

total bacteria at time n“

mn

bn `mn

.

Since pn is the fraction of the total population that are mutants, it is naturallyrestricted to the range 0 ď pn ď 1 (and so we can naturally think of it asmeasuring the percentage of the total population that are mutants). Notethat the fraction of wild-type bacteria must be 1´pn. Our job is to determinethe dynamical system describing pn, and the following calculations do justthat. In the first step, we use the separate dynamical systems for bn`1 andmn`1 above.

pn`1 “mn`1

bn`1 `mn`1

“3mn

2bn ` 3mn

“3mn

2bn ` 3mn

¨1{pbn `mnq

1{pbn `mnq

“3 pmn{pbn `mnqq

2 pbn{pbn `mnqq ` 3 pmn{pbn `mnqq

“3pn

2p1´ pnq ` 3pn

“3pn

2` pn

We see that the updating function for pn is given by

fpxq “3x

2` x.

Solving for the equilibria gives

3x

2` x“ x

3x “ p2` xqx

3x “ 2x` x2

x2´ x “ 0

xpx´ 1q “ 0

x “ 0, 1.

Page 42: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 33

This means that the only equilibria are p˚ “ 0 (the wild-type make up allof the population) or p˚ “ 1 (the mutants make up the entire culture). Thederivative of the updating function is

f 1pxq “6

p2` xq2.

Since f 1p0q “ 3{2, p˚ “ 0 is an unstable equilibrium. The other equilib-rium, p˚ “ 1, gives f 1p1q “ 2{3 and so is asymptotically stable. Hence, thepopulation will tend to be overwhelmed by the mutant strain as time goeson.

Note that this result is obvious given the circumstances of the problem.Namely, the mutants are reproducing at a faster rate than wild-type bacteria.Given that fact, we would imagine that given enough time the number ofmutants will be far larger than the number of wild-type. Note that this DOESNOT imply that the wild-type bacteria die out. In fact, both populationsare growing rapidly. It is simply that the mutants will be far more numerousin the long run. �

Having looked at a specific example, we want to examine this model inmore generality. Suppose now that

bn`1 “ rbn

mn`1 “ smn

where r and s are the (non-negative) growth rates of the two populations.These numbers are parameters, that is quantities which may vary fromsituation to situation but are considered to be constant in any particularversion of the system.

As before, let pn be the fraction of mutants in the total population (and

Page 43: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 34

again 0 ď pn ď 1). If we repeat our calculations, we find

pn`1 “mn`1

bn`1 `mn`1

“smn

rbn ` smn

“smn

rbn ` smn

¨1{pbn `mnq

1{pbn `mnq

“s pmn{pbn `mnqq

r pbn{pbn `mnqq ` s pmn{pbn `mnqq

“spn

rp1´ pnq ` spn

“spn

r ` ps´ rqpn.

The updating function we have found is

fpxq “sx

r ` ps´ rqx.

Finding the fixed points of this function gives

sx

r ` ps´ rqx“ x

sx “ pr ` ps´ rqxqx

sx “ rx` ps´ rqx2

´ ps´ rqx2` ps´ rqx “ 0

ps´ rqxp´x` 1q “ 0.

Notice that if r “ s, EVERY value of x is an equilibrium! In this case, themutant bacteria and the wild-type reproduce at exactly the same rate, andso the fraction of mutants stays constant for all time: pn “ p0.

Suppose that r ‰ s. In this case, there are only two equilibria for thesystem: p˚ “ 0, 1. As in our original example, the only possible equilibriaare the cases where the population is entirely wild-type (p˚ “ 0) or entirelymutant (p˚ “ 1). To determine stability, we need the derivative

f 1pxq “rs

pr ` ps´ rqxq2.

Page 44: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 35

Remember that r and s are parameters (and should be considered constantswhen taking the derivative). Substituting the equilibria values x “ 0 andx “ 1 gives

f 1p0q “s

r

f 1p1q “r

s.

Suppose that s ą r which means the mutants reproduce faster than thewild-type. In this case we see that 0 is unstable while 1 is asymptoticallystable. Again, this makes perfect sense. If the mutants reproduce faster,they will eventually overwhelm the population.

If s ă r, the mutants reproduce slower than the wild-type. Now 0 isasymptotically stable and 1 is unstable. In this case, the faster reproducingwild-type bacteria will out perform the mutants, and the population willeventually be dominated by wild-types.

1.5.2 A Simple Disease Model

There are a number of sophisticated disease models, and we will exploreseveral more throughout the text. For a first example, we will make thesimplifying assumptions that the size of the population being studied is notchanging and that there can only be healthy people and infected people.More complex models can account for changing population sizes as well asthe existence of people who are immune to the disease.

Example 1.5.2. There is a disease afflicting a population. While the num-bers of healthy and infected individuals change each month, we will assumethe total population size is constant. Each month, 25% of the infected recoverwhile 20% of the healthy population become infected. We wish to model thetotal fraction Pn of infected people in the population.

In this simple model, there are two types of people, healthy and infected.Let Hn be the total number of healthy people in the population and In be thetotal number of infected people in a given month n. The fraction of peoplethat are infected is therefore

Pn “In

Hn ` In.

Page 45: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 36

As in the previous section, 0 ď Pn ď 1 (and once again we can naturallythink of it as the percentage of people who are infected). Also, since thetotal population is assumed to be constant, we have

Hn`1 ` In`1 “ Hn ` In.

From the given information, we know that

In`1 “ 0.75In ` 0.2Hn

Hn`1 “ 0.25In ` 0.8Hn.

Note that these equations are consistent with the total population beingconstant.

Using this equation, we find

Pn`1 “In`1

Hn`1 ` In`1

“0.75In ` 0.2Hn

Hn ` In

“ 0.75

ˆ

InHn ` In

˙

` 0.2

ˆ

Hn

Hn ` In

˙

“ 0.75Pn ` 0.2p1´ Pnq

“ 0.2` 0.55Pn.

In the next to last step, we used the fact that the fraction of healthy peoplemust be 1´ Pn.

So, the updating function for this dynamical system is fpxq “ 0.2`0.55xgiving an equilibrium value of

0.2` 0.55x “ x

0.2 “ 0.45x

x “0.2

0.45“

4

9.

Since the derivative of the updating function is f 1pxq “ 0.55, we know thatthis equilibrium is asymptotically stable. This tells us that in the long run, weexpect 4{9 « 44.44% of the population to be infected each month. A diseasethat is present in a stable fraction of a population is said to be endemic tothe population. �

Page 46: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 37

As before, we want to generalize this example. Suppose now that r isthe fraction of infected people who recover from the disease while s is thefraction of healthy people who become infected. Both r and s are parametersin our model that lie between 0 and 1. We have

In`1 “ p1´ rqIn ` sHn

Hn`1 “ rIn ` p1´ sqHn,

and the total population is constant

In`1 `Hn`1 “ In `Hn.

Letting Pn be the fraction of the population that is infected and repeatingour calculation from above leads to

Pn`1 “In`1

Hn`1 ` In`1

“p1´ rqIn ` sHn

Hn ` In

“ p1´ rq

ˆ

InHn ` In

˙

` s

ˆ

Hn

Hn ` In

˙

“ p1´ rqPn ` sp1´ Pnq

“ s` p1´ r ´ sqPn.

The updating function is fpxq “ s` p1´ r´ sqx and the only equilibrium is

P ˚ “s

s` r.

The derivative of the updating function is f 1pxq “ 1´ r´ s. At one extreme,when r “ s “ 0, we have f 1pxq “ 1 and our derivative test is inconclusive.In this case, infected people never recover but healthy people never becomeinfected. At the other extreme, r “ s “ 1 implies f 1pxq “ ´1 (and we havean inconclusive case again). In this extreme case, EVERY infected personrecovers each time period. Simultaneously, EVERY healthy person becomesinfected.

In any reasonable case, 1 ´ r ´ s will lie between ´1 and 1 and theequilibrium will be asymptotically stable. If 1 ă r`s ă 2, the asymptoticallystable equilibrium will be a spiral point. In any interesting case, the diseasewill always be endemic to the population in this simple model.

Page 47: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 38

1.5.3 A Simple Model of the Heart

In this section, we will examine a fairly simplistic model of the heart whichnonetheless can predict certain cardiac conditions seen in patients. See[Ad13, pp. 126 – 131] for a more thorough discussion.

The heart’s pumping action is controlled by a complex electrical system.Part of the system, the sinoatrial node, provides “regular” pulses to theheart – acting as the body’s natural pacemaker. The actual pace set by thesinoatrial node (SA node) changes in response to a number of physiologicalconditions. For our purposes, we will assume the SA node is sending outregularly spaced pulses.

The second major part of the system is the atrioventricular node (AVnode). This nerve cluster has several jobs, but most importantly for us, itmonitors the condition of the heart and decides if it is ready to beat. In orderfor the heart muscle to contract, the voltage of the heart must be increasedto a sufficiently high level.3 In between beats, the heart needs to relax (i.e.the voltage must subside), and the AV node decides if the heart has relaxedenough to undergo the next beat. If the voltage has decreased enough bythe time of the next pulse from the SA node, the AV node allows the heartto beat. Otherwise, the AV node stops the heart from beating in order toprevent damage to the heart muscle.

Our simple model of the heart is as follows.

1.) The pulses from the SA node are assumed to be regular, and they willcorrespond to our discrete time steps n “ 0, 1, 2, 3, 4, . . .

2.) We will model Vn: the overall voltage of the heart muscle at the n-thpulse from the SA node.

3.) There is a critical voltage, Vc, such that if the voltage of the heartmuscle is below this value, the AV node will allow the heart to beat.Otherwise, the AV node prevents the heart from beating.

4.) In between beats, the voltage of the heart muscle decreases by a factorc, the relaxation rate, which is a number in the range 0 ă c ă 1. Thecloser this number is to 0, the faster the heart recovers. The closer itis to 1, the slower the heart is to relax.

3For our purposes, we will assume the heart simply contracts. The heart’s motion isactually more complex than this, but that will not matter for our purposes.

Page 48: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 39

5.) If the heart has relaxed enough to beat, the AV node causes the voltageof the heart to increase by an amount u, the beat voltage.

SA Node

(n “ 0, 1, 2, 3, . . .)AV Node

Vn`1 “

cVn ` u

BEAT

cVn ď Vc ?

Vn`1 “

cVn

SKIP

cVn ą Vc ?

These assumptions give us the following dynamical system

Vn`1 “

"

cVn, if cVn ą VccVn ` u, if cVn ď Vc

.

Example 1.5.3. Consider our simple heart model with parameters c “25, Vc “ 1, and u “ 1. Suppose that the initial voltage is V0 “ 1. This

gives us the dynamical system

Vn`1 “

$

&

%

25Vn, if 2

5Vn ą 1

25Vn ` 1, if 2

5Vn ď 1

V0 “ 1.

To determine V1, we first check the condition on 25V0:

2

5V0 “

2

5p1q “

2

5ă 1.

Since this is less than the critical voltage, Vc “ 1, the heart will beat and

V1 “2

5V0 ` 1 “

7

5.

Page 49: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 40

To determine V2, we check the condition on 25V1:

2

5V1 “

2

5

ˆ

7

5

˙

“14

25ă 1.

Since this is less than the critical voltage, the heart will beat and

V2 “2

5V1 ` 1 “

39

25.

Repeating this process, we can determine the voltage for as many pulses ofthe SA node as we wish. For example, since

2

5V2 “

2

5

ˆ

39

25

˙

“78

125ă 1,

the heart will beat. Thus

V3 “2

5V2 ` 1 “

203

125.

If we look at the cobweb plot for this dynamical system, we find

Figure 1.5.1: Cobweb Plot for Example 1.5.3

The upper branch of the updating function corresponds to the heart beat-ing (Vn`1 “ cVn ` u) while the branch in the lower right indicates that theheart skips a beat (Vn`1 “ cVn). Also notice that there is a single equilib-rium. We will revisit the existence of equilibria for this model a little later.�

Page 50: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 41

Example 1.5.4. Consider the heart model with the same parameters asabove: c “ 2

5, Vc “ 1, and u “ 1. But now suppose that the initial voltage is

V0 “ 3.Since

2

5V0 “

2

5p3q “

6

5ą 1,

the heart will skip a beat and

V1 “2

5V0 “

6

5.

Here, the heart was at too high a voltage initially, and the AV node forcedthe heart to skip a beat in order to give it more time to recover.

For the next step,

2

5V1 “

2

5

ˆ

6

5

˙

“12

25ă 1,

and so the heart will beat. This gives

V2 “2

5V1 ` 1 “

37

25.

Examining the cobweb plot shows that the heart will beat for every pulse ofthe SA node after the first one.

Figure 1.5.2: Cobweb Plot for Example 1.5.4

Page 51: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 42

We can clearly see that the heart skips the first beat since it first hits thelower right branch of the updating function. Thereafter, it always hits theupper left branch – which indicates regular beating. �

Example 1.5.5. Consider the heart model with parameters c “ 0.65, Vc “ 1,and u “ 1 with initial data V0 “ 1.75. We will present the values of the systemin a table.

Condition Check Vn Beat/Skip

V0 “ 1.750.65pV0q “ 1.1375 ą 1 V1 “ 0.65pV0q “ 1.1375 SKIP0.65pV1q « 0.7394 ă 1 V2 “ 0.65pV1q ` 1 « 1.7394 BEAT0.65pV2q « 1.1306 ą 1 V3 “ 0.65pV2q « 1.1306 SKIP0.65pV3q « 0.7349 ă 1 V4 “ 0.65pV3q ` 1 « 1.7349 BEAT0.65pV4q « 1.1277 ą 1 V5 “ 0.65pV4q « 1.1277 SKIP0.65pV5q « 0.7330 ă 1 V6 “ 0.65pV5q ` 1 « 1.7330 BEAT

From the table, we can see that the heart seems to be skipping every otherbeat! The cobweb plot confirms this.

Figure 1.5.3: Cobweb Plot for Example 1.5.5

When the heart is in a rhythm where every other pulse results in a skippedbeat, we say the heart is experiencing a 2:1 AV Block. �

Page 52: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 43

Before moving on, we should discuss equilibria for the heart model. Theupdating function is

fpxq “

"

cx, if cx ą Vccx` u, if cx ď Vc

.

In order to solve fpxq “ x, we have to examine each possible branch of theupdating function.

If cx ą Vc, then we would need

cx “ x,

but this is impossible unless x “ 0 (recall that 0 ă c ă 1). However x “ 0will certainly belong to the other branch! Hence, there is no equilibriumassociated to the branch where the heart skips a beat.

If cx ď Vc, we would then need cx` u “ x. This is easily solved to give

x “u

1´ c.

However, this will only be an equilibrium if this value of x satisfies the con-dition for this branch (i.e. the condition that the heart will beat). So, wewill need to check that

cu

1´ cď Vc.

Lemma 1.5.1. For the heart model with updating function

fpxq “

"

cx, if cx ą Vccx` u, if cx ď Vc

,

there will be an equilibrium at

V ˚ “u

1´ c

provided thatcu

1´ cď Vc.

Since the derivative of the updating function will be f 1pxq “ c on thebranch where the equilibrium occurs, the equilibrium must be asymptoticallystable if it exists.

Page 53: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 44

For our first two examples above, there is an equilibrium at

V ˚ “u

1´ c“

1

1´ 2{5“

5

3

becausecu

1´ c“

2

5

ˆ

5

3

˙

“2

3ď 1 “ Vc.

However, for the third model

V ˚ “u

1´ c“

1

1´ 0.65“

20

7

butcu

1´ c“ 0.65

ˆ

20

7

˙

« 1.8571 ą 1 “ Vc.

This means that there is no equilibrium for this set of parameters. Note thatany set of parameters will produce a possible equilibrium value, but you mustcheck the condition to ensure that the potential equilibrium value is actuallypresent in the system.

For our simple model of the heart, there are three generic types of behaviorwe can discern:

1.) If the system has an equilibrium, then eventually the heart will settleinto a steady rhythm where it beats on every pulse from the SA node.We will refer to this as steady rhythm.

2.) The system has no equilibrium, and eventually the heart settles intoa rhythm where it skips every other beat from the SA node. This isreferred to as a 2:1 AV Block.

3.) The system has no equilibrium. The heart eventually settles into arhythm where it will beat regularly for some number of beats and thensuddenly skip a beat. This is referred to as the Wenckebach Phe-nomenon.

We have already seen cases of steady rhythm and the 2:1 AV Block. Ourfinal example exhibits the Wenckebach Phenomenon.

Page 54: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 45

Example 1.5.6. Consider the heart model with c “ 0.5, u “ 1.5, and Vc “1.4. So, we have

Vn`1 “

"

0.5Vn, if 0.5Vn ą 1.40.5Vn ` 1.5, if 0.5Vn ď 1.4

.

If we check for an equilibrium, we find

u

1´ c“

1.5

1´ 0.5“ 3.

However, when we check the condition for the equilibrium to exist we find

cu

1´ c“

0.5p1.5q

1´ 0.5“ 1.5 ą 1.4 “ Vc.

So there is no equilibrium, but the condition is almost satisfied.Consider the cobweb plot for this system with V0 “ 2.

Figure 1.5.4: Cobweb Plot for Example 1.5.6

Notice that the updating function nearly intersects y “ x, but the jumpto the lower branch occurs just before the point of intersection. After thethird step in the cobweb plot, the system looks as though it is trying to limitto the point of intersection. However, the fourth step will result in a skippedbeat.

Page 55: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 46

Figure 1.5.5: Cobweb Plot for Example 1.5.6, continued

If we follow the system longer, we see that the heart will beat 3 times ina row and then skip a beat, and it will continue this pattern indefinitely.

Figure 1.5.6: Cobweb Plot for Example 1.5.6, continued

This is a typical example exhibiting the Wenckebach Phenomenon; asystem that nearly satisfies the condition for having an equilibrium can beatnormally for several pulses of the SA node but then skip a single beat whenit overshoots the discontinuity at V “ Vc{c which is just before the valuewhere the equilibrium would exist.

Page 56: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 47

1.5.4 The Discrete Logistic Map

The final discrete-time dynamical system we wish to discuss is the discretelogistic model also known as the logistic map. This is the dynamicalsystem with updating function

fpxq “ λxp1´ xq

where λ is a parameter in the range 0 ă λ ď 4.For the logistic map, we usually restrict our attention to the range

0 ď x ď 1. This is the primary reason for the range restriction on λ. Notethat the quadratic function ppxq “ xp1´ xq is non-negative over 0 ď x ď 1,that its graph is concave down over this interval, and that the function hasan absolute maximum at x “ 1{2. Moreover, pp1{2q “ 1{4.

Figure 1.5.7: Plot of y “ xp1´ xq

So, if we multiply p by any factor in the range 0 ă λ ď 4, we areguaranteed that the output of the function will lie between 0 and 1 if theinput is also between 0 and 1. Once we allow a factor that is negative orgreater than 4, an input of x “ 1{2 will lead to an output that is no longerin the range of interest.

Example 1.5.7. Consider the logistic map with parameter λ “ 2:

qn`1 “ 2qnp1´ qnq.

Page 57: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 48

If we look for equilibria, we find

2xp1´ xq “ x

2x´ 2x2“ x

x´ 2x2“ 0

xp1´ 2xq “ 0

x “ 0,1

2.

The first derivative of the updating function is f 1pxq “ 2´4x. Since f 1p0q “ 2,we know that q˚ “ 0 is an unstable equilibrium. The equilibrium at q˚ “ 1{2is asymptotically stable since f 1p1{2q “ 0. The cobweb plot below (usingq0 “ 0.05) clearly shows the behavior of both of these equilibria. �

Figure 1.5.8: Cobweb Plot for the Logistic Map with λ “ 2

Example 1.5.8. Consider the logistic map with parameter λ “ 5{2:

qn`1 “5

2qnp1´ qnq.

Page 58: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 49

If we look for equilibria, we find

5

2xp1´ xq “ x

5

2x´

5

2x2“ x

3

2x´

5

2x2“ 0

1

2xp3´ 5xq “ 0

x “ 0,3

5.

The first derivative of the updating function is f 1pxq “ 5{2 ´ 5x. Sincef 1p0q “ 5{2, we know that q˚ “ 0 is an unstable equilibrium. The equilibriumat q˚ “ 3{5 is an asymptotically stable spiral point since f 1p3{5q “ ´1{2.The cobweb plot below (using q0 “ 0.05) clearly shows the behavior of bothof these equilibria. �

Figure 1.5.9: Cobweb Plot for the Logistic Map with λ “ 5{2

What we would like to do is to classify the behavior of the system forany value of the parameter λ. We will only present partial results about thisreally fascinating dynamical system. For a more thorough discussion, see[Ro95, Chapter 2] and [HK91, pp. 92 – 100].

First, we find the equilibria for the logistic map.

Page 59: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 50

Lemma 1.5.2 (Equilibria of the Logistic Map). For the logistic map

qn`1 “ λqnp1´ qnq

with 0 ă λ ď 4, q˚ “ 0 is an equilibrium value for any choice of λ. For theparameter range 0 ă λ ď 1, 0 is the only equilibrium in the range of interest(0 ď x ď 1). For the range 1 ă λ ď 4, there is a second equilibrium in therange of interest at

q˚ “λ´ 1

λ.

Proof: Since the updating function is fpxq “ λxp1 ´ xq, the equilibriaare

λxp1´ xq “ x

λx´ λx2“ x

pλ´ 1qx´ λx2“ 0

x “ 0,λ´ 1

λ.

Since we only want to consider the range 0 ď x ď 1, the second equilibriumwill only be of interest when it is a positive number (note that it is necessarilyless than 1). So, the second equilibrium is of interest only when λ ą 1. �

Now that we have the equilibria, we need to classify them.

Lemma 1.5.3 (Stability of q˚ “ 0). For 0 ă λ ă 1, q˚ “ 0 is asymptoticallystable for the logistic map. For λ “ 1, q˚ “ 0 is semi-stable, but it is stablefrom the right (i.e. it is asymptotically stable over the interval of interest0 ď x ď 1). For λ ą 1, q˚ “ 0 is unstable for the logistic map.

Proof: The derivative of the updating function is f 1pxq “ λ ´ 2λx, andso f 1p0q “ λ. When 0 ă λ ă 1, the first derivative test for discrete-timedynamical systems tells us that 0 is asymptotically stable, and when λ ą 1,the test tells us it is unstable. The test is inconclusive for λ “ 1, but checkingthe cobweb plot in this case verifies the assertion of the lemma. �

Lemma 1.5.4 (Stability of q˚ “ pλ ´ 1q{λ). For the logistic map, the equi-librium at q˚ “ pλ ´ 1q{λ is asymptotically stable for the parameter range1 ă λ ď 3. Moreover, it is an asymptotically stable spiral point for 2 ă λ ď 3.For 3 ă λ ď 4, this equilibrium is an unstable spiral point.

Page 60: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 51

Proof: The first derivative evaluated at this equilibrium value is f 1pq˚q “2´λ. In order to have an asymptotically stable equilibrium, this value needsto be between -1 and 1.

´1 ă 2´λ ă 1

´3 ă ´λ ă ´1

1 ăλ ă 3.

The behavior at λ “ 3 can be confirmed by cobweb plot. As soon as λ ą 3,the equilibrium is definitely an unstable spiral point. To determine the rangewhere the equilibrium is an asymptotically stable spiral point, we need 2´λto be between -1 and 0.

´1 ă 2´λ ă 0

´3 ă ´λ ă ´2

2 ăλ ă 3.

The behavior at λ “ 2 can be confirmed by cobweb plot. �We can characterize these results in the table below:

Equilibria of the Logistic MapRange of λ q˚ “ 0 q˚ “ λ´1

λ

0 ă λ ď 1 Asymptotically Stable NONE1 ă λ ď 2 Unstable Asymptotically Stable2 ă λ ď 3 Unstable Asymptotically Stable Spiral3 ă λ ď 4 Unstable Unstable Spiral

The really interesting behavior in this system is in the parameter range3 ă λ ď 4. For these values of λ, there are no stable equilibria, but all qn aretrapped in the range 0 ď qn ď 1. This means the values of the dynamicalsystem can bounce around the interval r0, 1s in complex ways. In fact, whenλ ą 3.57, the system exhibits chaotic behavior.

Example 1.5.9. Consider the logistic map with λ “ 3.75. From our results,we know that q˚ “ 0 is unstable and q˚ “ 11{15 is an unstable spiral point.Consider the cobweb plot with q0 “ 0.1 out to 10 steps.

Page 61: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 52

Figure 1.5.10: Cobweb Plot for the Logistic Map with λ “ 3.75

We can see that there is a tension between the unstable equilibrium at 0and the one at 11/15. If we extend the plot to 50 steps, we can see that thedynamics are quite complicated.

Figure 1.5.11: Cobweb Plot for the Logistic Map with λ “ 3.75, continued

As we extend the cobweb plot for more and more steps, the dynamicsbegins to fill up a solid region of the plot.

Page 62: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 53

Figure 1.5.12: Cobweb Plot for the Logistic Map with λ “ 3.75, continued

This is a hallmark of chaotic dynamics. �

1.6 Problems

1.) Suppose that a discrete-time dynamical system is given by

qn`1 “3

2qn.

a.) If q0 “ 16, compute q1 through q4.

b.) Find a direct formula for qn in terms of q0. Use this formula topredict q15 when q0 “ 16.

c.) This system is time reversible. Find a formula for qn in terms ofqn`1.

d.) If q4 “ 81, find q0.

2.) Suppose that a discrete-time dynamical system is given by

Ln`1 “ 3Ln ´ 2.

a.) If L0 “ 2, compute L1 through L4.

b.) Find a direct formula for Ln in terms of L0. Use this formula topredict L10 if L0 “ 2.

Page 63: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 54

c.) This system is time reversible. Find a formula for Ln in terms ofLn`1.

d.) If L4 “ 163, find L0.

3.) Consider the dynamical system given by

pn`1 “ p2n

p0 “1

2

a.) Compute p1 through p4.

b.) Find a direct formula for pn in terms of n. Use this formula topredict p10.

c.) Is this system time reversible? If so, find a formula for pn in termsof pn`1.

4.) Consider the dynamical system whose updating function is the Collatzfunction (c.f. Example 1.1.9).

a.) If the initial data is q0 “ 4, find q1 through q5. Do you spota pattern? (You should find an example of what is known as a3-cycle.)

b.) Show that with initial data q0 “ 23, the system eventually entersthe 3-cycle you found in part a.). How many steps did it take toreach 1 the first time?

c.) Suppose the system is currently in state qn`1 “ 7. Is it possible touniquely determine qn? What if qn`1 “ 8?

5.) A population of bacteria is doubling every 10 hours. If we measure timein 10 hour blocks, and there are initially 500 organisms in the petri dish,how many 10 hour blocks until there are more than 1,000,000 of thebacteria? (Remember that the time must be an integer in this model.)

6.) In the absence of fishing, the population of trout in a lake will increaseby 50% every 2 years. In the same time period, 15,000 fish are removedby fishing. If the lake is stocked with 35,000 trout, what will the pop-ulation be in 20 years? What would happen to the population if thelake was stocked with only 25,000 fish?

Page 64: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 55

7.) Find and determine the stability of all equilibria for the dynamicalsystem given by

qn`1 “ 3qn ´ 1.

Produce a cobweb plot to verify the stability of each equilibrium.

8.) Find and determine the stability of all equilibria for the dynamicalsystem in problem 6.) above. Produce a cobweb plot to verify thestability of each equilibrium.

9.) Find and determine the stability of all equilibria for the dynamicalsystem given by

Ln`1 “1

2Ln p1´ Lnq .

Produce a cobweb plot to verify the stability of each equilibrium.

10.) Find and determine the stability of all equilibria for the dynamicalsystem given by

Mn`1 “Mn `5

10`Mn

Mn ` 1.

Produce a cobweb plot to verify the stability of each equilibrium.

11.) Find and determine the stability of all equilibria for the dynamicalsystem given by

Pn`1 “1

4P 3n ´

1

8P 2n `

3

4Pn `

1

8.

Produce a cobweb plot to verify the stability of each equilibrium.

12.) Consider the mutant vs. wild-type model. Suppose the mutants aredoubling every 5 hours while the wild-type population grows to 2.5times their size in the same period. If originally the population ismade up of 20% mutants, how long until the population is only 5%mutant.

13.) Consider the mutant vs. wild-type model. If the mutants are repro-ducing at half the rate of the wild-type, determine any equilibria forthe fraction of mutants and classify their stability.

Page 65: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 56

14.) Consider our simple disease model. Suppose that each time period80% of infected people recover while 25% of healthy people becomeinfected. At what fraction should the population be infected in thelong run? Do you expect the population to limit directly to this valueor oscillate around it?

15.) Consider our simple disease model. If the rate people recover from thedisease is double the rate healthy people become infected, what fractionof the population should be infected in the long run? For what values ofs will the equilibrium be an asymptotically stable spiral point? (HINT:What is the maximum allowable value of s?)

16.) A certain species of bird lives on two neighboring islands. Each year,30% of the birds on Island 1 migrate to Island 2 while 35% of the birdson Island 2 migrate to Island 1. Let Pt be the fraction of birds livingon Island 1 in year t. Assume that the total number of birds each yearis constant. Find the updating function for Pt and determine if thereare any equilibrium fractions for the system. Be sure to examine thestability of any equilibria you find.

17.) Consider the heart model with parameters c “ 0.75, u “ 0.75, andVc “ 2. Determine the long-term behavior of the system (i.e. classifyit as one of the three possibilities discussed for this model).

18.) Consider the heart model with parameters c “ 0.5, u “ 1, and Vc “ 2.Determine the long-term behavior of the system (i.e. classify it as oneof the three possibilities discussed for this model).

19.) Consider the heart model with parameters c “ 0.5, u “ 1.5, and Vc “ 1.Determine the long-term behavior of the system (i.e. classify it as oneof the three possibilities discussed for this model).

20.) One way to account for a change in the pace set by the SA node in theheart model is to allow the relaxation rate c to change over time. Infact, the relaxation time is given by

c “ e´ατ

where α is a positive parameter and τ is the time between pulses fromthe SA node.

Page 66: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 57

Suppose that for a given heart, the increase in voltage when the heartbeats is u “ 10 and the critical voltage is Vc “ 15. When the SA nodeis sending out pulses every 0.85 seconds, the relaxation rate is c “ 0.5.What is the shortest time between pulses from the SA node for whichthe system can exhibit a steady rhythm?

21.) Find and classify all equilibria in the range 0 ď x ď 1 for the logisticmap with parameter λ “ 3{2.

22.) Find and classify all equilibria in the range 0 ď x ď 1 for the logisticmap with parameter λ “ 18{5.

23.) The behavior of equilibria should reverse when time is reversed. Con-sider the dynamical system given by

qn`1 “2qn

1` 3qn

a.) Find all equilibria for this system and determine their stability.

b.) Find the time-reversed dynamical system. That is solve the sys-tem above for qn to find

qn “ f´1pqn`1q.

c.) Consider the discrete-time dynamical system with updating func-tion f´1 where f´1 was found in part b.). Verify that this systemhas the same equilibria as the original but that the stability resultshave been reversed.

24.) Consider the Ricker model which has updating function

fpxq “ rxe´x.

The parameter r is strictly positive.

a.) Find the equilibria for the system. You will get different answersfor different ranges of the parameter r.

b.) Classify the stability of the equilibria you found above (again, thiswill depend on the range of the parameter r). For any indetermi-nate cases, use cobweb plots to justify your answer!

Page 67: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 1. DISCRETE DYNAMICAL SYSTEMS 58

25.) Challenge: Consider the discrete-time dynamical system with updat-ing function

fpxq “ αx2p1´ xq.

a.) Determine the appropriate range of the parameter α that willguarantee an input in the range 0 ď x ď 1 will generate an outputin the same range.

b.) Find the equilibria for the system. Note that you will get differentresults for different ranges of the parameter α!

c.) Classify the stability of the equilibria you found above. For anyindeterminate cases, use cobweb plots to justify your answer!

Page 68: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Chapter 2

Techniques of Integration

Before we can move on to continuous dynamical systems, we need to intro-duce a couple of integration techniques not commonly taught in first semestercalculus courses. We begin with a brief review of integration by substitution(in case that was omitted from your first calculus course). See AppendixB for a list of common derivative and integration rules that you should befamiliar with.

The new integration techniques are integration by parts and integrationby partial fraction decomposition. Integration by parts is the integral ruleassociated to the product rule for derivatives and allows us to find the anti-derivatives of a great variety of functions. Integration by partial fractionsallows us to integrate any rational function (at least in principle). The pri-mary limitation with this method is that it requires us to factor polynomials,and polynomials of degree larger than 5 can be hard to manage!

Integration is quite difficult in general. While we can differentiate mostany combination of polynomials, exponential and logarithmic functions, trigono-metric functions, etc., there are examples of fairly simple functions whoseanti-derivatives cannot be written in terms of elementary functions. For in-stance, the anti-derivative

ż

e´x2

dx

exists (the area under y “ e´x2

is certainly a sensible quantity), but it is notany combination of functions you are likely to have encountered before!

Since integration can be so challenging, it is important to develop goodtechniques and strategies to attack them. When you encounter an integral,go through the following thought process:

59

Page 69: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 60

1.) Is this a basic form I should know? (Brush up on these in AppendixB.)

2.) Is there a u-substitution that will work?

3.) Is the integrand a rational function? If so, try partial fraction decom-position.

4.) Try integration by parts.

There are many more integration techniques than the ones we cover, but thechecklist above should get you through any integrals you encounter in thistext.

2.1 Integration by Substitution

Since integration is the reverse process of differentiation (thanks to the Fun-damental Theorem of Calculus), there is a rule for integration correspondingto every differentiation rule. Integration by substitution (often calledu-substitution) corresponds to the chain rule for derivatives:

d

dx

fpgpxqq‰

“ f 1pgpxqqg1pxq ðñ

ż

fpgpxqqg1pxqdx “

ż

fpuqdu

where u “ gpxq in the final integral on the right. This method hinges onbeing able to identify appropriate substitutions, and the only way to becomecomfortable with it is to practice!

Example 2.1.1. Find the anti-derivative

ż

xex2

dx.

Answer: We try the substitution u “ x2 for which du “ 2x dx. Sincewe have x dx appearing in the integral, we only need to supply a factor of 2

Page 70: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 61

(remember to balance it with a factor of 1/2 outside the integral).

ż

xex2

dx “1

2

ż

ex2

2x dx

“1

2

ż

eu du

“1

2eu ` C

“1

2ex

2

` C.

Notice in the final step that we replaced all u’s with x’s. �Quite often, functions appearing as exponents, functions inside of trigono-

metric functions or logarithms, or functions in the denominator of a rationalexpression make excellent choices for u.

Example 2.1.2. Find the anti-derivative

ż

cos plnpxqq

xdx.

Answer: We try u “ lnpxq giving du “ 1{x dx.

ż

cos plnpxqq

xdx “

ż

cos plnpxqq1

xdx

ż

cospuq du

“ sinpuq ` C

“ sin plnpxqq ` C. �

Example 2.1.3. Find the anti-derivative

ż

x2 ` 2

x3 ` 6x` 1dx.

Answer: Trying u “ x3 ` 6x` 1 gives du “ p3x2 ` 6qdx “ 3px2 ` 2qdx.

Page 71: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 62

Since we are only missing a factor of 3, this substitution will work.

ż

x2 ` 2

x3 ` 6x` 1dx “

1

3

ż

1

x3 ` 6x` 13px2

` 2qdx

“1

3

ż

1

udu

“1

3ln |u| ` C

“1

3ln |x3

` 6x` 1| ` C. �

Sometimes, a substitution requires us to replace leftover x-variables withcorresponding u-variables.

Example 2.1.4. Find the anti-derivative

ż

x?x` 1 dx.

Answer: If we try u “ x ` 1 (to make the argument under the squareroot more tractable), we find du “ dx. In order to get rid of the x in frontof the square root, we solve for x to find x “ u´ 1.

ż

x?x` 1 dx “

ż

pu´ 1q?u du

ż

`

u3{2´ u1{2

˘

du

“2

5u5{2

´2

3u3{2

` C

“2

5px` 1q5{2 ´

2

3px` 1q3{2 ` C. �

Example 2.1.5. Find the anti-derivative

ż

1

x`?xdx.

Answer: We could try making the entire denominator equal to u, butthat would lead to several difficulties. Since the square root in the denomina-tor is the primary difficulty, we try u “

?x. This gives du “ dx{p2

?xq. If we

Page 72: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 63

rearrange this, we find 2?xdu “ dx which looks strange until we remember

that u “?x. That gives us 2u du “ dx. Similarly, x “ u2.

ż

1

x`?xdx “

ż

1

u2 ` u2u du

“ 2

ż

u

u2 ` udu

“ 2

ż

1

u` 1du

“ 2 ln |u` 1| ` C

“ 2 lnˇ

ˇ

?x` 1

ˇ

ˇ` C. �

For definite integrals, we can avoid having to rewrite the integral in termsof the original variable if we change the limits of integration according to theu-substitution.

Example 2.1.6. Computeż 3

0

x

x2 ` 1dx.

Answer: With the substitution u “ x2 ` 1, we have du “ 2x dx and sowe only need to supply a factor of 2. When we rewrite the integral in termsof u, we change the limits of integration as follows:

x “ 0 Ñ u “ p0q2 ` 1 “ 1,

x “ 3 Ñ u “ p3q2 ` 1 “ 10.

Putting all of this together gives:ż 3

0

x

x2 ` 1dx “

1

2

ż 3

0

1

x2 ` 12x dx

“1

2

ż 10

1

1

udu

“1

2ln |u|

ˇ

ˇ

ˇ

ˇ

10

1

“1

2lnp10q ´

1

2lnp1q

“lnp10q

2. �

Page 73: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 64

Example 2.1.7. Compute

ż π{2

0

sinpxqecospxq dx.

Answer: The obvious substitution here is u “ cospxq givingdu “ ´ sinpxq dx. For the limits of integration, we have

x “ 0 Ñ u “ cosp0q “ 1,

x “π

2Ñ u “ cos

´π

2

¯

“ 0.

This gives

ż π{2

0

sinpxqecospxq dx “ ´

ż π{2

0

ecospxqp´ sinpxqq dx

“ ´

ż 0

1

eu du

“ ´eu|01“ ´e0

´ p´e1q

“ e´ 1. �

2.2 Integration by Parts

Integration by parts is the integration rule corresponding to the productrule for derivatives. If we take the product rule

d

dxrfpxqgpxqs “ f 1pxqgpxq ` fpxqg1pxq,

and integrate both sides, we getż

d

dxrfpxqgpxqs dx “

ż

pf 1pxqgpxq ` fpxqg1pxqq dx

fpxqgpxq “

ż

f 1pxqgpxq dx`

ż

fpxqg1pxq dx

In the second line, we first use the fact that an anti-derivative is the inverseoperation of differentiation (up to a constant). For the right-hand side, weuse the fact that the integral of a sum is the sum of the integrals.

Page 74: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 65

Notice that we did not list an arbitrary constant ( a “`C”). The reason isthat there are still indefinite integrals on the right-hand side. Any arbitraryconstant we would get from the left-hand side can be combined with thearbitrary constant from the remaining integral. In the same vein, we onlyneed a single `C on the right-hand side.

So far, this does not look like a very useful identity. The integration byparts formula comes from solving for one of the two integrals on the right.

Theorem 2.2.1 (Integration by Parts). If f and g are continuously differ-entiable functions, then

ż

fpxqg1pxq dx “ fpxqgpxq ´

ż

f 1pxqgpxq dx.

The reason this is useful is that it often allows us to exchange a more difficultintegral (the one on the left) for an integral that is hopefully simpler (theone on the right).

Example 2.2.1. Find the anti-derivative

ż

x lnpxq dx.

Answer: Since this is not a basic form or rational function and thereseems to be no reasonable substitution to make, we try integration by parts.The key to using integration by parts is selecting f and g1 in the originalintegral in such a way that f 1 is simpler than f and g is not much morecomplicated than g1. For this integral, the appropriate choices are fpxq “lnpxq and g1pxq “ x. We need to compute f 1 and g:

fpxq “ lnpxq g1pxq “ x

f 1pxq “1

xgpxq “

ż

x dx “1

2x2

Notice that we do not need to supply a “`C” until the very last integralhas been computed (so no constant appears on g). Using the integration by

Page 75: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 66

parts formula, we find

ż

x lnpxq dx “ lnpxq

ˆ

1

2x2

˙

´

żˆ

1

x

˙ˆ

1

2x2

˙

dx

“1

2x2 lnpxq ´

1

2

ż

x dx

“1

2x2 lnpxq ´

1

2

ˆ

1

2x2

˙

` C

“1

2x2 lnpxq ´

1

4x2` C.

Notice that the arbitrary constant only appeared after the final integral wascomputed!

If we want to check that our answer is correct, we simply take the deriva-tive of our answer:

d

dx

1

2x2 lnpxq ´

1

4x2` C

“ x lnpxq `1

2x2

ˆ

1

x

˙

´1

2x

“ x lnpxq. �

The trick to using integration by parts successfully is identifying the bestchoice for f and g1. We will develop some intuition for that shortly (alongwith a more convenient form for remembering the formula). Before that, asecond example.

Example 2.2.2. Find the anti-derivative

ż

x sinpxq dx.

Answer: Again, this is not a basic form, no simple substitution seemsappropriate, and the integrand is not a rational function; hence, integrationby parts is our last resort. The appropriate choice for f is fpxq “ x whichleaves g1pxq “ sinpxq.

fpxq “ x g1pxq “ sinpxq

f 1pxq “ 1 gpxq “

ż

sinpxq dx “ ´ cospxq

Page 76: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 67

This givesż

x sinpxq dx “ xp´ cospxqq ´

ż

1p´ cospxqq dx

“ ´x cospxq `

ż

cospxq dx

“ ´x cospxq ` sinpxq ` C. �

The integration by parts formula is usually remembered in a slightlydifferent form – one reminiscent of the formula for u-substitution The idea isto replace fpxq by upxq and gpxq by vpxq. In addition, we use the short-handdu “ u1pxq dx and dv “ v1pxq dx. This gives:

Theorem 2.2.2 (Integration by Parts – Alternate Form). For two continu-ously differentiable functions u and v, we have

ż

u dv “ uv ´

ż

v du.

This is NOT a different formula! This is equivalent to the original formula,but it has been rewritten in a form that is easier to remember.

Example 2.2.3. Find the anti-derivativeż

xe2x dx.

Answer: We make the following choices:

u “ x dv “ e2x dx

du “ dx v “

ż

e2x dx “1

2e2x

This givesż

xe2x dx “ x

ˆ

1

2e2x

˙

´

ż

1

2e2x dx

“1

2xe2x

´1

2

ż

e2x dx

“1

2xe2x

´1

2

ˆ

1

2e2x

˙

` C

“1

2xe2x

´1

4e2x` C. �

Page 77: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 68

The main question for us to address is how to pick u and dv. There isno rule that is guaranteed to work in every possible situation, but there is amnemonic for picking u that works in a large majority of cases.

The best choice for the function u when using integration by parts is veryoften given by the acronym LIATE where

L is for Logarithmic functions,I is for Inverse trigonometric functions,A is for Algebraic functions,T is for Trigonometric functions,E is for Exponential functions.

The logic behind this rule of thumb is that logarithmic and inverse trigono-metric functions often become simpler when you take their derivatives (theytypically become algebraic functions). Algebraic functions (like powers of x)stay algebraic functions under differentiation. The last two classes, trigono-metric and exponential functions, do not become simpler when you differen-tiate them and are typically not great choices for u.

Example 2.2.4. Find the anti-derivative

ż

x2 cospxq dx.

Answer: Based on our mnemonic, we should choose u “ x2.

u “ x2 dv “ cospxq dx

du “ 2x dx v “

ż

cospxq dx “ sinpxq

So,

ż

x2 cospxq dx “ x2 sinpxq ´

ż

sinpxq ¨ 2x dx

“ x2 sinpxq ´ 2

ż

x sinpxq dx.

Page 78: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 69

How should we attack this new integral? Integration by parts, of course! Wechoose u “ x giving

u “ x dv “ sinpxq dx

du “ dx v “

ż

sinpxq dx “ ´ cospxq

Be careful to distribute the ´2 to every term from the second integration byparts.

ż

x2 cospxq dx “ x2 sinpxq ´ 2

ż

x sinpxq dx

“ x2 sinpxq ´ 2

´x cospxq ´

ż

´ cospxq dx

“ x2 sinpxq ` 2x cospxq ´ 2

ż

cospxq dx

“ x2 sinpxq ` 2x cospxq ´ 2 sinpxq ` C. �

Finally, definite integrals can be handled with integration by parts in theobvious way.

Theorem 2.2.3 (Integration by Parts – Definite Integral Form). For twocontinuously differentiable functions u and v, we have

ż b

a

u dv “ uv

ˇ

ˇ

ˇ

ˇ

b

a

´

ż b

a

v du.

Example 2.2.5. Evaluate the definite integral

ż 2

1

x2 lnpxq dx.

Answer: Choosing u “ lnpxq gives

u “ lnpxq dv “ x2 dx

du “1

xdx v “

ż

x2 dx “1

3x3

Page 79: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 70

Therefore,ż 2

1

x2 lnpxq dx “1

3x3 lnpxq

ˇ

ˇ

ˇ

ˇ

2

1

´

ż 2

1

1

3x3

ˆ

1

x

˙

dx

ˆ

8

3lnp2q ´

1

3lnp1q

˙

´1

3

ż 2

1

x2 dx

“8

3lnp2q ´

1

9x3

ˇ

ˇ

ˇ

ˇ

2

1

“8

3lnp2q ´

ˆ

8

1

9

˙

“8

3lnp2q ´

7

9. �

On occasion, you need to make a u-substitution before attempting inte-gration by parts.

Example 2.2.6. Evaluate the definite integralż 4

0

?xe?x dx.

Answer: If we try to integrate by parts directly, our mnemonic wouldindicate u “

?x giving

u “?x dv “ e

?x dx

du “1

2?xdx v “

ż

e?x dx “ ???

This presents two problems. First, integrating e?x is not easy (it turns out

that it can be done by the same substitution we are about to discuss). Second,it is far from clear that

ş

v du will be easy to integrate thanks to the?x that

will appear in the denominator. Hence, we try a different approach.We try the u-substitution u “

?x which gives du “ 1

2?xdx. Notice that

dx “ 2?x du

“ 2u du.

This transforms our integral toż 4

0

?xe?x dx “ 2

ż 2

0

u2eu du

Page 80: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 71

which we can certainly attack by parts. We should not re-use u for a differentpurpose, so we will use r and s for integration by parts.

Instead of keeping the limits throughout the computation, we can findthe anti-derivative and evaluate the limits at the end of the computation.Choosing r “ u2, we have

r “ u2 ds “ eu du

dr “ 2u du s “

ż

eu du “ eu

This gives

2

ż

u2eu du “ 2u2eu ´ 2

ż

2ueu du

“ 2u2eu ´ 4

ż

ueu du.

We choose r “ u for a second round of integration by parts:

r “ u ds “ eu du

dr “ du s “

ż

eu du “ eu

which gives

2

ż

u2eu du “ 2u2eu ´ 4

ż

ueu du

“ 2u2eu ´ 4

ueu ´

ż

eu du

“ 2u2eu ´ 4ueu ` 4eu ` C.

We can now evaluate the limits:

2

ż 2

0

u2eu du “`

2u2eu ´ 4ueu ` 4eu˘ˇ

ˇ

2

0

“`

8e2´ 8e2

` 4e2˘

´`

4e0˘

“ 4e2´ 4. �

Finally, there are instances where integration by parts does not seemapplicable but turns out to be the appropriate method.

Page 81: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 72

Example 2.2.7. Find the anti-derivative

ż

lnpxq dx.

Answer: Considering how important the natural logarithm is, it maystrike you as strange that we have not seen its anti-derivative until now. Thatis because you need integration by parts to get it! If we choose u “ lnpxq,what is left for dv? The only thing left is dv “ dx which is completely fine!

u “ lnpxq dv “ dx

du “1

xdx v “

ż

dx “ x

This gives

ż

lnpxq dx “ x lnpxq ´

ż

x

ˆ

1

x

˙

dx

“ x lnpxq ´

ż

dx

“ x lnpxq ´ x` C. �

2.3 Integration by Partial Fraction Decom-

position

Our final method, integration by partial fraction decomposition, islimited to the integration of proper rational functions. For a function of theform

fpxq “ppxq

qpxq

to be a proper rational function, p and q must be polynomials, and the degreeof p must be strictly smaller than the degree of q. If you need to integrate animproper rational function, you must first perform long division to rewritethe function as a polynomial plus a proper rational function.

For instance, if we need to integrate

fpxq “x4

x2 ´ 4,

Page 82: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 73

we first carry out the long-division to get

x2 ` 4

x2 ´ 4¯

x4

´ x4 ` 4x2

4x2

´ 4x2 ` 16

16

This tells us that

fpxq “x4

x2 ´ 4“ x2

` 4`16

x2 ´ 4.

The polynomial portion on the right is easy to integrate, and partial fractiondecomposition will handle the proper rational function.

We begin with an example.

Example 2.3.1. Find the anti-derivativeż

1

x2 ´ 4dx.

Answer: This not a basic form and no substitution seems appropriate.The idea is to try and decompose the proper rational function into a sum ofsimpler terms. In this case,

1

x2 ´ 4“

1

px´ 2qpx` 2q“

A

x´ 2`

B

x` 2,

for some numbers A and B. The two terms on the right are the partialfractions we hope to decompose our original fraction into. The question iswhether or not there are two numbers A and B such that the two simplerfunctions on the right add up to our original function. If we add those tworational terms together, we get

1

px´ 2qpx` 2q“

Apx` 2q

px´ 2qpx` 2q`

Bpx´ 2q

px` 2qpx´ 2q“Apx` 2q `Bpx´ 2q

px´ 2qpx` 2q.

In order for these two rational expressions to be identical, their numeratorsmust be identical for any value of x. This leads us to

1 “ Apx` 2q `Bpx´ 2q

“ pA`Bqx` p2A´ 2Bq.

Page 83: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 74

Since the left-hand side is independent of x, we need A` B “ 0 so that theright-hand side will not have an x term. Likewise, since the left-hand sidehas a constant term of 1, we must have 2A´2B “ 1. The first equation tellsus that B “ ´A, and substituting this into the second gives

2A´ 2B “ 1

4A “ 1

A “1

4.

Which immediately gives B “ ´1{4. Thus, we have shown that

1

x2 ´ 4“

1

4

ˆ

1

x´ 2

˙

´1

4

ˆ

1

x` 2

˙

.

The advantage of this is that the right-hand side is now easy to integrate!

ż

1

x2 ´ 4dx “

1

4

ż

1

x´ 2dx´

1

4

ż

1

x` 2dx

“1

4ln |x´ 2| ´

1

4ln |x` 2| ` C. �

This method works in general so long as the rational function is properand the denominator factors into distinct linear terms.

Page 84: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 75

Suppose that the denominator of a proper rational function

fpxq “ppxq

qpxq

factors into distinct linear terms:

qpxq “ pa1x` b1qpa2x` b2q ¨ ¨ ¨ panx` bnq.

Then the rational function can be decomposed as

ppxq

qpxq“

C1

a1x` b1

`C2

a2x` b2

` ¨ ¨ ¨ `Cn

anx` bn

for some coefficients C1, C2, . . . , Cn.

Note thatż

1

aix` bidx “

1

ailn |aix` bi| ` C.

If there are repeated linear terms or irreducible quadratic terms in the de-nominator, then the partial fraction decomposition is a little different. Wewill discuss those modifications shortly, but first a couple of examples.

Example 2.3.2. Find the anti-derivative

ż

x

x2 ` 3x´ 4dx.

Answer: The first method you should attempt is u-substitution. If wetry u “ x2`3x´4, we would need du “ p2x`3q dx which is not very similarto what we have in the numerator. Since this is a proper rational function,we try partial fractions.

x

x2 ` 3x´ 4“

x

px´ 1qpx` 4q“

A

x´ 1`

B

x` 4.

Summing up the rational terms on the right and equating numerators gives

x “ Apx` 4q `Bpx´ 1q “ pA`Bqx` p4A´Bq.

Page 85: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 76

In order for these two expression to be identical, A ` B “ 1 (since thecoefficient of x must be 1) and 4A´B “ 0 (since there should be no constantterm). The second equation tells us that B “ 4A which combines with thefirst to give

A`B “ 1

5A “ 1

A “1

5.

Thus, B “ 4{5 and we have the decomposition

x

x2 ` 3x´ 4“

1

5

ˆ

1

x´ 1

˙

`4

5

ˆ

1

x` 4

˙

.

Using this in the integral givesż

x

x2 ` 3x´ 4dx “

1

5

ż

1

x´ 1dx`

4

5

ż

1

x` 4dx

“1

5ln |x´ 1| `

4

5ln |x` 4| ` C. �

At this point, it worth mentioning that there is a second way to findthe coefficients in the decomposition: substituting various values into thevariable! In the example above, we needed

x “ Apx` 4q `Bpx´ 1q

to be a true statement for all values of x. In particular, the statement shouldbe true at x “ 1. Substituting this into both sides gives

1 “ Ap5q `Bp0q,

which clearly gives A “ 1{5! Similarly, substituting x “ ´4 gives

´4 “ Ap0q `Bp´5q,

which gives B “ 4{5. This method is often faster when the denominatorconsists of distinct linear factors!

Example 2.3.3. Find the anti-derivativeż

x4 ` 2

x3 ´ xdx.

Page 86: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 77

Answer: Because this is an improper rational function, we have to per-form long division before proceeding:

x4 ` 2

x3 ´ x“ x`

x2 ` 2

x3 ´ x.

Since integrating x presents no difficulty, we focus on the remaining properrational term:

x2 ` 2

x3 ´ x“

x2 ` 2

xpx´ 1qpx` 1q“A

x`

B

x´ 1`

C

x` 1.

So, we need

x2` 2 “ Apx´ 1qpx` 1q `Bxpx` 1q ` Cxpx´ 1q.

If we substitute x “ 0, we must have 2 “ Ap´1q ` Bp0q ` Cp0q which givesA “ ´2. Substituting x “ 1 gives 3 “ Ap0q ` Bp2q ` Cp0q, which givesB “ 3{2. Finally, x “ ´1 gives 3 “ Ap0q ` Bp0q ` Cp2q, and so C “ 3{2.Thus,

x2 ` 2

x3 ´ x“ ´2

ˆ

1

x

˙

`3

2

ˆ

1

x´ 1

˙

`3

2

ˆ

1

x` 1

˙

.

So, our original integral becomes

ż

x4 ` 2

x3 ´ xdx “

ż

x dx´ 2

ż

1

xdx`

3

2

ż

1

x´ 1dx`

3

2

ż

1

x` 1dx

“1

2x2´ 2 ln |x| `

3

2ln |x´ 1| `

3

2ln |x` 1| ` C. �

When there are repeated linear factors or irreducible quadratic factors inthe denominator, we have to modify the partial fraction expansion for thatparticular factor. While this is not a major concern for us in this text, it isworth mentioning just for the sake of completeness.

Page 87: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 78

Suppose that the denominator of a proper rational function

fpxq “ppxq

qpxq

has a linear factor to some power n ą 1; that is, a term like

pax` bqn

appears in the factorization of qpxq. Then the contribution tothe partial fraction decomposition for this factor should be

C1

ax` b`

C2

pax` bq2` ¨ ¨ ¨ `

Cnpax` bqn

Note thatż

1

pax` bqidx “ ´

ˆ

1

pi´ 1qa

˙

1

pax` bqi´1` C

for i ą 1.

Example 2.3.4. Find the anti-derivativeż

x` 2

x3 ` 2x2 ` xdx.

Answer: The denominator factors as x3 ` 2x2 ` x “ xpx ` 1q2. So ourpartial fraction decomposition must be

x` 2

x3 ` 2x2 ` x“A

x`

B

x` 1`

C

px` 1q2.

This gives us the equality

x` 2 “ Apx` 1q2 `Bxpx` 1q ` Cx.

If we substitute x “ 0, we get 2 “ Ap1q ` Bp0q ` Cp0q, which gives A “ 2.Substituting x “ ´1, we get 1 “ Ap0q `Bp0q `Cp´1q, which gives C “ ´1.There is no simple substitution that will give us B, but we can substituteany value for x we have not currently used! For instance, we can substitutex “ 1; 3 “ Ap4q `Bp2q ` Cp1q giving

2B “ 3´ 4A´ C “ 3´ 8` 1 “ ´4.

Page 88: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 79

So, B “ ´2. We finally get

x` 2

x3 ` 2x2 ` x“ 2

ˆ

1

x

˙

´ 2

ˆ

1

x` 1

˙

´1

px` 1q2.

So, the integral becomes

ż

x` 2

x3 ` 2x2 ` xdx “ 2

ż

1

xdx´ 2

ż

1

x` 1dx´

ż

1

px` 1q2dx

“ 2 ln |x| ´ 2 ln |x` 1| `1

x` 1` C. �

A polynomial has an irreducible quadratic factor if the polynomial hascomplex roots. For instance, x3 ` x “ xpx2 ` 1q, and x2 ` 1 cannot befactored over the set of real numbers (its roots are ˘i).

Suppose that the denominator of a proper rational function

fpxq “ppxq

qpxq

has an irreducible quadratic factor to some power n; that is,a term like

pax2` bx` cqn

appears in the factorization of qpxq, and this quadratic poly-nomial does not factor over the real numbers. Then the con-tribution to the partial fraction decomposition for this factorshould be

B1x` C1

ax2 ` bx` c`

B2x` C2

pax2 ` bx` cq2` ¨ ¨ ¨ `

Bnx` Cnpax2 ` bx` cqn

This can become quite complicated for repeated irreducible quadratic factors.We will be content with a simpler example.

Example 2.3.5. Find the anti-derivative

ż

x` 1

x3 ` xdx.

Page 89: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 80

Answer: Since the denominator factors as x3 ` x “ xpx2 ` 1q, we mustlook for a partial fraction decomposition of the form

x` 1

x3 ` x“A

x`Bx` C

x2 ` 1.

This gives us the following equality:

x` 1 “ Apx2` 1q ` pBx` Cqx.

Substituting x “ 0 will give us A: 1 “ Ap1q ` pBp0q ` Cqp0q “ A. Nosimple choices of x will directly give us B or C. We could substitute any twox-values of our choice (except 0) and get a pair of equations for B and C,or we could expand the right-hand side and match coefficients (rememberingthat A “ 1):

x` 1 “ 1px2` 1q `Bx2

` Cx

“ pB ` 1qx2` Cx` 1.

Since the left-hand side has no x2 term, we must have B “ ´1. Since thecoefficient of x on the left-hand side is 1, C “ 1. This gives us our partialfraction decomposition:

x` 1

x3 ` x“

1

x`´x` 1

x2 ` 1“

1

x

x2 ` 1`

1

x2 ` 1.

The final splitting of the irreducible quadratic term into two pieces is tofacilitate integration.

ż

x` 1

x3 ` xdx “

ż

1

xdx´

ż

x

x2 ` 1dx`

ż

1

x2 ` 1dx

“ ln |x| ´1

2

ż

2x

x2 ` 1dx` arctanpxq

“ ln |x| ´1

2lnpx2

` 1q ` arctanpxq ` C.

Notice that the integral of px2 ` 1q´1 is a basic form you should be familiarwith (i.e. it integrates to arctanpxq). In the second line, we set up a u-substitution to handle the middle integral. You should fill in the details tomake sure you understand how the integral was computed. �

Page 90: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 81

2.4 Problems

Compute the following definite and indefinite integrals.

1q

ż

x

1´ x2dx

2q

ż

1

1` y2dy

3q

ż π{4

0

x cospxq dx

4q

ż

x

x2 ` x´ 2dx

5q

ż 2{π

4{π

1

s2sin

ˆ

1

s

˙

ds

6q

ż 10

2

1

x2 ´ xdx

7q

ż

x` 1

px` 2qpx` 3q2dx

8q

ż 2

1

x lnpxq dx

9q

ż

1

cos2pxqdx

Page 91: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 2. TECHNIQUES OF INTEGRATION 82

10q

ż

r2e´r dr

11q

ż

2x2 ` 1

2x2 ` x´ 1dx

12q

ż

x2 cosp2xq dx

13q

ż 14

2

z?z ` 2 dz

14q

ż

plnpxqq10

xdx

15q

ż 2

0

t2e2t dt

16q

ż 3

0

1

3x2 ` 4x` 1dx

17q

ż

x` 1

x3 ` 4xdx

18q

ż

1

y2 ` 4y ` 5dy (HINT: Try completing the square in the denominator!)

19q

ż

arctanpxq dx (HINT: Try integrating by parts followed by u-substitution!)

20q Challenge:

ż

e?x dx (HINT: Try a u-substitution then integration by parts!)

Page 92: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Chapter 3

Applications of Integration

Before we return to dynamical systems, we first discuss some applications ofintegrals that are often useful in practice. The first two involve finding areasof shapes and the volumes of a special class of solid figures. The final appli-cation, improper integration, extends integration to infinite intervals and/orto functions which are unbounded over their range of integration. This topicwill be important when we discuss continuous probability distributions inChapter 7.

3.1 Areas Between Curves

As you learned in a first calculus course, the definite integral

ż b

a

fpxq dx

computes the signed area between the curve y “ fpxq and the x-axis overthe interval a ď x ď b.

83

Page 93: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 84

Figure 3.1.1: Area Under a Curve

The reason the definite integral gives us signed area is that regions belowthe x-axis are counted as negative area.

Figure 3.1.2: Signed Area

So, the portion of the figure above that is shaded in red will count asnegative area in the integral

ż b

a

fpxq dx.

Page 94: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 85

If we want the total area between this curve and the x-axis, we have to splitthe definite integral into three pieces.

Figure 3.1.3: Signed Area, continued

This gives

Total Area “

ż c

a

fpxq dx´

ż d

c

fpxq dx`

ż b

d

fpxq dx

where the x-values c and d are the solutions to fpxq “ 0 that lie in the rangea ď x ď b.

Example 3.1.1. Find the total area between the x-axis and the curvey “ x3 ´ 4x2 ` 3x over the interval ´1 ď x ď 3.

Page 95: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 86

Figure 3.1.4: Graph of y “ x3 ´ 4x2 ` 3x over ´1 ď x ď 3.

Answer: In order to compute the total area (rather than the signedarea), we need to compute separate integrals over the different regions wherethe area is above or below the x-axis. To find the correct limits of integration,we solve

x3´ 4x2

` 3x “ 0

xpx2´ 4x` 3q “ 0

xpx´ 1qpx´ 3q “ 0

x “ 0, 1, 3.

This means the total area is given by

Total Area “ ´

ż 0

´1

`

x3´ 4x2

` 3x˘

dx `

ż 1

0

`

x3´ 4x2

` 3x˘

dx

´

ż 3

1

`

x3´ 4x2

` 3x˘

dx.

Note that the signs in front of the integrals correspond to which portions ofthe graph are above or below the x-axis. The first integral is

´

ż 0

´1

`

x3´ 4x2

` 3x˘

dx “ ´

ˆ

x4

4x3

3`

3x2

2

˙ˇ

ˇ

ˇ

ˇ

0

´1

“ ´

ˆ

1

4´´4

3`

3

2

˙

“37

12.

Page 96: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 87

The second integral givesż 1

0

`

x3´ 4x2

` 3x˘

dx “

ˆ

x4

4x3

3`

3x2

2

˙ˇ

ˇ

ˇ

ˇ

1

0

ˆ

1

4

3`

3

2

˙

´ 0

“5

12.

This third integral is

´

ż 3

1

`

x3´ 4x2

` 3x˘

dx “ ´

ˆ

x4

4x3

3`

3x2

2

˙ˇ

ˇ

ˇ

ˇ

3

1

“ ´

„ˆ

81

108

3`

27

2

˙

´

ˆ

1

4

3`

3

2

˙

“9

4`

5

12

“8

3.

Adding these together gives us the total enclosed area.

Total Area “37

12`

5

12`

8

3“

37

6. �

In many situations, we do not simply want the area between a curve andthe x-axis but rather the area between curves.

Figure 3.1.5: Area Between Two Curves

Page 97: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 88

The key insight is that we can compute this area by taking the area belowy “ fpxq and subtracting the area below y “ gpxq.

Figure 3.1.6: Area Between Two Curves by Subtraction

This means that the area between these two curves is given by

Area “

ż b

a

fpxq dx´

ż b

a

gpxq dx “

ż b

a

pfpxq ´ gpxqq dx.

In other words, we identify which of the two curves lies underneath the otherone over the range of integration, subtract the functions giving the curvesin the appropriate order (“top minus bottom”), and then integrate over theappropriate range. Quite often, the limits of integration are the points ofintersection of the two curves: fpxq “ gpxq.

Example 3.1.2. Find the area contained between the curves y “ x2 andy “ 8´ x2.

Page 98: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 89

Figure 3.1.7: Area for Example 3.1.2

Answer: First, we find the points of intersection of the two curves.

x2“ 8´ x2

2x2“ 8

x2“ 4

x “ ˘2.

For the interval ´2 ď x ď 2, we see that the curve y “ 8 ´ x2 lies overy “ x2. So the area enclosed by these two curves is

Area “

ż 2

´2

p8´ x2q ´ x2

dx

ż 2

´2

`

8´ 2x2˘

dx

ˆ

8x´2

3x3

˙ˇ

ˇ

ˇ

ˇ

2

´2

ˆ

16´16

3

˙

´

ˆ

´16`16

3

˙

“32

ˆ

´32

3

˙

“64

3. �

Page 99: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 90

Example 3.1.3. Find the area contained between the curves y “ x2 andy “

?x.

Figure 3.1.8: Area for Example 3.1.3

Answer: The intersection points of these two curves are

x2“?x

x4“ x

x4´ x “ 0

xpx3´ 1q “ 0

x “ 0, 1.

Over the interval 0 ď x ď 1, y “?x lies over y “ x2. So, the area is given

by

Area “

ż 1

0

`?x´ x2

˘

dx

ˆ

2

3x3{2

´1

3x3

˙ˇ

ˇ

ˇ

ˇ

1

0

ˆ

2

1

3

˙

´ 0

“1

3. �

Page 100: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 91

Example 3.1.4. Find the area bounded by the curves y “ 4, y “ ex, andthe y-axis.

Answer: In this example, we have a region bounded by three differentcurves.

Figure 3.1.9: Area for Example 3.1.4

Clearly, the left boundary is x “ 0 (i.e. the y-axis). For the right bound-ary, we need to find where y “ 4 intersects y “ ex:

ex “ 4

ln pexq “ lnp4q

x “ lnp4q.

The area of this region is given by

Area “

ż lnp4q

0

p4´ exq dx

“ p4x´ exq|lnp4q0

“`

4 lnp4q ´ elnp4q˘

´ p0´ e0q

“ 4 lnp4q ´ 4` 1

“ 8 lnp2q ´ 3. �

Page 101: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 92

Example 3.1.5. Find the area contained between the curves y “ x3 ´ 4xand y “ x2 ` 2x.

Figure 3.1.10: Area for Example 3.1.5

Answer: As usual, we first find the points of intersection of these twocurves.

x3´ 4x “ x2

` 2x

x3´ x2

´ 6x “ 0

xpx2´ x´ 6q “ 0

xpx` 2qpx´ 3q “ 0

x “ ´2, 0, 3.

Notice that on the interval ´2 ď x ď 0, y “ x3 ´ 4x lies over y “ x2 ` 2x,but on 0 ď x ď 3, the curves switch their relative positions. So, we need tointegrate px3 ´ 4xq ´ px2 ` 2xq over ´2 ď x ď 0, while on 0 ď x ď 3 we

Page 102: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 93

should integrate px2 ` 2xq ´ px3 ´ 4xq.

Area “

ż 0

´2

px3´ 4xq ´ px2

` 2xq‰

dx`

ż 3

0

px2` 2xq ´ px3

´ 4xq‰

dx

ż 0

´2

`

x3´ x2

´ 6x˘

dx`

ż 3

0

`

´x3` x2

` 6x˘

dx

ˆ

1

4x4´

1

3x3´ 3x2

˙ˇ

ˇ

ˇ

ˇ

0

´2

`

ˆ

´1

4x4`

1

3x3` 3x2

˙ˇ

ˇ

ˇ

ˇ

3

0

“ 0´

ˆ

16

4`

8

3´ 12

˙

`

ˆ

´81

4`

27

3` 27

˙

´ 0

“16

3`

63

4

“253

12. �

Example 3.1.6. Find the area contained between the curves y “ x4´7x2`7and y “ 3x2 ´ 2.

Figure 3.1.11: Area for Example 3.1.6

Page 103: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 94

Answer: The points of intersection of these two curves are

x4´ 7x2

` 7 “ 3x2´ 2

x4´ 10x2

` 9 “ 0

px2´ 1qpx2

´ 9q “ 0

px` 1qpx´ 1qpx` 3qpx´ 3q “ 0

x “ ´3,´1, 1, 3.

The area should be given by the following three integrals.

Area “

ż ´1

´3

p3x2´ 2q ´ px4

´ 7x2` 7q

dx

`

ż 1

´1

px4´ 7x2

` 7q ´ p3x2´ 2q

dx

`

ż 3

1

p3x2´ 2q ´ px4

´ 7x2` 7q

dx

ż ´1

´3

`

´x4` 10x2

´ 9˘

dx`

ż 1

´1

`

x4´ 10x2

` 9˘

dx

`

ż 3

1

`

´x4` 10x2

´ 9˘

dx.

A shortcut for this particular problem is to notice that the area is symmetricabout the line x “ 0. This allows us to compute the area by

Area “ 2

„ż 1

0

`

x4´ 10x2

` 9˘

dx`

ż 3

1

`

´x4` 10x2

´ 9˘

dx

“ 2

ˆ

1

5x5´

10

3x3` 9x

˙ˇ

ˇ

ˇ

ˇ

1

0

` 2

ˆ

´1

5x5`

10

3x3´ 9x

˙ˇ

ˇ

ˇ

ˇ

3

1

“ 2

ˆ

1

10

3` 9´ 0

˙

` 2

´243

5`

270

3´ 27´

ˆ

´1

5`

10

3´ 9

˙

“176

15`

608

15

“784

15. �

Page 104: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 95

3.2 Volumes of Solids of Revolution

It turns out that integration can be used to compute much more than justareas! One of the most natural extensions of integration is to the computationof volumes. To see how this works, we begin by reviewing the conceptualidea behind computing areas under curves.

Since we know how to compute the areas of simple shapes (e.g. rectan-gles), we subdivide our given area into N smaller rectangles of width ∆x(which means ∆x “ pb´ aq{N).

Figure 3.2.1: Subdivision of Area into Rectangles

The points xi along the x-axis mark the lower-left vertices of each rectangle(xi “ a` i ¨∆x), and we can take the height of each rectangle as fpxiq. Eventhough this will not give us the exact area, we can feel confident that

Area « fpaq∆x` fpx1q∆x` fpx2q∆x` ¨ ¨ ¨ ` fpxN´1q∆x “N´1ÿ

i“0

fpxiq∆x

so long as ∆x is rather small (which means N “ pb ´ aq{∆x is quite large).If we take the limit ∆xÑ 0, then our approximation becomes exact and thesummation becomes an integral:

N´1ÿ

i“0

fpxiq∆x ÝÑ∆xÑ0

ż b

a

fpxq dx.

Page 105: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 96

This give us an intuitive way to think about the integral. We can imaginethat we stack a huge number of extremely thin rectangles of width dx. Theintegral then “adds” the content of these thin slices to produce the overallarea of the figure. This heuristic idea of integration can be extended to alarge class of problems.

Example 3.2.1. Find the volume of a right pyramid with square base ofside length 2 units and an overall height of 3 units.

Figure 3.2.2: A Square Pyramid of Side-length 2 and Height 3

Answer: We can think of the pyramid as being stacks of thin, rectangularslabs.

Page 106: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 97

Figure 3.2.3: Pyramid with Cross Section

If this slab is at a height h from the base, the cross section is a smallersquare of side-length s (the thickness will be the infinitesimal dh). So, wewould have a slab of volume s2 dh. In order to add up the contents of theseslabs as the height h goes from h “ 0 to h “ 3, we need to determine howthe side-length s varies with h. That is, we need to find s as a function of h,s “ sphq.

In order to do this, we consider the triangle running from the center lineof the pyramid down the center of one of the oblique faces and back throughthe base.

Page 107: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 98

h

3´ h

3

1

s{2

Figure 3.2.4: Similar Triangle for s

As we can see from the similar triangles above,

3´ h

3“s{2

1.

This gives us the formula for side-length in terms of h:

s “2

3p3´ hq.

Notice that at the bottom of the pyramid (h “ 0) we get s “ 2 as expected.Likewise, we get s “ 0 at the top of the pyramid (when h “ 3). So, the areaof a square cross section is

cross sectional area “ s2“

4

9p3´ hq2 “

4

9ph´ 3q2.

To get the volume of the pyramid we simply integrate the cross sectional area

Page 108: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 99

over the entire height of the pyramid.

Volume “

ż 3

0

4

9ph´ 3q2 dh

“4

27ph´ 3q3

ˇ

ˇ

ˇ

ˇ

3

0

“ 0´4

27p´3q3

“ 4. �

Example 3.2.2. Find the volume of the right pyramid whose base is anequilateral triangle of side-length 3 units and having a height of 4 units.

Figure 3.2.5: Pyramid with Equilateral Triangle Base of Side-length 3 andHeight 4

Answer: The cross sections of this pyramid will be equilateral triangleswhose side-lengths will get progressively smaller. As a matter of review, the30˝ – 60˝ – 90˝ right triangle is pictured below along with the area of ageneric equilateral triangle.

Page 109: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 100

60˝

30˝

12

?3

2

1

60˝

30˝

s{2

?3

2s

s

s

Area =?

34s2

Figure 3.2.6: 30˝ – 60˝ – 90˝ Triangles and Equilateral Triangles

Looking at a particular cross section of the pyramid, we see the following.

32

4s2

h

Figure 3.2.7: Cross Section of Pyramid in Example 3.2.2

From the right triangle on the right above, we see by similar triangles that

4´ h

4“s{2

3{2.

Page 110: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 101

This gives

s “3

4p4´ hq,

and from our area formula, we have the cross sectional area at height h isgiven by

cross sectional area “

?3

4s2“

9?

3

64p4´ hq2 “

9?

3

64ph´ 4q2.

To find the total volume of the pyramid, we only need to integrate this crosssectional area over the height of the pyramid (0 ď h ď 4).

Volume “

ż 4

0

9?

3

64ph´ 4q2 dh

“9?

3

64

ph´ 4q3

3

ˇ

ˇ

ˇ

ˇ

4

0

“ 0´9?

3

64

ˆ

´64

3

˙

“ 3?

3. �

The method of this example will work in general if we can build-up a givenvolume by stacking thin cross sections in a consistent way. Here, “consistent”means in a way we can easily predict from the length, width, or height of thesolid figure (as we did for side-length s).

We will not focus on pyramids here since there is a very nice formula forthe volume of any pyramid no matter what kind of base it has ! For a pyramidof height h above a base of area A (regardless of shape), the volume V isgiven by

V “1

3Ah,

(i.e. one-third ˆ base area ˆ height). Notice that this includes the area of acone with radius r and height h (whose base is a circle A “ πr2).

For the remainder of this section, we focus on solids of revolution.These are three-dimensional figures obtained by rotating a curve in the xy-plane about an axis in the plane. As an example, consider the curve y “

?x

on the interval 0 ď x ď 4 rotated about the x-axis.

Page 111: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 102

Figure 3.2.8: y “?x and its Solid of Revolution about the x-axis

The nice thing about solids of revolution is that their cross sections are eithercircles (also called disks) or annuli (also called washers).

r rin

Area = πr2

rout

Area = πpr2out ´ r

2inq

Figure 3.2.9: Disks and Washers

A solid disk has area πr2. For a washer, we subtract the area of the smallerdisk (radius rin) from the area of the larger disk (radius rout). This gives atotal area of πpr2

out ´ r2inq.

Example 3.2.3. Find the volume of the solid obtained by rotating the regionbetween y “

?x and the x-axis on the interval 0 ď x ď 4 about the x-axis.

Answer: This is the solid pictured in Figure 3.2.8. The cross sections ofthis solid are disks with radius r “

?x over the interval 0 ď x ď 4.

Page 112: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 103

Figure 3.2.10: Radius for Example 3.2.3

This means that the cross sectional area for any particular value of x is

cross sectional area “ πr2“ π

`?x˘2“ πx.

To compute the volume, we simply integrate this cross sectional area overthe length of the solid (from x “ 0 to x “ 4):

Volume “

ż 4

0

πx dx

“ πx2

2

ˇ

ˇ

ˇ

ˇ

4

0

“ π42

2“ 8π. �

Example 3.2.4. Find the volume of the solid obtained by rotating the regioncontained between y “

?x and y “ x2 about the x-axis.

Page 113: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 104

Figure 3.2.11: Radius for Example 3.2.4

Answer: As the figure above shows, the cross sections will be washerswith an outer radius of rout “

?x and an inner radius of rin “ x2. This gives

a total cross sectional area of

cross sectional area “ π”

`?x˘2´`

x2˘2ı

“ π`

x´ x4˘

.

So, the total volume of this solid will be

Volume “

ż 1

0

π`

x´ x4˘

dx

“ π

ˆ

x2

2´x5

5

˙ˇ

ˇ

ˇ

ˇ

1

0

“ π

ˆ

1

1

5

˙

“3π

10. �

While we are not limited to rotating about the coordinate axes, for thepurposes of this text we will only consider rotation about the x- and y-axes.

Page 114: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 105

Example 3.2.5. Find the volume of the solid obtained by rotating the regioncontained between y “

?x and the y-axis on the interval 0 ď x ď 4 about

the y-axis.

Figure 3.2.12: Area and Solid for Example 3.2.5

Answer: In this example, the cross sections are once again disks. Butthe disks are now being stacked vertically rather than horizontally (becausewe rotated about the y-axis). As a result, the radii of the disks are x-valueswhich change as y increases from y “ 0 to y “ 2 (the top of the solid figure).In order to find the volume, we have to express the radius r in terms of y(since we will be integrating over the range 0 ď y ď 2). If we take theboundary curve y “

?x and solve for x, we find that

r “ x “ y2.

Page 115: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 106

So, the volume of this solid is given by

Volume “

ż 2

0

π`

y2˘2

dy

“ π

ż 2

0

y4 dy

“ πy5

5

ˇ

ˇ

ˇ

ˇ

2

0

“32π

5. �

Example 3.2.6. Find the volume of the solid obtained by rotating the regioncontained between y “ 3

?x´ 1 and y “ px´ 1q2 about the y-axis.

Figure 3.2.13: Area and Solid for Example 3.2.6

Page 116: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 107

Answer: First, we need to determine where these two curves intersect.

3?x´ 1 “ px´ 1q2

x´ 1 “ px´ 1q6

0 “ px´ 1q6 ´ px´ 1q

0 “ px´ 1q“

px´ 1q5 ´ 1‰

x “ 1 or px´ 1q5 “ 1

x “ 1, 2.

Since the cross sections are washers stacked vertically, we need to express theinner and outer radii in terms of y. For the outer radii,

y “ px´ 1q2?y “ x´ 1

x “?y ` 1,

rout “?y ` 1,

r2out “ y ` 2

?y ` 1.

The inner radii are given by

y “ 3?x´ 1

y3“ x´ 1

x “ y3` 1,

rin “ y3` 1,

r2in “ y6

` 2y3` 1.

So, the cross sectional area at height y is given by

cross sectional area “ π`

y ` 2?y ´ y6

´ 2y3˘

For the limits of integration, note that when x “ 1, both curves are at height

Page 117: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 108

y “ 0 while at x “ 2, both are at y “ 1. So

Volume “ π

ż 1

0

`

y ` 2?y ´ y6

´ 2y3˘

dy

“ π

ˆ

y2

2`

4y3{2

3´y7

7´y4

2

˙ˇ

ˇ

ˇ

ˇ

1

0

“ π

ˆ

1

2`

4

1

1

2

˙

“25π

21. �

3.3 Improper Integrals

While it may not have been heavily emphasized in your first semester calculuscourse, the definition of the Riemann integral

ż b

a

fpxq dx

implicitly required the following two important properties:

1.) The interval a ď x ď b must be a finite interval. In other words, thelength of the interval, b´ a, should be finite.

2.) The function f must be bounded over the interval of integration. Thatis, f cannot diverge to ˘8 over a ď x ď b.

It turns out that we can relax these requirements if we interpret the resultingintegral in an appropriate way. Any integral where the two properties aboveare not satisfied are called improper integrals. In general, an improperintegral may violate one or both of the requirements above. We will focuson the cases where the integral violates exactly one of the two. The moregeneral case can be handled by splitting up the integral into two or moreintegrals each of which violates exactly one of the conditions above.

3.3.1 Type I Improper Integrals

We begin with an illustrative example.

Page 118: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 109

Example 3.3.1. Compute the integral

ż 8

1

1

x2dx.

Figure 3.3.1: Graph of y “ 1x2

If we consider our two requirements for Riemann integrals, we clearlysee that the first is violated: the interval of integration has infinite length.The second requirement (that f is bounded over the interval of integration)is satisfied since fpxq “ 1{x2 only diverges at x “ 0 (which is outside ourinterval).

An improper integral where a bounded function is to be integrated overan infinite interval of the real line is said to be a Type I Improper Integral.In order to make sense of such an interval, we employ a limit!

Answer: Since we cannot explicitly compute a Riemann integral over aninfinite interval, we use a limit to do the job:

ż 8

1

1

x2dx “ lim

RÑ8

ż R

1

1

x2dx.

Since R is always a finite real number, the integral on the right makes perfectsense. Once we compute the integral, we can then take the limit to “push R

Page 119: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 110

out to infinity.”

ż 8

1

1

x2dx “ lim

RÑ8

ż R

1

1

x2dx

“ limRÑ8

´1

x

ˇ

ˇ

ˇ

ˇ

R

1

“ limRÑ8

ˆ

´1

R´´1

1

˙

“ limRÑ8

ˆ

1´1

R

˙

“ 1´ limRÑ8

1

R“ 1. �

So, the total area under y “ 1{x2 on the interval 1 ď x ă 8 is equal to1, a finite value! If an improper integral of either type returns a finite value,we say that it converges.

Be aware that an improper integral need not converge! If the resultinglimit returns˘8, we say the improper integral diverges. The other possibilityis that the improper integral does not exist (when the limit fails to exist).Some authors use “diverge” for both of these cases.

Example 3.3.2. Compute the integral

ż 8

0

x2 dx.

Page 120: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 111

Figure 3.3.2: Graph of y “ x2

Answer: Using a limit to make sense of the integral, we find

ż 8

0

x2 dx “ limRÑ8

ż R

0

x2 dx

“ limRÑ8

1

3x3

ˇ

ˇ

ˇ

ˇ

R

0

“ limRÑ8

R3

3“ 8. �

This improper integral diverges. Of course, this was clear from the graph!If a function does not limit to 0 as xÑ 8, then its integral over a ď x ă 8will diverge. The same is true for integrals out to ´8.

Before we look at several more examples, we give the precise definition ofType I Improper Integrals.

Page 121: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 112

Type I Improper IntegralsSuppose that f is continuous over the intervals of integration below.

ż 8

a

fpxq dx “ limRÑ8

ż R

a

fpxq dx,

ż b

´8

fpxq dx “ limrÑ´8

ż b

r

fpxq dx,

ż 8

´8

fpxq dx “ limrÑ´8

ż a

r

fpxq dx` limRÑ8

ż R

a

fpxq dx,

where a in the last integral is an arbitrary real number (often taken to be 0).

Example 3.3.3. Computeż 8

2

e´x dx.

Answer:

ż 8

2

e´x dx “ limRÑ8

ż R

2

e´x dx

“ limRÑ8

´e´xˇ

ˇ

R

2

“ limRÑ8

´1

eR` e´2

“ e´2. �

Example 3.3.4. Computeż 8

10

1?xdx

Answer:

ż 8

10

1?xdx “ lim

RÑ8

ż R

10

1?xdx

“ limRÑ8

2?xˇ

ˇ

R

10

“ limRÑ8

2?R ´ 2

?10

“ 8. �

Page 122: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 113

This last example raises a very important issue. If we look at the graphof the integrand, we find the following.

Figure 3.3.3: Graph of y “ 1{?x

Notice that the function is converging to 0 as xÑ 8, but it is not convergingfast enough to keep the improper integral from diverging. How fast a functionneeds to converge to zero for its integral to converge is addressed by thefollowing theorem.

Theorem 3.3.1. The Type I Improper Integrals

ż 8

1

1

xndx

� converge when n ą 1,

� diverge when n ď 1.

Notice that there is nothing special about our choice of lower limit for theseintegrals – any positive lower limit would give the same results!

Proof: The indefinite integral above is different when n “ 1, so we splitthat case from the rest.

Page 123: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 114

ż 8

1

1

xndx “ lim

RÑ8

ż R

1

x´n dx

“ limRÑ8

$

&

%

x´n`1

´n`1

ˇ

ˇ

ˇ

R

1, n ‰ 1

ln |x||R1 , n “ 1

“ limRÑ8

$

&

%

R´n`1

´n`1´ 1´n`1

, n ‰ 1

lnpRq, n “ 1

When n ą 1, there will be some power of R in the denominator of the leftmostfraction above. The limit of that term will be zero and we see

ż 8

1

1

xndx “

1

n´ 1when n ą 1.

For n ď 1, the limit above will definitely diverge. �

Example 3.3.5. Compute

ż ´2

´8

1

x2 ´ 1dx.

Answer: Notice that the integrand diverges at x “ ˘1. Fortunately, thisis outside of our interval of integration! Since this integral is a little morecomplicated, we tackle it first before looking at the limit. By partial fractiondecomposition

1

x2 ´ 1“

1

2

ˆ

1

x´ 1´

1

x` 1

˙

,

and soż

1

x2 ´ 1dx “

1

2

żˆ

1

x´ 1´

1

x` 1

˙

dx

“1

2pln |x´ 1| ´ ln |x` 1|q ` C

“1

2ln

ˇ

ˇ

ˇ

ˇ

x´ 1

x` 1

ˇ

ˇ

ˇ

ˇ

` C.

Page 124: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 115

Our improper integral becomes

ż ´2

´8

1

x2 ´ 1dx “ lim

rÑ´8

ż ´2

r

1

x2 ´ 1dx

“1

2limrÑ´8

ln

ˇ

ˇ

ˇ

ˇ

x´ 1

x` 1

´2

r

“1

2ln

ˇ

ˇ

ˇ

ˇ

´2´ 1

´2` 1

ˇ

ˇ

ˇ

ˇ

´1

2limrÑ´8

ln

ˇ

ˇ

ˇ

ˇ

r ´ 1

r ` 1

ˇ

ˇ

ˇ

ˇ

“1

2lnp3q ´

1

2ln

ˆ

limrÑ´8

ˇ

ˇ

ˇ

ˇ

r ´ 1

r ` 1

ˇ

ˇ

ˇ

ˇ

˙

“1

2lnp3q ´

1

2lnp1q

“1

2lnp3q.

Notice that in the fourth step above, we used the continuity of the logarithm(for positive real numbers) to move the limit inside this function. �

Example 3.3.6. Compute

ż 8

´8

xe´x2

dx.

Answer: The indefinite integral is an easy u-substitution: u “ ´x2

giving du “ ´2x dx.

ż

xe´x2

dx “ ´1

2

ż

e´x2

p´2xq dx

“ ´1

2

ż

eu du

“ ´1

2eu ` C

“ ´1

2e´x

2

` C.

In order to compute the given improper integral, we have to split the integral

Page 125: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 116

into two parts at any arbitrary real number. Often, 0 is an excellent choice.

ż 8

´8

xe´x2

dx “ limrÑ´8

ż 0

r

xe´x2

dx` limRÑ8

ż R

0

xe´x2

dx

“ limrÑ´8

˜

´1

2e´x

2

ˇ

ˇ

ˇ

ˇ

0

r

¸

` limRÑ8

˜

´1

2e´x

2

ˇ

ˇ

ˇ

ˇ

R

0

¸

“ limrÑ´8

ˆ

´1

2`

1

2e´r

2

˙

` limRÑ8

ˆ

´1

2e´R

2

`1

2

˙

“ ´1

2`

1

2“ 0.

Just to emphasize that the choice of 0 makes no difference to the finalanswer, consider what would have happened had we chosen 1:

ż 8

´8

xe´x2

dx “ limrÑ´8

ż 1

r

xe´x2

dx` limRÑ8

ż R

1

xe´x2

dx

“ limrÑ´8

˜

´1

2e´x

2

ˇ

ˇ

ˇ

ˇ

1

r

¸

` limRÑ8

˜

´1

2e´x

2

ˇ

ˇ

ˇ

ˇ

R

1

¸

“ limrÑ´8

ˆ

´1

2e´1

`1

2e´r

2

˙

` limRÑ8

ˆ

´1

2e´R

2

`1

2e´1

˙

“ ´1

2e´1

`1

2e´1

“ 0.

If we had first considered the graph of this function, we could have anticipatedthat the answer would be zero.

Page 126: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 117

Figure 3.3.4: Graph of y “ xe´x2

It certainly seems that the negative area on the left will exactly cancel thepositive area on the right (by symmetry). This turns out to be correct inthis case, but great care must be taken with this kind of reasoning! �

Example 3.3.7. Computeż 8

0

sinpxq dx.

Figure 3.3.5: Graph of y “ sinpxq

Page 127: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 118

Answer: From the figure above, you might suspect that the value of thisintegral would be zero, but that is not the case!

ż 8

0

sinpxq dx “ limRÑ8

ż R

0

sinpxq dx

“ limRÑ8

´ cospxqˇ

ˇ

ˇ

R

0

“ cosp0q ´ limRÑ8

cospRq

“ 1´ limRÑ8

cospRq.

But limRÑ8 cospRq does not exist because cosine has no definite limitingbehavior at infinity (it oscillates between ´1 and 1 forever). Thus,

ż 8

0

sinpxq dx does not exist. �

3.3.2 Type II Improper Integrals

Type II Improper Integrals are integrals where the integrand diverges atsome point over its interval of integration. By breaking integrals apart, wecan always assume that the point of divergence is one of the endpoints of theinterval of integration.

Type II Improper IntegralsSuppose that a ď x ď b is a finite interval and f is continuous over thisinterval except at one of the endpoints.

If f diverges at the left endpoint a, then

ż b

a

fpxq dx “ limrÑa`

ż b

r

fpxq dx.

If f diverges at the right endpoint b, then

ż b

a

fpxq dx “ limRÑb´

ż R

a

fpxq dx.

Notice that the definitions involve either a left-handed or a right-handed limit.In the case where f diverges at the left endpoint, we take a right-handed limitr Ñ a` because we only need to consider values of x bigger than the lower

Page 128: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 119

limit x “ a. Likewise, we use a left-handed limit RÑ b´ in the second casesince we only need to consider values of x smaller than x “ b when computingthe integral.

Example 3.3.8. Computeż 1

0

1?xdx.

Answer: Since the integrand diverges at the left endpoint x “ 0, wehave

ż 1

0

1?xdx “ lim

rÑ0`

ż 1

r

1?xdx

“ limrÑ0`

2?x

ˇ

ˇ

ˇ

ˇ

1

r

“ 2´ 2 limrÑ0`

?r

“ 2. �

Example 3.3.9. Compute

ż 2

0

1

px´ 2q2dx.

Answer: This integrand diverges at the right endpoint of the integral.

ż 2

0

1

px´ 2q2dx “ lim

RÑ2´

ż R

0

1

px´ 2q2dx

“ limRÑ2´

´1

x´ 2

ˇ

ˇ

ˇ

ˇ

R

0

“ ´ limRÑ2´

1

R ´ 2´

1

2

“ 8.

So, this improper integral diverges. �These two examples are specific cases of a more general trend.

Theorem 3.3.2. The Type II Improper Integrals

ż 1

0

1

xndx

Page 129: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 120

� converge when n ă 1,

� diverge when n ě 1.

Proof: As above, we split the case n “ 1 from the rest.

ż 1

0

1

xndx “ lim

rÑ0`

ż 1

r

x´n dx

“ limrÑ0`

$

&

%

x´n`1

´n`1

ˇ

ˇ

ˇ

1

r, n ‰ 1

ln |x||1r , n “ 1

“ limrÑ0`

$

&

%

1´n`1

´ r´n`1

´n`1, n ‰ 1

´ lnprq, n “ 1

When n ă 1, there will be some power of r in the numerator of the rightmostfraction above. The limit of that term will be zero and we see

ż 1

0

1

xndx “

1

1´ nwhen n ă 1.

For n ě 1, the limit above will definitely diverge. �If f diverges in the interior of the interval of integration, split the integral

into two parts at the point where f diverges.

Example 3.3.10. Compute

ż 1

´1

ˆ

13?x

˙2

dx.

Answer: The integrand diverges at x “ 0. So, we split the integral intotwo pieces:

ż 1

´1

ˆ

13?x

˙2

dx “

ż 0

´1

ˆ

13?x

˙2

dx`

ż 1

0

ˆ

13?x

˙2

dx.

Page 130: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 121

The first integral on the right gives

ż 0

´1

ˆ

13?x

˙2

dx “ limRÑ0´

ż R

´1

x´2{3 dx

“ limRÑ0´

3x1{3

ˇ

ˇ

ˇ

ˇ

R

´1

“ limRÑ0´

3R1{3´ 3p´1q1{3

“ 3.

Similarly,

ż 1

0

ˆ

13?x

˙2

dx “ limrÑ0`

ż 1

r

x´2{3 dx

“ limrÑ0`

3x1{3

ˇ

ˇ

ˇ

ˇ

1

r

“ 3´ limrÑ0`

3r1{3

“ 3.

Combining these results gives

ż 1

´1

ˆ

13?x

˙2

dx “ 3` 3 “ 6. �

3.4 Problems

1.) Computeż 3

´2

`

x2´ 1

˘

dx.

Find the total area between the curve y “ x2´ 1 and the x-axis on theinterval ´2 ď x ď 3. Why are these two numbers different?

2.) Find the total area between y “ cospxq and the x-axis on the interval0 ď x ď 2π.

3.) Find the area contained between the curves y “ x2´10 and y “ 8´x2.

Page 131: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 122

4.) Find the area contained between the curves y “ 4x and y “ x2 ` 3.

5.) Find the area contained between the curves y “ x3 ` 3x2 ` 3 andy “ x2 ` 3x` 3.

6.) Find the area bounded by the curves y “ 3, x “ 0, and

y “8x

x2 ´ 1.

7.) Find the area bounded by the curves y “?x, y “

?2x´ 1, and y “ 0.

(Hint: This will require you to compute two integrals!)

8.) Find the volume of the solid obtained by rotating the region betweeny “

?2x` 1 and the x-axis on the interval 0 ď x ď 4 about the x-axis.

9.) Find the volume of the solid obtained by rotating the region betweeny “

?2x` 1 and the y-axis on the interval 0 ď x ď 4 about the y-axis.

10.) Find the volume of the solid obtained by rotating the region containedbetween y “ 3

?x and y “

?x about the x-axis.

11.) Find the volume of the solid obtained by rotating the region containedbetween y “ 3

?x and y “

?x about the y-axis.

12.) Find the volume of the solid obtained by rotating the region containedbetween y “ x and y “ 2

?x about the x-axis.

13.) Find the volume of the solid obtained by rotating the region containedbetween y “ x and y “ 2

?x about the y-axis.

14.) Find the volume of the solid obtained by rotating the region boundedby y “ 1´ e´x

2, y “ 1

2, and x “ 0 about the y-axis.

15.) Prove that the volume of a right circular cone of radius r and height his given by

V “1

3πr2h

by rotating an appropriate line through the origin about the y-axis.

16.) Computeż 8

0

e´2x dx.

Page 132: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 3. APPLICATIONS OF INTEGRATION 123

17.) Computeż 1

´8

e3x dx.

18.) Computeż ´1

´8

13?xdx

19.) Computeż 8

1

xe´x dx.

20.) Computeż 8

2

1

x3 ´ 2x2 ` xdx

21.) Computeż 0

´1

13?xdx

22.) Computeż 10

2

1

px´ 2q3dx

23.) Computeż 6

3

x?x´ 3

dx

24.) Find the volume of the solid obtained by rotating the region betweeny “ 1{x and the x-axis on the interval 1 ď x ă 8 about the x-axis.1

25.) Challenge: Computeż 8

1

lnpxq

x2dx.

(HINT: Remember L’Hopital’s Rule!)

1The solid in Problem 24.) is known as Gabriel’s Horn. You should find that it hasfinite volume, but it turns out that it has infinite surface area. Loosely speaking, youcould fill the horn with a finite volume of paint, but that amount of paint is not nearlyenough to cover its surface!

Page 133: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Chapter 4

Continuous Dynamical Systems

4.1 Introduction to Differential Equations

For a continuous-time dynamical system, we often know something about therate of change of the quantity (or quantities) we are studying rather thanhaving direct knowledge about its actual value. In other words, we haveinformation about the quantity’s derivative, and our task is to deduce thevalue of the quantity itself from this information. Since anti-differentiationis the process of “undoing” differentiation, it will come as no surprise thatindefinite integrals play a key role.

As an example, consider an object at some particular temperature sittingin a large environment that is held at a fixed temperature. We will makethe simplifying assumption that the temperature of the object is uniformthroughout its body. We also assume that the environment is large enoughthat our object does not significantly change the ambient temperature as itheats up or cools down.

Suppose that the temperature of the object at time t is the functionT ptq. Time here can be any real number, so this is clearly a continuous-timedynamical system. The fixed environmental temperature is Te (e for environ-ment). In this system, the time t is called the independent variable. Thisindicates that t is the quantity upon which all other variables in the prob-lem will depend. In contrast, the temperature T “ T ptq is the dependentvariable. Dependent variables are any quantities in the problem which arefunctions of the independent variable.

Isaac Newton is attributed with giving the first universal law of cooling:

124

Page 134: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 125

the rate at which an object’s temperature changes is proportional to its dif-ference in temperature with the environment.1 In terms, of T “ T ptq, wehave

dT

dt“ k pTe ´ T q ,

where k ą 0 is the cooling rate of the object. The cooling rate depends onmany things in general, but it is most directly affected by the size, shape,and composition of the object as well as the type of environment.2

The equation above is a differential equation: an equation for an un-known function in terms of one (or more) of its derivatives. In this case,T “ T ptq is the unknown function, and we have information about its firstderivative. In such a case, we say that the equation above is a first orderdifferential equation. If we had information about the second derivative,we would say that we had a second order differential equation. In general,the order of a differential equation is the order of the highest derivativeappearing in the equation. In this chapter, we will only deal with first or-der equations. Notice that the differential equation for dT {dt involves theunknown function T itself! This is a common occurrence in differential equa-tions that arise in practice.

There are two constants appearing in the differential equation above:the environmental temperature Te and the cooling rate k. These are bothparameters: quantities appearing in a dynamical system which are fixednumbers in any particular version of the problem. In this case, the envi-ronmental temperature and cooling rate are fixed once we decide what sortof object we are modeling and what kind of environment the object will besitting in.

There is an additional piece of information that we need in order toguarantee a unique answer. Thinking about our example of an object that iscooling off (or heating up) in some environment, we would need to know theactual temperature of the object at some particular time to make a definiteprediction about the temperature in the future. Typically, we assume thatwe know the temperature at time t “ 0, and our task is to predict the

1While Newton’s Law of Cooling is extremely useful in many situations, it has definitelimitations. Obviously it does not directly model differences of temperature inside ofan object. It is also suffers from a confusion between the concepts of heat energy andtemperature – a confusion that was only cleared up well after Newton’s day.

2For example, a hot piece of metal will cool off much quicker in a water bath than inair at the same temperature.

Page 135: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 126

temperature for future times t ą 0. This extra information is called theinitial condition (or initial datum) for the differential equation: a givenvalue of the function at some particular time t0 (often t0 “ 0).

Our model of the cooling object is now an instance of an initial valueproblem: a differential equation together with appropriate initial data.

dT

dt“ kpTe ´ T q

T p0q “ T0

Initial value problems (IVPs) are very common in applied mathematics.

4.2 Solutions to Differential Equations

Now that we have discussed the basic terminology of differential equations,our next goal is to understand what it means for a function to be a solution.A solution to a differential equation is any function such that substi-tuting it for the dependent variable in the differential equation yields a truestatement.

Consider the following example.

Example 4.2.1. Show that T ptq “ 10´5e´t{2 is a solution to the differentialequation

dT

dt“

1

2p10´ T q .

Answer: We first compute the derivative of T :

dT

dt“

d

dt

10´ 5e´t{2‰

“ ´5e´t{2ˆ

´1

2

˙

“5

2e´t{2.

If we look at the right-hand side of the differential equation, we find

1

2p10´ T q “

1

2

10´ p10´ 5e´t{2q‰

“1

2

`

5e´t{2˘

“5

2e´t{2.

Page 136: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 127

Since T ptq “ 10´ 5e´t{2 gives the same function when substituted into boththe right- and left-hand sides of the differential equation, it is a solution. �

Without initial data, typical differential equations will have infinite fam-ilies of solutions. Usually this family of solutions has a definite form withone or more arbitrary constants appearing in the formula. The formula spec-ifying the entire family of solutions to a differential equation is called thegeneral solution of the differential equation.

Example 4.2.2. Show that T ptq “ 10` Ce´t{2 is a solution to

dT

dt“

1

2p10´ T q

for any choice of the arbitrary constant C.

Answer: As before, we verify that the function T “ T ptq given aboveproduces the same result on both sides of the differential equation. Remem-ber that C represents an arbitrary real number (and so is not a function oft).

dT

dt“

d

dt

10` Ce´t{2‰

“ Ce´t{2ˆ

´1

2

˙

“ ´C

2e´t{2.

For the right-hand side:

1

2p10´ T q “

1

2

10´ p10` Ce´t{2q‰

“1

2

`

´Ce´t{2˘

“ ´C

2e´t{2.

Since the given function produces the same quantity on both sides of thedifferential equation, we know that T ptq “ 10 ` Ce´t{2 is a solution of thedifferential equation for any choice of the constant C. It turns out that this

Page 137: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 128

T is the general solution to the differential equation above. We will be ableto prove this in later sections! �

Example 4.2.3. Show that

fpxq “ Cex2

´5

2

is a solution to the differential equation

df

dx“ 2xf ` 5x

for any choice of the arbitrary constant C.

Answer: Taking the derivative of the given function gives

df

dx“

d

dx

Cex2

´5

2

“ 2Cxex2

.

For the right-hand side, we find

2xf ` 5x “ 2x

Cex2

´5

2

` 5x

“ 2Cxex2

´ 5x` 5x

“ 2Cxex2

. �

To verify that a given function is a solution to an initial value problem,we have to verify that it satisfies both the differential equation and the giveninitial condition.

Example 4.2.4. Verify that

xptq “ 6et2´1´

5

2t2 ´

5

2

is a solution to the initial value problem

tdx

dt“ 2t2x` 5t4

xp1q “ 1.

Page 138: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 129

Answer: Substituting x “ xptq into the left-hand side of the differentialequation gives

tdx

dt“ t

d

dt

ˆ

6et2´1´

5

2t2 ´

5

2

˙

“ t

ˆ

6et2´1p2tq ´

5

2p2tq

˙

“ 12t2et2´1´ 5t2.

For the right-hand side, we find

2t2x` 5t4 “ 2t2ˆ

6et2´1´

5

2t2 ´

5

2

˙

` 5t4

“ 12t2et2´1´ 5t4 ´ 5t2 ` 5t4

“ 12t2et2´1´ 5t2.

This proves that the given function is a solution to the differential equation.We only need to check the initial datum.

xp1q “ 6ep1q2´1´

5

2p1q2 ´

5

2

“ 6e0´

5

5

2“ 6´ 5

“ 1. �

While it is always worthwhile to know how to verify that a solution iscorrect, what we really need to understand is how to produce the generalsolution to a given differential equation. In general, this is a VERY difficultproblem (just as integration is difficult in general). We will focus on twospecial classes of differential equations that are typically easy to solve anduseful in many applied problems.

4.3 Separable Differential Equations

The most general first order differential equation is an equation of the form

F

ˆ

t, x,dx

dt

˙

“ 0.

Page 139: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 130

This generic equation represents any combination of t, x “ xptq, and x1ptqset equal to zero. Such an equation can be quite difficult to solve, so mosttreatments of first order differential equations discuss the slightly less generalequation

dx

dt“ fpt, xq.

Even this simplified form can be difficult to solve in general, but at the veryleast there are several techniques that can produce numeric approximationsto the actual solutions of this type of differential equation. We will beginby focusing on an even narrower class of differential equations - separablefirst order differential equations.

A separable first order differential equation is any differential equation ofthe form

dx

dt“ fptqgpxq.

As the name suggests, the key thing about this class is that the right-handside of the differential equation is a product of separate functions of theindependent variable t and the dependent variable x “ xptq.

It turns out that there is a simple process for finding the solution toseparable differential equations. We will first develop this general processand then apply it to a number of examples.

Theorem 4.3.1. The general solution to the separable equation

dx

dt“ fptqgpxq

is given by the integralsż

dx

gpxq“

ż

fptq dt` C.

Proof: In order to understand the proof, it will help to explicitly displaythe functional dependence x “ xptq in the differential equation:

x1ptq “ fptqgpxptqq.

We begin by bringing all terms involving xptq to one side of the equation

x1ptq

gpxptqq“ fptq

Page 140: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 131

(we should technically assume that gpxptqq is non-zero, but this will not makeany difference in the proof). Next, we integrate both sides with respect to t.

ż

x1ptq

gpxptqqdt “

ż

fptq dt` C.

Notice that we only need one unknown constant on the right-hand side of theequation! We cannot do anything more with the right-hand integral withoutknowing the specific form of the function fptq. The left-hand side can besimplified by a u-substitution: u “ xptq and du “ x1ptq dt.

ż

x1ptq

gpxptqqdt “

ż

du

gpuq.

Since the variable u was an arbitrary choice, we could just as easily use x(committing a slight abuse of notation). This gives us

ż

dx

gpxq“

ż

fptq dt “ C. �

What this theorem suggests is that we can treat dx{dt as if it were afraction (which it definitely is not). For the equation

dx

dt“ fptqgpxq,

we solve by dividing both sides by gpxq and then multiplying both sides bydt. We then integrate both sides and attempt to solve for x “ xptq.

Example 4.3.1. Find the general solution to

dx

dt“ tx.

Answer: We first separate the t and x variables and integrate to getż

dx

x“

ż

t dt` C.

Integrating both sides gives

ln |x| “1

2t2 ` C.

Page 141: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 132

Notice that we only need one arbitrary constant for both integrals. We cansolve for x by first taking the natural exponential of both sides:

eln |x|“ e

12t2`C

|x| “ eCe12t2 .

Finally, we undo the absolute value by allowing the right-hand side to beeither positive or negative:

|x| “ eCe12t2

xptq “ ˘eCe12t2

xptq “ Ce12t2 .

Since˘eC can be any arbitrary real number (positive or negative)3, we simplyreplaced it with a new arbitrary constant C in the last step. This gives usthe general solution to the differential equation. �

Example 4.3.2. Find the general solution to

dx

dt“ e3t

p1` x2q.

Separating and integrating gives

ż

dx

1` x2“

ż

e3t dt` C

arctanpxq “1

3e3t` C

xptq “ tan

ˆ

1

3e3t` C

˙

. �

Notice in the last example that the “`C” is part of the function argumentof the tangent. This is critical to the solution, and the functions tan

`

13e3t

˘

`

3Technically, ˘eC can be any value except 0. However, allowing C “ 0 yields a correctsolution (namely xptq “ 0). The reason this solution was not found by our calculationswas that in dividing by x “ xptq, we implicitly assumed it was non-zero! This is a verycommon happenstance with separable DEs.

Page 142: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 133

C are completely different (and not the general solution to the differentialequation above).

For initial value problems, we first find the general solution as above andthen force the initial condition (which will determine the arbitrary constantC).

Example 4.3.3. Find the solution to

dx

dt“ tpx` 1q

xp0q “ 2.

Answer: We begin by finding the general solution to the separable dif-ferential equation as usual.

ż

dx

x` 1“

ż

t dt` C

ln |x` 1| “1

2t2 ` C

|x` 1| “ e12t2`C

|x` 1| “ eCe12t2

x` 1 “ ˘eCe12t2

xptq “ Ce12t2´ 1.

Now that we have the general solution, finding the specific solution to ourinitial value problem is simple:

xp0q “ Ce12p0q2´ 1

“ C ´ 1 “ 2

C “ 3.

So, the solution to the initial value problem is

xptq “ 3e12t2´ 1. �

Page 143: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 134

Example 4.3.4. Find the solution to

dx

dt“xp1´ xq

txp1q “ 5.

Answer:ż

dx

xp1´ xq“

ż

dt

t` C “ ln |t| ` C.

For the integral on the left-hand side, we use partial fraction decomposition:

1

xp1´ xq“

1

x`

1

1´ x.

This allows us to compute the integral above:ż

dx

xp1´ xq“

ż

1

xdx`

ż

1

1´ xdx

“ ln |x| ´ ln |1´ x| `D

ln

ˇ

ˇ

ˇ

ˇ

x

1´ x

ˇ

ˇ

ˇ

ˇ

`D.

We will not need the second arbitrary constant, “`D,” in the differentialequation, but since we were doing a separate indefinite integral it technicallyneeds to be there!

This gives the general solution of the differential equation as

ln

ˇ

ˇ

ˇ

ˇ

x

1´ x

ˇ

ˇ

ˇ

ˇ

“ ln |t| ` C.

Taking the natural exponential of both sides givesˇ

ˇ

ˇ

ˇ

x

1´ x

ˇ

ˇ

ˇ

ˇ

“ eln |t|`C

“ eCeln |t|

“ eC |t|x

1´ x“ ˘eC |t|

x

1´ x“ C|t|.

Page 144: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 135

The next question is whether or not we can solve for x. It turns out that wecan by multiplying both sides by 1´ x.

x

1´ x“ C|t|

x “ p1´ xqC|t|x “ C|t| ´ C|t|x

x` C|t|x “ C|t|xp1` C|t|q “ C|t|

xptq “C|t|

1` C|t|.

Notice that the constant C must be the same constant in both the numeratorand denominator of the general solution! Finally, we use the initial conditionto find the solution to the initial value problem.

xp1q “C

1` C“ 5

C “ 5p1` CqC “ 5` 5C

´4C “ 5

C “ ´5

4.

This gives

xptq “´5

4|t|

1´ 54|t|

“´5|t|

4´ 5|t|

“5|t|

5|t| ´ 4. �

4.4 First Order Linear Differential Equations

The second type of differential equations we discuss is the class of first orderlinear differential equations. These are differential equations of the form

dx

dt` P ptqx “ Qptq.

Page 145: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 136

The method used to solve these equations involves finding an integratingfactor. This is a function µptq which converts the left–hand side of the dif-ferential equation into a perfect derivative. In other words, we want to finda function µ “ µptq that has the following property:

µdx

dt` µP ptqx “

d

dtrµxs .

Sinced

dtrµxs “ x

dt` µ

dx

dt,

our integrating factor µ must satisfy

xdµ

dt“ µP ptqx.

So long as x ‰ 0, we must have

dt“ µP ptq.

But this is just a separable differential equation for µ! The solution is givenby

ż

µ“

ż

P ptq dt` C

lnµ “

ż

P ptq dt` C

µptq “ Ceş

P ptq dt

Since we only need a single integrating factor, we take C “ 1.Once we have the integrating factor, we find

dx

dt` P ptqx “ Qptq

µptqdx

dt` µptqP ptqx “ µptqQptq

d

dtrµptqxs “ µptqQptq

µptqxptq “

ż

µptqQptq dt` C

xptq “

ş

µptqQptq dt` C

µptq.

We summarize our computations above in the following theorem

Page 146: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 137

Theorem 4.4.1. The general solution to a differential equation of the form

dx

dt` P ptqx “ Qptq

is given by

xptq “

ş

µptqQptq dt` C

µptq

where the integrating factor µ is given by

µptq “ eş

P ptq dt.

Example 4.4.1. Find the general solution to

dx

dt` 2tx “ t.

Answer: Since P ptq “ 2t, we can take

µptq “ eş

2t dt“ et

2

for the integrating factor. Since Qptq “ t, the general solution is given by

xptq “

ş

tet2dt` C

et2

12et

2` C

et2“

1

2` Ce´t

2

. �

Example 4.4.2. Solve the following initial value problem.

tdx

dt` 2x “

cosptq

txpπq “ 2

Answer: Before we can use our general solution, we have to write the dif-ferential equation in the correct form. Dividing both sides of the equationby t, we find

dx

dt`

2

tx “

cosptq

t2.

Page 147: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 138

This means

P ptq “2

t,

Qptq “cosptq

t2.

Sinceż

P ptq dt “

ż

2

tdt “ 2 lnptq “ lnpt2q,

we can takeµptq “ elnpt2q

“ t2.

The general solution to our differential equation is

xptq “

ş

µptqQptq dt` C

µptq

ş

t2 cosptqt2

dt` C

t2

ş

cosptq dt` C

t2

“sinptq ` C

t2.

Now we can fit the initial condition.

xpπq “sinpπq ` C

π2“ 2

C

π2“ 2

C “ 2π2.

So, the solution to our initial value problem is

xptq “sinptq ` 2π2

t2. �

Page 148: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 139

4.5 Application: Newton’s Law of Cooling

As we mentioned in Section 4.1, Newton’s Law of Cooling states that the rateat which an object’s temperature changes is proportional to its difference intemperature with the environment. This leads to the differential equation

dT

dt“ kpTe ´ T q

where T “ T ptq is the temperature of the object at time t, Te is the envi-ronmental temperature, and k is the cooling rate of the object (assumed tobe a positive parameter). Note the order in which the temperatures are sub-tracted. If the object is colder than the environment, T “ T ptq is smaller thanTe. In this case, kpTe ´ T q ą 0 and the temperature of the object increases.Similarly, kpTe´T q ă 0 when the object is hotter than the environment. Asa result, T “ T ptq will decrease.

Theorem 4.5.1. The solution to the initial value problem

dT

dt“ kpTe ´ T q

T p0q “ T0

(where k and Te are parameters) is given by

T ptq “ Te ´ pTe ´ T0q e´kt.

Proof: Newton’s Law of Cooling is certainly a separable differential equa-tion. The general solution is found as follows.

ż

dT

Te ´ T“

ż

k dt` C

´ ln |Te ´ T | “ kt` C

ln |Te ´ T | “ ´kt´ C

|Te ´ T | “ e´Ce´kt

Te ´ T “ ˘e´Ce´kt

Te ´ T “ Ce´kt

T ptq “ Te ´ Ce´kt.

Page 149: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 140

To find the arbitrary constant C, we us the initial condition T p0q “ T0. Thisgives

T p0q “ Te ´ Ce0

“ Te ´ C “ T0

C “ Te ´ T0.

So, the solution to Newton’s Law of Cooling is

T ptq “ Te ´ pTe ´ T0q e´kt,

where Te is the environmental temperature, T0 is the initial temperature ofthe object, and k is the cooling rate of the object. �

Notice thatlimtÑ8

T ptq “ Te

regardless of the initial temperature (because k ą 0). This means that thetemperature of the object approaches the environmental temperature just aswe would expect from experience.

There is no need to remember the formula we just derived since you canreconstruct it for any particular problem by the usual methods for separabledifferential equations. We give it here just to illustrate the typical way theseproblems are solved.

Example 4.5.1. Suppose an object initially at a temperature of T0 “ 150˝Cis placed in a large water bath at 10˝C. If the cooling rate of the object isk “ 1

20sec´1, how long until the object reaches 25˝C?

Answer: The given information leads us to the following initial valueproblem.

dT

dt“

1

20p10´ T q

T p0q “ 150.

Page 150: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 141

Solving the differential equation yields

ż

dT

10´ T“

ż

1

20dt` C

´ ln |10´ T | “1

20t` C

|10´ T | “ e´Ce´t{20

10´ T “ ˘e´Ce´t{20

T ptq “ 10´ Ce´t{20.

Using the given initial datum gives

T p0q “ 10´ C “ 150

C “ 10´ 150 “ ´140.

So, the temperature of the object is given by

T ptq “ 10` 140e´t{20.

We are being asked for the time t such that T ptq “ 25. This means weneed to solve

T ptq “ 10` 140e´t{20“ 25.

10` 140e´t{20“ 25

140e´t{20“ 25´ 10

e´t{20“

15

140“

3

28

´1

20t “ ln

ˆ

3

28

˙

t “ ´20 ln

ˆ

3

28

˙

“ 20 ln

ˆ

28

3

˙

« 44.7 seconds. �

Notice in the last step we used

´ lnpxq “ ln

ˆ

1

x

˙

Page 151: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 142

to simplify the expression for t. This is a common tool for simplifying ex-pressions in these types of problems.

Typically, we are not given the constant k directly. Instead, we usuallyhave additional temperature information at some time after the initial tem-perature reading. This allows us to find k and predict the temperature atfuture times as well.

Example 4.5.2. A can of soda is taken from a refrigerator at a temperatureof 35˝F and is left in room held at a temperature of 70˝F. If the can warmsto a temperature of 45˝F after 20 minutes, how long until the soda is at attemperature of 60˝F?

Answer: We are given the environmental temperature, Te “ 70˝F, andthe initial temperature of the soda, T0 “ 35˝F. Notice that we are not giventhe constant k. The data we have so far leads us to the initial value problem

dT

dt“ kp70´ T q

T p0q “ 35.

Separating and integrating the differential equation gives

ż

dT

70´ T“

ż

k dt` C

´ ln |70´ T | “ kt` C

70´ T “ Ce´kt

T ptq “ 70´ Ce´kt.

Using the initial condition gives

T p0q “ 70´ C “ 35

C “ 35.

So far, we know thatT ptq “ 70´ 35e´kt.

The other piece of information we are given is that T p20q “ 45. Using this,

Page 152: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 143

we can find k.

T p20q “ 70´ 35e´kp20q“ 45

70´ 45 “ 35e´20k

25 “ 35e´20k

e´20k“

25

35“

5

7

´20k “ ln

ˆ

5

7

˙

k “´ lnp5{7q

20“

lnp7{5q

20.

We are now ready to answer the question posed in the problem: find thetime t so that T ptq “ 60. Even though we know k, the expression for it ismessy enough that we will not explicitly substitute for it until the end of theproblem. Notice that the steps below are exactly like the steps used to findk.

T ptq “ 70´ 35e´kt “ 60

70´ 60 “ 35e´kt

e´kt “10

35“

2

7

´kt “ ln

ˆ

2

7

˙

t “´ lnp2{7q

k“

20 lnp7{2q

lnp7{5q

« 74.5 minutes. �

4.6 Application: Selective Diffusion

A model related to Newton’s Law of Cooling is a simplistic model of selectivediffusion across a membrane. Consider the diagram below showing a cellsitting inside a ambient solution of some chemical.

Page 153: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 144

C “ Cptq

external concentration “ Γ

α

β

Figure 4.6.1: A Schematic of Selective Diffusion

The concentration of the chemical outside the cell membrane is Γ (assumedto be constant) while the concentration inside the cell is C “ Cptq. Thechemical can cross into the cell at a rate α (a positive parameter) whileit can leave at a rate β (also positive). Note that these two rates couldbe different in general (hence the name selective diffusion). Assuming thevolume of the cell is constant, we arrive at the following differential equation

dC

dt“ αΓ´ βC.

The units for the rates α and β are “per time” (so “per second,” “per minute,”etc.). If we factor out the rate β, we get the following equation

dC

dt“ β

ˆ

α

βΓ´ C

˙

which is equivalent to Newton’s Law of Cooling with k replaced by β and Tereplaced by the concentration αΓ{β. Since this equation has the same form,the problem solving techniques are the same as the previous section!

Page 154: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 145

Example 4.6.1. Suppose that a cell is immersed in a salt solution with aconcentration of potassium ions of 5 mmol per liter. The flow rate of ions intothe cell is 1/15 per second while the flow rate out is only 1/25 per second. Ifthe concentration of potassium ions inside the cell is 1 mmol per liter, howlong until the concentration reaches 4 mmol per liter? If the cell remains inthe solution, what value will the concentration of potassium ions inside thecell approach in the long run?

Answer: We have Γ “ 5, α “ 1{15, and β “ 1{25. The differentialequation for this problem is

dC

dt“

1

15p5q ´

1

25C “

1

1

25C “

1

25

ˆ

25

3´ C

˙

.

This gives us the initial value problem

dC

dt“

1

25

ˆ

25

3´ C

˙

Cp0q “ 1.

Separating and integrating the differential equation gives

ż

dC

25{3´ C“

ż

1

25dt`D

´ ln

ˇ

ˇ

ˇ

ˇ

25

3´ C

ˇ

ˇ

ˇ

ˇ

“t

25`D

25

3´ C “ De´t{25

Cptq “25

3´De´t{25.

Note that we used “`D” for the arbitrary constant since C is being used forconcentration. Fitting the initial data gives

Cptq “25

22

3e´t{25.

Page 155: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 146

Solving Cptq “ 4 gives

25

22

3e´t{25

“ 4

22

3e´t{25

“25

3´ 4 “

13

3

e´t{25“

13{3

22{3“

13

22

´1

25t “ ln

ˆ

13

22

˙

t “ ´25 ln

ˆ

13

22

˙

“ 25 ln

ˆ

22

13

˙

« 13.2 seconds.

For the second question, note that

limtÑ8

Cptq “ limtÑ8

ˆ

25

22

3e´t{25

˙

“25

3.

So, the concentration will limit to 25{3 mmol per liter. �

Notice that the limiting concentration of ions inside the cell (813

mmol/L)is higher than the ambient concentration. The slightly slower rate of diffusionout of the cell allows the concentration of ions inside the cell to be higherthan the environment.

Example 4.6.2. Suppose that a certain drug leaves a cell three times fasterthan it enters. The concentration in the bloodstream is currently at 3 µg/Lwhile the concentration inside the cell is 8 µg/L. After 30 minutes, the con-centration in the cell has fallen to 5 µg/L. Once the drug falls below a con-centration of 2 µg/L, it ceases to be effective. How much longer will the drughave an effect inside the cell.

Answer: We know that β “ 3α and Γ “ 3. This give us the differentialequation

dC

dt“ αp3q ´ 3αC.

Page 156: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 147

Factoring out 3α and noting the initial condition give us the problem

dC

dt“ 3α p1´ Cq

Cp0q “ 8.

Solving the differential equation givesż

dC

1´ C“

ż

3α dt`D

´ ln |1´ C| “ 3αt`D

1´ C “ De´3αt

Cptq “ 1´De´3αt.

Fitting the initial data gives us

Cptq “ 1` 7e´3αt.

Notice that the limiting concentration inside the cell will be 1 µg/L.We use the data Cp30q “ 5 to determine α.

Cp30q “ 1` 7e´3αp30q“ 5

7e´90α“ 4

e´90α“

4

7

´90α “ ln

ˆ

4

7

˙

α “´ lnp4{7q

90“

lnp7{4q

90.

Now that we know α, we can easily solve Cptq “ 2.

1` 7e´3αt“ 2

7e´3αt“ 1

e´3αt“

1

7

´3αt “ ln

ˆ

1

7

˙

t “´ lnp1{7q

3α“

30 lnp7q

lnp7{4q

« 104.3 minutes. �

Page 157: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 148

4.7 Application: Exponential Growth and De-

cay

The simplest of all population models is exponential growth. The rate atwhich a population is increasing is proportional to the size of the population.If we let P “ P ptq be the size of the population at time t, then we have

dP

dt“ kP,

where k ą 0 is the growth rate of the population. If we know the size of thepopulation at t “ 0, we get the initial value problem

dP

dt“ kP

P p0q “ P0.

Theorem 4.7.1. The solution to any exponential growth problem is

P ptq “ P0ekt.

Proof: Separating and integrating the differential equation givesż

dP

P“

ż

k dt` C

ln |P | “ kt` C

|P | “ eCekt

P “ ˘eCekt

P ptq “ Cekt.

Fitting the initial condition gives

P p0q “ C “ P0. �

Example 4.7.1. A culture of bacteria is growing exponentially. Initially,there are 200 organisms, and after 20 hours, the population has increased to1800 organisms. How many bacteria will there be after 2 days? How longuntil there are 1,000,000 organisms?

Page 158: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 149

Answer: From our result above, we know that

P ptq “ 200ekt.

Our first job is to find k. Using P p20q “ 1800, we find

P p20q “ 200e20k“ 1800

e20k“ 9

20k “ lnp9q

k “lnp9q

20.

For the first question, since 2 days is 48 hours, we have

P p48q “ 200ekp48q

“ 200e4820

lnp9q

“ 200elnp912{5q

“ 200`

912{5˘

« 39013.

So there will be just over 39,000 bacteria after 48 hours. For the secondquestion, we solve P ptq “ 1, 000, 000.

200ekt “ 1000000

ekt “ 5000

kt “ lnp5000q

t “lnp5000q

k“

20 lnp5000q

lnp9q

« 77.5 hours. �

Exponential decay of radioactive elements is essentially the same dif-ferential equation. In words, the rate of decay of a radioactive isotope isproportional to the total amount of the element. If A “ Aptq is the amountof the element at time t, we have

dA

dt“ ´kA

Aptq “ A0,

where k ą 0 is the decay rate of the radioactive element (also called itsactivity) and A0 is the initial amount of the element.

Page 159: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 150

Theorem 4.7.2. The solution to any exponential decay problem is

Aptq “ A0e´kt.

Proof: The proof is the same as for exponential growth – just replace kby ´k. �

Example 4.7.2. Ru–261 is an isotope of rutherfordium which undergoesα-decay into nobelium–257 (among other products). Initially, we have 100µg of the isotope, and only 35 µg remain after 120 seconds. How long untilthere is less than 1 µg remaining? How long did it take for half of the sampleto decay?

Answer: We know that the amount of the isotope at time t is given by

Aptq “ 100e´kt.

Using Ap120q “ 35 gives

100e´kp120q“ 35

e´120k“

35

100“

7

20

´120k “ ln

ˆ

7

20

˙

“ ´ ln

ˆ

20

7

˙

k “lnp20{7q

120.

To find out how long until there is only 1 µg, we solve Aptq “ 1.

100e´kt “ 1

e´kt “1

100

´kt “ ln

ˆ

1

100

˙

“ ´ ln p100q

t “120 lnp100q

lnp20{7q

« 526.4 seconds.

Page 160: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 151

To find out the time when there was half the original amount, we solveAptq “ 50.

100e´kt “ 50

e´kt “1

2

´kt “ ln

ˆ

1

2

˙

“ ´ ln p2q

t “120 lnp2q

lnp20{7q« 79.2 seconds. �

Instead of listing the activity of a radioactive element directly, usuallythe isotope’s half-life is given. This is defined to be the amount of timeuntil only half the original amount of the isotope remains. In other words,the half-life, t1{2, is a solution to

Apt1{2q “1

2A0.

If we try to find a relationship between the half-life and the activity k, thefirst thing we find is

A0e´kt1{2 “

1

2A0

e´kt1{2 “1

2.

Notice that the actual initial amount of the isotope (A0) is completely irrel-evant to the half-life. This means that the half-life is a characteristic of theisotope itself (and not the specific sample of the isotope being studied).

Lemma 4.7.3. The half-life of a radioactive element, t1{2, is related to itsactivity k by

k “lnp2q

t1{2.

Page 161: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 152

Proof: Finishing the computation above

A0e´kt1{2 “

1

2A0

e´kt1{2 “1

2

´kt1{2 “ ln

ˆ

1

2

˙

“ ´ lnp2q

k “lnp2q

t1{2. �

Example 4.7.3. The half-life of plutonium–238 is 87.7 years. If we have asample containing 30 g of the isotope, how long until there is less than 1 gof plutonium in the sample?

Answer: We know that the activity is

k “lnp2q

87.7.

We need to solve Aptq “ 1.

30e´kt “ 1

e´kt “1

30

´kt “ ln

ˆ

1

30

˙

“ ´ lnp30q

t “lnp30q

k“

87.7 lnp30q

lnp2q

« 430.3 years. �

There is a related notion for exponential growth – doubling time. Thedoubling time, t2, of a population undergoing exponential growth is theamount of time it takes for the population to double in size. That is,

P pt2q “ 2P0.

Lemma 4.7.4. The doubling time, t2, of a population experiencing exponen-tial growth is related to the growth rate k by

k “lnp2q

t2.

Page 162: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 153

Proof:

P0ekt2 “ 2P0

ekt2 “ 2

kt2 “ lnp2q

k “lnp2q

t2. �

Example 4.7.4. A certain population is experiencing exponential growth.Initially there are 500 organisms, and the population increased to 1600 or-ganisms after 36 hours. What is the doubling time for this population?

Answer: To find the doubling time, we first need the growth rate. Weknow P ptq “ 500ekt and P p36q “ 1600. Solving for k gives

500e36k“ 1600

e36k“

16

5

36k “ ln

ˆ

16

5

˙

k “lnp16{5q

36.

So, the doubling time is given by

t2 “lnp2q

k“

36 lnp2q

lnp16{5q« 21.5 hours.

So, the population doubles in size roughly every 21.5 hours. �

4.8 Application: Logistic Growth

While exponential growth is a decent model for relatively small populations,it fails to account for a number of environmental factors that can limit thegrowth of larger populations. Most importantly, environments where re-sources are limited can only support some maximum number of individuals

Page 163: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 154

in the long-term. The simplest population model which can account forlimited resources is the logistic growth model. The rate of change of apopulation’s size is roughly proportional to the population size for relativelysmall populations. However, when the population nears a critical size, thepopulation’s growth approaches zero.

Mathematically speaking, there are many models we could develop thathave this behavior. The best advice to give in such situations is to start withas simple a model as possible. In that spirit, logistic growth is given by thedifferential equation

dP

dt“ kP

ˆ

1´P

N

˙

,

where P “ P ptq is the population size at time t, k ą 0 is the logistic growthrate of the population, and N ą 0 is the critical population size – usuallycalled the carrying capacity of the environment.

Just as before, we give the general solution and then examine some par-ticular cases.

Theorem 4.8.1. The solution to the logistic differential equation

dP

dt“ kP

ˆ

1´P

N

˙

P p0q “ P0,

is given by

P ptq “N

Ce´kt ` 1

where the constant C is related to the initial datum and carrying capacity by

C “N ´ P0

P0

.

Proof: Solving this differential equation is similar to Example 4.3.4.Separating and integrating the differential equation gives

ż

dP

P p1´ P {Nq“

ż

k dt` C “ kt` C.

In order to attack the left-hand integral, we use partial fraction decomposi-tion:

1

P p1´ P {Nq“

1

P`

1{N

1´ P {N“

1

P`

1

N ´ P.

Page 164: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 155

So, the integral on the left-hand side above is

ż

dP

P p1´ P {Nq“

ż

dP

P`

ż

dP

N ´ P

“ ln |P | ´ ln |N ´ P | `D

“ ln

ˇ

ˇ

ˇ

ˇ

P

N ´ P

ˇ

ˇ

ˇ

ˇ

`D.

Dropping the extraneous “`D” we have

ln

ˇ

ˇ

ˇ

ˇ

P

N ´ P

ˇ

ˇ

ˇ

ˇ

“ kt` C

ˇ

ˇ

ˇ

ˇ

P

N ´ P

ˇ

ˇ

ˇ

ˇ

“ eCekt

P

N ´ P“ ˘eCekt

P

N ´ P“ Cekt

P “ CektpN ´ P qP ` PCekt “ NCekt

P ptq “NCekt

1` Cekt.

Fitting the initial datum gives

P p0q “NC

1` C“ P0

NC “ P0p1` CqNC ´ P0C “ P0

C “ P0

N ´ P0

.

Page 165: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 156

Substituting this value for C and simplifying gives

P ptq “N rP0{pN ´ P0qse

kt

1` rP0{pN ´ P0qsekt

“N rP0{pN ´ P0qse

kt

1` rP0{pN ´ P0qsekt¨N ´ P0

N ´ P0

“NP0e

kt

N ´ P0 ` P0ekt.

The form of the solution given in the theorem is obtained from this one bydividing both numerator and denominator by P0e

kt. �Two typical plots of logistic growth functions are shown below.

Figure 4.8.1: Typical Logistic Curves

Notice that for initial data significantly smaller than the carrying capacityN , the population starts out growing at an almost exponential rate. Oncethe population nears the carrying capacity, the size of the population levelsoff. On the other hand, for initial data that is larger than this critical size thesystem rapidly decreases to the carrying capacity. The form of the solutiongiven in the theorem clearly indicates that for any reasonable condition (thatis, P0 ą 0)

limtÑ8

P ptq “ N.

Page 166: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 157

Notice that except for the exceptional case P0 “ N , the solution P ptq neveractually equals to N ; it merely approaches the value as time goes on.

Example 4.8.1. A population is experiencing logistic growth in a regionwhere the carrying capacity for the species is 25,000 organisms. If there were1500 individuals initially and 5000 after 5 years, how long until there are20,000 organisms?

Answer: As usual, we are not given the growth rate directly. Using thegiven information P0 “ 1500 and N “ 25000, we have

P ptq “25000

473e´kt ` 1

“75000

47e´kt ` 3.

Using P p5q “ 5000 gives

75000

47e´kp5q ` 3“ 5000

75000 “ 5000p47e´5k` 3q

15 “ 47e´5k` 3

e´5k“

12

47

´5k “ ln

ˆ

12

47

˙

k “ ´1

5ln

ˆ

12

47

˙

“1

5ln

ˆ

47

12

˙

.

Page 167: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 158

Now that we have k, we can answer the question posed in the problem.

P ptq “ 20000

75000

47e´kt ` 3“ 20000

75000 “ 20000p47e´kt ` 3q

15

4“ 47e´kt ` 3

47e´kt “3

4

e´kt “3

188

´kt “ ln

ˆ

3

188

˙

t “ ´lnp3{188q

k“

5 lnp188{3q

lnp47{12q

« 15.2 years. �

Determining both the growth rate and the carrying capacity for a popu-lation requires 3 observations of the population: the initial population sizeand two observations at later times. However, it is NOT the case that any3 observations of increasing population sizes can be made to fit the logisticmodel. In particular, the proportional growth rate, P 1{P , needs to be a linearfunction of P with negative slope:

dP {dt

P“ k

ˆ

1´P

N

˙

.

In actual applications, we would have a large number of observations ofthe population size (more than three, at any rate). Since such observationscome with associated error, we can try to find the logistic curve which bestfits the data. This statistical approach would then give us estimates of thecarrying capacity, N , and growth rate, k. There are various tests which canbe used to determine whether a logistic growth model is appropriate for agiven set of data.

Page 168: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 159

4.9 Application: Single Compartment Mix-

ing

A type of problem similar to the Selective Diffusion model is a simple modelfor a solution being mixed in a large tank. Consider the following situation.

Example 4.9.1. We have a tank that initially holds 50 liters of a salinesolution at a concentration of 30 grams per liter. A salt solution of concen-tration 10 grams per liter is flowing into the tank at a rate of 5 liters perminute. The well–mixed solution is flowing out of the tank at a matchingrate of 5 liters per minute. Determine the concentration of salt in the tankas a function of time.

5 L/min

10 g/L @ 5 L/min

ô

Figure 4.9.1: Tank from Example 4.9.1

Answer: Since the flow rate in matches the flow rate out (both are 5 L/min),the volume of fluid in the tank does not change. Let C “ Cptq be theconcentration of salt in the tank at time t. Notice that C has units gramsper liter. It turns out that the easiest thing to model is the total amount ofsalt in the tank at time t, A “ Aptq which has units grams. Since the volumein the tank is a constant 50 L, we have

Cptq “Aptq

50.

Page 169: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 160

To model A, we need to consider dA{dt which has units grams per minute.

dA

dt“ ptotal salt in per minuteq ´ ptotal salt out per minuteq

ptotal salt in per minuteq “´

10g

L

¯

ˆ

5L

min

˙

“ 50g

min

ptotal salt out per minuteq “

ˆ

A

50

g

L

˙ˆ

5L

min

˙

“A

10

g

min

Notice that the amount of salt leaving the tank at time t is proportional tothe concentration of salt in the tank at that time! This gives us the followinginitial value problem

dA

dt“ 50´

A

10

Ap0q “´

30g

L

¯

p50 Lq “ 1500 g.

The differential equation for A is both separable and first order linear.We solve it here as a first order linear differential equation.

dA

dt`

1

10A “ 50

µptq “ eş

1{10 dt“ et{10

Aptq “

ş

50et{10dt`D

et{10

“500et{10 `D

et{10

“ 500`De´t{10

Fitting the initial condition gives

Ap0q “ 500`D “ 1500

D “ 1000.

So,

Aptq “ 500` 1000e´t{10

Cptq “Aptq

50“ 10` 20e´t{10.

Page 170: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 161

Figure 4.9.2: Solution to Example 4.9.1

Notice that the concentration of salt inside the tank starts at 30 g/L asit should. We also see that

limtÑ8

Cptq “ 10 g/L.

This makes sense as that is the concentration of the external salt solutionflowing into the tank. Basically, as the solution in the tank is drained it isslowly replaced by the solution flowing in. As a result, the concentration ofsalt in the tank should limit to the incoming concentration. �

Analyzing the total amount of the compound in the tank is always thebest way to approach these mixing problems. The crucial fact to remember isthat the amount of salt flowing out of the tank should be proportional to theconcentration of salt currently in the tank (and so will involve the unknownquantity A).

The assumption that the solution is well–mixed is fairly suspect. Es-sentially, we are assuming that the solution that flows into the tank fromthe outside is fully mixed throughout the tank instantaneously. One way ofthinking about this assumption is that the mixing process should be very

Page 171: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 162

fast on the time–scale of the problem. Since our previous problem usedminutes and salt diffuses fairly rapidly, we are probably okay assuming thesolution is always well–mixed. Had we wanted to predict the concentrationon the scale of seconds, the well–mixed assumption becomes more suspect.On the flip–side, switching the time scale to hours versus minutes shouldmake the well–mixed assumption even more justifiable. We will simply usethis assumption for the remaining problems without further comment.

Example 4.9.2. Suppose the set-up from Example 4.9.1 is modified so thatthe external solution flows into the tank at rate of 7 L/min. If the tank canhold 100 L of fluid and the solution remains well–mixed for all time, find theconcentration inside the tank for all times until the tank is full.

5 L/min

10 g/L @ 7 L/min

ô

Figure 4.9.3: Tank from Example 4.9.2

Answer: First, note that since the flow rates no longer match, the volume offluid in the tank is increasing at a rate of 2 liters every minute. This meansthat the volume of fluid in the tank is given by

V ptq “ 50` 2t.

Since the tank can hold a maximum of 100 liters, we can only model theconcentration of salt inside the tank up to t “ 25 minutes. After this time,the salt solution will start to overflow the top of the tank (and so more willflow out of the tank than 5 L/min). Now, the concentration, Cptq, and thetotal amount of salt in the tank, Aptq, are related by

Cptq “Aptq

2t` 50for 0 ď t ď 25.

Page 172: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 163

Analyzing the total salt flowing into and out of the tank gives

dA

dt“ ptotal salt in per minuteq ´ ptotal salt out per minuteq

ptotal salt in per minuteq “´

10g

L

¯

ˆ

7L

min

˙

“ 70g

min

ptotal salt out per minuteq “

ˆ

A

2t` 50

g

L

˙ˆ

5L

min

˙

“5A

2t` 50

g

min

This gives us the differential equation

dA

dt`

ˆ

5

2t` 50

˙

A “ 70

Ap0q “ 1500.

Notice that when the volume of fluid in the tank changes, the differentialequation is still first order linear but no longer separable.

The integrating factor for this differential equation requires the followingintegral.

ż

P ptq dt “

ż

5

2t` 50dt

“5

2lnp2t` 50q

“ lnp2t` 50q5{2

This means the integrating factor is

µptq “ eş

P ptq dt

“ elnp2t`50q5{2

“ p2t` 50q5{2.

For the total amount of salt, we find

Aptq “

ş

70p2t` 50q5{2 dt`D

p2t` 50q5{2

“70p2

7qp1

2qp2t` 50q7{2 `D

p2t` 50q5{2

“ 10p2t` 50q `Dp2t` 50q´5{2.

Page 173: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 164

For the initial condition, we have

Ap0q “ 10p50q `Dp50q´5{2“ 1500

D

12500?

2“ 1000

D “ 12500000?

2.

This gives us

Aptq “ 10p2t` 50q ` 12500000?

2p2t` 50q´5{2,

Cptq “ 10` 12500000?

2p2t` 50q´7{2.

Figure 4.9.4: Solution to Example 4.9.2

Notice that the concentration still limits to 10 g/L just as in the firstexample. However, our differential equation ceases to be valid after t “ 25minutes since the tank begins to overflow at that time. �

Example 4.9.3. We have a tank containing 100 gallons of a sugar solutionat concentration 2 ounces per gallon. A sugar solution of concentration 5

Page 174: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 165

ounces per gallon is flowing into the tank at a rate of 3 gallons per minute.The well–mixed solution is flowing out of the tank at a rate of 4 gallons perminute. Model the concentration of sugar in the tank up until the time whenthe tank is empty.

4 gal/min

5 oz/gal @ 3 gal/min

ô

Figure 4.9.5: Tank from Example 4.9.3

Answer: Clearly the tank is losing 1 gallon each minute. This means thevolume of fluid in the tank is given by

V ptq “ 100´ t for 0 ď t ď 100.

After t “ 100 minutes, the tank is empty and our model will no longer bevalid. The relationship between concentration and amount of sugar is givenby

Cptq “Aptq

100´ t.

Running through the same series of computations as before gives

dA

dt“ ptotal sugar in per minuteq ´ ptotal sugar out per minuteq

ptotal sugar in per minuteq “

ˆ

5oz

gal

˙ˆ

3gal

min

˙

“ 15oz

min

ptotal sugar out per minuteq “

ˆ

A

100´ t

oz

gal

˙ˆ

4gal

min

˙

“4A

100´ t

oz

min

This gives us the following initial value problem

dA

dt`

ˆ

4

100´ t

˙

A “ 15

Ap0q “

ˆ

2oz

gal

˙

p100 galq “ 200 oz.

Page 175: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 166

For the integrating factor, we have

µptq “ eş

4{p100´tq dt

“ e´4 lnp100´tq

“ elnp100´tq´4

“ p100´ tq´4.

This gives us

Aptq “

ş

15p100´ tq´4 dt`D

p100´ tq´4

“5p100´ tq´3 `D

p100´ tq´4

“ 5p100´ tq `Dp100´ tq4.

For the initial condition, we find

Ap0q “ 5p100q `Dp100q4 “ 200

100000000c “ ´300

D “ ´3

1000000

which gives

Aptq “ 5p100´ tq ´3p100´ tq4

1000000,

Cptq “ 5´3p100´ tq3

1000000

for 0 ď t ď 100.

Page 176: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 167

Figure 4.9.6: Solution to Example 4.9.3

Notice that at t “ 100, the concentration actually becomes 5 oz/gal. Thismakes sense since in the final moments before the tank empties, the solutionin the tank should be almost completely made up of the external solution.�

4.10 Autonomous Differential Equations, Equi-

libria, and Stability

The most important examples of differential equations we have seen so farhave been of the form

dx

dt“ gpxq.

That is, there is no explicit time-dependence on the right-hand side of thedifferential equation. Such equations are called autonomous differentialequations.

While we can solve autonomous differential equations using the techniqueswe have developed in the previous sections (they are just a special type of

Page 177: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 168

separable differential equation), it turns out we can predict the qualitativebehavior of such systems with very little effort.

4.10.1 Equilibria of Autonomous Differential Equations

An equilibrium for an autonomous differential equation

dx

dt“ gpxq

is any value x˚ of the dependent variable such that

gpx˚q “ 0.

What make equilibria significant for these differential equations is that theyare the only constant solutions to the differential equation.

Theorem 4.10.1. Suppose that x˚ satisfies gpx˚q “ 0. Then the solution tothe initial value problem

dx

dt“ gpxq

xp0q “ x˚

is the constant function xptq “ x˚. Moreover, the only constant solutions tothis differential equation are given by the equilibria.

Proof: If x˚ is an equilibrium, then for the function xptq “ x˚ we havex1ptq “ 0 and gpxptqq “ gpx˚q “ 0. So, xptq “ x˚ is a solution to thedifferential equation. On the other hand, if xptq “ x˚ is a solution to thedifferential equation, then since x1ptq “ 0 we must have

gpxptqq “ gpx˚q “ 0.

Hence, x˚ must be an equilibrium value. �

Example 4.10.1. Find the equilibria of the differential equation

dx

dt“ 2x3

´ x2´ x.

Page 178: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 169

Answer: To find the equilibria, we need to solve 2x3 ´ x2 ´ x “ 0.

2x3´ x2

´ x “ 0

xp2x2´ x´ 1q “ 0

xp2x` 1qpx´ 1q “ 0

x “ ´1

2, 0, 1. �

An autonomous differential equation can have any number of equilibria,from none at all to infinitely many.

Example 4.10.2. Find the equilibria of the differential equation

dx

dt“ x2

` 2.

Answer: Since x2`2 “ 0 has no real solutions, this differential equationhas no equilibria. �

Example 4.10.3. Find the equilibria of the differential equation

dx

dt“ sinp2xq.

Answer: Since the solutions of sinpθq “ 0 are θ “ nπ for any integer n,the equilibria of our differential equation are

sinp2xq “ 0

2x “ nπ

x “nπ

2,

where n is any integer. So, this differential equation has an infinite numberof equilibria! �

Page 179: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 170

4.10.2 Phase Lines and Stability

After identifying the equilibria for an autonomous differential equation, wecan then develop its phase line. The phase line for an autonomous differ-ential equation

dx

dt“ gpxq

is a number line (typically oriented vertically) displaying the equilibria of thedifferential equation. The regions in between the equilibria are marked witharrows indicating whether g is positive or negative in those regions. Notethat we are assuming that g is a continuous function of x so that the sign ofg is consistent in the regions between equilibria!

Steps to Sketch a Phase Line:

1.) Find all equilibria by solving gpxq “ 0.

2.) Draw a vertical number line and mark all equilibria in their appropriateplaces on it.

3.) Pick a test point for each region between equilibria. Substitute the testx-values into g.

4.) If gpxq ą 0 at a test point, mark the corresponding region with uparrows. If gpxq ă 0, mark the region with down arrows.

Example 4.10.4. Sketch the phase line for the differential equation

dx

dt“ 2x3

´ x2´ x.

Answer: We have already found the equilibria in Example 4.10.1. Wefirst sketch a vertical number line with the equilibria marked in the appro-priate locations.

Page 180: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 171

´12

0

1

´1

´14

12

2

Figure 4.10.1: Phase Line for Example 4.10.4, Steps 1 – 3

Note that we have already selected a number of test points in the regionsbetween the equilibria (shown in red). These points can be chosen arbitrarilyso long as we have a representative value in each region. The idea is thatsince the right-hand side of the differential equation is continuous, the signof this function must be consistently positive or negative throughout theseregions. So, any test point in the region can reveal the sign of the right-handside of the equation for the entire region. Since we only care about the signfor these test points, it certainly makes life easier to use the factored form

gpxq “ 2x3´ x2

´ x “ xp2x` 1qpx´ 1q.

Page 181: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 172

g p´1q “ p´1qp´2` 1qp´1´ 1q

“ p´1qp´1qp´2q ă 0,

g

ˆ

´1

4

˙

ˆ

´1

4

˙ˆ

´1

2` 1

˙ˆ

´1

4´ 1

˙

ˆ

´1

4

˙ˆ

1

2

˙ˆ

´5

4

˙

ą 0,

g

ˆ

1

2

˙

ˆ

1

2

˙

p1` 1q

ˆ

1

2´ 1

˙

ˆ

1

2

˙

p2q

ˆ

´1

2

˙

ă 0,

gp2q “ p2qp4` 1qp2´ 1q

“ p2qp5qp1q ą 0.

Adding the arrows according to the signs found above, we find.

´12

0

1

Figure 4.10.2: Phase Line for Example 4.10.4

Page 182: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 173

Drawing the phase line was fairly simple, but why is this useful infor-mation? Consider the phase line next to a plot of typical solutions to thedifferential equation.

´12

0

1

Figure 4.10.3: Phase Line and Typical Solutions for Example 4.10.4

Notice that the arrows correspond to whether solutions are increasing ordecreasing. The reason for this is the right-hand side of

dx

dt“ gpxq.

controls whether the solution increases or decreases. �In order to make sense of the results above, we need a theoretical result

about solutions to differential equations.

Theorem 4.10.2 (Existence and Uniqueness of Solutions to DifferentialEquations). Suppose that the function g and its derivative g1 are both contin-uous in some open interval containing x0. Then, there is a unique solutionto the initial value problem

dx

dt“ gpxq

xp0q “ x0

for some range of t-values around t “ 0.

Page 183: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 174

Proof: A proof of this result is beyond the scope of this text. See [Ro95,pp. 141 – 143] for the proof of a slightly more general result. �

For all of the examples we will consider, g and its derivative will be con-tinuous everywhere. That means any initial datum we happen to choose willlead to a unique solution for some range of t-values. The most important con-sequence of this is that solutions from different initial data cannot intersectone another. Consider again the solution curves for Example 4.10.4.

Figure 4.10.4: Typical Solutions for Example 4.10.4

Notice that the three solutions in green are the only constant solutions(xptq “ ´1{2, xptq “ 0, and xptq “ 1). Since no two solutions can in-tersect, no solution curves can cross the equilibria solutions. If we considerthe solutions starting from initial data between ´1{2 and 0, these solutionsmust be increasing for all t (because x1ptq ą 0). However, they cannot crossx “ 0. Therefore all these solution curves increase forever but are boundedabove by x “ 0 (never quite reaching this value). Similarly, the solutionsstarting with initial data between 0 and 1 must be decreasing for all t, butcannot cross x “ 0. So, they decrease forever and are bounded below byx “ 0. Notice that solutions starting with initial data less than ´1{2 or

Page 184: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 175

greater than 1 have no equilibria to approach. As such, they will decrease orincrease without bound.

Example 4.10.5. Sketch the phase line for

dx

dt“ px` 2qpx` 1q2px´ 1qp2´ xq.

Answer: The equilibria are fairly easy to find in this case: x “ ´2,´1, 1, 2.

´2

´1

1

2

´3

´32

0

32

3

Figure 4.10.5: Phase Line for Example 4.10.5, Steps 1 – 3

Next, we check the sign of gpxq “ px ` 2qpx ` 1q2px ´ 1qp2 ´ xq for each

Page 185: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 176

of the values indicated in red above.

gp´3q “ p´3` 2qp´3` 1q2p´3´ 1qp2` 3q

“ p´1qp´2q2p´4qp5q ą 0,

gp´3{2q “ p´3{2` 2qp´3{2` 1q2p´3{2´ 1qp2` 3{2q

“ p1{2qp´1{2q2p´5{2qp7{2q ă 0,

gp0q “ p2qp1q2p´1qp2q ă 0,

gp3{2q “ p3{2` 2qp3{2` 1q2p3{2´ 1qp2´ 3{2q

“ p7{2qp5{2q2p1{2qp1{2q ą 0,

gp3q “ p3` 2qp3` 1q2p3´ 1qp2´ 3q

“ p5qp4q2p2qp´1q ă 0.

´2

´1

1

2

Figure 4.10.6: Phase Line for Example 4.10.5

Notice that we can give a qualitative description of the solutions using thephase line. For initial data greater than 2, solutions will decrease towards

Page 186: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 177

x “ 2. For initial data between 1 and 2, solutions will increase toward x “ 2.Initial data between ´1 and 1 launch solutions that decrease to x “ ´1,while initial data between ´2 and ´1 launch solutions that decrease towardx “ ´2. Finally, solutions with initial data less than ´2 increase towardx “ ´2. �

´2

´1

1

2

Figure 4.10.7: Phase Line and Typical Solutions for Example 4.10.5

Notice in the last example that the sign of gpxq need not change across anequilibrium. Do not assume that the arrows in the phase line will simplyalternate!

The phase line allows us to classify equilibria for autonomous differentialequations into one of three types based on their stability. Notice that thedefinitions given below mirror the definitions given for discrete dynamicalsystems.4 Throughout the following discussion, we assume that g and g1 arecontinuous functions so that the existence and uniqueness theorem statedabove is applicable!

4Equilibria that are stable but not asymptotically stable do not occur in single au-tonomous differential equations (at least for the case of continuous gpxq with isolated ze-ros). Such equilibria are possible for systems of autonomous differential equations whichwe discuss in Chapter 5.

Page 187: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 178

An equilibrium ofdx

dt“ gpxq

is asymptotically stable (also called a sink) if there is some open inter-val containing the equilibrium such that any initial datum in the intervaldifferent from the equilibrium itself launches a solution that approaches theequilibrium value for all future times.

An equilibrium is unstable (also called a source) if there is some openinterval containing the equilibrium such that any initial datum in the intervaldifferent from the equilibrium itself launches a solution that diverges fromthe equilibrium value for all future times.

An equilibrium is semi-stable (also called a node) if there is some openinterval containing the equilibrium such that initial data on one side of theequilibrium launch solutions that approach the equilibrium value. On theother side of the equilibrium, initial data launch solutions that diverge fromthe equilibrium value.

Equilibria are easily classified directly from the phase line.5

Sink(Asymptotically Stable)

Source(Unstable)

x˚ x˚

Node(Semi-Stable)

Figure 4.10.8: Stability and Phase Lines

Example 4.10.6. Classify the equilibria for the autonomous differentialequation in Example 4.10.1:

dx

dt“ 2x3

´ x2´ x.

5It is possible for a non-zero differentiable function gpxq to have an entire intervalof zeros. In this case, the zeros in the interior of the interval would be stable (but notasymptotically stable) while the ones on the boundary could be stable or unstable. Suchfunctions rarely (if ever) come up in this context!

Page 188: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 179

Answer: Since we have already sketched the phase line for this differen-tial equation, we only need to classify the equilibria

´12

0

1

Source

Sink

Source

Figure 4.10.9: Phase Line and Stability for Example 4.10.1

So, x˚ “ ´1{2 and x˚ “ 1 are unstable while x˚ “ 0 is asymptotically stable.�

Example 4.10.7. Classify the equilibria for the autonomous differentialequation in Example 4.10.5:

dx

dt“ px` 2qpx` 1q2px´ 1qp2´ xq.

Answer:

Page 189: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 180

´2

´1

1

2

Sink

Node

Source

Sink

Figure 4.10.10: Phase Line for Example 4.10.5

So, x˚ “ ´2 and x˚ “ 2 are both asymptotically stable, x˚ “ ´1 is semi-stable, and x˚ “ 1 is unstable. �

4.10.3 Equilibria and Stability for Important AutonomousEquations

In this section, we will revisit the most important examples of autonomousdifferential equations. Our primary focus will be on the equilibria of thesemodels together with stability results.

Theorem 4.10.3 (Equilibrium for Newton’s Law of Cooling). The only equi-librium for Newton’s Law of Cooling

dT

dt“ kpTe ´ T q

is the environmental temperature T ˚ “ Te. This equilibrium is asymptoticallystable.

Proof: The equilibrium is found by the equation

kpTe ´ T q “ 0.

Page 190: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 181

Since the cooling rate k is assumed to be positive, the only equilibrium isT “ Te. As we mentioned in the analysis of this differential equation, whenT ă Te, the right-hand side will be negative; on the other hand, it will bepositive when T ą Te. This gives us the phase line shown below. �

Te Sink

Figure 4.10.11: Phase Line and Typical Solutions for Newton’s Law ofCooling

Theorem 4.10.4 (Equilibrium for Selective Diffusion). The only equilibriumfor the selective diffusion model

dC

dt“ αΓ´ βC

is the concentrationC˚ “

α

βΓ.

This equilibrium is asymptotically stable.

Proof: This system is identical to Newton’s Law of Cooling. �

Theorem 4.10.5 (Equilibria for Exponential Growth and Decay). The onlyequilibrium for either exponential growth or decay

dP

dt“ kP or

dA

dt“ ´kA,

is 0. For exponential growth, this equilibrium is unstable, while for exponen-tial decay it is asymptotically stable.

Page 191: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 182

Proof: Since the growth rate k (or for decay, the activity k) is assumedto be positive, the only equilibrium is P ˚ “ 0 (or A˚ “ 0). For exponentialgrowth, the right-hand side of the differential equation will be positive whenP ą 0 (and negative when P ă 0). This shows us that P ˚ “ 0 is unstable.For exponential decay, the negative sign on the right-hand side of the equationreverses the arrows giving an asymptotically stable equilibrium. �

0 Source

Figure 4.10.12: Phase Line and Typical Solutions for Exponential Growth

0 Sink

Figure 4.10.13: Phase Line and Typical Solutions for Exponential Decay

Theorem 4.10.6 (Equilibria for Logistic Growth). The equilibria for the

Page 192: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 183

logistic growth modeldP

dt“ kP

ˆ

1´P

N

˙

are P ˚ “ 0 which is unstable and the carrying capacity P ˚ “ N which isasymptotically stable.

Proof: The equilibria are given by

kP

ˆ

1´P

N

˙

“ 0.

Since the growth rate k is positive, the only solutions are P ˚ “ 0 and P ˚ “ N .When P ă 0 (which is not meaningful for populations of organisms),

kP

ˆ

1´P

N

˙

ă 0.

For populations in the range 0 ă P ă N , we can see that

kP

ˆ

1´P

N

˙

ą 0

since k and P are certainly positive and P {N ă 1. This shows us that P ˚ “ 0is unstable. For P ą N ,

kP

ˆ

1´P

N

˙

ă 0

which shows us that P ˚ “ N is asymptotically stable. �

0 Source

N Sink

Figure 4.10.14: Phase Line and Typical Solutions for Logistic Growth

Page 193: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 184

4.11 Problems

For problems 1.q – 4.q, identify the independent and dependent variablesalong with any parameters for the given differential equation. Then verifythe given function is a solution to the initial value problem.

1.)$

&

%

dvdt

“ 10´ 3v

vp0q “ 0

vptq “10

10

3e´3t

2.)$

&

%

dvdt

“ g ´ bv

vp0q “ 1

vptq “g

b`

´

1´g

b

¯

e´bt

3.)$

&

%

tdxdt` x “ t3

xp1q “ 2

xptq “t4 ` 7

4t

4.)$

&

%

tdxdt` αx “ t

xp1q “ 0

xptq “1

1` α

ˆ

t´1

˙

For problems 5.q – 12.q, solve the given initial value problem.

5.)$

&

%

dxdt

“ t2x2

xp1q “ 1

Page 194: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 185

6.)$

&

%

dxdt

“ t2x

xp0q “ 5

7.)$

&

%

dxdt

“ tx

xp0q “ 5

8.)$

&

%

dxdt

“ t sinptqx

xp0q “ 1

9.)$

&

%

dxdt

“ xp1´ xq

xp0q “ 6

10.)$

&

%

dxdt` 2x “ e3t

xp0q “ 2

11.)$

&

%

dxdt` 2tx “ t

xp0q “ 1

12.)$

&

%

dxdt` 3

tx “

sinptqt2

xpπq “ 0

For problems 13.) – 18.), determine the equilibria for the given autonomousdifferential equation. Sketch a phase line and classify the equilibria that youfind. Also, sketch representative solution curves.

Page 195: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 186

13.)dx

dt“ ´x2

` x` 6

14.)dx

dt“ ´x3

` 8x2´ 15x

15.)dx

dt“ px` 5q p2x` 3q2 px´ 1qp4´ xq

16.)dx

dt“ ´p1` x2

q

17.)dx

dt“ sinpxq

18.)dx

dt“

5x2

1` x2´ 2x

Solve the following problems related to the standard differential equationsdiscussed in the chapter.

19.) A culture of bacteria is undergoing exponential growth. If initiallythere are 500 organisms, and there 1500 after 8 hours, how long untilthe population reaches 10,000 individuals?

20.) If a culture of bacteria grows from 1200 to 1600 individuals in 10 hours,what is the doubling time for the population?

21.) A certain radioactive element has a half-life of 12 minutes. If there are100 µg initially, how long until only 20 µg remain?

22.) A lump of clay is molded into a vase. Once it has been dried at roomtemperature (25˝C), the vase is placed in a kiln at 1100˝C. After 1 hour,the vase has reached 500˝C. How long until the vase reaches 1000˝C?

Page 196: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 187

23.) A steel rod initially at 50˝C will cool to 46˝C in 5 seconds if placedinto an oil bath held at 30˝C. The steel is quenched by first heating itto 900˝C and then plunging it into the 30˝C oil bath. How long doesit take the rod to cool to 100˝C?

24.) The concentration of a certain drug in the blood stream is 200 ng/dL(nanograms per deciliter). The drug diffuses into a red blood cell 4times faster than it leaves the cell. After 10 minutes, the concentrationof the drug inside the cell has risen from 0 ng/dL to 300 ng/dL. Howlong until the concentration in the cell reaches 500 ng/dL? What is thelimiting concentration of the drug inside the cell?

25.) A population is undergoing logistic growth according to the differentialequation

dP

dt“

1

3P p1000´ P q.

Identify the growth rate and the carrying capacity for the population.If there are 300 individuals initially, how long until the populationreaches 600?

26.) A population is living in an area that has a carrying capacity of 50,000individuals. If initially there were 15,000 individuals, and the popula-tion has increased to 20,000 after 5 years, how long until the populationreaches 30,000?

27.) A tank initially holds 30 liters of a sugar solution at a concentrationof 35 grams per liter. Pure water flows into the top of the tank at arate of 10 liters per minute, and the well–mixed solution flows out ofthe tank at a matching rate. What is the concentration of sugar in thetank after 20 minutes?

28.) A tank initially holds 20 liters of a saline solution at a concentrationof 50 grams per liter. A saline solution of concentration of 30 gramsper liter flows into the tank at a rate of 5 liters per minute. The well–mixed solution flows out of the tank at the same rate. When will theconcentration of salt in the tank fall to 40 grams per liter?

Page 197: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 4. CONTINUOUS DYNAMICAL SYSTEMS 188

29.) A large tank capable of holding 1000 gallons of fluid is initially filledwith 200 gallons of pure water. An acid solution at concentration one-quarter pound per gallon flows into the tank at a rate of 3 gallons perminute. The well–mixed solution flows out of the tank at a rate of 1gallon per minute. What is the concentration of acid in the tank at thepoint when the tank begins to overflow?

30.) Challenge: A population is increasing logistically. Suppose that P p0q “1, P p1q “ 9{2, and P p2q “ 9. Find the carrying capacity N and thegrowth rate k.

Page 198: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Chapter 5

Systems of AutonomousDifferential Equations

All of the differential equations we have studied so far have been for a sin-gle unknown function. That is, there was a single dependent variable (e.g.x “ xptq), and we were given information about its derivative (and per-haps an appropriate initial condition). In many applications, however, thereare several dependent variables which depend on one another (as well asdepending on the independent variable t). This gives rise to systems ofdifferential equations.

As a particular example, suppose we have two species: one a predator andthe other its prey. If there were no predators, then the prey species mightincrease exponentially (or maybe logistically). Certainly the presence of apredator would change the growth rate! Likewise, the predators would likelydie off if there were no prey animals (assuming there were no other sourcesof food). On the other hand, if the prey animals were plentiful enough, thepredator population would likely increase dramatically.

In a simple predator–prey model, there are two populations of animals:R “ Rptq is the population of prey while F “ F ptq is the population ofpredators.1 The generic form of the resulting system of differential equations

1In one of the early studies of predator–prey models, “R” was used for rabbits and “F”was used for foxes. These letters have become standard in discussing these models.

189

Page 199: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 190

is

dR

dt“ fpR,F q

dF

dt“ gpR,F q.

In words, the rate of change of the prey population is some function of boththe prey population and the predator population. The rate of change of thepredator population is a different function of the same two quantities. Noticethat there is no explicit t dependence in the model. This means we have asystem of autonomous differential equations.

While we could consider more general cases than this, systems of au-tonomous differential equations are already difficult to solve in any but themost simple of cases. In this chapter, we will be content with a more quali-tative approach similar to the discussion of equilibria for single autonomousequations in the previous chapter. We will primarily discuss two-dimensionalautonomous systems in which there are only two dependent variables (like thepredator–prey example above). While we discuss a few higher dimensionalsystems in a very limited way, the qualitative approach we develop becomesextremely difficult once there are more than two dependent variables. If youare comfortable with matrix techniques (see Chapter 8 for the appropriatematerial), you can find a rigorous treatment of these results in Chapter 9.

5.1 Equilibria and Nullclines

The equilibria of the two-dimensional autonomous system

dx

dt“ fpx, yq

dy

dt“ gpx, yq

are pairs of values px˚, y˚q such that

fpx˚, y˚q “ 0 AND gpx˚, y˚q “ 0.

This means that the equilibria are the simultaneous solutions to the equations"

fpx, yq “ 0gpx, yq “ 0

.

Page 200: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 191

As was the case for a single autonomous equation, a system of autonomousequations can have any number of equilibria – from none at all to infinitelymany! If the functions f and g are fairly complicated, the equilibria can bedifficult to identify. Fortunately, we will deal with relatively simple cases.

Just as with single autonomous equations, the equilibria give us the con-stant solutions to the autonomous system.

Theorem 5.1.1. Suppose that px˚, y˚q is an equilibrium of the autonomoussystem

dx

dt“ fpx, yq

dy

dt“ gpx, yq.

Then the constant functions xptq “ x˚ and yptq “ y˚ are solutions to thesystem. Conversely, if xptq “ x˚ and yptq “ y˚ are constant solutions to thesystem of autonomous equations, then px˚, y˚q must be an equilibrium of thesystem.

Proof: Suppose that px˚, y˚q is an equilibrium. Then fpx˚, y˚q “ 0 andgpx˚, y˚q “ 0. Checking the differential equation for the functions xptq “ x˚

and yptq “ y˚ gives

0 “ x1ptq “ fpxptq, yptqq “ fpx˚, y˚q “ 0,

0 “ y1ptq “ gpxptq, yptqq “ gpx˚, y˚q “ 0.

So, these constant functions are a solution. For the converse, since x1ptq “ 0and y1ptq “ 0, we must have

fpxptq, yptqq “ fpx˚, y˚q “ 0,

gpxptq, yptqq “ gpx˚, y˚q “ 0,

for these functions to be a solution. Therefore, px˚, y˚q must be an equilib-rium. �

We begin with a relatively simple example.

Example 5.1.1. Find all equilibria for the autonomous system

dx

dt“ x` y ´ 1

dy

dt“ x´ y ´ 3.

Page 201: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 192

Answer: As per usual, the independent variable is t. This system has twodependent variables, x “ xptq and y “ yptq, and is autonomous since thereis no explicit dependence on t in either right-hand sides of the differentialequations. To find equilibria, we have to solve the system of equations

"

x` y ´ 1 “ 0x´ y ´ 3 “ 0

.

Since these are linear equations, the solution is fairly simple to get! If weadd the two equations, we get 2x ´ 4 “ 0, and so x “ 2. Substituting thisfor x in the first equation (or the second) gives

2` y ´ 1 “ 0

y ` 1 “ 0

y “ ´1.

So, the only equilibrium for this system is p2,´1q. �

Example 5.1.2. Find all equilibria for the autonomous system

dx

dt“ xpx´ yq

dy

dt“ xy ` y ´ 2.

Answer: To find equilibria, we have to solve the system of equations"

xpx´ yq “ 0xy ` y ´ 2 “ 0

.

The first equation gives us two possible cases:

xpx´ yq “ 0

x “ 0 OR x´ y “ 0

x “ 0 OR x “ y.

We have to take each of these cases individually, apply them to the secondequation, and see what the corresponding equilibria are.

Page 202: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 193

Case 1: x “ 0Substituting x “ 0 into the second equation gives:

p0qy ` y ´ 2 “ 0

y ´ 2 “ 0

y “ 2.

So, p0, 2q is an equilibrium for the system.

Case 2: x “ ySubstituting x “ y into the second equation gives

pyqy ` y ´ 2 “ 0

y2` y ´ 2 “ 0

py ´ 1qpy ` 2q “ 0

y “ ´2, 1.

Since x “ y in this case, the equilibria for Case 2 are p´2,´2q and p1, 1q.

So, this system has 3 equilibria altogether: p0, 2q, p´2,´2q, and p1, 1q. �

In order to examine the stability of equilibria, we need to introduce thephase plane for two-dimensional autonomous systems. The idea is thatsince the right-hand sides of the system

dx

dt“ fpx, yq

dy

dt“ gpx, yq,

do not depend on the independent variable t, we can display a lot of infor-mation about the system in the xy-plane. In this case, the xy-plane is calledthe phase plane for the system. While the phase plane will be extraordinarilyuseful for describing the system, it is important to remember that quite a lotof information about the t-dependence of the solutions x “ xptq and y “ yptqis suppressed in the process.

Graphically, the equations giving us the equilibria (i.e. fpx, yq “ 0 andgpx, yq “ 0) are curves in the xy-plane. The equilibria are precisely the inter-section points of these two curves! So, for the two-dimensional autonomous

Page 203: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 194

system

dx

dt“ fpx, yq

dy

dt“ gpx, yq,

all curves given by fpx, yq “ 0 in the xy-plane are called x -nullclines forthe system. All curves given by gpx, yq “ 0 in the xy-plane are called y-nullclines for the system. The equilibria of the system are precisely thepoints where an x-nullcline intersects a y-nullcline.

Example 5.1.3. Plot the nullclines and the equilibria for the system

dx

dt“ x` y ´ 1

dy

dt“ x´ y ´ 3.

from Example 5.1.1 in the phase plane.

Answer: The x-nullcline is the curve x` y´ 1 “ 0 which is just the liney “ ´x` 1. Similarly, the y-nullcline is the line x´ y ´ 3 “ 0 or y “ x´ 3.

x-nullcliney-nullcline

p2,´1q

Figure 5.1.1: Nullclines and Equilibrium for Example 5.1.3

Notice that the nullclines intersect in a single point which is the only equi-librium for the system. �

Page 204: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 195

Example 5.1.4. Plot the nullclines and the equilibria for the system

dx

dt“ xpx´ yq

dy

dt“ xy ` y ´ 2.

from Example 5.1.2 in the phase plane.

Answer: The x-nullclines are given by xpx ´ yq “ 0 which are the twoseparate lines x “ 0 and x “ y. Similarly, the y-nullcline is the curvexy ` y ´ 2 “ 0 which is the hyperbola

y “2

x` 1.

x-nullcliney-nullcline

p1, 1q

p´2,´2q

p0, 2q

Figure 5.1.2: Nullclines and Equilibrium for Example 5.1.3

Note that the origin is NOT an equilibrium. Even though two nullclines meetthere, they are both x-nullclines. �

The last example brings up a very important point. Equilibria only occurwhere an x-nullcline intersects a y-nullcline. When you make a sketch ofthe nullclines for a system, it is very important to keep track of which are x-and which are y-nullclines. If you do not have separate colors available, trymaking one set solid and the other set dashed. Otherwise, the phase planecan get very confusing!

Page 205: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 196

5.2 Stability of Equilibria

Now that we know how to find equilibria for systems of autonomous equa-tions, our next job is to classify them. It turns out there are 6 main types ofequilibria.

1.) Unstable Nodes2

2.) Unstable Spiral Points

3.) (Unstable) Saddle Points

4.) Asymptotically Stable Nodes

5.) Asymptotically Stable Spiral Points

6.) Stable Center Points

There are also a few other kinds of equilibria that are intermediate betweenthe ones listed above, but these rarer types arise infrequently and will notconcern us here. For the purposes of this chapter, we will mostly be interestedin whether an equilibrium is unstable, stable, or asymptotically stable ratherthan its specific type.

The idea of stability is in spirit no different from what we discussed inChapter 1. Essentially, an equilibrium is unstable if there are initial datapoints arbitrarily close to the equilibrium that launch trajectories which leavethe vicinity of the equilibrium. An equilibrium is stable if all initial datasufficiently close to the equilibrium launch trajectories that stay in the vicin-ity of the equilibrium for all time. If all such trajectories actually limit tothe equilibrium rather than just staying near it, we say that the equilibriumis asymptotically stable.

It is possible to determine the stability of an equilibrium by examiningthe signs of the derivatives dx{dt and dy{dt in the various regions determinedby the nullclines.

2The use of the term “Node” for systems of autonomous differential equations is quitedifferent than its use for a single autonomous equations. For a single differential equation,a node is always semi-stable. For systems, the term “Node” refers to the shape solutioncurves make as they approach or diverge from the equilibrium.

Page 206: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 197

Example 5.2.1. Determine whether the equilibrium p2,´1q for the system

dx

dt“ x` y ´ 1

dy

dt“ x´ y ´ 3.

from Example 5.1.1 is asymptotically stable, stable, or unstable.

Answer: We will prepare a sign chart that will help us determine howsolutions behave in the various regions in the phase plane.

Figure 5.2.1: Phase Plane for Example 5.2.1

Notice that we have selected 8 points in total: 1 for each region betweennullclines and 1 for each boundary nullcline between these regions. This islikely many more points than are needed to determine stability, but they willcertainly make the result clear!

For each of the 8 points above, we substitute the x- and y-values of thesepoints into the functions

fpx, yq “ x` y ´ 1

gpx, yq “ x´ y ´ 3,

and keep track of the signs. We will start with p1, 0q and move clockwise.

Page 207: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 198

Point fpx, yq gpx, yq Signs

p1, 0q fp1, 0q “ 1` 0´ 1 “ 0 gp1, 0q “ 1´ 0´ 3 “ ´2 p0,´qp2, 0q fp2, 0q “ 2` 0´ 1 “ 1 gp2, 0q “ 2´ 0´ 3 “ ´1 p`,´qp3, 0q fp3, 0q “ 3` 0´ 1 “ 2 gp3, 0q “ 3´ 0´ 3 “ 0 p`, 0qp3,´1q fp3,´1q “ 3´ 1´ 1 “ 1 gp3,´1q “ 3` 1´ 3 “ 1 p`,`qp3,´2q fp3,´2q “ 3´ 2´ 1 “ 0 gp3,´2q “ 3` 2´ 3 “ 2 p0,`qp2,´2q fp2,´2q “ 2´ 2´ 1 “ ´1 gp2,´2q “ 2` 2´ 3 “ 1 p´,`qp1,´2q fp1,´2q “ 1´ 2´ 1 “ ´2 gp1,´2q “ 1` 2´ 3 “ 0 p´, 0qp1,´1q fp1,´1q “ 1´ 1´ 1 “ ´1 gp1,´1q “ 1` 1´ 3 “ ´1 p´,´q

What exactly do these signs tell us? Consider the sign chart p`,´q for thepoint p2, 0q. The ` in the x-component tells us that dx{dt is positive at thispoint. That means that the solution is trying to move to the right in thephase plane (toward larger x-values). Similarly, the ´ in the y-componenttells us that dy{dt is negative here. Thus, the solution will move downwardsin the phase plane (toward smaller y-values). We can indicate this with asmall arrow at p2, 0q pointing to the right and downward.

Figure 5.2.2: Phase Plane for Example 5.2.1 with Arrow at p2, 0q

If we continue this process for the other 7 points, we get the following picture.

Page 208: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 199

Figure 5.2.3: Phase Plane for Example 5.2.1 with Arrows

Notice that the arrows seem to indicate the equilibrium is unstable, nomatter how close you start to the equilibrium, you are eventually pushed awayfrom it. In more advanced treatments, we could prove that this equilibriumis a saddle point (which is one of the variety of unstable equilibria). SeeChapter 9 for more details.

In the figure below, we plot a few solution curves for this system.

Figure 5.2.4: Phase Plane for Example 5.2.1 with Sample Solution Curves

These curves are called parametric curves since they are generated by follow-ing the point pxptq, yptqq as t is varied. Each of the four curves shown aboverepresent a solution curve for a particular choice of initial data. For exam-

Page 209: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 200

ple, if we focus on the black curve in the figure above (which goes throughp3,´1q), we get the following curves for x “ xptq and y “ yptq.

Figure 5.2.5: Solutions through p3,´1q for Example 5.2.1

Even though this will not concern us much, the reason this equilibrium is asaddle point is that almost all solution curves move toward the equilibriumfor times sufficiently far in the past but after reaching a point of closestapproach move away from the equilibrium for all future times. This is alsowhy this type of equilibrium is inherently unstable. In the long run, thereare solutions starting relatively close to the equilibrium that eventually endup very far from it. �

Note that the details of how we move along the parametric curve in thephase plane are lost. All we see is the overall path produced by trackingpxptq, yptqq over time. Despite the loss of information, these parametric curvesare more than sufficient to determine the stability of the equilibria. To makedetailed predictions about the behavior of the system as time progresses,we would need the actual solutions or at least some way to numericallyapproximate solutions. Such techniques exist (as evidenced by the solutioncurves shown above), but they are beyond the scope of this text. 3

Example 5.2.2. Determine whether the equilibria for the system

dx

dt“ xpx´ yq

dy

dt“ xy ` y ´ 2.

3There are a number of techniques for numerically approximating solutions to differ-ential equations. For a nice discussion of several of them, see [BDH12, Chap. 7].

Page 210: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 201

from Example 5.1.2 are asymptotically stable, stable, or unstable.

Answer: For this system, we have

fpx, yq “ xpx´ yq

gpx, yq “ xy ` y ´ 2.

We will consider the three equilibria separately. We begin with p0, 2q. In thefigure below, we have used the following sign chart to produce the arrows.

Point fpx, yq gpx, yq Signs

p´0.1, 2.5q fp´0.1, 2.5q ą 0 gp´0.1, 2.5q ą 0 p`,`qp0, 2.5q fp0, 2.5q “ 0 gp0, 2.5q ą 0 p0,`qp0.1, 2.2q fp0.1, 2.2q ă 0 gp0.1, 2.2q ą 0 p´,`q

p1{10, 20{11q fp1{10, 20{11q ă 0 gp1{10, 20{11q “ 0 p´, 0qp0.1, 1.5q fp0.1, 1.5q ă 0 gp0.1, 1.5q ă 0 p´,´qp0, 1.5q fp0, 1.5q “ 0 gp0, 1.5q ă 0 p0,´q

p´0.1, 1.8q fp´0.1, 1.8q ą 0 gp´0.1, 1.8q ă 0 p`,´qp´1{10, 20{9q fp´1{10, 20{9q ą 0 gp´1{10, 20{9q “ 0 p`, 0q

Figure 5.2.6: Behavior Near p0, 2q for Example 5.2.2

Note that this looks similar to the equilibrium from the previous case. Asyou might guess, p0, 2q is unstable (and is a saddle point).

Page 211: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 202

Figure 5.2.7: Solutions Near p0, 2q for Example 5.2.2

If we repeat the process for p1, 1q, we find the following plot.

Figure 5.2.8: Solutions Near p1, 1q for Example 5.2.2

Looking back at our list of possible types of equilibria, you would probablyguess that this one is an unstable spiral point. Certainly it is unstable sincesolution curves starting near p1, 1q definitely move away from the equilibrium.

Page 212: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 203

The solutions also seem to spiral outwards giving rise to the name of this typeof equilibrium.

Finally, for p´2,´2q we find the following plot.

Figure 5.2.9: Solutions Near p´2,´2q for Example 5.2.2

This equilibrium is asymptotically stable. Solution curves starting nearp´2,´2q move closer to the equilibrium as time goes on. This point is tech-nically an asymptotically stable spiral point. �

Our plots of direction vectors near an equilibrium are stripped down ex-amples of vector plots or vector field plots. For a system of differentialequations

dx

dt“ fpx, yq

dy

dt“ gpx, yq,

we plot arrows at various points having slopes given by

dy

dx“dy{dt

dx{dt“gpx, yq

fpx, yq.

This gives us a very nice idea of how solutions to the system must behave.For example, the system from Example 5.1.2 has the following vector plot.

Page 213: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 204

Figure 5.2.10: Vector Plot for Example 5.1.2

In addition to getting the behavior near each of the equilibria, we also havesome idea how general solutions will behave. For example, the vector plotabove seems to indicate that solutions starting in Quadrant II should traveldown to Quadrant III and then be attracted to the asymptotically stableequilibrium at p´2,´2q. The plot below shows an approximate solutioncurve demonstrating this behavior.

Page 214: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 205

Figure 5.2.11: Vector Plot with Sample Solution Curve for Example 5.1.2

Vector plots are difficult to draw by hand. Computing derivatives atenough points to render a decent plot is time intensive, and drawing smallarrows with the appropriate slope is quite hard. For these reasons, it isbest to generate vector plots using technology. Appendix E shows how togenerate them using the TI–89. It is also possible to generate such plots inmost computer algebra systems (e.g. Mathematica or Maple).

Even given a decent vector plot, it can still be challenging to determinethe exact behavior of solutions near an equilibrium. Fortunately, there is ananalytic method for determining stability that gives clear cut answers in mostcases. This method is discussed in Chapter 9, but the technique requires adecent knowledge of matrices. A brief introduction to matrix algebra can befound in Chapter 8.

5.3 Predator–Prey Models

As we mentioned in the beginning of this section, one of the more celebratedsystems of autonomous differential equations is the predator–prey model,also known as the Lotka–Volterra Model. We will use R “ Rptq for thepopulation of prey animals and F “ F ptq for the population of predators at

Page 215: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 206

time t. The model has the form

dR

dt“ αR ´ βRF “ Rpα ´ βF q

dF

dt“ ´γF ` δFR “ ´F pγ ´ δRq

where α, β, γ, and δ are positive parameters.If you look at the differential equation for dR{dt, you notice that if F “ 0,

the equation looks like dR{dt “ αR. That is, in the absence of predators,the prey grow exponentially. When there are predators, the RF term mea-sures the likelihood of an interaction between a predator and a prey animal;each such interaction reduces the prey population. For dF {dt, the predatorpopulation decays exponentially in the absence of prey (when R “ 0). Simi-larly, an interaction between a predator and prey (again with likelihood RF )increases the predator population.

Theorem 5.3.1 (Equilibria for the Lotka-Volterra Model). The predator–prey model

dR

dt“ Rpα ´ βF q

dF

dt“ ´F pγ ´ δRq

always has two equilibria: p0, 0q and

pR˚, F ˚q “

ˆ

γ

δ,α

β

˙

.

The equilibrium at p0, 0q is unstable while the other equilibrium is a stablecenter point.

Proof: From the factored form, the R-nullclines are R “ 0 and F “ α{βwhile the F -nullclines are F “ 0 and R “ γ{δ. The typical phase planediagram for this system is

Page 216: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 207

Figure 5.3.1: Phase Plane for the Predator–Prey Model

Notice that solution curves form closed loops around the central equilib-rium. As such, solutions starting near this equilibrium point stay close to itfor all future times, but the solutions do not necessarily get any closer thantheir starting points. This is why the equilibrium is said to be stable ratherthan asymptotically stable.

We should also note that it is impossible for solutions to leave the firstquadrant of the phase plane. For example, if a solution were to cross fromQuadrant I to Quadrant II, it would need to intersect the F -axis. But onthe F -axis, dR{dt is zero while dF {dt is negative, and so the solution curvemust move directly downwards toward the origin rather than crossing intoQuadrant II. In fact, uniqueness of solutions prevents a curve in the interior ofQuadrant I from intersecting the F -axis in the first place! Similar statementsare true about the R-axis.

Notice that the nullclines divide Quadrant I into four regions (labeled I –IV in the figure above). In region I, there are large populations of both preda-tors and prey (large as compared to the equilibrium values). The population

Page 217: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 208

of prey is large enough that the predator population is growing. However,the population of predators is large enough that the prey population is dyingoff.

In Region II, both the populations of predators and prey are declining.The predator population is still large enough to kill off the prey at a largerate. But the prey population is no longer large enough to sustain the numberof predators.

In both regions III and IV, the population of predators is rather small,allowing the prey population to grow. In region III, the prey populationis increasing, but the actual population size is not large enough to sustaingrowth in the predator population. In region IV, the prey population hasincreased enough to support an increase in the predator population, butthe number of predators is still small enough to allow the prey to continuegrowing.

If we consider how the populations of predators and prey change overtime, we typically find curves like the following.

F “ F ptq

R “ Rptq

Figure 5.3.2: Typical Solution Curves for the Predator–Prey Model

It is clear from these plots that the solutions to the predator–prey model areperiodic functions (though not sines or cosines). It is also apparent that thepredator population (shown in red) lags behind the prey population as wediscussed above. �

Page 218: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 209

5.4 Competing Species Models

The next autonomous system that we will investigate is a model describingcompeting species. In this model, there are two species living in a com-mon area which utilize the same resources for thier survival. As a result,interactions between the two species are to the detriment of both.

We will let a “ aptq and b “ bptq be the populations of the two speciesand assume that either species would grow logistically in the absence of theother. As is usual, we will model the likelihood of interactions between thegroups as the product of their populations. These assumptions lead to thefollowing system of differential equations.

da

dt“ kaa

ˆ

1´a

Na

˙

´ αab

db

dt“ kbb

ˆ

1´b

Nb

˙

´ βab

The parameters ka and kb are the logistic growth rates and Na and Nb arethe carrying capacities for the two species. The parameters α and β are com-petition parameters measuring the rate at which one species steals resourcesfrom the other.

It turns out that there are 3 distinct qualitative behaviors for the compet-ing species model (or maybe 4 depending on how you count). Rather thanpresenting a theorem with all the results up front, we will explore these threecases separately and then present a theorem summarizing our results.

We first lay some ground work. Our phase plane will be set up so that a isthe horizontal axis while b is the vertical (so points will be listed in the orderpa, bq). Since we are dealing with populations (a “ aptq ě 0 and b “ bptq ě 0)we are restricted to the first quadrant of the phase plane. Next, we identifythe a- and b-nullclines.

� a-nullclines:

kaa

ˆ

1´a

Na

˙

´ αab “ 0

kaa

ˆ

1´1

Na

a´α

kab

˙

“ 0

a “ 0 or 1´1

Na

a´α

kab “ 0

Page 219: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 210

The first is the vertical axis in the phase plane. The second is theoblique line in the phase plane connecting the points

pNa, 0q and

ˆ

0,kaα

˙

.

� b-nullclines:

kbb

ˆ

1´b

Nb

˙

´ βab “ 0

kbb

ˆ

1´1

Nb

b´β

kba

˙

“ 0

b “ 0 or 1´1

Nb

b´β

kba “ 0

The first is the horizontal axis in the phase plane. The second is theoblique line in the phase plane connecting the points

p0, Nbq and

ˆ

kbβ, 0

˙

.

The different qualitative behaviors for the system depend on the relativepositions of the 4 points determining the oblique nullclines.

Case 1: Competitive ExclusionIn this case, the two oblique nullclines do not intersect in the first quad-

rant of the phase plane, and there are only 3 equilibria: p0, 0q, pNa, 0q, andp0, Nbq. The origin will always be unstable. Depending on the relative sizesof the parameters for the two species, one of the other two equilibria will beasymptotically stable while the remaining one will be unstable. This meansthat one species will dominate the other. If Nb ă ka{α and kb{β ă Na,pNa, 0q will be asymptotically stable.

Page 220: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 211

Figure 5.4.1: Competing Species Model, Species a Dominant

In this case, species a will definitely out-compete species b (so long as thepopulation of species a is not zero initially). More precisely, species a willapproach its carrying capacity, Na, while species b will tend to die out.

When ka{α ă Nb and Na ă kb{β, the behavior is exactly reversed andp0, Nbq will be asymptotically stable.

Page 221: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 212

Figure 5.4.2: Competing Species Model, Species b Dominant

Even though these are technically two different cases, they are qualita-tively identical. If we simply interchange the axes in the second phase plane(i.e. switch a and b), the two diagrams would be indistinguishable.

Case 2: Weak Competition (Coexistence)When Nb ă ka{α and Na ă kb{β, the two oblique nullclines intersect in

the first quadrant of the phase plane and a fourth equilibrium appears:

pa˚, b˚q “

ˆ

kbNapka ´ αNbq

kakb ´ αβNaNb

,kaNbpkb ´ βNaq

kakb ´ αβNaNb

˙

.

We will refer to this new equilibrium as the coexistence point for the twospecies. When both of the points representing the carrying capacities of thetwo species are closer to the origin than the other two points determining theoblique nullclines, the coexistence point will be asymptotically stable whilethe other three will be unstable. In this case, the species are said to competeweakly.

Page 222: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 213

Figure 5.4.3: Competing Species Model, Weak Competition

This is the only case where the two competing species will coexist in the longterm.

Case 3: Strong CompetitionWhen ka{α ă Nb and kb{β ă Na, the two oblique nullclines still intersect

at the coexistence point

pa˚, b˚q “

ˆ

kbNapka ´ αNbq

kakb ´ αβNaNb

,kaNbpkb ´ βNaq

kakb ´ αβNaNb

˙

.

However, when both carrying capacities are relatively large, the coexistencepoint becomes unstable (in fact, it becomes an unstable saddle point). Thepoints pNa, 0q and p0, Nbq will now BOTH be asymptotically stable.

Page 223: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 214

Figure 5.4.4: Competing Species Model, Strong Competition

Notice that in the long run, one species will dominate the other. The differ-ence between this case and the first one we discussed is that either of the twospecies can dominate. Which species wins out in the long run depends onthe initial data for the system – a fact that biologists refer to as the foundereffect. Since they cannot coexist, the species in this case are said to competestrongly.

We summarize all of this information in a final theorem.

Theorem 5.4.1 (Equilibria for the Competing Species Model). The com-peting species model

da

dt“ kaa

ˆ

1´a

Na

˙

´ αab

db

dt“ kbb

ˆ

1´b

Nb

˙

´ βab

always has the three equilibria p0, 0q, pNa, 0q, and p0, Nbq. When Nb ă ka{αand Na ă kb{β or ka{α ă Nb and kb{β ă Na, there is a fourth equilibrium at

pa˚, b˚q “

ˆ

kbNapka ´ αNbq

kakb ´ αβNaNb

,kaNbpkb ´ βNaq

kakb ´ αβNaNb

˙

.

Page 224: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 215

The origin, p0, 0q, is always unstable. The other 3 equilibria can be unsta-ble or asymptotically stable depending on the parameters in the model. Theasymptotically stable equilibria are summarized in the following table.

Nb ă ka{α ka{α ă Nb

Weak Competition Competitive ExclusionNa ă kb{β pa˚, b˚q p0, Nbq

Asy. Stable Asy. StableCompetitive Exclusion Strong Competition

kb{β ă Na pNa, 0q pNa, 0q and p0, Nbq

Asy. Stable Asy. Stable

5.5 Disease Modeling

5.5.1 The SIR Model

Next we examine a well-known disease model called the SIR Model. Theacronym SIR stands for the three types of people in the model: Susceptible(people who could become infected), Infected, and Removed or Resistant(people who are naturally immune or have developed an immunity to thedisease). We will use these three letters to represent the sizes of these pop-ulations. We also assume that the total population is constant (no births ordeaths). This means that the total population is a fixed size N and

Sptq ` Iptq `Rptq “ N,

for all time. This condition is guaranteed so long as the derivatives of thesethree functions add up to zero:

S 1ptq ` I 1ptq `R1ptq “ 0.

This condition will be built into all of the models we consider in this section.More complicated models can incorporate births and deaths, but we will becontent with this simplifying assumption.

In the SIR model, once a person recovers from the disease they are im-mune from the disease for all future times. When a susceptible person in-teracts with an infected person, the susceptible person has some probabilityof becoming infected. As with the predator–prey model, the likelihood of

Page 225: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 216

an interaction is assumed to be given by the product of these populations:SI. Finally, infected persons recover from the disease at a certain rate. Thisgives rise to the following differential equations

dS

dt“ ´αSI

dI

dt“ αSI ´ βI

dR

dt“ βI

where α and β are positive parameters. The parameter α is the infection ratewhile β is the rate that infected people recover (and so become immune).Since Rptq “ N ´ Sptq ´ Iptq, the removed people play a passive role in thismodel. So, we can focus on the susceptible and infected people.

Theorem 5.5.1 (Equilibria for the SIR Model). The equilibria for the SIRModel

dS

dt“ ´αSI

dI

dt“ αSI ´ βI “ I pαS ´ βq .

are every point of the form pS˚, I˚q “ ps, 0q. In other words, every point onthe positive S-axis is an equilibrium.

Proof: The S-nullclines are the lines S “ 0 and I “ 0. The I-nullclinesare I “ 0 and S “ β{α. Note that I “ 0 is a nullcline for both variables. Thismeans that all points ps, 0q are equilibria. The stability of these equilibriais actually a little tricky, but things are easier since we are only concernedwith cases for which Sptq ě 0 and Iptq ě 0. This means that the number ofsusceptible people is always decreasing. The number of infected people willincrease when S ą β{α but decrease when S falls below this level.

A typical phase plane for the SIR Model is shown below. The horizontalline I “ 0 is displayed in purple since it is a nullcline for both dependentvariables (i.e. every point on the S-axis is an equilibrium point). The yellowtriangle represents the region in the first quadrant where S`I ď N . Since thetotal population is always N (recall that we some portion of the populationis resistant), solutions must stay in this region for all time. Note that on theoblique boundary, all arrows point towards the interior of the triangle!

Page 226: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 217

Figure 5.5.1: A Typical Phase Plane for the SIR Model

As we can see, the equilibria ps, 0q for s ă β{α are asymptotically stablewhile the others are unstable. The individual solution curves for the typicalsolution above are shown in the following figure.

S vs t I vs t

Figure 5.5.2: Typical Solution Curves for the SIR Model

Notice that the susceptible population continually decreases, but approachesa limiting value as time goes on. The number of infected individuals initiallyis increasing, but once the number of susceptible people falls to a certainthreshold, the number of infected decreases and approaches zero.

To summarize, the number of infected individuals in the SIR Model ap-proaches zero as time goes on. The remaining population will be split be-tween the removed (or resistant) people and the individuals who are still

Page 227: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 218

susceptible. The idea is that once the infected population falls to a fairly lowlevel, there will not be enough interactions between susceptible and infectedpersons to keep the number of infected people from approaching zero. Thenumber of people who remain susceptible once the disease has effectivelydied out depends on the initial data. If the ratio β{α is close to zero, thatmeans the rate of infection is much larger than the rate of recovery. In sucha case, the limiting population that remains susceptible is fairly small indi-cating that most of the population becomes infected and recovers. On theother hand, if the rate of infection is much smaller than the rate of recovery,the disease can effectively die out before much of the population becomesinfected.

5.5.2 The SIRS Model

The SIR Model only works well for relatively short-lived diseases (as it as-sumes the population is fixed in size) for which recovery grants completeimmunity from future infection. While we do not want to give up the as-sumption that the population remains constant, we can alter our model totake into account the fact that people who recover can sometimes lose theirimmunity from the disease. This gives rise to the SIRS Model; the final“S” in the name is meant to emphasize that recovered people can again be-come susceptible over time. This model is given by the following differentialequations.

dS

dt“ ´αSI ` γR

dI

dt“ αSI ´ βI

dR

dt“ βI ´ γR

The positive parameters α and β play the same role as before: α is theinfection rate and β is the rate that infected people recover. The positiveparameter γ represents the rate at which people who recover from the diseaselose their immunity.

Using the fact that the total population is fixed at size N , we can replace

Page 228: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 219

R in the differential equation for S with R “ N ´ S ´ I.

dS

dt“ ´αSI ` γ pN ´ S ´ Iq

dI

dt“ I pαS ´ βq

The behavior of this model can be far more complicated than the SIR Model.In particular, it is possible for the number of infected people to approach anon-zero limiting value. In such a case, we say that the disease is endemicto the population.

Theorem 5.5.2 (Equilibria for the SIRS Model). The SIRS Model

dS

dt“ ´αSI ` γ pN ´ S ´ Iq

dI

dt“ I pαS ´ βq

either has 1 or 2 equilibria. The point pN, 0q is always an equilibrium. Thepoint

pS˚, I˚q “

ˆ

β

α,γpαN ´ βq

αpβ ` γq

˙

is a second equilibrium provided β{α ă N . This second equilibrium is asymp-totically stable when it is realistic for the model. pN, 0q is asymptoticallystable when it is the only sensible equilibrium and unstable otherwise.

Proof: The S-nullcline is the curve

I “γpN ´ Sq

γ ` αS.

The I-nullclines are the same as in the SIR Model, I “ 0 and S “ β{α. Forthe equilibria, we first consider the case when I “ 0. Substituting this intothe S-nullcline gives S “ N which is the first equilibrium. For the secondcase, we substitute S “ β{α into the S-nullcline to get

I “γpαN ´ βq

αpβ ` γq.

If β{α ą N, then the second equilibrium cannot be reached by any re-alistic solution (as N is the total population size and populations must be

Page 229: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 220

positive). If β{α “ N, the two equilibria are identical. Whenever pN, 0q isthe only equilibrium, it will be asymptotically stable (this can be shown bymore advanced techniques).

Assume that β{α ă N. It turns out that in this case

β

α`γpαN ´ βq

αpβ ` γqă N

which makes the second equilibrium realistic for our model. When there aretwo equilibria, pN, 0q will be unstable while the second one will be asymp-totically stable. �

When β{α ě N, the phase plane for the SIRS Model generically lookslike the following plot.

Figure 5.5.3: A Typical Phase Plane for the SIRS Model, β{α ě N

As with the SIR Model, the shaded triangle represents the region in the firstquadrant where S ` I ď N . Again, note that on the oblique boundary allarrows point towards the interior of the triangle.

As we can see, there is a single equilibrium at pN, 0q and all realisticsolution curves are attracted toward it (hence it is asymptotically stable).The parametric curve shown in green above represents the solutions S “ Sptqand I “ Iptq shown below.

Page 230: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 221

S vs t I vs t

Figure 5.5.4: Typical Solution Curves for the SIRS Model, β{α ě N

Notice how the population of infected people fairly rapidly approaches zero.The susceptible population gradually rises to the total population N as therecovered individuals slowly lose their immunity.

For the case β{α ă N, the second equilibrium becomes realistic andasymptotically stable.

Figure 5.5.5: A Typical Phase Plane for the SIRS Model, β{α ă N

Note that pN, 0q has become unstable in this case. Looking once again atthe parametric curve in green gives us the following solution curves.

Page 231: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 222

S vs t I vs t

Figure 5.5.6: Typical Solution Curves for the SIRS Model, β{α ă N

In this case, both S “ Sptq and I “ Iptq oscillate (slightly) around theirequilibrium values as they approach these limiting population sizes. Thisis because the equilibrium they are attracted to is an asymptotically stablespiral point. While the second equilibrium pS˚, I˚q is always asymptoticallystable, it is not always a spiral point (it can also be an asymptotically stablenode). The exact type of this equilibrium is difficult to classify, but in anyevent solutions limit to it!

5.5.3 The SEIR Model, Covid-19, and Social Distanc-ing

A slightly more sophisticated model of disease proliferation is the SEIRModel. For this model, there are four types of individuals in the popula-tion.

1) Susceptible people who could contract the illness (population given bySptq)

2) Exposed people who have come into contact with the disease but arenot actively ill or contagious (population given by Eptq)

3) Infected people who are contagious (population given by Iptq)

4) Recovered people who are no longer susceptible (populations given byRptq)

As with the other models, the total population is assumed to stay constant,but equal birth and death rates are allowed. To make incorporating the birth

Page 232: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 223

and death rates easier, we assume the total population size is 1. So, we cannaturally think of the populations S,E, I, and R as being percentages of thetotal population in this model. Note that the death rate is the normal ratein the overall population in the absence of the disease. As with the other twomodels, there are no deaths due to the disease itself (which was very sadlynot the case for the Covid-19 outbreak).

The system of differential equations for the SEIR Model have strikingsimilarities to the previous two models.

dS

dt“ µ´ αSI ´ µS

dE

dt“ αSI ´ pµ` γqE

dI

dt“ γE ´ pµ` βqI

dR

dt“ βI ´ µR

The positive parameters in the model are as follows.

� µ: the natural birth and death rate in the population

� α: the rate of transmission of the virus from infected people to suscep-tible people

� γ: the rate of infection amongst the exposed population

� β: the rate of recovery from the disease

Note that the model assumes that all newborns are susceptible to the disease(if we had wanted a population of size N , the first term in the differentialequation for dS{dt should have been µN). Notice that each population has amatching death rate (´µS,´µE,´µI, and ´µR in each respective equation).Notice that for transmission to occur in the model, a susceptible personmust interact with an infected person – not an exposed one. Since the totalpopulation size is fixed at 1, we can safely ignore the differential equation for

Page 233: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 224

R and focus on the remaining three.

dS

dt“ µ´ αSI ´ µS

dE

dt“ αSI ´ pµ` γqE

dI

dt“ γE ´ pµ` βqI

We can still find equilibria for this system just as we did before (the onlydifference is that we have three equations to solve instead of two). Un-fortunately, our phase plane techniques do not apply since we would needthree dimensions to display everything (the correct term here would be phasespace).

Theorem 5.5.3 (Equilibria for the SEIR Model). The SEIR Model eitherhas 1 or 2 equilibria. The point S “ 1, E “ 0, I “ 0, and R “ 0 is alwaysan equilibrium regardless of the parameters. The other possible equilibriumis given by the values

S˚ “pβ ` µqpγ ` µq

αγ

E˚ “ µ

ˆ

1

γ ` µ´β ` µ

αγ

˙

I˚ “ µ

ˆ

γ

pβ ` µqpγ ` µq´

1

α

˙

R˚ “ β

ˆ

γ

pβ ` µqpγ ` µq´

1

α

˙

which is sensible for the model precisely when

S˚ “pβ ` µqpγ ` µq

αγă 1.

If the birth/death rate µ is considerably smaller than the other parameters,then

S˚ «β

αE˚ « 0

I˚ « 0

R˚ « 1´β

α.

Page 234: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 225

Proof: The algebra to find these equilibria is straightforward (if messy).Showing that the second equilibrium exists when S˚ ă 1 requires some workbut is omitted for space. �

The stability of equilibria in higher dimensions is a delicate subject, andclassification becomes far more difficult. It can be shown that ifpS “ 1, E “ 0, I “ 0, R “ 0q is the only equilibrium for the system, then it isasymptotically stable.4 If the second equilibrium pS˚, E˚, I˚, R˚q is present,then pS “ 1, E “ 0, I “ 0, R “ 0q becomes an unstable saddle point. Thestability of pS˚, E˚, I˚, R˚q is far more difficult to work out, but it can beshown to be asymptotically stable (when it is sensible for the model).

During the Covid-19 outbreak, much attention was paid to the idea thatsocial distancing could reduce the maximum number of people who wereinfected (and likely needing medical attention) at any given time. If toomany people require hospitalization over a relatively short period of time,then hospital resources will quickly become overwhelmed, and the overallmortality rate will spike due to the inability of patients to receive adequatecare.

While all the parameters in the model are more or less sensitive to thepopulation’s response to the disease, social distancing acts to decrease thetransmission rate α. In the graph below, we plot only the susceptible andinfected populations to keep the graphs from being cluttered. For demon-stration purposes only, we take µ “ 0.001, β “ 0.05, and γ “ 0.3. The initialpopulation sizes are taken to be Sp0q “ 0.999, Ep0q “ 0.001, Ip0q “ 0, andRp0q “ 0 (i.e. 0.1% of the population has been exposed to the disease whilethe remaining 99.9% of the population is susceptible). If we start with a rel-atively large α (α “ 0.5 here), we see that there is a large spike in infectiouspeople before the populations approach their equilibrium values (shown asdashed lines), and hospitals are likely to be overwhelmed.

4This requires techniques we develop in Section 9.5.

Page 235: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 226

Figure 5.5.7: SEIR Model with Large Transmission Rate

The intended effect of social distancing is a reduction of the transmissionrate α. Below is a plot of the susceptible and infected populations with thesame model parameters as above except α has been reduced by a factor of 5(so α “ 0.1 in this particular model.)

Figure 5.5.8: SEIR Model with Reduced Transmission Rate

Notice that the peak of the infected population has shifted a bit later but is

Page 236: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 227

significantly smaller.Since we are only looking at numerical solutions, we can also allow the

transmission rate to change with time, α “ αptq. This allows us to modelrelaxation of social distancing and its impact on the total number of infectedpeople. For this example, we model the relaxation of social distancing by afunction αptq that increases linearly from α “ 0.1 to α “ 0.5 between t “ 180and t “ 190 (the time around the peak infectious cases for the model usingα “ 0.1 for all time).

Figure 5.5.9: Variable Transmission Rate for Relaxation of SocialDistancing

Page 237: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 228

Figure 5.5.10: Early Relaxation of Social Distancing

Notice that while the new peak of the infected population is still smallerthan the peak when there was no social distancing at all, relaxing the socialdistancing guidelines too soon resulted in a tremendous spike in the number ofinfected persons (more than doubling the number of infections in a relativelyshort amount of time in our particular model).

On the other hand, if we relax social distancing after the initial peak haspassed results are much better. The next graphs show the results of rampingα “ 0.1 to α “ 0.5 between t “ 300 and t “ 310 (well after the peak ofinfectious cases when α “ 0.1 for all time).

Page 238: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 229

Figure 5.5.11: Later Relaxation of Social Distancing

While there is a second peak in the infected population, both peaks aredramatically smaller than the case of no social distancing measures.

While the numbers used in this particular example are fictitious, theyserve to illustrate the main points that epidemiologists stressed during theCovid-19 pandemic.

1) Implementing social distancing early in an outbreak can drasticallyreduce the burden on the healthcare system (and so save lives).

2) Relaxing social distancing measures too soon during the outbreak canresult in a dramatic surge in the infected population and result in hos-pitals being overwhelmed with patients (potentially costing lives in theprocess).

5.6 Problems

For problems 1.q – 5.q, find all equilibria for the given autonomous system.Sketch a plot of the nullclines in a phase plane and try to determine whethereach equilibrium is asymptotically stable or unstable.

Page 239: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 230

1.)

dx

dt“ p1´ xqpy ` 1q

dy

dt“ x´ y

2.)

dx

dt“ xy ´ x´ y

dy

dt“ px´ 2qpy ´ 3q

3.)

dx

dt“ xp1´ 2yq

dy

dt“ ´yp3´ xq

4.)

dx

dt“ x

´

1´x

3

¯

´1

6xy

dy

dt“ y

´

1´y

4

¯

´1

8xy

5.)

dx

dt“ ´

1

3xy

dy

dt“

1

3xy ´ 2y

Solve the following problems related to the standard autonomous systemsdiscussed in the chapter.

6.) A population of mice are being preyed upon by a number of owls. In theabsence of owls, the population of mice would grow exponentially witha rate α “ 2. The predation rate is β “ 1{15. If there were no mice,

Page 240: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 231

the owls would die out exponentially fast at a rate γ “ 5. Preying onthe mice gives an increase to owl reproduction with a rate δ “ 1{100.What is the stable equilibrium point for these two species? If initiallythere are 600 mice and 20 owls in the region, will each population startout increasing or decreasing?

7.) A population of grasshoppers are being preyed upon by a number offrogs. In the absence of frogs, the population of grasshoppers wouldgrow exponentially with a rate α “ 3. The predation rate is β “ 1{20.If there were no grasshoppers, the frogs would die out exponentially fastat a rate γ “ 6. Preying on the grasshoppers gives an increase to frogreproduction with a rate δ “ 1{200. What is the stable equilibriumpoint for these two species? If initially there are 1300 grasshoppersand 70 frogs in the region, will each population start out increasing ordecreasing?

8.) Suppose in the SIR Model that the rate of infection is α “ 1{1000 whilethe recovery rate is β “ 1{2. What is the largest number of susceptiblepeople that the model predicts is stable?

9.) Suppose in the SIRS Model that the rate of infection is α “ 1{1000, therecovery rate is β “ 1{2, and the rate at which people lose immunityis γ “ 1{100. If the total population is N “10,000, what populationsof susceptible and infected persons are asymptotically stable? Is thedisease endemic to the population in this case?

10.) Suppose in the SIRS Model that the rate of infection is α “ 1{2000,the recovery rate is β “ 2, and the rate at which people lose immunityis γ “ 1{10. If the total population is N “3,000, what populationsof susceptible and infected persons are asymptotically stable? Is thedisease endemic to the population in this case?

11.) There are two species competing for the same resources. For speciesa, the logistic growth rate is ka “ 1{2 while the carrying capacity isNa “ 250. Interspecies competition reduces the rate of reproductionat a rate α “ 1{500. For species b, the logistic growth rate is kb “1{3 while the carrying capacity is Nb “ 150. Interspecies competitionreduces the rate of reproduction at a rate β “ 1{600. What will be thesize of these populations in the long-term?

Page 241: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 5. SYSTEMS OF AUTONOMOUS D.E. 232

12.) There are two species competing for the same resources. For speciesa, the logistic growth rate is ka “ 1{2 while the carrying capacity isNa “ 100. Interspecies competition reduces the rate of reproductionat a rate α “ 1{500. For species b, the logistic growth rate is kb “1{3 while the carrying capacity is Nb “ 150. Interspecies competitionreduces the rate of reproduction at a rate β “ 1{600. What will be thesize of these populations in the long-term?

13.) There are two species competing for the same resources. For speciesa, the logistic growth rate is ka “ 1{2 while the carrying capacity isNa “ 100. Interspecies competition reduces the rate of reproductionat a rate α “ 1{500. For species b, the logistic growth rate is kb “1{3 while the carrying capacity is Nb “ 300. Interspecies competitionreduces the rate of reproduction at a rate β “ 1{600. What will be thesize of these populations in the long-term?

14.) Suppose in the previous problem that the growth rate of species bdrops to kb “ 1{8. Can you say for certain what will happen to thetwo populations in the long term?

15.) Challenge: Consider the following modified predator–prey model.

dR

dt“ αR

ˆ

1´R

NR

˙

´ βRF

dF

dt“ ´γF ` δRF

The difference between this model and the traditional Lotka-VolterraModel is that the prey population is assumed to grow logistically in theabsence of predators. α ą 0 is now the logistic growth rate and NR

is the carrying capacity for the prey. The other coefficients have thesame interpretation as the standard predator–prey model.

Identify all equilibria for the model and determine their stability. HINT:This will depend on the relative sizes of NR and the quantity γ{δ.

Page 242: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Chapter 6

Discrete Probability

6.1 Introduction and Basic Terminology

Quite often, the final outcome of some process cannot be predicted withcomplete confidence. We could imagine several reasons why this might bethe case, but there are two possibilities which are often cited.

1.) The outcome is completely determined once the process is set up, butthe system being studied is so complex that exact predictions are nextto impossible.

2.) The outcome is not completely determined by the initial setup of theprocess. That is, there is inherent randomness in the process.

There has been a long running discussion in the scientific and philosoph-ical communities about these possibilities and the nature of probability. Webypass all such issues here and focus strictly on the mathematical theory ofprobability. For an introduction to the various interpretations of probability,see [Hj12].

As always, we begin with some basic terminology. When discussing prob-ability, an experiment is any process whose final outcome cannot be pre-dicted with complete confidence in advance. As examples, we could imaginetossing a fair coin, rolling a six-sided die, or flicking a spinner on a gameboard.

233

Page 243: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 234

Figure 6.1.1: A Typical Spinner

The set of all possible outcomes for a particular experiment is said to bethe sample space for the experiment. For instance, there are two possibili-ties when throwing a coin – heads and tails. So, we can think of the samplespace as the set

S “ tH,T u.

For the case of a six-sided die, the sample space is the set

S “ t1, 2, 3, 4, 5, 6u.

The sample space for the spinner is a little more complicated. Ideally, theoutcome of the spinner could be any angle between 0˝ and 360˝. Thus, thesample space would be

S “ tθ|0˝ ď θ ă 360˝u “ r0˝, 360˝q.

This last example of a sample space brings up an important distinction.An experiment is said to be discrete if it has a finite number of outcomesor if its outcomes can be labeled by the positive integers 1, 2, 3, 4, . . . If anexperiment has an entire range of real numbers for its sample space, it is saidto be continuous.

An event for an experiment is simply a subset of its sample space. Insymbols, an event is a set of outcomes E which satisfies E Ă S. If ourexperiment is rolling a six-sided die, then an event might be rolling an evennumber.

E “ t2, 4, 6u Ă S “ t1, 2, 3, 4, 5, 6u

Often in probability, we describe events in words rather than giving an ex-plicit list of outcomes. Consider the spinner (S “ r0˝, 360˝q). We might

Page 244: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 235

want to consider the event E where the spinner lands in the first quadrant.Translating this into set notation gives

E “ p0˝, 90˝q Ă S “ r0˝, 360˝q.

Since sample spaces and events are sets, we can apply basic set operationsto them. The most important such operations are listed below. Let S be thesample space for some experiment, and let E1 and E2 be two events in S.

1.) Intersection: The event “E1 AND E2” is the event that is the inter-section of the two separate events:

E1 X E2 “ E1E2 “ tx|x P E1 and x P E2u.

(NOTE: Writing the intersection of two sets as E1E2 is a peculiar habitin probability, but it is common enough to be aware of.)

2.) Union: The event “E1 OR E2” is the event that is the union of thetwo separate events:

E1 Y E2 “ tx|x P E1 or x P E2u.

3.) Complement: The event “NOT E” is the event that is the set com-plement of E (relative to S):

Ec“ tx|x P S and x R Eu.

Two events are said to be mutually exclusive if

E1 X E2 “ H.

That is, two events are mutually exclusive if they share no possible outcomesin common.

A probability on a sample space S is a function on the events of S whichreturns a number between zero and one. Specifically, a probability must havethe following properties.

� For any event E Ă S,0 ď PpEq ď 1,

� PpSq “ 1,

Page 245: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 236

� If E1 and E2 are mutually exclusive events (E1 X E2 “ H),

PpE1 Y E2q “ PpE1q ` PpE2q.

A few comments are in order. We already mentioned that a probability isa real number between zero and one (which is the content of the first propertyabove). The second property, PpSq “ 1, simply reinforces the requirementthat the sample space S contains all of the possible outcomes.

The third property above is the most critical one. It asserts that theprobability of non-overlapping events is just the sum of the individual prob-abilities. In fact, this property instantly scales up to any finite number ofmutually exclusive events. That is, if E1, E2, . . . , EN are any finite numberof mutually exclusive events (so Ei XEj “ H for any pair of distinct indicesi and j), then

PpE1 Y E2 Y ¨ ¨ ¨ Y ENq “ PpE1q ` PpE2q ` ¨ ¨ ¨ ` PpENq.

In more advanced treatments of probability, it is important to extend thisproperty to countably infinite mutually exclusive events:

P

˜

i“1

Ei

¸

8ÿ

i“1

PpEiq

provided Ei X Ej “ H for any pair of distinct indices i and j. Since we willnever deal with countably many events at one time, this more general versionwill not be terribly important for our purposes.

There are a number of important consequences of this definition. We listthe two most crucial ones below.

Lemma 6.1.1. Let P be a probability on the events in a sample space S.

� If E is any event in S, we have

PpEcq “ 1´ PpEq.

� For any two events E and F in S,

PpE Y F q “ PpEq ` PpF q ´ PpE X F q.

Page 246: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 237

Proof: For the first equality, we note that E and Ec are mutually exclu-sive and E YEc “ S by definition. Invoking the second and third propertiesof probabilities, we have

PpSq “ PpE Y Ecq

1 “ PpEq ` PpEcq.

Rearranging this equality gives the result.The second equality is intuitively obvious from the following Venn dia-

gram.

E F

S

Figure 6.1.2: Venn Diagram of Two Events E and F

Here, the probability of an event is represented by its area in the diagram(and so the total area of the rectangle representing S is equal to 1). Theevent E Y F is the totality of all three shaded regions shown. If we add theprobabilities of E and F together, then the green region (which is E X F ) iscounted twice. Hence,

PpE Y F q “ PpEq ` PpF q ´ PpE X F q. �

Finally, a random variable is any function defined on the sample spaceS. As an example, consider the experiment where we roll two, fair, six-sideddice. The sample space S is all possible pairs of rolls:

S “ tpi, jq|i, j “ 1, 2, 3, 4, 5, 6u “ tp1, 1q; p1, 2q; p1, 3q; ¨ ¨ ¨ p6, 4q; p6, 5q; p6, 6qu.

The random variable most often considered in such a case is the sum of thetwo dice: Rpi, jq “ i ` j. It turns out that we can think of the randomvariable R as a new experiment whose sample space is

S 1 “ t2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12u,

Page 247: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 238

and the probabilities of the outcomes for R can be computed knowing theprobabilities for the original experiment (rolling two dice).

We will often use the terms “random variable” and “experiment” inter-changeably in what follows. Given any experiment, we can define the randomvariable which is just the identity function on the sample space! In otherwords, the concept of random variable generalizes the notion of experiment.

6.2 Discrete Random Variables

As mentioned above, a discrete random variable is any experiment wherethe outcomes can be labeled by a subset of the natural numbers. This meansthe sample space looks like

S “ td1, d2, d3, ¨ ¨ ¨ dNu

if the sample space is finite. For a discrete random variable, we only need tospecify the probabilities of the individual outcomes di.

Lemma 6.2.1. A probability on a finite sample space

S “ td1, d2, d3, ¨ ¨ ¨ dNu

is a specification of probabilities for the individual outcomes

Pptdiuq “ pi

where the probabilities pi satisfy

1.) 0 ď pi ď 1,

2.)řNi“1 pi “ 1.

Proof: Since tdiu and tdju are disjoint subsets of S as long as i ‰ j, theprobability of any event E in S is simply the sum of the probabilities of theoutcomes in E. The axiom that the probability of S must equal 1 forces thesum of all the individual probabilities to be 1. This shows that a probabilityon a discrete sample space must have the properties above. Reversing thesearguments shows that the two properties above give us a probability on adiscrete space. �

Page 248: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 239

Example 6.2.1 (A Fair Coin). A fair coin is the random variable withsample space S “ tH,T u and probabilities

PptHuq “ PptT uq “1

2. �

Example 6.2.2 (A Biased Coin). A biased coin is any random variable withsample space S “ tH,T u and probabilities

PptHuq “ p

PptT uq “ 1´ p

where 0 ď p ď 1. Notice that the biased coin contains the fair coin as thespecial case p “ 1{2. �

Example 6.2.3 (A Fair Six-Sided Die). A fair six-sided die is the randomvariable with sample space S “ t1, 2, 3, 4, 5, 6u and probabilities

Ppt1uq “ Ppt2uq “ ¨ ¨ ¨ “ Ppt6uq “1

6.

The term “fair” usually indicates that all possible outcomes are equallylikely while “biased” indicates that some outcomes are more likely than oth-ers.

Example 6.2.4 (A Biased Six-Sided Die). Suppose we have a six-sided diewhere the outcomes 2, 3, 4, and 5 all have probability 1{10 and the proba-bilities of 1 and 6 are equal. What are these two probabilities?

Answer: We know that the sum of the probabilities must equal 1.

1 “ Ppt1uq ` Ppt2uq ` Ppt3uq ` Ppt4uq ` Ppt5uq ` Ppt6uq

1 “ Ppt1uq `1

10`

1

10`

1

10`

1

10` Ppt6uq

1 “ Ppt1uq ` Ppt6uq `2

53

5“ Ppt1uq ` Ppt6uq.

Using Ppt1uq “ Ppt6uq, we have

3

5“ 2Ppt1uq

Ppt1uq “3

10.

Page 249: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 240

This gives

Ppt1uq “ Ppt6uq “3

10. �

Example 6.2.5 (Rolling Two Fair Six-Sided Dice). If we roll two fair six-sided dice, the sample space consists of 36 pairs of outcomes

S “ tpi, jq|i, j “ 1, 2, 3, 4, 5, 6u “ tp1, 1q; p1, 2q; p1, 3q; ¨ ¨ ¨ p6, 4q; p6, 5q; p6, 6qu.

Since the dice are fair, each pair is equally likely:

Pptpi, jquq “1

36.

We will have more to say about this and similar situations in later sections.Suppose now that we want to consider the random variable R “ Rpi, jq “

i`j which is the sum of the outcomes for the two dice. What are the possibleoutcomes for R and their respective probabilities?

Answer: The sum of two dice can be any integer between 2 and 12. Thismeans that the sample space for R is the set

S “ t2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12u.

In order to work out the probabilities for R, we only have to count theoutcomes from the original sample space which give the particular value of

Page 250: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 241

R we are considering.

PpR “ 2q “ Pptp1, 1quq “1

36,

PpR “ 3q “ Pptp1, 2q; p2, 1quq “2

36“

1

18,

PpR “ 4q “ Pptp1, 3q; p2, 2q; p3, 1quq “3

36“

1

12,

PpR “ 5q “ Pptp1, 4q; p2, 3q; p3, 2q; p4, 1quq “4

36“

1

9,

PpR “ 6q “ Pptp1, 5q; p2, 4q; p3, 3q; p4, 2q; p5, 1quq “5

36,

PpR “ 7q “ Pptp1, 6q; p2, 5q; p3, 4q; p4, 3q; p5, 2q, p1, 6quq “6

36“

1

6,

PpR “ 8q “ Pptp2, 6q; p3, 5q; p4, 4q; p5, 3q; p6, 2quq “5

36,

PpR “ 9q “ Pptp3, 6q; p4, 5q; p5, 4q; p6, 3quq “4

36“

1

9,

PpR “ 10q “ Pptp4, 6q; p5, 5q; p6, 4quq “3

36“

1

12,

PpR “ 11q “ Pptp5, 6q; p6, 5quq “2

36“

1

18,

PpR “ 12q “ Pptp6, 6quq “1

36. �

This last example shows a couple of notational peculiarities common inthe theory of probability. First, probabilists rarely display the function ar-guments for random variables. We see this in the example above where wewrote R instead of Rpi, jq for the sum of the two dice. The second is thatwe often leave off the set braces when computing probabilities with randomvariables. Above, we used the short-hand PpR “ 3q to stand for the moreaccurate version:

PpR “ 3q “ Pptpi, jq|Rpi, jq “ 3uq “ Pptp1, 2q; p2, 1quq.

Typically, these abuses of notation do not cause much confusion. In this text,we will only use the set braces when listing individual outcomes.

Page 251: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 242

6.3 Independent Events

One of the most important concepts in probability is the idea of indepen-dence. Two events E and F from a sample space S are said to be indepen-dent if

PpE X F q “ PpEq ¨ PpF q.

The definition extends to any number of events E1, E2, . . . EN by requiringthe probability of any intersection of these events to be the product of theprobabilities of the events involved in the intersection.

Example 6.3.1. Consider the experiment where we roll two fair six-sideddice. We will consider three random variables related to this experiment:

1.) D1 “ D1pi, jq “ i “ outcome of first die,

2.) D2 “ D2pi, jq “ j “ outcome of second die,

3.) R “ Rpi, jq “ i` j “ sum of the two dice.

Determine whether the following events are independent.

a.) D1 “ 4 and D2 “ 3

b.) R “ 7 and D1 “ 3

c.) R “ 6 and D2 “ 4

Answer: To determine whether the events are independent, we comparethe probability of the intersection of the two events with the product of theirindividual probabilities.

a.) The event D1 “ 4 consists of the following separate outcomes:

tD1 “ 4u “ tp4, 1q; p4, 2q; p4, 3q; p4, 4q; p4, 5q; p4, 6qu.

So, the probability of this event is PpD1 “ 4q “ 1{6. Similarly,

tD2 “ 3u “ tp1, 3q; p2, 3q; p3, 3q; p4, 3q; p5, 3q; p6, 3qu

giving a probability PpD2 “ 3q “ 1{6.

Page 252: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 243

Next, the intersection of these two events is

tD1 “ 4u X tD2 “ 3u “ tp4, 3qu,

and so the probability of the intersection is

PptD1 “ 4u X tD2 “ 3uq “1

36“ PpD1 “ 4q ¨ PpD2 “ 3q.

That means these two events are independent.

Note there is nothing special about the choices for these two randomvariables. The events D1 “ i and D2 “ j are independent of oneanother for any choice of i and j. This means that the outcome ofthe first roll is independent of the outcome of the second roll, and viceversa.

b.) We computed the probability that R “ 7 in Example 6.2.5 above:PpR “ 7q “ 1{6. As in the last problem

tD1 “ 3u “ tp3, 1q; p3, 2q; p3, 3q; p3, 4q; p3, 5q; p3, 6qu

giving PpD1 “ 3q “ 1{6. Notice that intersection of these two events is

tR “ 7u X tD1 “ 3u “ tp3, 4qu,

and so the probability of the intersection is

PptR “ 7u X tD1 “ 3uq “1

36“ PpR “ 7q ¨ PpD1 “ 3q.

So, these two events are independent.

As above, there is nothing special about the event D1 “ 3. In fact, theevent R “ 7 is independent of any events of the form D1 “ i or D2 “ j!

c.) The probability that R “ 6 was computed to be PpR “ 6q “ 5{36. ForD2 “ 4, we have PpD2 “ 4q “ 1{6. For the intersection, we have

PptR “ 6uXtD2 “ 4uq “ Pptp2, 4quq “1

36‰ PpR “ 6q¨PpD2 “ 4q “

5

216.

So, these two events are not independent. �

Page 253: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 244

Instead of directly checking whether events are independent, we oftenassume independence to make the computation of certain probabilities easier.The idea is that if an experiment is comprised of a number of independentsub-experiments, then we simply have to multiply the probabilities of thecomponent events to get the probability of the overall outcome. The followingexample makes that clear.

Example 6.3.2. Suppose we independently toss 3 fair coins. Determine thesample space and the probabilities of all possible outcomes.

Answer: We can list each possible outcome as a string consisting of H’sand T ’s of length 3.

S “ tHHH,HHT,HTH,HTT, THH, THT, TTH, TTT u.

Let C1, C2, and C3 be the outcomes of coins 1, 2, or 3 respectively. Tocompute probabilities, we use the assumption that the coin tosses are inde-pendent. For instance,

PptHHHuq “ PpC1 “ H and C2 “ H and C3 “ Hq

“ PpC1 “ Hq ¨ PpC2 “ Hq ¨ PpC3 “ Hq

“1

1

1

2“

1

8.

Since the coins are fair, the computation will be the same for any of the 8outcomes.

PptHHHuq “ PptHHT uq “ ¨ ¨ ¨ “ PptTTT uq “1

8. �

This method is exactly how we came by the probabilities for rolling twofair six-sided dice. We can also compute the probabilities of fairly com-plicated experiments so long as they are composed of independent parts.Consider the next simple example.

Example 6.3.3. Suppose we perform an experiment where we toss a faircoin and independently roll a fair six-sided die. List all possible outcomesand find their probabilities.

Answer: We can list the outcomes as an H or a T followed by a numberbetween 1 and 6.

S “ tH1, H2, H3, H4, H5, H6, T1, T2, T3, T4, T5, T6u.

Page 254: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 245

Let C be the outcome of the coin toss and D be the outcome of the die roll.Using the assumption of independence, we find

PptH1uq “ PpC “ H and D “ 1q

“ PpC “ Hq ¨ PpD “ 1q

“1

1

6“

1

12.

Since both outcomes of the coin toss have probability 1{2 and all six outcomesof the die roll have probability 1{6, each outcome of this experiment hasprobability 1{12. �

As a special note, be careful not to confuse the notions of independentevents and mutually exclusive events. If two events E and F are mutuallyexclusive, then PpE X F q “ 0 since E X F is the empty set. If the eventswere also independent, we would need

0 “ PpE X F q “ PpEq ¨ PpF q.

This can only happen if PpEq “ 0 or PpF q “ 0. So, two mutually exclusiveevents can only be independent if at least one of them has probability zero!Generically speaking, mutually exclusive events are not independent, andvice versa.

6.4 Basic Combinatorics and the Computa-

tion of Probabilities

Quite often, the computation of probabilities for discrete random variablescomes down to counting the number of outcomes matching some property.

Example 6.4.1. We (independently) toss three fair coins. What is theprobability that we have at least two heads in our outcome?

Answer: We listed the sample space earlier:

S “ tHHH,HHT,HTH,HTT, THH, THT, TTH, TTT u.

Let E be the event that there are two or more heads in the outcome. Lookingthrough the outcomes, we see

E “ tHHH,HHT,HTH, THHu.

Page 255: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 246

Since each outcome has probability 1{8, we find

PpEq “4

8“

1

2. �

In the last example, we simply listed all possible outcomes and determinedwhich were in our particular event. But what if there had been 10 indepen-dent coin tosses? How many outcomes would there be? How many wouldhave 2 or more heads? Once the number of outcomes becomes rather large,listing all of them becomes impractical. Fortunately, there are mathematicaltechniques which can help us count outcomes matching some pattern. Thebranch of mathematics that studies counting techniques is called combina-torics.

Theorem 6.4.1 (The Fundamental Principle of Counting). Suppose that atask consists of selecting one element from each of N sets: S1, S2, . . . SN . Let|Si| represent the number of elements in the set Si. Then, the number of waysof accomplishing the task is given by the product of the number of elementsin each set:

|S1| ¨ |S2| ¨ ¨ ¨ |SN |.

Proof: If the task consists of picking an element from a single set S,then clearly there are |S| ways to accomplish the task. If the task consists ofpicking one element from S1 and one element from S2, then after we make achoice from S1 there are exactly |S2| choices we can make. Since there were|S1| initial possible choices, the total number of choices must be

|S1| ¨ |S2|.

The general form above follows by induction on the number of sets. �

Example 6.4.2. How many outcomes are possible if we toss 10 coins?

Answer: We can think of this as a task where we have to pick one itemfrom 10 sets:

S1 “ tH,T u, S2 “ tH,T u, ¨ ¨ ¨S10 “ tH,T u.

Since each set has 2 elements, we have

2 ¨ 2 ¨ ¨ ¨ 2looomooon

10 times

“ 210“ 1024. �

Page 256: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 247

Example 6.4.3. How many outcomes are possible if we roll 3 six-sided dice?

Answer: We have to pick an element from 3 sets

S1 “ S2 “ S3 “ t1, 2, 3, 4, 5, 6u.

Since each set has 6 elements, we have 6 ¨ 6 ¨ 6 “ 63 “ 216 possible outcomes.�

Lemma 6.4.2 (Permutations). Suppose a task consists of choosing k objects(without replacement) in a particular order from a set of N distinguishableobjects pN ě kq. Then the number of ways to accomplish the task is given by

PNk “

N !

pN ´ kq!“ NpN ´ 1qpN ´ 2q ¨ ¨ ¨ pN ´ k ` 1q.

Proof: We have N ways to make the first choice. Once we remove thefirst item, there are N ´ 1 one items remaining. Thus, there are NpN ´ 1qways to make the first two choices. Continuing in this manner proves thegeneral formula above. �

Example 6.4.4. A committee consists of 20 people. From these 20 people,a chairperson, secretary, and treasurer must be selected. How many differentslates of officers are possible?

Answer: We have to select three people (in order) from a group of 20.This means there are

P 203 “ 20 ¨ 19 ¨ 18 “ 6840 slates of officers. �

Lemma 6.4.3 (Combinations). Suppose a task consists of choosing k objects(without replacement) from a set of N distinguishable objects without regardto order. Then the number of ways to accomplish the task is given by

ˆ

N

k

˙

“N !

k!pN ´ kq!.

Proof: If we choose the k objects in particular order, then there are

PNk “

N !

pN ´ kq!

Page 257: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 248

possible outcomes. This over counts the number of actual outcomes since wewant do not care about different orderings of the same set of k objects. Sincethere are P k

k “ k! different orderings of k objects, we have

ˆ

N

k

˙

“N !

k!pN ´ kq!possible outcomes. �

The coefficients

ˆ

N

k

˙

are known as binomial coefficients and are often read

as “N choose k.”

Example 6.4.5. A committee consists of 20 people. If a subcommittee of 6people needs to be formed, how many different subcommittees are possible?

Answer: We need to select 6 people out of the original 20, but the orderin which they are selected is unimportant. So, the number of subcommitteesis

ˆ

20

6

˙

“20!

6!14!“

20 ¨ 19 ¨ 18 ¨ 17 ¨ 16 ¨ 15

6 ¨ 5 ¨ 4 ¨ 3 ¨ 2 ¨ 1“ 38, 760. �

Example 6.4.6. A standard deck consists of 52 distinguishable cards. Apoker hand consists of 5 cards in no particular order. How many differentpoker hands are possible?

Answer: We need to choose 5 cards from the deck of 52. This meansthere are

ˆ

52

5

˙

“52!

5!47!“

52 ¨ 51 ¨ 50 ¨ 49 ¨ 48

5 ¨ 4 ¨ 3 ¨ 2 ¨ 1“ 2, 598, 960

different hands of poker. �Quite often, we have to combine these two methods of counting.

Example 6.4.7. A committee consists of 20 people. A subcommittee con-sists of a chairperson, a secretary, and 4 regular members. How many differ-ent subcommittees are possible?

Answer: The task of selecting a subcommittee consists of two parts.First, we have to pick a chairperson and a secretary for the subcommittee.Since there are 20 people to choose from, the number of way of choosing theofficers for the subcommittee is

P 202 “ 20 ¨ 19 “ 380.

Page 258: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 249

After selecting these two positions, we have to choose the 4 regular membersfrom the remaining 18 people. This means there are

ˆ

18

4

˙

“18!

4!14!“ 3, 060

ways to choose the remaining members of the subcommittee. Combining thiswith the number of ways of selecting the officers gives

380 ¨ 3, 060 “ 1, 162, 800

possible subcommittees.Notice that this answer is independent of how we order the two different

tasks. If we choose the 4 regular members first, then there areˆ

20

4

˙

“20!

4!16!“ 4, 845

ways to select this component of the subcommittee. From the remaining 16people, we have to choose a chairperson and a secretary:

P 162 “ 16 ¨ 15 “ 240.

Combining these two gives

4, 845 ¨ 240 “ 1, 162, 800. �

Example 6.4.8. Suppose we flip a coin 10 times. Of the total number ofoutcomes, how many have exactly 2 heads?

Answer: We can label the different tosses with the numbers 1 through10. If we think of these different tosses as “slots,” our job is to pick the twoslots where the heads will go. The remaining slots must necessarily be tails.Since the order we choose the slots in is unimportant, we have

ˆ

10

2

˙

“10!

2!8!“

10 ¨ 9

2“ 45 tosses with exactly 2 heads. �

These basic counting tools allow us to answer some interesting probabilityquestions.

Example 6.4.9. Suppose we (independently) flip a fair coin 10 times. Whatis the probability of getting exactly 3 heads?

Page 259: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 250

Answer: We know there are 210 “ 1024 possible outcomes. Since theflips are independent, we know that

Pptany single outcomeuq “1

1024.

We only need to count the number of outcomes with exactly 3 heads. Re-peating our analysis from above, we find

ˆ

10

3

˙

“10!

3!7!“ 120

possible outcomes with exactly 3 heads. Since each has the same probability,we find

Pptexactly 3 headsuq “120

1024“

15

128. �

Example 6.4.10. We (independently) flip a fair coin 6 times. What is theprobability that more than half of the outcomes are heads?

Answer: There are 26 “ 64 possible outcomes. We want to know howmany outcomes have 4, 5, or 6 heads. Notice that these are mutually exclusiveoutcomes. So, we need to count the number of outcomes for each typeseparately and sum them up to get the total.

ˆ

6

4

˙

“ 15 outcomes with 4 heads

ˆ

6

5

˙

“ 6 outcomes with 5 heads

ˆ

6

6

˙

“ 1 outcome with 6 heads

15` 6` 1 “ 22 outcomes with 4, 5, or 6 heads

So, the probability of having more than half of the flips turn up heads is

Pptmore than 3 headsuq “22

64“

11

32. �

Example 6.4.11. Suppose we have an urn containing 3 red balls, 3 greenballs, and 4 yellow balls, and we randomly select 3 balls from the urn (withoutreplacement). What is the probability that exactly two of the balls areyellow?

Page 260: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 251

Answer: Since we choose three balls at random from the urn, the numberof possible outcomes from the experiment is given by

ˆ

10

3

˙

“ 120.

Any of these outcomes is equally likely, so the probability of any particularone is 1{120.

We need to count the number of outcomes that have exactly 2 yellowballs. So, we need to choose 2 from the 4 yellow balls and then choose anyone of the 6 non-yellow balls. The number of ways of doing this is

ˆ

4

2

˙

¨ 6 “ 6 ¨ 6 “ 36.

So the probability of having exactly 2 yellow balls is

Pptexactly 2 yellowsuq “36

120“

3

10.

Alternatively, we could compute the probability by pretending the ballsare distinguishable and that we take the balls out in some order. We justhave to be sure to count all possible outcomes that correspond to having 2yellow balls. Let us pretend the balls are numbered 1 through 10. Balls 1,2, and 3 are red; balls 4, 5, and 6 are green; balls 7 – 10 are yellow. Sincewe are pulling three balls out of the urn in order, the number of outcomes isP 10

3 “ 10 ¨ 9 ¨ 8 “ 720. Each outcome is equally likely, and so the probabilityof an particular outcome is 1{720.

Since we want to have exactly two yellows, there are three possible typesof outcomes we need to count:

Y Y not Y

Y not Y Y

not Y Y Y

The slots labeled “Y ” (for yellow) have to be chosen from balls 7 – 10 whilethe slot labeled “not Y ” (for not yellow) has to be chosen from balls 1 – 6.This leads to the following counts:

Y Y not Y “ 4 ¨ 3 ¨ 6 “ 72,

Y not Y Y “ 4 ¨ 6 ¨ 3 “ 72,

not Y Y Y “ 6 ¨ 4 ¨ 3 “ 72.

Page 261: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 252

Since these individual types are mutually exclusive, there are 72` 72` 72 “216 outcomes that have exactly two yellow balls. Computing the probabilitygives

Pptexactly 2 yellowsuq “216

720“

3

10. �

Example 6.4.12. Consider the urn from the previous problem (containing 3red, 3 green, and 4 yellow balls). If we now select 4 balls from the urn (withoutreplacement), what is the probability that there are 2 or more yellow ballsin our selection?

Answer: There areˆ

10

4

˙

“ 210

different outcomes for this experiment. Hence, the probability of any partic-ular outcome is 1{210.

For this particular problem, it is easier to find the probability of theopposite event:

Pptat least two yellow ballsuq

“ 1´ Ppt0 yellow balls or 1 yellow balluq.

Notice that

Ppt0 yellow balls or 1 yellow balluq

“ Ppt0 yellow ballsuq ` Ppt1 yellow balluq

since these two events are mutually exclusive.If there are no yellow balls in our group of 4, then we selected 4 balls

from the 6 non-yellow balls:ˆ

6

4

˙

“ 15 outcomes with no yellow balls.

This gives

Ppt0 yellow ballsuq “15

210“

1

14.

If there is exactly 1 yellow ball, then we have 4 ways to pick a yellow balland the remaining 3 balls must be selected from the non-yellow ones. Thismeans that there are

4 ¨

ˆ

6

3

˙

“ 4 ¨ 20 “ 80 outcomes with exactly 1 yellow ball.

Page 262: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 253

So,

Ppt1 yellow balluq “80

210“

8

21.

Putting these two together gives

Pptat least two yellow ballsuq “ 1´1

14´

8

21

“23

42. �

Example 6.4.13 (The Birthday Problem). Out of a group of N people(N ě 2), what is the probability that at least two people share a commonbirthday? How big should N be so that there is at least a 50% chance thattwo or more people share a common birthday?

Answer: To make things simple, we will assume there are 365 differentbirthdays (so we ignore leap years). We will also assume that all birthdaysare equally likely and independent. Both of these assumptions are suspect!It is well known that birth rates vary somewhat over the year, and if there aretwins in the group, then birthdays are certainly not independent! However,none of these issues make a significant difference to the outcome.

First note that N ě 2 for the problem to make any sense at all. The otherobvious fact is that once N ě 366 there must be a pair of people sharing thesame birthday (since there are only 365 different possible dates to choosefrom). So, we assume 2 ď N ď 365 in what follows.

Instead of arguing directly, we first find the probability that no two peopleshare a birthday. To compute this probability, we imagine that we line upthe people in the group in some order (any order will do) and ask for theirbirthdays one at a time. Each time a person tells us their birthday, we placea mark on that date in a calendar. The first person can have any particularbirthday at all which means there are 365 possible choices. If no two peopleare going to share a birthday, then the second person’s birthday can be anyone of the remaining 365 ´ 1 “ 364 days. The third person’s birthday canbe any of the remaining 365 ´ 2 “ 363 days; the fourth person’s birthdaycan be any of the remaining 365 ´ 3 “ 362 days, etc. For the last personin the group, N ´ 1 dates have already been marked on the calendar, so365´pN ´ 1q “ 365´N ` 1 days are left for their birthday (again assumingno two people share a birthday). This means there are

p365qp364qp363q ¨ ¨ ¨ p365´N ` 1q “ P 365N “

365!

p365´Nq!

Page 263: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 254

ways that no two people in the group can share a birthday. Since there are365N total arrangements of birthdays, we find

Pptno two share a common birthdayuq “365!

365Np365´Nq!.

Since the complementary event to at least two people share a commonbirthday is precisely the event that no two people do, we find

Pptat least two share a common birthdayuq “ 1´365!

365Np365´Nq!

for 2 ď N ď 365. We were asked to find N such that this probability is1{2 or larger. Unfortunately, the form of the answer makes this difficult tocompute directly. Instead, we present a partial chart of these probabilities.

N Pptat least two share a birthdayuq21 0.443722 0.475723 0.507324 0.538325 0.5687

So for a group of 23 people, there is just over a 50% chance that two peopleshare a common birthday. �

The answer above surprises most people since 23 people does not seemlike a very large group. However, there are

ˆ

23

2

˙

“ 253

different pairs of people in a group of 23. The fact that the total number ofdistinct pairs grows rapidly with N ,

ˆ

N

2

˙

“NpN ´ 1q

2,

is why the likelihood of a common birthday increases so quickly. It turns outthat once the group has more than 46 people, the probability that at leasttwo people share a birthday is over 95%!

Page 264: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 255

6.5 Conditional Probability and the Law of

Total Probability

Frequently, we have partial information about the outcome of an experiment,and we want to update our assessment of probabilities based on this extraknowledge. For instance, suppose we (independently) flip 3 fair coins. Sincethere are 23 “ 8 equally likely outcomes, any particular outcome has prob-ability 1{8. Imagine a game where someone flips the 3 coins but does notreveal to us the actual outcome. Without any information about the out-come, we would rightly claim that the probability of getting all heads (i.e.HHH) is 1{8. However, if the person who flipped the coins tells us thereis at least one tails in the outcome, we would update our assessment of theprobability – the probability of HHH becomes zero!

The set of possible outcomes for this particular experiment is

S “ tHHH,HHT,HTH,HTT, THH, THT, TTH, TTT u.

The information we have been given is that the outcome actually lies in themore restricted event

E “ tat least one T u “ tHHT,HTH,HTT, THH, THT, TTH, TTT u,

which has 7 outcomes. Since these outcomes were equally likely before theadditional information was given to us, we have no reason to suspect that theprobabilities are not still equally likely. So, the probability of any outcomein E should be updated to 1{7.

The idea above was that the partial information essentially restricted usto a new sample space – from S to the event E. We then updated theprobabilities so that E had total probability 1. Generalizing this idea leadsus to the notion of conditional probability.

Let S be a sample space with some probability defined on it. Let E and Fbe events in S, and suppose that PpEq ą 0. The conditional probabilityof F given E is defined to be

PpF |Eq “PpE X F qPpEq

.

The quantity PpF |Eq is supposed to represent our updated assessment ofthe likelihood that F has happened given that we are certain the outcomelies in the event E. Graphically, the situation is shown below.

Page 265: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 256

E F

S

given E E

E X F

Figure 6.5.1: Diagram Showing Conditional Probability

The information that the outcome is definitely in E restricts the samplespace from all of S to just E. If we want to know the probability that F alsooccurs, we must be looking at the outcomes in E X F . The final thing to dois to rescale the probabilities so that the event E has probability 1. This isaccomplished in the definition by dividing all probabilities by PpEq (whichis why E cannot be allowed to have probability zero).

Example 6.5.1. Suppose we (independently) flip three fair coins. Giventhat there is at least one tails in the outcome, what is the probability thatwe have two heads?

Answer: As above, let E be the event that the outcome has at least onetails:

E “ tHHT,HTH,HTT, THH, THT, TTH, TTT u.

Let F be the event that the outcome has at least 2 heads:

F “ tHHH,HHT,HTH, THHu.

The intersection of these two events is

E X F “ tHHT,HTH, THHu.

We can now use the definition of conditional probability to compute theanswer. Remember that the probabilities in the formula are the ones asso-ciated to the full sample space S! In this case, all individual outcomes have

Page 266: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 257

probability 1{8.

PpF |Eq “PpE X F qPpEq

“PptHHT,HTH, THHuq

PptHHT,HTH,HTT, THH, THT, TTH, TTT uq

“3{8

7{8“

3

7. �

Example 6.5.2. Suppose we (independently) roll 2 fair six-sided dice. Giventhat the sum of the two dice is 5, what is the probability that one of the dicerolled a 3?

Answer: Let E be the event that the sum of the two dice is 5:

E “ tp1, 4q; p2, 3q; p3, 2q; p4, 1qu.

Let F be the event that at least one of the dice shows a 3:

F “ tp3, 1q; p3, 2q; p3, 3q; p3, 4q; p3, 5q; p3, 6q; p1, 3q; p2, 3q; p4, 3q; p5, 3q; p6, 3qu.

Since the intersection of these two events is

E X F “ tp3, 2q; p2, 3qu,

we see that

PpF |Eq “PpE X F qPpEq

“Pptp3, 2q; p2, 3quq

Pptp1, 4q; p2, 3q; p3, 2q; p4, 1quq

“2{36

4{26“

1

2. �

Before giving more interesting examples, we stop to give an alternatecharacterization of independent events.

Lemma 6.5.1 (Independent Events and Conditional Probability). SupposeE and F are two events in a sample space S and PpEq ą 0. Then E and Fare independent if and only if

PpF |Eq “ PpF q.

Page 267: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 258

Proof: If E and F are independent, then PpE X F q “ PpEq ¨ PpF q. So,

PpF |Eq “PpE X F qPpEq

“PpEq ¨ PpF q

PpEq“ PpF q.

On the other hand, if PpF |Eq “ PpF q, then

PpE X F qPpEq

“ PpF q

PpE X F q “ PpEq ¨ PpF q,

and so the events are independent. �This lemma gives us the crucial insight into the name “independent.”

That is, two events are independent if knowing that one of the events hasoccurred does not alter our assessment of how likely the other event is. Thisalso makes clear that, in general, mutually exclusive events are definitely notindependent. Consider the experiment where we (independently) roll 2 fairsix-sided die. Let E be the event that the sum of the two dice is 6 or less, andlet F be the event that at least one of the two dice rolls a 6. These events aremutually exclusive since rolling a 6 on one of the two dice guarantees thatthe sum of the two is at least 7. So, if we are told that the sum of the twodice is not greater than 6, we know that the probability of having rolled a 6on one of the dice is zero! This is certainly different from the unconditionalprobability of rolling a 6:

Pptroll at least one 6uq “11

36.

Example 6.5.3. Consider an urn filled with 3 red, 3 green, and 4 yellowballs. We perform an experiment where 3 balls are drawn from the urnwithout replacement. Given that at least one of the balls is red, what is theprobability that we have one ball of each color?

Answer: We will compute the probability in two ways. We begin bypretending all of the balls are distinguishable: balls 1 – 3 are red, 4 – 6green, and 7 – 10 yellow. We will also assume that the order in which theballs are pulled from the urn matters. Since there are 10 balls, that meansthere are

P 103 “ 10 ¨ 9 ¨ 8 “ 720 outcomes.

Page 268: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 259

Let E be the event that at least one ball is red, and let F be the event thatwe have one ball of each color. To compute the probability of E, we need toknow how many outcomes are in this event. We have to be very careful here.There can be exactly 1 red ball, exactly 2 red balls, or exactly 3 red balls inour selection. We should count these outcomes separately.

Case 1: Exactly 1 Red BallHere, there are three types of outcomes:

R not R not R “ 3 ¨ 7 ¨ 6 “ 126,

not R R not R “ 7 ¨ 3 ¨ 6 “ 126,

not R not R R “ 7 ¨ 6 ¨ 3 “ 126.

Thus, there are 378 outcomes with exactly one red ball.

Case 2: Exactly 2 Red BallsHere again, there are three types of outcomes:

R R not R “ 3 ¨ 2 ¨ 7 “ 42,

R not R R “ 3 ¨ 7 ¨ 2 “ 42,

not R R R “ 7 ¨ 3 ¨ 2 “ 42.

So, there are 126 outcomes with exactly two red balls.

Case 3: Exactly 3 Red Balls

R R R “ 3 ¨ 2 ¨ 1 “ 6

So, there are a total of 510 outcomes with at least one red ball, and theprobability of this event is

PpEq “510

720“

17

24.

Next, we need to consider the event E X F which in words is the eventthat there is at least one red ball and a ball of each color. Clearly, if thereis a ball of each color then there will be exactly one red ball! In this caseE X F “ F.One Ball of Each Color

Page 269: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 260

There are six types of outcomes:

R G Y “ 3 ¨ 3 ¨ 4 “ 36,

R Y G “ 3 ¨ 4 ¨ 3 “ 36,

G R Y “ 3 ¨ 3 ¨ 4 “ 36,

G Y R “ 3 ¨ 4 ¨ 3 “ 36,

Y R G “ 4 ¨ 3 ¨ 3 “ 36,

Y G R “ 4 ¨ 3 ¨ 3 “ 36.

This gives 216 outcomes with exactly one ball of each color, which means

PpF q “ PpE X F q “216

720“

3

10.

Finally, the conditional probability we are asked for is

PpF |Eq “PpE X F qPpEq

“3{10

17{24“

36

85.

The method above was certainly the lengthy way of obtaining the answer!The first simplification is to forget about the order in which the balls areremoved from the urn. This means there are

ˆ

10

3

˙

“ 120 outcomes.

Next,Pptat least one reduq “ 1´ Pptno redsuq.

Since there are 7 non-red balls, there areˆ

7

3

˙

“ 35 outcomes with no red balls.

This gives

Pptat least one reduq “ 1´ Pptno redsuq “ 1´35

120“

17

24.

As before, E X F “ F . The number of outcomes with one ball of each coloris

ˆ

3

1

˙

¨

ˆ

3

1

˙

¨

ˆ

4

1

˙

“ 3 ¨ 3 ¨ 4 “ 36.

Page 270: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 261

As before,

PpF q “ PpE X F q “36

120“

3

10.

Once again, we have

PpF |Eq “PpE X F qPpEq

“3{10

17{24“

36

85. �

If we rearrange the formula for conditional probability, we find an alter-nate one:

PpE X F q “ PpF |EqPpEq.This simple observation leads us to the following very useful theorem.

Theorem 6.5.2 (The Law of Total Probability). Let E and F be two eventsof a sample space S, and assume that 0 ă PpEq ă 1. Then

PpF q “ PpF |EqPpEq ` PpF |EcqPpEc

q.

Proof: Using the rearranged form of conditional probability above, wehave

PpF |EqPpEq ` PpF |EcqPpEc

q “ PpF X Eq ` PpF X Ecq.

Since E and Ec are mutually exclusive events, so are F X E and F X Ec.This means that the sum of the probabilities of these two events is just theprobability of their union:

PpF |EqPpEq ` PpF |EcqPpEc

q “ PpF X Eq ` PpF X Ecq

“ P ppF X Eq Y pF X Ecqq .

Basic results about set operations give

pF X Eq Y pF X Ecq “ F X pE Y Ec

q

“ F X S

“ F.

Hence,PpF |EqPpEq ` PpF |Ec

qPpEcq “ PpF q. �

The reason that this formula is useful is that it allows us to compute theprobability of the event F by conditioning on whether the separate eventE has happened or not. The idea is to pick E so that knowing whether Ehappens makes the computation of F easier. For this reason, the law of totalprobability is often referred to as conditioning.

Page 271: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 262

Example 6.5.4. Consider an experiment that consists of two stages. First,we flip a fair coin. If the coin comes up heads, we then roll a fair six-sided die.If the coin comes up tails, we roll a fair 12-sided die. What is the probabilitythat the second stage of the experiment gives us a 4?

Answer: Let F “ toutcome from die is 4u. While we could list all thepossibilities (there are 18) and compute their probabilities using indepen-dence, we will proceed by conditioning. It would be very helpful to knowwhether the coin toss resulted in a heads or tails.

Let E “ t outcome of coin toss is Hu (which means Ec is the event thatthe coin toss is a tails). By the law of total probability

PpF q “ PpF |EqPpEq ` PpF |EcqPpEc

q.

Since the coin toss is fair, we know

PpEq “ PpEcq “

1

2.

For the conditional probabilities, we only have to think about the situationsthey imply. For instance, PpF |Eq is asking us for the probability of rolling a4 given that the coin toss resulted in a heads. If the coin toss is heads, weuse a fair 6-sided die. Therefore,

PpF |Eq “1

6.

Similarly, if the coin toss results in tails, we use a fair 12-sided die. Thus,

PpF |Ecq “

1

12.

Putting these numbers together gives

PpF q “ PpF |EqPpEq ` PpF |EcqPpEc

q

“1

1

2`

1

12¨

1

2

“3

24“

1

8. �

Example 6.5.5. Dichromatism is a genetic disorder resulting in a kind ofcolor blindness. The disorder affects 5% of men and 1% of women. If apopulation is 52% female, what is the probability that a randomly sampledperson will have dichromatism?

Page 272: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 263

Answer: Let D be the event that a person has dichromatism and F bethe event that a person is female (so F c is the event that a person is male).Our information gives us

PpF q “ 0.52 and PpF cq “ 1´ 0.52 “ 0.48.

The information about the rates of dichromatism are actually conditionalstatements:

PpD|F q “ 0.01 and PpD|F cq “ 0.05.

Using the law of total probability, we have

PpDq “ PpD|F qPpF q ` PpD|F cqPpF c

q

“ 0.01p0.52q ` 0.05p0.48q

“ 0.0292.

So, there is a 2.92% chance that a randomly selected person in the populationwill have dichromatism. �

The law of total probability is not limited to two events!

Corollary 6.5.2.1 (The Generalized Law of Total Probability). Let E1, E2, ¨ ¨ ¨ , ENbe a collection of mutually exclusive events with positive probability that ex-haust the sample space S. In other words,

� Ei X Ej “ H whenever i ‰ j,

� E1 Y E2 Y ¨ ¨ ¨ Y EN “ S,

� PpEiq ą 0 for all i.

Then for any event F in S,

PpF q “ PpF |E1qPpE1q ` PpF |E2qPpE2q ` ¨ ¨ ¨ ` PpF |ENqPpENq.

Proof: This result follows from the law of total probability by inductionon the number of events Ei. �

Example 6.5.6. Craps is a game where we roll 2 fair six-sided dice. If weroll a sum of 2, 3, or 12, we automatically lose. If we roll a sum of 7 or 11, weautomatically win. If we roll any of the other possible sums (4, 5, 6, 8, 9, or10), we have to continue rolling the dice until either we roll our original sum(in which case we win) or we roll a 7 (in which case we lose). What is theprobability that we win the game on the first roll? What is the probabilitythat the game will continue for more than one roll?

Page 273: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 264

Answer: Let R be the sum of the two dice on the first roll. Note thatthe 11 events

R “ 2, R “ 3, ¨ ¨ ¨ , R “ 12

are mutually exclusive and exhaust the sample space (that is, they account forall of the possibilities). As such, we can use them for conditioning! Rememberthat we computed the probabilities of the random variable R in Example6.2.5.

Let W be the event that we win the game on the first roll. Then usingthe law of total probability

PpW q “ PpW |R “ 2qPpR “ 2q ` PpW |R “ 3qPpR “ 3q

` PpW |R “ 4qPpR “ 4q ` ¨ ¨ ¨ ` PpW |R “ 12qPpR “ 12q.

These conditional probabilities make the problem simple! According to therules,

PpW |R “ 7q “ 1 and PpW |R “ 11q “ 1

while all of the other conditional probabilities are zero (the only way to winon the first roll is to get a 7 or 11)! That means

PpW q “ PpW |R “ 7qPpR “ 7q ` PpW |R “ 11qPpR “ 11q

“ PpR “ 7q ` PpR “ 11q

“1

6`

1

18“

2

9.

Of course, we could have obtained this by the simpler observation that weneed to roll a 7 or 11 to win outright. But this serves to illustrate the basicidea of conditioning. Likewise, if C is the event that the game continues pastthe first roll, then

PpCq “ PpC|R “ 2qPpR “ 2q ` PpC|R “ 3qPpR “ 3q

`PpC|R “ 4qPpR “ 4q ` ¨ ¨ ¨ ` PpC|R “ 12qPpR “ 12q.

Now,PpC|R “ 2q “ PpC|R “ 3q “ PpC|R “ 12q “ 0

since we automatically lose the game if those are our first roll, and

PpC|R “ 7q “ PpC|R “ 11q “ 0

Page 274: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 265

since we win on the first roll with those two outcomes. All of the remainingconditional probabilities are 1. Hence,

PpCq “ PpC|R “ 4qPpR “ 4q ` PpC|R “ 5qPpR “ 5q ` PpC|R “ 6qPpR “ 6q

` PpC|R “ 8qPpR “ 8q ` PpC|R “ 9qPpR “ 9q ` PpC|R “ 10qPpR “ 10q

“ PpR “ 4q ` PpR “ 5q ` PpR “ 6q ` PpR “ 8q ` PpR “ 9q ` PpR “ 10q

“1

12`

1

9`

5

36`

5

36`

1

9`

1

12“

2

3.

Even though we were not asked, we can also calculate that the probabilityof losing on the first roll is 1{9. �

With slightly more advanced techniques, it can be shown that the overallprobability of winning at craps is

244

495« 0.4929.

The difficulty in computing this probability is that in theory the game cango on for arbitrarily large number of rolls; if you roll a 4, 5, 6, 8, 9, or 10,you continue rolling until you get a 7 or the first roll again. Even thoughthe game could go on forever, it is also possible to show that games of crapstypically last between 1 and 9 rolls with an average length of about 3 rolls.

6.6 Application: The Hardy–Weinberg Prin-

ciple

Consider the case of a trait whose expression is controlled by a single genewith two different alleles: A and a (the dominant and recessive versions ofthe gene, respectively). Assuming that each individual has two copies of thegene (one from each parent), there are three different genotypes: AA,Aa,and aa. Since A is the dominant version of the gene, both AA and Aaindividuals will have the same phenotype (physical expression of the trait)while aa individuals will have a different expression of the trait.

Suppose that in a given population, p percentage of the genes are domi-nant while q “ 1 ´ p is the percentage of the genes that are recessive. Thismeans that a randomly chosen copy of the gene has a probability p of be-ing A and a probability q of being a. The first question to address is how

Page 275: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 266

these probabilities relate to the overall frequency of the three genotypes inthe population.

Let P,Q, and R be the probabilities that a randomly selected individualis AA,Aa, or aa, respectively (with P `Q` R “ 1). To find a relationshipbetween these quantities, we can compute the probability that a randomlyselected copy of the gene is of type A by conditioning on the type of individualwe sample the gene from.

PpAq “ PpA|AAqPpAAq ` PpA|AaqPpAaq ` PpA|aaqPpaaq

The quantity PpA|AAq is clearly 1 since the probability of selecting an A genefrom an AA individual is 1. Similarly, PpA|aaq “ 0 since you cannot select anA gene from an aa individual. The remaining conditional probability is 1{2since there is a 50-50 chance of selecting an A copy of the gene from an Aaindividual. Putting this together with the fact that PpAq “ p, PpAAq “ P ,and PpAaq “ Q, gives

p “ P `1

2Q.

Similarly,

Ppaq “ Ppa|AAqPpAAq ` Ppa|AaqPpAaq ` Ppa|aaqPpaaq

q “1

2Q`R.

If we think of p and q as the known quantities and try to solve for P,Q, andR in terms of them, we see that there is not enough information to computethem. This is because there are an infinite number of ways that the individualgenes could be sorted into the three groups AA,Aa, and aa and still retainthe overall frequencies p and q for the individual alleles. In one extreme case,the genes could be completely stratified into the two homozygous genotypesAA and aa (in which case P “ p, Q “ 0, and R “ q). In another extremecase, if p ą q then there could be no homozygous recessive individuals (withP “ p ´ q, Q “ 2q, and R “ 0). Of course, both of these scenarios seemunlikely in general.

To make progress, we need to make some assumptions about mating inour population. The following work was first done independently by themathematician G.H. Hardy and the physician Wilhelm Weinberg in 1908.The primary assumptions in their modeling are as follows.

1) Mating is totally random among the individuals in the population.

Page 276: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 267

2) The number of offspring capable of successful reproduction for anymating pair is roughly equal (i.e. AA ˆ AA is not likely to producemore successful offspring than AAˆ Aa, etc.).

3) No mutations or migrations occur (so the overall frequencies p and qof the two alleles stays constant over generations).

Note that the frequency of genotypes for offspring of each mating pair areeasily found by Punnett Square:

Frequency of OffspringMating Pair AA Aa aa

AAˆ AA 1 0 0

AAˆ Aa 12

12

0

AAˆ aa 0 1 0

Aaˆ Aa 14

12

14

Aaˆ aa 0 12

12

aaˆ aa 0 0 1

Suppose that the percentages of AA,Aa, and aa individuals in the firstgeneration are P1, Q1, and R1, respectively (with their sum being 1). Whatwill the percentages be in the subsequent generation (call them P2, Q2, andR2). To compute these probabilities, we use our assumption of random mat-ing to compute the probabilities of the six different mating pairs.

Mating Pair FrequencyAAˆ AA P 2

1

AAˆ Aa 2P1Q1

AAˆ aa 2P1R1

Aaˆ Aa Q21

Aaˆ aa 2Q1R1

aaˆ aa R21

Page 277: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 268

The factors of 2 above come from the fact that there are two possible wayssuch a mating could occur (e.g. with AAˆ Aa, the father could be AA andthe mother Aa or vice versa). Note that

P 21 ` 2P1Q1 ` 2P1R1 `Q

21 ` 2Q1R1 `R

21 “ pP1 `Q1 `R1q

2“ 1.

To compute the frequencies P2, Q2, and R2 in the next generation, we cancondition on the parentage of the offspring.

P2 “ Ppchild is AAq

“ Ppchild is AA|parents are AAˆ AAqPpparents are AAˆ AAq

` Ppchild is AA|parents are AAˆ AaqPpparents are AAˆ Aaq

` Ppchild is AA|parents are AAˆ aaqPpparents are AAˆ aaq

` Ppchild is AA|parents are Aaˆ AaqPpparents are Aaˆ Aaq

` Ppchild is AA|parents are Aaˆ aaqPpparents are Aaˆ aaq

` Ppchild is AA|parents are aaˆ aaqPpparents are aaˆ aaq

“ 1 ¨ P 21 `

1

2¨ 2P1Q1 ` 0`

1

4¨Q2

1 ` 0` 0

“ P 21 ` P1Q1 `

1

4Q2

1

ˆ

P1 `1

2Q1

˙2

“ p2

where in the last step we have used the fact computed above that in anygeneration p “ P `Q{2.

Page 278: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 269

For the heterozygous offspring, we find

Q2 “ Ppchild is Aaq

“ Ppchild is Aa|parents are AAˆ AAqPpparents are AAˆ AAq

` Ppchild is Aa|parents are AAˆ AaqPpparents are AAˆ Aaq

` Ppchild is Aa|parents are AAˆ aaqPpparents are AAˆ aaq

` Ppchild is Aa|parents are Aaˆ AaqPpparents are Aaˆ Aaq

` Ppchild is Aa|parents are Aaˆ aaqPpparents are Aaˆ aaq

` Ppchild is Aa|parents are aaˆ aaqPpparents are aaˆ aaq

“ 0`1

2¨ 2P1Q1 ` 1 ¨ 2P1R1 `

1

2¨Q2

1 `1

22Q1R1 ` 0

“ P1Q1 ` 2P1R1 `1

2Q2

1 `Q1R1

“ 2

ˆ

P1 `1

2Q1

˙ˆ

1

2Q1 `R1

˙

“ 2pq.

The homozygous recessive offspring frequency can be computed equivalentlywith the result

R2 “ Ppchild is aaq “

ˆ

1

2Q1 `R1

˙2

“ q2

What these computations show is that regardless of the initial distributionof the three genotypes, random mating (along with the other assumptionslisted above) will produce a distribution of genotypes given solely by theunderlying frequency of the alleles:

PpAAq “ p2,

PpAaq “ 2pq,

Ppaaq “ q2.

Moreover, these frequencies will remain constant in all subsequent genera-tions so long as the assumptions in the model remain true. This fact leadsus to call the special frequencies above the Hardy–Weinberg Equilibrium ofthe population, and the constancy of this frequency over time is known asthe Hardy–Weinberg Principle.

Example 6.6.1. The dominant coloration of pea plants is actually yellow(the fact that green peas are the ones we commonly consume is due to very

Page 279: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 270

selective farming practices). The coloration of pea plants is controlled bya dominant allele Y and a recessive allele y. Y Y and Y y plants are yellowwhile yy plants are green. Suppose that we have an initial population ofpea plants where one-eighth have genotype Y Y , one-quarter Y y, and five-eighths yy. Under the assumptions of the Hardy–Weinberg principle, whatshould the proportions of the genotypes be in subsequent generations? Whatpercentage of the plants should be yellow in the future?

Answer: We have that P1 “1

8, Q1 “

1

4, and R1 “

5

8. These allow us to

compute the underlying frequency of the individual alleles.

p “ PpY q “ P1 `1

2Q1 “

1

4

q “ Ppyq “1

2Q1 `R1 “

3

4

Using the Hardy–Weinberg Equilibrium, we expect that for future genera-tions of the plants

PpY Y q “ p2“

1

16,

PpY yq “ 2pq “3

8,

Ppyyq “ q2“

9

16.

Since only the yy plants are green, we anticipate that

Ppyellow pea plantq “7

16. �

Example 6.6.2. Suppose that the length of rabbit ears is controlled by asingle gene with S being the dominant allele giving short ears and s beingthe recessive allele giving long, floppy ears. In a particular population of1000 rabbits, only 90 have long, floppy ears. Assuming the population is inHardy–Weinberg Equilibrium, find the overall frequency of the two alleles inthe population.

Answer: If the population is in equilibrium, then

PpSSq “ p2,

PpSsq “ 2pq,

Ppssq “ q2.

Page 280: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 271

Since only the ss individuals have long ears, we must have

q2“ Ppssq “

90

1000“ 0.09.

This gives usq “

?0.09 “ 0.3.

This means that p “ 1 ´ q “ 0.7. Hence, 70% of all copies of the gene arethe dominant type, and only 30% are recessive. �

6.7 Bayes’ Formula and Medical Testing

It frequently happens that we are given the conditional probability PpF |Eq(or at least this probability is easy to compute), but we actually need PpE|F q.Fortunately, there is a formula connecting these two numbers.

Theorem 6.7.1 (Bayes’ Formula). Suppose that E and F are two events ina sample space S and that PpEq ą 0 and PpF q ą 0. Then,

PpE|F q “PpF |EqPpEq

PpF q.

Proof: Using the alternate form of conditional probability we noted justbefore the law of total probability,

PpE|F q “PpE X F qPpF q

“PpF |EqPpEq

PpF q. �

We will begin with an example where we can explicitly compute bothconditional probabilities and then compare the results (verifying Bayes’ For-mula). We then examine a couple of problems which are more typical exam-ples of Bayesian reasoning.

Example 6.7.1. Suppose we independently flip 10 fair coins. Let E be theevent that there are exactly 4 heads, and let F be the event that the firstcoin toss is a heads. Compute PpE|F q, PpF |Eq, and verify that they satisfyBayes’ Formula.

Page 281: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 272

Answer: We know that there are 210 “ 1024 outcomes. We first computethe probabilities of the events themselves. For E, there must be 4 heads and6 tails. The idea for counting the outcomes here is that once we place the4 heads, the remaining positions have to be filled with tails. Since there are10 positions and we have to choose 4 of them to be heads, there are

ˆ

10

4

˙

“ 210 outcomes.

This means

PpEq “210

1024“

105

512.

For F , since the first coin flip is independent of the remaining 9 flips,

PpF q “1

2.

For the conditional probabilities, we need the probability of EXF . Outcomesin this event all start with a heads and have exactly 4 heads in total. Soamong the 9 coin flips after the first one, there are 3 heads in total:

ˆ

9

3

˙

“ 84.

This gives

PpE X F q “84

1024“

21

256.

For the conditional probabilities,

PpE|F q “PpE X F qPpF q

“21{256

1{2

“21

128,

PpF |Eq “PpE X F qPpEq

“21{256

105{512

“42

105“

2

5.

Page 282: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 273

Notice that we could have computed these conditional probabilities moredirectly. For instance, PpE|F q is asking for the probability that there are 4heads in total given that the first coin flip results in a heads. This is thesame as the probability that there are exactly 3 heads in the remaining 9flips.

PpE|F q “`

93

˘

29“

84

512“

21

128.

The second conditional probability, PpF |Eq, is a little harder to computedirectly but can be done. In this case, we know there are exactly 4 heads inthe outcome and are being asked for the probability that the first coin tosswas one of them. There are

`

104

˘

possible outcomes (all equally likely) but

only`

93

˘

of them definitely have a heads for the first coin flip. So,

PpF |Eq “`

93

˘

`

104

˘ “84

210“

2

5.

Finally, we verify Bayes’ Formula:

21

128“ PpE|F q “

PpF |EqPpEqPpF q

“p2{5qp105{512q

1{2“

21

128. �

Example 6.7.2. A teacher gives a true/false test. If a student does notknow the correct answer for a particular question, he or she will guess atrandom. The teacher estimates that a student has a 75% chance of knowingthe correct answer for any given question. Given that a student got thecorrect answer, what is the probability that they knew the right answer?

Answer: Let C be the event that the student gets the correct answer,and K be the event that the student knew the correct answer. We are toldPpKq “ 0.75, and so PpKcq “ 1´ 0.75 “ 0.25.

The rest of the information we know is all conditional. If a student knowsthe correct answer, then they will certainly choose the right answer:

PpC|Kq “ 1 and PpCc|Kq “ 0.

If a student does not know the correct answer, then they will guess the correctanswer with probability 1{2:

PpC|Kcq “

1

2and PpCc

|Kcq “

1

2.

Page 283: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 274

We are being asked for PpK|Cq. Using Bayes’ Formula, we have

PpK|Cq “PpC|KqPpKq

PpCq.

We have the probabilities needed for the numerator, but the probability inthe denominator is the overall probability that a student gets the correctanswer to a question. To compute this, we use conditioning.

PpCq “ PpC|KqPpKq ` PpC|KcqPpKc

q

“ 1p0.75q ` p0.5qp0.25q “ 0.875.

Notice that the first term in this sum is exactly the numerator from Bayes’Formula.

PpK|Cq “PpC|KqPpKq

PpCq“

1p0.75q

0.875« 0.8571.

So, there is over an 85% chance that a student who selects the correct answerto the question actually knew the right answer. �

Example 6.7.3. A pharmaceutical company is developing a new test forbubonic plague. For a sample known to be infected, the test returns a falsenegative with probability of 0.02. For a sample known to be disease-free, thetest returns a false positive with probability 0.001. Suppose the test is beingadministered in a region where bubonic plague is estimated to to infect 1out of every 10,000 people. What is the probability that a person who testspositive for the plague is actually disease-free? Is the company’s test reliablein this case?

Answer: Let I be the event that a given person is infected with thedisease (so Ic is the event that the person is disease-free). Let P be the eventthat the test returns a positive result (i.e. the test indicates the person hasthe disease). We are told

PpIq “1

10000and PpIcq “ 1´

1

10000“

9999

10000.

When a pharmaceutical company tries to determine how effective theirtest is, they run the test on samples already known to be infected or disease-free (presumably by running a costlier and/or more time consuming test).So, the rates reported by the company are conditional probabilities. A false

Page 284: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 275

positive in this context would be for the test to return a positive on a sampleknown to be disease-free:

PpP |Icq “ 0.001loooooooomoooooooon

false positive

and PpP c|Icq “ 1´ 0.001 “ 0.999.

A false negative is when the test returns a negative result on a sample knownto be infected:

PpP |Iq “ 1´ 0.02 “ 0.98 and PpP c|Iq “ 0.02

loooooooomoooooooon

false negative

.

We are being asked for the probability that a person who tests positivefor the disease is actually disease-free: PpIc|P q. Fortunately, Bayes’ Formulacomes to the rescue:

PpIc|P q “PpP |IcqPpIcq

PpP q.

We know the two probabilities in the numerator. The probability in thedenominator is the overall probability that a test returns a positive. Forthat, we use conditioning!

PpP q “ PpP |IqPpIq ` PpP |IcqPpIcq“ 0.98p0.0001q ` 0.001p0.9999q

“ 0.0010979.

Notice that the second term is precisely the numerator in Bayes’ Formula!

PpIc|P q “PpP |IcqPpIcq

PpP q

“0.001p0.9999q

0.0010979« 0.9107.

This means that there is over a 91% chance that a person who receives apositive test result is actually healthy! In other words, this test is not veryreliable in determining who is actually infected with the disease.

Even though we were not asked, we can determine the complimentaryprobability PpI|P cq, the probability that a person who receives a negativetest result is actually infected.

PpI|P cq “

PpP c|IqPpIqPpP cq

.

Page 285: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 276

We can use conditioning for the denominator

PpP cq “ PpP c

|IqPpIq ` PpP c|IcqPpIcq

“ 0.02p0.0001q ` 0.999p0.9999q

“ 0.9989021,

or we can realize

PpP cq “ 1´ PpP q “ 1´ 0.0010979 “ 0.9989021.

Completing the computation gives

PpI|P cq “

PpP c|IqPpIqPpP cq

“0.02p0.0001q

0.9989021« 2ˆ 10´6.

Despite the very poor reliability of a positive test result, a negative test resultis pretty significant. If a person tests negative, then they are very likely tobe healthy. If a person receives a positive test result, they are still likely tobe healthy but should be retested or sent off for a costlier, more accuratetest. �

The example above, while certainly contrived, demonstrates some veryimportant facts to know about medical tests. The sensitivity of a test is theprobability that a person who has the disease tests positive for it while thespecificity of the test is the probability that a disease-free individual testsnegative. In terms of conditional probabilities, these are given by

sensitivity “ Pptest is positive | individual has diseaseq,

specificity “ Pptest is negative | individual is disease-freeq.

These quantities are related to the rate of false positives and negatives in theobvious way:

Ppfalse positiveq “ Pptest is positive | individual is disease-freeq

“ 1´ Pptest is negative | individual is disease-freeq

“ 1´ specificity,

Ppfalse negativeq “ Pptest is negative | individual has diseaseq

“ 1´ Pptest is positive | individual has diseaseq

“ 1´ sensitivity.

Page 286: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 277

The sensitivity and specificity of a test are often confused for their re-verse conditional statements. The positive predictive value (PPV) of a testis the probability that an individual actually has the disease if they havetested positive for it. Similarly, the negative predictive value (NPV) is theprobability that a person is actually disease-free if they test negative.

PPV “ Ppindividual has disease | test is positiveq

NPV “ Ppindividual is disease-free | test is negativeq

Bayes’ Formula gives the connection between these quantities. As in theexample above, let P be the event that an individual tests positive for thedisease and I the event that they actually have the disease.

PPV “ PpI|P q

“PpP |IqPpIq

PpP q

“PpP |IqPpIq

PpP |IqPpIq ` PpP |IcqPpIcq

“PpP |IqPpIq

PpP |IqPpIq ``

1´ PpP c|Icq˘

PpIcq

In the next to last step, we conditioned on whether a person has the diseaseto compute the overall probability of receiving a positive test. For the finalstep, we used the complementary event to work in the specificity of the test,PpP c|Icq. Notice that the positive predictive value depends on both thesensitivity and specificity of the test as well as the overall prevalence of thedisease in the population, PpIq. Using similar computations, we have

NPV “PpP c|IcqPpIcq

`

1´ PpP |Iq˘

PpIq ` PpP c|IcqPpIcq.

In the previous example, our test for bubonic plague had a sensitivity of98% and a specificity of 99.9%. Despite these very favorable numbers, wesaw that a person who tested positive had a fairly high probability of beingdisease-free. In fact, the PPV for the test was only about 9%. While thetest has very good sensitivity and specificity, the number of people actuallyinfected with the disease is so low that the number of false positives is signifi-cantly larger than the number of true positives. What we take away from this

Page 287: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 278

is that even a remarkably accurate test can have low positive predictive valueif the disease is fairly rare. Similarly, a reasonably good test can have poornegative predictive value if the disease is very common in the population.

Example 6.7.4. The Centers for Disease Control and Prevention (CDC)sets minimum standards that a rapid diagnostic test for the flu must meet.In particular, they require that a test have a sensitivity of at least 80% anda specificity of at least 95%. If a test meets the minimum requirements andthe flu is suspected to infect 15% of the population, what are the positiveand negative predictive values of the test?

Answer: We have

sensitivity “ PpP |Iq “ 0.8,

specificity “ PpP c|Icq “ 0.95,

prevalence “ PpIq “ 0.15.

Using the formulas developed above:

PPV “PpP |IqPpIq

PpP |IqPpIq ``

1´ PpP c|Icq˘

PpIcq

“p0.8qp0.15q

p0.8qp0.15q ` p0.05qp0.85q« 0.7385,

NPV “PpP c|IcqPpIcq

`

1´ PpP |Iq˘

PpIq ` PpP c|IcqPpIcq

“p0.95qp0.85q

p0.2qp0.15q ` p0.95qp0.85q« 0.9642.

This means that a person who tests positive has slightly over a 1 in 4 chanceof not having the flu and should probably be given a more accurate test toconfirm the results. On the other hand, a person who tests negative for theflu can be fairly confident they are not infected. �

Example 6.7.5. An antibody test for a disease checks for immunologicalfactors that indicate whether a person has had the disease in the past. So, apositive test hopefully indicates that a person has recovered from the diseaseand has some immunity to it. During the Covid-19 outbreak, many antibody

Page 288: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 279

tests were produced with doubtful efficacy. One such test had a sensitivity ofaround 89% and a specificity of about 91%. If the novel coronavirus infected5% of the total population at the time the test was administered, what arethe positive and negative predictive values of this test? If the specificity is95%, what is the largest PPV we can hope for?

Answer:

PPV “PpP |IqPpIq

PpP |IqPpIq ``

1´ PpP c|Icq˘

PpIcq

“p0.89qp0.05q

p0.89qp0.05q ` p0.09qp0.95q« 0.3423,

NPV “PpP c|IcqPpIcq

`

1´ PpP |Iq˘

PpIq ` PpP c|IcqPpIcq

“p0.91qp0.95q

p0.11qp0.05q ` p0.91qp0.95q« 0.9937.

So, a person receiving a negative test result has very likely not had thedisease. On the other hand, a person receiving a positive test only has abouta 34% chance of actually having the antibodies for the coronavirus! As such,relying on this test to determine who has been exposed to the disease ishighly dubious.

Now suppose the specificity is 95%. To get the best PPV we assume thetest is 100% sensitive.1

PPV “PpP |IqPpIq

PpP |IqPpIq ``

1´ PpP c|Icq˘

PpIcq

“p1qp0.05q

p1qp0.05q ` p0.05qp0.95q« 0.5128.

So even with 100% sensitivity, there is little better than a 50-50 chance thata person who tests positive for antibodies actually has immunity to the virus!�

1While this may seem obvious, letting the sensitivity be x gives

PPV “x

x` 0.95

which is a strictly increasing function over the range 0 ď x ď 1.

Page 289: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 280

6.8 Expected Value, Variance, and Standard

Deviation

Now that we have discussed the basics of probability, we want to exploresome quantities associated to a random variable which attempt to give ussome intuition about “typical outcomes” and “generic behaviors” that wecan expect from experiments modeled by the random variable. There aretoo many such quantities for us to cover here. Instead, we focus on thethree which are arguably the most important: expected value, variance, andstandard deviation.

Let X be a discrete random variable with sample space

S “ td1, d2, . . . , dNu

where the outcomes are assumed to be real numbers. Let the probabilities ofthe individual outcomes be given by

Pptdiuq “ pi.

Then the expected value of the random variable X (denoted ErXs or X)is given by

ErXs “ p1 ¨ d1 ` p2 ¨ d2 ` ¨ ¨ ¨ ` pN ¨ dN .

In other words, the expected value of any discrete random variable is justthe sum of “outcome ˆ probability” over all possible outcomes. As the namesuggests, the expected value of a random variable X is the value we wouldexpect to see on average. That is, if we do a large number of independenttrials of the experiment modeled by X and average all of the outcomes, theresult should be roughly ErXs.2 For this reason, the expected value of X isalso called the average value or the mean value of X.

Example 6.8.1. Let R be the sum of two fair six-sided dice. What is theexpected value of R?

Answer: The sample space for R is S “ t2, 3, 4, ¨ ¨ ¨ , 12u and the prob-abilities of these outcomes were given in Example 6.2.5. For the expected

2In more advanced treatments of probability, this fact is known as the law of largenumbers, but the proof of this important theorem is beyond the scope of this text.

Page 290: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 281

value, all we need to do is sum up “outcome ˆ probability” for all 11 out-comes.

ErRs “ 2 ¨1

36` 3 ¨

1

18` 4 ¨

1

12` 5 ¨

1

9` 6 ¨

5

36` 7 ¨

1

6

` 8 ¨5

36` 9 ¨

1

9` 10 ¨

1

12` 11 ¨

1

18` 12 ¨

1

36“ 7.

So, if we roll our dice a large number of times and average the results, wewould expect to see 7 on average. This hardly seems surprising since 7 is inthe middle of the outcomes, and the probabilities are exactly symmetric foroutcomes around 7. �

In the last example, the expected value also happened to be the outcomewith the highest probability.3 This is certainly not the case in general. Infact, the expected value of a random variable may not be one of the possibleoutcomes!

Example 6.8.2. A weighted six-sided die has the property that the evennumbers are twice as likely as the odd numbers. What is the expected valuefor this die?

Answer: Let D be the outcome of rolling this die. Clearly the samplespace is S “ t1, 2, 3, 4, 5, 6u. If

PpD “ 1q “ PpD “ 3q “ PpD “ 5q “ p

thenPpD “ 2q “ PpD “ 4q “ PpD “ 6q “ 2p

since the even numbers must be twice as likely as the odd numbers. Sincethe probabilities must add up to 1, we have

1 “ PpD “ 1q ` PpD “ 2q ` PpD “ 3q ` PpD “ 4q ` PpD “ 5q ` PpD “ 6q

“ p` 2p` p` 2p` p` 2p

“ 9p.

3The outcome (or outcomes) with the highest probability is the mode of the discreterandom variable.

Page 291: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 282

So p “ 1{9, the odds have probability 1{9, and the evens have probability2{9. For the expected value, we have

ErDs “ 1 ¨1

9` 2 ¨

2

9` 3 ¨

1

9` 4 ¨

2

9` 5 ¨

1

9` 6 ¨

2

9

“11

3“ 3.6. �

The expected value gives us a measure of the size of a typical outcome, buta particular outcome may be quite far from this value. It would be beneficialto have some quantity which would tell us how tightly grouped outcomestend to be around the expected value. While there are several candidates,the most important is the standard deviation.4 The standard deviation isobtained by first computing a related value – the variance.

Let X be a discrete random variable with sample space

S “ td1, d2, . . . , dNu

where the outcomes are assumed to be real numbers. Let the probabilities ofthe individual outcomes be given by

Pptdiuq “ pi.

Then the variance of X (denoted VarpXq) is given by

VarpXq “ ErpX ´ ErXsq2s“ p1 ¨ pd1 ´ ErXsq2 ` p2 ¨ pd2 ´ ErXsq2 ` ¨ ¨ ¨ ` pN ¨ pdN ´ ErXsq2.

The standard deviation of X (denoted σpXq) is simply the square root ofthe variance:

σpXq “a

VarpXq.

Lemma 6.8.1.

VarpXq “ ErX2s ´ pErXsq2 “ p1 ¨ d

21 ` p2 ¨ d

22 ` ¨ ¨ ¨ ` pN ¨ d

2N ´ pErXsq

2 .

Proof: Using the identity

px´ yq2 “ x2´ 2xy ` y2

4Another popular group of quantities are percentiles – which include the quartilesand median.

Page 292: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 283

on each of the terms, we get

VarpXq “ p1 ¨ pd1 ´ ErXsq2 ` p2 ¨ pd2 ´ ErXsq2 ` ¨ ¨ ¨ ` pN ¨ pdN ´ ErXsq2

“ p1 ¨ pd21 ´ 2d1ErXs ` ErXs2q ` p2 ¨ pd

22 ´ 2d2ErXs ` ErXs2q

` ¨ ¨ ¨ ` pN ¨ pd2N ´ 2dNErXs ` ErXs2q

“ p1 ¨ d21 ` p2 ¨ d

22 ` ¨ ¨ ¨ ` pN ¨ d

2N

´ 2 pp1 ¨ d1 ` p2 ¨ d2 ` ¨ ¨ ¨ ` pN ¨ dNqErXs` pp1 ` p2 ` ¨ ¨ ¨ ` pNqErXs2

“ p1 ¨ d21 ` p2 ¨ d

22 ` ¨ ¨ ¨ ` pN ¨ d

2N ´ 2ErXs2 ` 1ErXs2

“ p1 ¨ d21 ` p2 ¨ d

22 ` ¨ ¨ ¨ ` pN ¨ d

2N ´ ErXs2. �

So to compute the variance for a discrete random variable, we sum up“outcome2 ˆ probability” over all possibilities and then subtract the squareof the expected value. Intuitively, you should think of the expected value asthe center of the possible outcomes while the standard deviation gives us arange around this central point where we would typically expect to see mostof the outcomes.

Example 6.8.3. Find the expected value, variance, and standard deviationfor the sum of two fair six-sided dice.

Answer: As before, we let R be the sum of the two dice. We have theprobabilities for all outcomes listed in Example 6.2.5 and the expected valuewas already computed to be ErRs “ 7 in Example 6.8.1. The variance is

VarpRq “ 22¨

1

36` 32

¨1

18` 42

¨1

12` 52

¨1

9` 62

¨5

36` 72

¨1

6

` 82¨

5

36` 92

¨1

9` 102

¨1

12` 112

¨1

18` 122

¨1

36´ p7q2

“35

6.

The standard deviation of R is

σpRq “

c

35

6« 2.415.

Taken together, these quantities tell us that if we roll two dice and look attheir sum, then the outcome will be 7 on average, and most outcomes will liebetween ErRs ´ σpRq « 4.585 and ErRs ` σpRq « 9.415. That is, most rollswill be 5, 6, 7, 8, or 9 (which accounts for 66.6% of all possible outcomes).�

Page 293: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 284

Example 6.8.4. We flip a fair coin 6 times. Let H be the number of headsin the outcome of the experiment. Find the expected value, variance, andstandard deviation of H.

Answer: Since H is the number of heads in 6 coin flips, the sample spacemust be

S “ t0, 1, 2, 3, 4, 5, 6u.

We need to compute the probabilities of all these outcomes. Note that thereare 26 “ 64 possible outcomes.

PpH “ 0q “ Pptall tailsuq “1

64

PpH “ 1q “6

64“

3

32ppick the position for heads, all rest tailsq

PpH “ 2q “

`

62

˘

64“

15

64ppick two positions for heads, all rest tailsq

PpH “ 3q “

`

63

˘

64“

20

64“

5

16ppick three positions for heads, all rest tailsq

PpH “ 4q “

`

64

˘

64“

15

64ppick four positions for heads, all rest tailsq

PpH “ 5q “

`

65

˘

64“

6

64“

3

32ppick five positions for heads, all rest tailsq

PpH “ 6q “ Pptall headsuq “1

64

So, the expected value of H is

ErHs “ 0 ¨1

64` 1 ¨

3

32` 2 ¨

15

64` 3 ¨

5

16` 4 ¨

15

64` 5 ¨

3

32` 6 ¨

1

64“ 3

which is thoroughly unsurprising. For the variance, we have

VarpHq “ 02¨

1

64` 12

¨3

32` 22

¨15

64` 32

¨5

16` 42

¨15

64` 52

¨3

32` 62

¨1

64´ p3q2

“3

2,

and so the standard deviation is

σpHq “

c

3

2« 1.225.

Page 294: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 285

This means we expect 3 heads on average, with most results being 2, 3, or 4heads (which accounts for just over 78% of the total probability). �

Next, we note two basic results about expected value and variance thatare crucial in applications. The proofs of these results are beyond the scopeof this book, but see [Kh07] and [Rs03] for all relevant details.

Theorem 6.8.2 (Linearity of Expected Value). Let X1 and X2 be two ran-dom variables and a and b be real numbers. Then

EraX1 ` bX2s “ aErX1s ` bErX2s.

Theorem 6.8.3 (Variance of Independent Random Variables). Let X1 andX2 be independent random variables 5 and a, b and c be real numbers. Then

VarpaX1 ` bX2 ` cq “ a2VarpX1q ` b2VarpX2q.

Example 6.8.5. Consider the experiment where we roll 2 fair six-sided dice.Let R be the sum of the two dice. Use the theorems above to compute theexpected value and variance of R.

Answer: We can think of R as the sum of two independent randomvariables: D1 is the outcome of the first die, and D2 is the outcome of thesecond. You should verify that

ErD1s “ ErD2s “ 3.5,

VarpD1q “ VarpD2q “35

12.

Using the two results above:

ErRs “ ErD1 `D2s “ ErD1s ` ErD2s “ 3.5` 3.5 “ 7,

VarpRq “ VarpD1 `D2q “ VarpD1q ` VarpD2q “35

12`

35

12“

35

6.

Notice that these results match Example 6.8.3.

5This theorem is actually true for uncorrelated random variables. This notion is ex-plored in more advanced treatments of probability.

Page 295: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 286

6.9 A Catalog of Important Discrete Ran-

dom Variables

In this section, we list a number of common discrete random variables andtry to give an indication of typical situations they model. We also providethe expected value and standard deviation. While it is not important tomemorize every last detail about these random variables, it is useful to knowthe sorts of experiments they are meant to describe.

6.9.1 The Bernoulli Random Variable

The Bernoulli random variable is the most basic of all discrete random vari-ables. It models any situation where there are two outcomes – a “success” anda “failure”. The random variable has a single parameter p (with 0 ď p ď 1)which is the probability of a success.

To make things definite, we take a Bernoulli random variable withprobability of success p to be a random variable X whose sample space isS “ t0, 1u having probabilities

PpX “ 0q “ 1´ p,

PpX “ 1q “ p.

We often write X „ Bernoullippq to indicate that X is a Bernoulli randomvariable with probability of success p.

Notice that we use the number 0 to denote a “failure” and 1 to denote a“success.” We have made extensive use of one kind of Bernoulli random vari-able already; namely, a fair coin is simply Bernoullip1{2q. The only apparentdifference is that for a fair coin we used H and T for the outcomes, but 0and 1 work just as well!

In many treatments, the quantity 1´ p is given its own name: q “ 1´ p.In terms of this new quantity, we have

PpX “ 0q “ q,

PpX “ 1q “ p,

where p ` q “ 1. There is absolutely no new content in this version of theBernoulli random variable, but the quantity 1´ p shows up often enough inresults that having a name for it can be useful.

Page 296: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 287

Considering how basic this random variable is, there is not too muchmore to say about it. Its importance lies in the fact that several of the otherrandom variables we discuss are defined in terms of it. The only additionalthing we mention is the expected value, variance, and standard deviation ofthese random variables.

Lemma 6.9.1 (Expected Value, Variance, and Standard Deviation for Bernoullippq).Let X „ Bernoullippq. Then

ErXs “ p,

VarpXq “ pp1´ pq “ pq,

σpXq “a

pp1´ pq “?pq.

Proof:

ErXs “ 0p1´ pq ` 1ppq “ p,

VarpXq “ 02p1´ pq ` 12

ppq ´ ppq2 “ p´ p2“ pp1´ pq. �

6.9.2 The Binomial Random Variable

Imagine an experiment where we run n independent trials of a Bernoullippqrandom variable. In other words, we run n independent experiments wherethe outcome of each separate experiment is a success with probability p (anda failure with probability q “ 1 ´ p). The binomial random variable is therandom variable which counts the total number of successes out of the ntrials.

So, a binomial random variable with n trials and a probability ofsuccess p is a random variable X with sample space

S “ t0, 1, 2, ¨ ¨ ¨ , n´ 1, nu,

and probabilities

PpX “ iq “

ˆ

n

i

˙

pip1´ pqn´i “

ˆ

n

i

˙

piqn´i.

We writeX „ binomialpn, pq to indicate thatX is a binomial random variablewith n trials and a probability of success p.

The formula for the probabilities makes sense from basic counting consid-erations. We have n trials and we want to know the probability that i of them

Page 297: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 288

are successes. From a counting perspective, we have to choose i positions outof the n trials to place the successes – which explains the appearance of thebinomial coefficient! The remaining part is simply the probability of anysingle outcome with i successes and n´ i failures.

Example 6.9.1. Suppose that we flip a fair coin 20 times. What is theprobability of getting exactly 7 heads? What is the most likely outcome?

Answer: Let H be the random variable that counts the number of headsin our 20 coin tosses. Since the probability of getting heads on a fair coin is1{2, it follows that

H „ binomial

ˆ

20,1

2

˙

.

Using the formula above

PpH “ 7q “

ˆ

20

7

˙ˆ

1

2

˙7 ˆ1

2

˙13

“77520

220“

4845

65536« 0.0739.

As we have seen in similar cases, the most likely outcome is exactly in themiddle H “ 10 (i.e. 10 heads). Below, we just list a few probabilities aroundH “ 10.

PpH “ 8q “

ˆ

20

8

˙ˆ

1

2

˙8 ˆ1

2

˙12

“125970

220« 0.1201,

PpH “ 9q “

ˆ

20

9

˙ˆ

1

2

˙9 ˆ1

2

˙11

“167960

220« 0.1602,

PpH “ 10q “

ˆ

20

10

˙ˆ

1

2

˙10 ˆ1

2

˙10

“184756

220« 0.1762,

PpH “ 11q “

ˆ

20

11

˙ˆ

1

2

˙11 ˆ1

2

˙9

“167960

220« 0.1602,

PpH “ 12q “

ˆ

20

12

˙ˆ

1

2

˙12 ˆ1

2

˙8

“125970

220« 0.1201. �

Before giving another example, we compute the expected value, variance,and standard deviation for all binomial random variables.

Page 298: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 289

Lemma 6.9.2 (Expected Value, Variance, and Standard Deviation for binomialpn, pq).Let X „ binomialpn, pq. Then

ErXs “ np,

VarpXq “ npp1´ pq “ npq,

σpXq “a

npp1´ pq “?npq.

Proof: Let X „ binomialpn, pq. Then we can think of X as

X “ X1 `X2 ` ¨ ¨ ¨ `Xn

where the random variables Xi are all Bernoullippq and independent of oneanother. Using Theorems 6.8.2 and 6.8.3, we have

ErXs “ ErX1 `X2 ` ¨ ¨ ¨ `Xns

“ ErX1s ` ErX2s ` ¨ ¨ ¨ ` ErXns

“ p` p` ¨ ¨ ¨ ` p

“ np,

VarpXq “ VarpX1 `X2 ` ¨ `Xnq

“ VarpX1q ` VarpX2q ` ¨ ¨ ¨ ` VarpXnq

“ pp1´ pq ` pp1´ pq ` ¨ ¨ ¨ ` pp1´ pq

“ npp1´ pq. �

Example 6.9.2. Let H be the total number of heads in 20 tosses of a faircoin. What are the expected value and standard deviation for H?

Answer: We have H „ binomialp20, 1{2q. So,

EpHq “ 20

ˆ

1

2

˙

“ 10,

VarpHq “ 20

ˆ

1

2

˙ˆ

1

2

˙

“ 5,

σpHq “?

5 « 2.2361.

So, we expect to see 10 heads out of 20 coin flips on average, with most resultsbeing 8, 9, 10, 11, or 12 heads total. Looking back at the probabilities wecomputed for this case, we see that these 5 outcomes account for about 73.7%of the probability. �

Page 299: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 290

Example 6.9.3. Dichromatism is a genetic condition that affects 5% of menand causes a form of color blindness. Suppose that we pick a sample of 1000men at random. How many men in this sample should we expect to havedichromatism? What is the probability that we have 5 or fewer men withthe condition?

Answer: Let X be the total number of men in the sample who havedichromatism. Then

X „ binomialp1000, 0.05q

since we can think of each person as an independent Bernoulli trial with“success” meaning the person has the condition. So,

EpXq “ 1000 p0.05q “ 50,

VarpXq “ 1000 p0.05q p0.95q “ 47.5,

σpXq “?

47.5 « 6.892.

So we would expect anywhere between 44 and 56 men in the sample to havedichromatism with an expected value of 50.

The probability that we have 5 or fewer men with the condition is

Pp0 ď X ď 5q “ PpX “ 0q ` PpX “ 1q ` PpX “ 2q ` PpX “ 3q

` PpX “ 4q ` PpX “ 5q

ˆ

1000

0

˙

p0.05q0p0.95q1000`

ˆ

1000

1

˙

p0.05q1p0.95q999

`

ˆ

1000

2

˙

p0.05q2p0.95q998`

ˆ

1000

3

˙

p0.05q3p0.95q997

`

ˆ

1000

4

˙

p0.05q4p0.95q996`

ˆ

1000

5

˙

p0.05q5p0.95q995

« 1.9ˆ 10´16. �

The probability computation in this last example is VERY tedious due tothe fact that n is rather large. See Appendix E for information on how tocompute these probabilities using the TI–83/84 and TI–89.

It turns out that for cases when the number of trials n is quite largeand the probability of success p is quite small, X „ binomialpn, pq is wellapproximated by a slightly simpler random variable – the Poisson random

Page 300: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 291

variable. In other words, the Poisson random variable is a very good ap-proximation to a binomial random variable when we are doing a rather largenumber of independent trials where the probability of success in each trialis rather small (so successes are rare events). We will discuss the Poissonrandom variable in Section 6.9.4.

6.9.3 The Geometric Random Variable

Consider the setup for the binomial random variable; we perform n indepen-dent Bernoullippq trials and count the number of successes. Suppose insteadthat we keep performing the independent trials until the first success occursin which case we stop. Let T be the total number of trials performed untilthe first success (which also counts the final trial which ends in success). Thissort of random variable is called a geometric random variable.

A geometric random variable with probability of success p is a randomvariable T with sample space

S “ t1, 2, 3, 4, ¨ ¨ ¨ u

and probabilities given by

PpT “ iq “ p1´ pqi´1p “ qi´1p.

We write T „ geometricppq to indicate that T is a geometric random variablewith a probability of success p.

There are a few things to note about this random variable. First, thesample space consists of all positive integers ! This is simply because we couldhave an arbitrarily large number of failures until the first success occurs. Theprobabilities are easy to understand since if T “ i, we had i´1 failures (eachwith probability 1´ p) and then a final success (with probability p). We willdiscuss the proof that these probabilities sum to one later.

Example 6.9.4. Suppose we flip a fair coin until we get the first tails. Whatis the probability that the first tails appears in the first three tosses? Whatis the probability that we have to flip the coin 5 or more times?

Let T be the number of flips until the first tails appears. Then T „

Page 301: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 292

geometricp1{2q. We are being asked for the probability that 1 ď T ď 3. So,

Pp1 ď T ď 3q “ PpT “ 1q ` PpT “ 2q ` PpT “ 3q

“1

2`

1

1

2`

1

1

1

2

“7

8. �

For the second question, we are being asked PpT ě 5q. Attempting thisdirectly would require us to add up an infinite number of terms (which turnsout to be easily doable in this case). However, it is probably easier at thispoint to look at the opposite event:

PpT ě 5q “ 1´ PpT ă 5q

“ 1´ PpT “ 1q ´ PpT “ 2q ´ PpT “ 3q ´ PpT “ 4q

“ 1´1

1

1

1

1

1

1

1

1

1

2

“1

16. �

Lemma 6.9.3 (Expected Value, Variance, and Standard Deviation for geometricppq).Let T „ geometricppq. Then

ErT s “1

p,

VarpT q “1´ p

p2“

q

p2,

σpT q “

?1´ p

p“

?q

p.

Proof: The computation of these quantities is a little cumbersome (andrely on results about power series). C.f. [Rs03][Chapter 2] for most of thedetails. However, we will discuss the proof that the probabilities add up to1.

Using summation notation, we have

8ÿ

i“1

PpT “ iq “8ÿ

i“1

qi´1p “ p8ÿ

i“1

qi´1,

Page 302: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 293

where q is a real number in the range 0 ă q ă 1. We just need to focus onthe summation, which we call S for convenience. Notice that

S “8ÿ

i“1

qi´1“ 1` q ` q2

` q3` q4

` ¨ ¨ ¨

If we multiply S by q, we see an interesting pattern

S “8ÿ

i“1

qi´1“ 1` q ` q2

` q3` q4

` ¨ ¨ ¨

qS “8ÿ

i“1

qi “ q ` q2` q3

` q4` ¨ ¨ ¨ .

If we subtract these two quantities, all of the terms involving q cancel out,leaving a 1. That means,

S ´ qS “ p1´ qqS “ 1.

Solving for S gives

S “1

1´ q“

1

p.

The last equality follows from the fact that p ` q “ 1. Putting everythingtogether, we have

8ÿ

i“1

PpT “ iq “ p8ÿ

i“1

qi´1“p

p“ 1. �

Example 6.9.5. Consider again dichromatism in men (which has a proba-bility of 0.05). How many men should we expect to sample at random untilwe find someone with the condition? What is the standard deviation for thisnumber?

Answer: Let N be the number of men sampled until we find one withdichromatism. Then N „ geometricp0.05q. According to the formulas above

ErN s “1

0.05“ 20,

VarpNq “0.95

p0.05q2“ 380,

σpNq “?

380 « 19.49.

Page 303: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 294

So we would expect to sample 20 men before finding one with dichromatism(i.e. 19 men without the condition followed by 1 with it), but the typicalrange is anywhere between 1 and 39 men. Using a calculator (see AppendixE) or computer, we can compute that

Pp1 ď N ď 39q “ PpN “ 1q ` PpN “ 2q ` ¨ ¨ ¨ ` PpN “ 39q

« 0.8647. �

6.9.4 The Poisson Random Variable

A Poisson random variable with positive parameter λ is a random variableX with sample space

S “ t0, 1, 2, 3, 4, ¨ ¨ ¨ u

and probabilities given by

PpX “ iq “ e´λλi

i!.

The proof that these numbers sum to one is a lot more involved than for thegeometric random variable, but power series techniques prove that they do.We write X „ Poissonpλq to indicate that X is a Poisson random variablewith parameter λ ą 0.

Lemma 6.9.4 (Expected Value, Variance, and Standard Deviation for Poissonpλq).Let X „ Poissonpλq. Then

ErXs “ λ,

VarpXq “ λ,

σpXq “?λ.

Proof: Again, the computations here are a little tricky. C.f. [Rs03][Chapter2] for most of the details. �

Example 6.9.6. Suppose that the number of typos on any given page ofa textbook has a Poisson distribution with λ “ 2. How many typos perpage would we expect on average? What is the standard deviation for thisexpected value? What is the probability that any given page has at least onetypo?

Page 304: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 295

Answer: Let T be the number of typos on a page. Then we are toldT „ Poissonp2q. From the formulas above,

ErT s “ 2,

VarpT q “ 2,

σpT q “?

2 « 1.414.

So, we would expect about 2 typos per page with typical pages having 1, 2,or 3 typos. The probability of these three outcomes is

PpT “ 1, 2, or 3q “ PpT “ 1q ` PpT “ 2q ` PpT “ 3q

“ e´2 21

1!` e´2 22

2!` e´2 23

3!

“ e´2

ˆ

16

3

˙

« 0.7218.

The second question is asking for the probability that T ě 1. Ratherthan summing up an infinite number of terms, it is easier to look at thecomplimentary event:

PpT ě 1q “ 1´ PpT “ 0q

“ 1´ e´2 20

0!“ 1´ e´2

« 0.8647. �

As we mentioned above, the Poisson random variable is a decent approx-imation of a binomial random variable in the case when the number of trialsn is quite large, and the probability of success p is quite small. In such a case,we can take λ “ np (so that the expected values match) and use the Pois-son random variable instead of the binomial since probabilities for Poissonrandom variables are typically easier to compute. Intuitively,

binomialpn, pq « Poissonpnpq when n is very large and p is very small.

In practical terms, this means that a Poisson random variable is a decentapproximation to the number of successes in a very large number of trialswhere the occurrence of a success is relatively rare.

Example 6.9.7. Consider dichromatism in men (which occurs with a prob-ability of 0.05). Suppose that we pick a sample of 1000 men at random. Howmany men in this sample should we expect to have dichromatism? What isthe probability that we have 5 or fewer men with the condition?

Page 305: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 296

Answer: Let X be the total number of men in the sample who havedichromatism. ThenX „ binomialp1000, 0.05q. As we saw in Example 6.9.3,binomial probabilities can be difficult to compute. Since np “ 1000p0.05q “50, we take X „ Poissonp50q instead.

EpXq “ 50,

VarpXq “ 50,

σpXq “?

50 « 7.071.

Notice that these values are fairly close to values obtained in Example 6.9.3;we would expect anywhere between 43 and 57 men in the sample to havedichromatism with an expected value of 50.

The probability that we have 5 or fewer men with the condition is

Pp0 ď X ď 5q “ PpX “ 0q ` PpX “ 1q ` PpX “ 2q ` PpX “ 3q

` PpX “ 4q ` PpX “ 5q

“ e´50

ˆ

500

0!`

501

1!`

502

2!`

503

3!`

504

4!`

505

5!

˙

« 5.6ˆ 10´16.

This is roughly 3 times the actual probability predicted by the binomialrandom variable! However, the results are much more encouraging for eventsthat are more likely. For instance

Pp43 ď X ď 57q « 0.7116

usingX „ Poissonp50q. If we use the correct distribution, X „ binomialp1000, 0.05q,we get

Pp43 ď X ď 57q « 0.7239.

For this range of (more likely) outcomes, the Poisson random variable ap-proximates the actual probability fairly well. �

Example 6.9.8. Suppose you enter 30 different lotteries, and in each of themyour probability of winning is 1{1000. What is the (approximate) probabilitythat you win exactly once? What is the (approximate) probability that youwin at least once?

Page 306: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 297

Answer: Let W be the number of lotteries that you win. If we werecomputing the probabilities exactly, we would have

W „ binomial

ˆ

30,1

1000

˙

.

Since the probability of winning is fairly low, we can approximate this withthe Poisson random variable instead. Since np “ 30{1000 “ 0.03, we use

W „ Poissonp0.03q.

As far as the expected value and standard deviation go,

EpW q “ 0.03,

VarpW q “ 0.03,

σpW q “?

0.03 « 0.1732.

Given the expected value and standard deviation, we should not expect towin any of the lotteries! We are first asked to compute the probability ofwinning exactly once:

PpW “ 1q “ e´0.03 0.031

1!“ 0.03e´0.03

« 0.0291.

So, there is almost a 3% chance we will win exactly one of the lotteries. Thesecond question asks for the probability that we will win 1 or more lotteries:

PpW ě 1q “ 1´ PpW “ 0q “ 1´ e´0.03« 0.0296.

Notice from the last computation that the probability we lose all 30 lotteriesis

PpW “ 0q “ e´0.03« 0.9704.

So, the probability of winning one or more of the lotteries is also around3%. This means that if we win at all, we are only likely to win once. We canmake this last assertion more precise by computing the conditional probabil-ity that we win exactly one lottery given that we win at least one. Below, weuse tW “ 1u X tW ě 1u “ tW “ 1u which is true because any event where

Page 307: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 298

we win exactly one of the lotteries is clearly an event where we win at leastone lottery!

PpW “ 1|W ě 1q “PptW “ 1u X tW ě 1uq

PpW ě 1q

“PpW “ 1q

PpW ě 1q

“0.03e´0.03

1´ e´0.03« 0.9851.

This means that if we manage to win at least one of the lotteries, there isover a 98% chance that we win only one of them. �

6.10 Problems

1.) The random variable X has sample space

S “ t0, 1, 2, 3, 4, 5u.

The probabilities for the first five outcomes are

PpX “ 0q “1

9“ PpX “ 1q,

PpX “ 2q “2

9,

PpX “ 3q “1

9“ PpX “ 4q.

Compute PpX “ 5q,ErXs, and σpXq.

2.) The random variable Y has sample space

S “ t1, 2, 3, 4, 5, 6, 7, 8u.

The probability of all the odd outcomes are the same, and the probabil-ity of all of the even outcomes are the same. However, the probabilityof an even outcome is one-half the probability of an odd outcome. Findthe probability of each outcome and compute the expected value andstandard deviation of this random variable.

Page 308: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 299

3.) A random variable Z has sample space

S “ t1, 2, 3, 4, 5u.

The probability that X “ 1 is double the probability that X “ 2. Theprobability that X “ 2 is double the probability that X “ 3, and so on.Find the probabilities for all five outcomes and compute the expectedvalue, variance, and standard deviation for Z.

4.) We perform an experiment where we first toss a biased coin which hasa probability of 3{5 to come up heads. If the coin toss comes up heads,we then roll a fair six-sided die. If the coin toss comes up tails, we thenpick a random number between 1 and 10 out of a hat (all 10 numbersare equally likely). What is the sample space for this experiment, andwhat are the probabilities of the individual outcomes? Compute theprobability that the second stage of the experiment gives us the number3 (either on the die or from the hat).

5.) Suppose we perform an experiment where we independently roll threefair six-sided dice. Let R be the sum of the three dice. What is thesample space for R? Compute PpR “ 5q.

6.) We have an urn containing 2 red balls, 3 yellow balls, and 5 green balls.We select two balls from the urn (without replacement). What is theprobability that both balls pulled from the urn are green? What is theprobability that one of the balls is yellow and the other is green?

7.) Consider the urn from Problem 6.). Now suppose we pull two balls fromthe urn but with replacement. In other words, we pull a ball from theurn, note its color, then place it back in the urn. After re-randomizingthe urn (i.e. shaking it up), we select a second ball and note its color.What is the probability that both balls pulled from the urn are green?What is the probability that one of the balls is yellow and the other isgreen?

8.) We roll a fair six-sided die 5 times. Let T be the total number of twosin the outcome of the rolls. Compute the probability of each possibleoutcome for T .

9.) We roll two fair six-sided dice. Let R be their sum. Given that at leastone of the two dice shows a 1, what is the probability that R “ 5? Is

Page 309: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 300

the event that R “ 5 independent of the event that at least one of thetwo dice shows a 1?

10.) Consider the experiment described in Problem 6.) (without replace-ment). What is the probability that both balls are green given that atleast one of the balls is green?

11.) We have an urn with balls 10 balls numbered 1 through 10. Balls 1 – 4are green, Ball 5 is yellow, and Balls 6 – 10 are red. We select two ballsfrom the urn (without replacement). Given that both balls are oddnumbered, what is the probability that the yellow ball was selected?Is the event that the yellow ball was selected independent of the eventthat both balls are odd?

12.) Consider the experiment in Problem 11.). Given that one of the twoballs is yellow, what is the probability that one of the balls is labeledwith an even number?

13.) A teacher is giving a multiple choice test, and each question has 5choices. From past experience, the teacher estimates that a studenthas a 70% of knowing the correct answer for any particular question. Ifthe student does not know the correct answer, the teacher assumes heor she guesses randomly. Given that the student answered the questioncorrectly, what is the probability that he or she knew the right answer?

14.) A pharmaceutical company has developed a new test for dengue fever.The test returns a false positive with a probability of 1% and a falsenegative with a probability of 0.5%. If the test is being administered ina region where dengue fever affects one in 5, 000 people, what are thepositive predictive value (PPV) and negative predictive value (NPV)for this test?

15.) Consider the diagnostic test from Problem 14.). However, we are ad-ministering the test in a region where we are not sure of the actualprevalence of dengue fever. Given that 2.5% of the population testpositive, what is the actual prevalence of dengue fever among the pop-ulation?

16.) Consider the diagnostic test from Problem 14.). However, we are ad-ministering the test in a region where we are not sure of the actual

Page 310: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 301

prevalence of dengue fever. If a person who tests positive for the dis-ease only has a 50% chance of actually having the disease, what is theactual prevalence of dengue fever among the population?

17.) We have an urn with 24 red balls and 1 green ball. We select 10 ballsfrom the urn with replacement. Let G be the number of times the greenball is selected from the urn. Which family of random variables doesG belong to? Use this to compute the probability that we select thegreen ball at least once.

18.) We toss a fair coin 15 times. Let T be the total number of tails in theoutcome. What is the expected value and standard deviation of T?What is the probability that the number of tails is within one standarddeviation on either side of the expected value.

Page 311: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 302

19.) We toss a fair coin 20 times. Given that there are at least 8 heads inthe outcome, what is the most likely value for T , the total number oftails in the outcome?

20.) There is roughly a 2% chance that a person has green eyes. If we select100 people at random, what is the probability that we have 3 or morepeople with green eyes?

21.) Suppose we have a biased coin that comes up heads 55% of the time.We perform an experiment where we toss the coin until the first tailsappears. Let T be the number of tosses until the first tails. What is theexpected value and standard deviation for T? What is the probabilitythat it takes 5 or more tosses before the first tails appears?

22.) A bag contains 4 identical white socks and 12 identical black socks.Suppose that the first sock I pull out of the bag is black. How manysocks should I expect to have to pull from the bag (with replacement)until I get a matching black sock. What is the probability that I pull3 white socks out of the bag before the black sock that I need?

23.) Suppose that the number of accidents on any given day for a particularstretch of highway is a Poisson random variable with an expected valueof 3. What is the probability that there are no accidents on the highwaytomorrow? Exactly one accident? Given that there were at least 4accidents today, find the probability that there were exactly 5 accidents.

24.) Klinefelter syndrome is a relatively common genetic disorder amongmen which occurs when a male has 2 (or more) X chromosomes (alsoknown as XXY syndrome). The actual rate at which this disorderoccurs in men is not exactly known, but is somewhere close to 1 outof every 750 live male births. Suppose we pull a random sample of4500 men. Let N be the number of men in the sample who haveKlinefelter syndrome. Using a Poisson random variable to approximatethe distribution of N , how many men in our sample should we expectto have the syndrome? What is the probability that there are 4 orfewer men in the group with the syndrome?

25.) In sheep, the color of wool is controlled by a single gene with two alleles:W is dominant and gives white wool while w is recessive and gives blackwool. In a group of 5000 sheep, there are 1800 individuals with black

Page 312: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 303

wool. Assuming the population is in Hardy–Weinberg Equilibrium,what are the overall frequency of the genes W and w in the population?What proportion of sheep are heterozygous for this gene (i.e. are Ww)?

26.) Handedness in humans is controlled by a single gene for which thereare two alleles: H is dominant and codes for right-handedness whileh is recessive and codes for left-handedness. Assuming that the worldpopulation is in Hardy–Weinberg Equilibrium (at least for the hand-edness gene) and that 10% of the population is left-handed, what arethe overall frequencies of the alleles H and h in the overall population?What percentage of the population is homozygous dominant (i.e. areHH)?

27.) A fish breeder sells angelfish to pet stores. One gene responsible for thecoloration of these fish has two alleles: D is dominant and gives darkcolored fish while d is recessive and gives gold colored fish. Supposethat the breeder’s initial population of fish is 10% homozygous domi-nant (DD individuals), 50% heterozygous (Dd), and 40% homozygousrecessive (dd). Assuming random mating and the other conditions ofthe Hardy–Weinberg Principle, what proportion of fish are expected tobe gold colored in future generations?

28.) In fruit flies, wing length is controlled by a gene with two possiblealleles: W gives long wings and is dominant while w gives short vestigialwings and is recessive. Fruit flies with short vestigial wings cannotfly. Suppose that an initial population of flies has 70% homozygousdominant individuals (WW ) and 30% heterozygous individuals (Ww).Assuming that the Hard–Weinberg Principle applies, what proportionof future generations will be incapable of flying?

29.) Challenge: Hardy–Weinberg Equilibrium for Tetraploidy

Polyploidy is when an organism has more than two copies of a particulargene. While this is a rare occurrence in animals, polyploidy is rathercommon in plants. Suppose that there is a particular plant gene withtwo alleles, A dominant and a recessive, but each plant has four copiesof the gene (two from each parent). Note that there are 5 types ofindividuals in this population: AAAA,AAAa,AAaa,Aaaa, and aaaa.Derive the Hardy–Weinberg Equilibrium frequencies of these genotypes

Page 313: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 6. DISCRETE PROBABILITY 304

in terms of the underlying frequencies of the individual alleles (i.e.PpAq “ p and Ppaq “ q).

30.) Challenge: The Negative Binomial Distribution

Suppose we perform independent trials of a Bernoullippq random vari-able until r successes are obtained. Let X be the total number of trialsneeded until the r-th success. Determine the sample space for X andfind a formula for PpX “ nq. A random variable distributed in thisfashion is listed as X „ nbpr, pq.

HINT: Clearly n ě r since you must do at least r trials to get rsuccesses. How many successes must there be among the first n ´ 1trials?

Page 314: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Chapter 7

Continuous Random Variables

We now turn to the study of continuous random variables. Recall that acontinuous random variable is one whose sample space consists of an entirerange of real numbers. A classic example is the spinner whose sample spaceis the set of angles S “ r0, 2πq if we choose to use radians or S “ r0˝, 360˝qin degrees.

Figure 7.0.1: A Typical Spinner

As another example, suppose we select a random adult and measuredtheir height (in inches). Since heights are non-negative real numbers, wecould say that this experiment has sample space S “ r0,8q. Of course, thevast majority of measurements should land in the range r12, 120s! For a thirdexample, we might select a light bulb and ask how long the bulb will work(in hours). The sample space for this is certainly S “ r0,8q.

Recall that a probability on a sample space S is a set function defined onthe events in S which enjoys the following properties.

305

Page 315: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 306

� For any event E Ă S,0 ď PpEq ď 1,

� PpSq “ 1,

� If E1 and E2 are mutually exclusive events (E1 X E2 “ H),

PpE1 Y E2q “ PpE1q ` PpE2q.

While probabilities for discrete random variables relied heavily on countingtechniques (i.e. the branch of mathematics called combinatorics), comput-ing probabilities for continuous random variables relies heavily on integra-tion. The key insight here comes from the final requirement in the definition:probabilities of mutually exclusive events simply add together. Thisis a lot like area! If we have two completely disjoint regions of the plane, thetotal area of the region is simply the sum of the two individual areas. Com-bining this with the fact that integrals were designed to compute areas givesus a clue that integration should be useful for continuous random variables!

7.1 Probability Density Functions

Associated to every continuous random variable X is a special function fcalled the probability density function (or pdf) of X. Suppose that Xis a continuous random variable with sample space S “ ra, bs (we can alsoallow infinite sample spaces). The probability density function associated toX is a function f with the following properties.

� fpxq ě 0 over the sample space S “ ra, bs

ż b

a

fpxq dx “ 1

The pdf allows us to compute probabilities associated to X. In particular,if we have an event rc, ds Ď ra, bs in the sample space, then the probabilitythat the outcome lies in this interval is

Ppc ď X ď dq “

ż d

c

fpxq dx.

Page 316: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 307

In other words, probabilities associated to X are computed by integrating fover an appropriate range of outcomes. The pdf is an essential part of thespecification for any continuous random variable. If you do not know thepdf, then you do not know the random variable!

Example 7.1.1. Suppose that X is a random variable with sample spaceS “ r0, 2s and pdf

fpxq “3

2x´

3

4x2“

3

4xp2´ xq.

Verify that f is a valid pdf, and use it to compute the probability that theoutcome of X lies in the interval r0, 1{2s.

Answer: In order for f to be a pdf, it has to be non-negative over thesample space. Note that the graph of f is a parabola which opens downwardand has zeros at x “ 0 and x “ 2.

Figure 7.1.1: Graph of the pdf for Example 7.1.1

Clearly this function is non-negative over the sample space 0 ď x ď 2,and the fact that this function is negative outside of the sample space is nota concern! The second requirement is that the pdf must integrate to 1 overthe sample space.

ż 2

0

fpxq dx “

ż 2

0

ˆ

3

2x´

3

4x2

˙

dx

ˆ

3

4x2´

1

4x3

˙ˇ

ˇ

ˇ

ˇ

2

0

“3

4p4q ´

1

4p8q

“ 1.

Page 317: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 308

So f is a valid pdf for the sample space. In order to compute the probabil-ity that the outcome of the experiment is in the range r0, 1{2s, we simplyintegrate the pdf over this interval.

0 ď X ď1

2

˙

ż 1{2

0

ˆ

3

2x´

3

4x2

˙

dx

ˆ

3

4x2´

1

4x3

˙ˇ

ˇ

ˇ

ˇ

1{2

0

“3

4

ˆ

1

4

˙

´1

4

ˆ

1

8

˙

“5

32. �

Quite often, we are not given the pdf in its entirety. Instead, we aregiven a function which is non-negative over the sample space and asked tonormalize the function. That is, we are tasked with finding a coefficientwhich ensures that the function integrates to 1 over the sample space.

Example 7.1.2. A continuous random variable Y has sample space S “r1, 9s and a pdf of the form

fpyq “ Ay2.

Find that value of A which normalizes the pdf, and then compute the prob-ability that Y will lie in the interval r2, 4s.

Answer: So long as A is positive, the function fpyq “ Ay2 will be positiveover the sample space. To find the appropriate value of A, we force the pdfto integrate to 1 over this range.

ż 9

1

Ay2 dy “ A

ż 9

1

y2 dy

“ A1

3y3

ˇ

ˇ

ˇ

ˇ

9

1

“1

3Ap93

´ 13q

“728

3A “ 1.

So, we should take A “ 3{728 giving a pdf of

fpyq “3

728y2

Page 318: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 309

over the sample space. We can now compute probabilities for Y . In partic-ular,

Pp2 ď Y ď 4q “

ż 4

2

3

728y2 dy

“3

728

ż 4

2

y2 dy

“3

728

ˆ

1

3y3

˙ˇ

ˇ

ˇ

ˇ

4

2

“1

728

`

43´ 23

˘

“56

728“

1

13. �

The convention in most probability texts is that a random variable isgiven a capital letter (like X or Y ) while the corresponding lower case letter(x or y, respectively) is used for the argument of the pdf. We will stick tothis convention throughout this text.

Example 7.1.3. The random variable T is the time (in years) until a carstereo fails. The sample space for T is the set of non-negative real numbers,r0,8q, and the pdf has the form

fptq “ Ae´t{10.

Compute the probability that stereo fails in the first 5 years you own the car.What is the probability the radio lasts 12 or more years?

Answer: The first thing we have to do is normalize the pdf.

ż 8

0

Ae´t{10dt “ A limRÑ8

ż R

0

e´t{10dt

“ A limRÑ8

´10 e´t{10ˇ

ˇ

R

0

“ ´10A limRÑ8

`

e´R{10´ 1

˘

“ 10A “ 1.

So, the coefficient must be A “ 1{10.

Page 319: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 310

The first probability we are being asked for is the probability that T isin the range r0, 5s.

Pp0 ď T ď 5q “

ż 5

0

1

10e´t{10dt

“ ´e´t{10ˇ

ˇ

5

0

“ ´e´5{10´ p´1q

“ 1´ e´1{2« 0.3935.

So, there is almost a 40% chance the radio will fail in the first five years!The second probability we are being asked to compute is the probability

that T lies in the range r12,8q. We could compute this probability directly,but we choose to proceed in a different way.

PpT ě 12q “ 1´ Pp0 ď T ď 12q

“ 1´

ż 12

0

1

10e´t{10dt

“ 1´´

´e´t{10ˇ

ˇ

12

0

¯

“ 1´`

´e´12{10´ p´1q

˘

“ 1´`

1´ e´6{5˘

“ e´6{5« 0.3012.

So, there is just over a 30% chance the radio will last at least 12 years. �The attentive reader will have noticed something strange in the last ex-

ample. When we computed the probability that T is 12 or larger, we used

PpT ě 12q “ 1´ Pp0 ď T ď 12q.

Since we want to include the probability that T “ 12 in our final answer, wereally should have used

PpT ě 12q “ 1´ Pp0 ď T ă 12q.

The curious thing about continuous random variables is that these two prob-abilities are exactly the same! To drive the point home, we note that

Pp0 ď T ď 12q “ Pp0 ď T ă 12q ` PpT “ 12q.

Page 320: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 311

However,

PpT “ 12q “ Pp12 ď T ď 12q

ż 12

12

fptq dt

“ 0.

This strange fact is true in general! If X is any continuous random variableand c is any particular value in its sample space, then

PpX “ cq “

ż c

c

fpxq dx “ 0.

So, the probability that a continuous random variable takes on anyparticular value is always zero! This rather counter-intuitive fact tellsus that the only sensible question we can ask about a continuous randomvariable is whether the outcome lies in some range of values. In practice,this strange state of affairs is completely unimportant. In any real worldmeasurement, there is always some associated error, and so all we can everdetermine is that the outcome of an experiment lies within some range.

Example 7.1.4. LetX be a random variable with sample space S “ p´8,8qand whose pdf is given by

fpxq “

$

&

%

0, x ă 032x´ 3

4x2, 0 ď x ď 2

0, x ą 2.

Verify that f is a pdf and find the probability that X is greater than 3/2.

Answer: Even though the sample space is listed as S “ p´8,8q, thefact that f is zero outside r0, 2s means all integrals are limited to this range.

ż 8

´8

fpxq dx “

ż 2

0

ˆ

3

2x´

3

4x2

˙

dx

ˆ

3

4x2´

1

4x3

˙ˇ

ˇ

ˇ

ˇ

2

0

“ 3´ 2 “ 1.

Page 321: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 312

So, f is a pdf over the sample space for X.

X ą3

2

˙

ż 8

3{2

fpxq dx

ż 2

3{2

ˆ

3

2x´

3

4x2

˙

dx

ˆ

3

4x2´

1

4x3

˙ˇ

ˇ

ˇ

ˇ

2

3{2

“ p3´ 2q ´

ˆ

27

16´

27

32

˙

“ 1´27

32

“5

32. �

Comparing the random variable from Example 7.1.1 with the one above,we see that the sample space from the former is S “ r0, 2s while the latter isall real numbers. However, the probability that an outcome for the randomvariable above will lie in the range r0, 2s is 1. Hence, these two randomvariables are essentially identical.

The point of this discussion is that we can suppress mentioning the samplespace of a continuous random variable altogether. Since the outcome mustlie in the range p´8,8q (by definition), we can simply list the pdf for therandom variable. There will automatically be zero probability of an outcomeoccurring in any interval of the real line where the pdf is identically zero.

Example 7.1.5. Suppose that W is a random variable with pdf

fpwq “

"

Ae2w, w ď 00, w ą 0

Normalize f , and find a so that the interval ra, 0s has probability 1{2.

Answer: Notice that the effective sample space for W is p´8, 0s. To

Page 322: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 313

normalize the pdf, we force the total probability to be 1.

1 “

ż 8

´8

fpwq dw

“ limRÑ´8

ż 0

R

Ae2w dw

“A

2lim

RÑ´8e2w

ˇ

ˇ

0

R

“A

2lim

RÑ´8

`

1´ eR˘

“A

2.

So, we need to take A “ 2 to normalize the pdf. To find the value a so thatra, 0s has probability 1{2, we need to solve

1

2“ Ppa ď W ď 0q

ż 0

a

2e2w dw

“ e2wˇ

ˇ

0

a

“ 1´ e2a.

This gives the equation

1

2“ 1´ e2a

e2a“

1

2

2a “ ln

ˆ

1

2

˙

“ ´ lnp2q

a “ ´lnp2q

2. �

Another useful tool for studying continuous random variables is the cu-mulative distribution function or cdf. Suppose that X is a continuousrandom variable with pdf f . The cumulative distribution function of X isgiven by

F pxq “ PpX ď xq “

ż x

´8

fptq dt.

Page 323: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 314

Notice that the convention is that a lower case letter (like f or g) is used fora pdf while the corresponding upper case letter is used for the correspondingcdf.

Knowing the cdf makes the computation of probabilities very easy!

Ppa ď X ď bq “

ż b

a

fpxq dx

ż b

´8

fpxq dx´

ż a

´8

fpxq dx

“ PpX ď bq ´ PpX ď aq

“ F pbq ´ F paq.

Computing the probability of any interval simply comes down to subtractingthe values of F at the endpoints of the interval!

Example 7.1.6. Find the cdf for the random variable X in Example 7.1.4.

Answer: We need to compute

F pxq “ PpX ď xq.

The first thing to note is that F pxq “ 0 for x ď 0. This is because X haszero probability of lying outside the interval r0, 2s. For any x in the range0 ď x ď 2, we have

F pxq “ PpX ď xq

ż x

0

ˆ

3

2t´

3

4t2˙

dt

“3

4x2´

1

4x3.

Notice that we used t for the integration variable since it is bad form (and po-tentially confusing) to use the same variable in both the limits of integrationand inside the integral itself.

For values of x that are larger than 2, we have

F pxq “ PpX ď xq

ż 2

0

ˆ

3

2t´

3

4t2˙

dt

“ 1

Page 324: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 315

since the pdf is zero outside the interval r0, 2s. Hence, the cdf for X is

F pxq “

$

&

%

0, x ă 034x2 ´ 1

4x3, 0 ď x ď 2

1, x ą 2. �

Figure 7.1.2: Graph of the cdf for Example 7.1.6

It turns out that all cdfs share certain properties.

Lemma 7.1.1. Let X be a continuous random variable with pdf f and cor-responding cdf F . Then F has the following properties.

� F is continuous.

� F is non-decreasing.

� limxÑ´8 F pxq “ 0

� limxÑ8 F pxq “ 1

Proof: Since F is the integral of f , it must be continuous. Moreover,since f is never negative, F can never decrease. The final two propertiescome from the fact that all outcomes of X must be in the range p´8,8q.�

Example 7.1.7. Find the cdf for the random variable T in Example 7.1.3.Use the cdf to find the probability that the car stereo will last between 10and 20 years.

Page 325: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 316

Answer: Since the sample space for T is r0,8q, the cdf for T will bezero for any t ă 0. For t ą 0, we have

F ptq “

ż t

0

fpxq dx

ż t

0

1

10e´x{10dx

“ ´e´x{10ˇ

ˇ

t

0

“ 1´ e´t{10.

This means that the cdf is the function

F ptq “

"

0, t ă 01´ e´t{10, t ě 0

.

Figure 7.1.3: Graph of the cdf for Example 7.1.3

Notice that the graph of F approaches 1 as t tends to infinity. To findthe probability that T is in the range 10 ď T ď 20, we simply subtract thevalues of the cdf at the endpoints.

Pp10 ď T ď 20q “ F p20q ´ F p10q

“`

1´ e´20{10˘

´`

1´ e´10{10˘

“ e´1´ e´2

« 0.2325. �

Page 326: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 317

7.2 Expected Value, Variance, and Standard

Deviation

Just as with discrete random variables, the most important descriptive quan-tities associated to a continuous random variable are the expected value,variance, and standard deviation. We begin with expected value.

Let X be a continuous random variable with sample space S “ ra, bs andpdf f . The expected value of X is the quantity

ErXs “ż b

a

x fpxq dx,

whenever this integral is finite.The definition of expected value for continuous random variables is for-

mally similar to the definition in the discrete case. The product of x withfpxq dx is essentially “outcome ˆ probability”, and the integral acts to “sumup” all of these contributions. Just as with discrete random variables, theexpected value is the outcome we would expect to see on average.

Example 7.2.1. Suppose Y is a random variable with pdf of the form

fpyq “

"

0, y ă 1Ay4, y ě 1

.

Find the expected value of Y .

Answer: The first thing to do is normalize the pdf for Y .

1 “

ż 8

´8

fpyq dy

ż 8

1

A

y4dy

“ A limRÑ8

ż R

1

1

y4dy

“ A limRÑ8

´1

3y3

ˇ

ˇ

ˇ

ˇ

R

1

“A

3limRÑ8

ˆ

1´1

R3

˙

“A

3.

Page 327: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 318

So, A must equal 3. To find the expected value, we compute the followingintegral.

ErY s “ż 8

´8

y fpyq dy

ż 8

1

y

ˆ

3

y4

˙

dy

“ limRÑ8

ż R

1

3

y3dy

“ limRÑ8

´3

2y2

ˇ

ˇ

ˇ

ˇ

R

1

“3

2limRÑ8

ˆ

1´1

R

˙

“3

2. �

Not every continuous random variable has an expected value. Considerthe following example.

Example 7.2.2. Suppose Z is a random variable with pdf of the form

fpzq “

"

0, z ă 1Az2, z ě 1

.

What happens when you try to find the expected value of Z?

Answer: As always, we first need to normalize the pdf.

1 “

ż 8

´8

fpzq dz

ż 8

1

A

z2dz

“ A limRÑ8

ż R

1

1

z2dz

“ A limRÑ8

´1

z

ˇ

ˇ

ˇ

ˇ

R

1

“ A limRÑ8

ˆ

1´1

R

˙

“ A.

Page 328: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 319

So, A is just 1. If we try to find the expected value, we find

ErZs “ż 8

´8

z fpzq dz

ż 8

1

z

ˆ

1

z2

˙

dz

“ limRÑ8

ż R

1

1

zdz

“ limRÑ8

lnpzq|R1

“ limRÑ8

plnpRqq

“ 8.

Since the result of this integration is not a real number, Z does not have anexpected value. �

Again, the expected value gives us a measure of the size of a typicaloutcome. But, the result of any particular experiment might be quite farfrom this value. The standard deviation of a random variable is a measureof how far we can expect outcomes to vary around the expected value.

Let X be a continuous random variable with sample space S “ ra, bs andpdf f . Then the variance of X (denoted VarpXq) is given by

VarpXq “ ErpX ´ ErXsq2s

whenever this integral is finite. The standard deviation of X (denotedσpXq) is simply the square root of the variance:

σpXq “a

VarpXq.

Just as with discrete random variables, there is a simpler formula forcomputing the variance of a continuous random variable.

Lemma 7.2.1.

VarpXq “ ErX2s ´ pErXsq2 “

ż b

a

x2 fpxq dx´ pErXsq2 .

Proof: The proof is analogous to the discrete case. Remember that ErXs is

Page 329: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 320

simply a number (and not involved in the integrals below).

VarpXq “ ErpX ´ ErXsq2s

ż b

a

px´ ErXsq2 fpxq dx

ż b

a

px2´ 2xErXs ` pErXsq2q fpxq dx

ż b

a

x2 fpxq dx´ 2ErXsż b

a

x fpxq dx` pErXsq2ż b

a

fpxq dx

ż b

a

x2 fpxq dx´ 2 pErXsq2 ` pErXsq2

ż b

a

x2 fpxq dx´ pErXsq2 . �

Example 7.2.3. Compute the expected value and standard deviation forthe random variable X in Example 7.1.1. What is the probability that anoutcome for X will be within one standard deviation of the expected value?

Answer: The expected value of X is

ErXs “ż 2

0

x fpxq dx

ż 2

0

x

ˆ

3

2x´

3

4x2

˙

dx

ż 2

0

ˆ

3

2x2´

3

4x3

˙

dx

ˆ

1

2x3´

3

16x4

˙ˇ

ˇ

ˇ

ˇ

2

0

“1

2p2q3 ´

3

16p2q4 “ 1.

So, the expected value of X is 1. To find the standard deviation, we first

Page 330: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 321

have to find the variance

VarpXq “

ż 2

0

x2 fpxq dx´ pErXsq2

ż 2

0

x2

ˆ

3

2x´

3

4x2

˙

dx´ 12

ż 2

0

ˆ

3

2x3´

3

4x4

˙

dx´ 1

ˆ

3

8x4´

3

20x5

˙ˇ

ˇ

ˇ

ˇ

2

0

´ 1

“3

8p2q4 ´

3

20p2q5 ´ 1 “

1

5.

Once we have the variance, the standard deviation is simple.

σpXq “a

VarpXq “

c

1

5“

?5

5.

To find the probability that an outcome for X will lie within one standarddeviation of its expected value, we need to compute

?5

5ď X ď 1`

?5

5

˙

.

To compute this probability, we can use the cdf for X that we computed inExample 7.1.6.

?5

5ď X ď 1`

?5

5

˙

“ F

ˆ

1`

?5

5

˙

´ F

ˆ

?5

5

˙

«

3

4

ˆ

1`

?5

5

˙2

´1

4

ˆ

1`

?5

5

˙3ff

´

«

3

4

ˆ

?5

5

˙2

´1

4

ˆ

?5

5

˙3ff

“7?

5

25« 0.6261.

So, there is almost a 63% chance that an outcome for X will lie within onestandard deviation of its expected value. �

Example 7.2.4. Compute the expected value and standard deviation forthe random variable, T , in Example 7.1.3. What is the probability that anoutcome for T will be within one–half of a standard deviation of the expectedvalue?

Page 331: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 322

Answer: The expected value of T is

ErT s “ż 8

0

t fptq dt

ż 8

0

t

ˆ

1

10e´t{10

˙

dt

“ limRÑ8

ż R

0

1

10te´t{10dt

“ limRÑ8

`

´p10` tqe´t{10˘ˇ

ˇ

R

0

“ limRÑ8

`

10´ p10`Rqe´R{10˘

“ 10.

Notice that the integral was evaluated by integration by parts. The resultinglimit can be computed via L’Hopital’s Rule. This result says that we expectthe car stereo to last 10 years.

We will also need to use integration by parts (twice) to compute thevariance.

VarpT q “

ż 8

0

t2 fptq dt´ 102

“ limRÑ8

ż R

0

1

10t2e´t{10dt´ 100

“ limRÑ8

ˆ

´t2e´t{10ˇ

ˇ

R

0`

ż R

0

2te´t{10dt

˙

´ 100

“ limRÑ8

`

´t2e´t{10´ 20p10` tqe´t{10

˘ˇ

ˇ

R

0´ 100

“ limRÑ8

`

200´R2e´R{10´ 20p10`Rqe´R{10

˘

´ 100

“ 100.

So, the standard deviation of T is

σpT q “a

VarpT q “?

100 “ 10.

As in the last example, we can use the cdf computed in Example 7.1.7 tocompute the probability that T is within one–half of a standard deviation of

Page 332: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 323

the expected value.

Pp10´ 5 ď T ď 10` 5q “ Pp5 ď T ď 15q

“ F p15q ´ F p5q

“`

1´ e´15{10˘

´`

1´ e´5{10˘

“ e´1{2´ e´3{2

« 0.3834.

So, there is just over a 38% chance that the car stereo will last within one–halfof a standard deviation of its expected lifetime. �

If a random variable does not have an expected value (as in Example7.2.2), then it cannot have a variance or standard deviation. However, arandom variable can have an expected value but no variance.

Example 7.2.5. Suppose that X is a random variable with sample spaceS “ r1,8s and pdf of the form

fpxq “A

x3.

Find the expected value of X. What happens when you attempt to computethe variance?

Answer: We first normalize the pdf.

1 “

ż 8

1

A

x3dx

“ A limRÑ8

ż R

1

1

x3dx

“ A limRÑ8

ˆ

´1

2x2

˙ˇ

ˇ

ˇ

ˇ

R

0

“A

2limRÑ8

ˆ

1´1

R2

˙

“A

2.

Page 333: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 324

So, A “ 2. The expected value of X is

ErXs “ż 8

1

x

ˆ

2

x3

˙

dx

“ 2 limRÑ8

ż R

1

1

x2dx

“ 2 limRÑ8

ˆ

´1

x

˙ˇ

ˇ

ˇ

ˇ

R

0

“ 2 limRÑ8

ˆ

1´1

R

˙

“ 2.

However, when we try to compute the variance we find

VarpXq “

ż 8

1

x2

ˆ

2

x3

˙

dx´ 22

“ 2 limRÑ8

ż R

1

1

xdx´ 4

“ 2 limRÑ8

lnpxq|R0 ´ 4

“ 2 limRÑ8

lnpRq ´ 4

“ 8.

Since the variance of X is infinite, so is the standard deviation. �

7.3 A Catalog of Important Continuous Ran-

dom Variables

As with discrete random variables, there are a number of families of contin-uous random variables that come up often in applications. For each family,we will compute all of the relevant descriptive quantities as well as providetypical applications of those random variables.

Page 334: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 325

7.3.1 Uniform Random Variables

A continuous random variable X is said to be a uniform random variableover the finite interval S “ ra, bs if the pdf for X is given by

fpxq “

"

1b´a

, a ď x ď b

0, otherwise.

We write X „ Unifpa, bq to indicate that the random variable X is distributedas a uniform random variable over S “ ra, bs.

The uniform random variable tries to generalize the situation for discreterandom variables where all outcomes are equally likely. Of course, the prob-ability of any particular outcome for a continuous random variable is alwayszero! For the uniform random variable, any two intervals in the sample spacethat have the same length will have the same probability.

Theorem 7.3.1. Suppose X „ Unifpa, bq. Then, the cdf for X is given by

F pxq “

$

&

%

0, x ă ax´ab´a

, a ď x ď b

1, x ą b.

The expected value, variance, and standard deviation of X are

ErXs “a` b

2,

VarpXq “pb´ aq2

12,

σpXq “b´ a

2?

3.

Proof: For the cdf, clearly PpX ď xq will be zero when x ă a (sincethese values of x are smaller than the smallest possible outcome). Likewise,PpX ď xq will be one when x ą b (since these values of x are larger than the

Page 335: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 326

largest possible outcome). For values between these extremes

F pxq “ PpX ď xq

ż x

a

fptq dt

ż x

a

1

b´ adt

“t

b´ a

ˇ

ˇ

ˇ

ˇ

x

a

“x

b´ a´

a

b´ a“x´ a

b´ a.

We now compute the expected value, variance, and standard deviation.

ErXs “ż b

a

x

b´ adx

“x2

2pb´ aq

ˇ

ˇ

ˇ

ˇ

b

a

“b2

2pb´ aq´

a2

2pb´ aq“

b2 ´ a2

2pb´ aq

“pb´ aqpb` aq

2pb´ aq“a` b

2.

VarpXq “

ż b

a

x2

b´ adx´

ˆ

a` b

2

˙2

“x3

3pb´ aq

ˇ

ˇ

ˇ

ˇ

b

a

´a2 ` 2ab` b2

4

“b3 ´ a3

3pb´ aq´a2 ` 2ab` b2

4

“pb´ aqpb2 ` ab` a2q

3pb´ aq´a2 ` 2ab` b2

4

“b2 ` ab` a2

3´a2 ` 2ab` b2

4

“b2 ´ 2ab` a2

12“pb´ aq2

12.

Page 336: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 327

As always, the standard deviation is just the square root of the variance. �Calculating the probability of an interval is particularly easy for a uniform

random variable.

Lemma 7.3.2. Suppose X „ Unifpa, bq. If rc, ds Ď ra, bs (i.e. a ď c ď d ďb), then

Ppc ď X ď dq “d´ c

b´ a.

In words, the probability of a sub-interval of ra, bs is just the length of thesub-interval divided by the total length of the sample space.

Proof:

Ppc ď X ď dq “ F pdq ´ F pcq

“d

b´ a´

c

b´ a

“d´ c

b´ a. �

Example 7.3.1. A standard spinner on a game board is a uniform randomvariable. If we use radians, then we can model the spinner as

Θ „ Unifp0, 2πq.

Compute the expected value, variance, and standard deviation for Θ. Whatis the probability that the spinner will land in Quadrant III?

Answer: Since Θ „ Unifp0, 2πq, we can simply use the results above toread off the expected value and standard deviation.

ErΘs “0` 2π

2“ π,

σpΘq “2π ´ 0

2?

3“

π?

3.

Since Quadrant III consists of the angles π ă θ ă 3π2

, we have

π ă Θ ă3π

2

˙

“3π{2´ π

2π ´ 0

“π{2

“1

4.

Page 337: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 328

So, the spinner has a 25% chance of landing in Quadrant III. Of course,this is the same probability that the spinner will land in any of the otherquadrants! �

Example 7.3.2. A particular subway train runs every 15 minutes. If we donot know the exact train schedule, then we can think of the time T that wewill have to wait for the train as a uniform random variable over the intervalS “ r0, 15s. How much time should we expect to wait on average? What isthe probability that our waiting time is within one standard deviation of theexpected value?

Answer: Since T „Unifp0, 15q, we know that

ErT s “0` 15

2“

15

2“ 7.5,

σpT q “15´ 0

2?

3“

5?

3

2« 4.33.

So, we should expect to wait about seven and a half minutes on average.The probability that our wait time is within one standard deviation of theexpected value is

15

5?

3

2ď T ď

15

2`

5?

3

2

˙

15

2`

5?

3

ˆ

15

5?

3

2

˙ˆ

1

15´ 0

˙

“5?

3

15“

?3

3« 0.5774.

This means that there is almost a 58% chance that we will be waiting betweenabout 3.2 and 11.8 minutes. �

7.3.2 Exponential Random Variables

An exponential random variable with positive parameter λ is any randomvariable T with sample space S “ r0,8q and pdf

fptq “

"

λe´λt, t ě 00, otherwise

.

We write T „ Exppλq to indicate that the random variable T is distributedas an exponential random variable with parameter λ ą 0. For a variety oftheoretical reasons, exponential random variables are excellent models forwaiting times – especially waiting times for relatively rare events.

Page 338: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 329

Theorem 7.3.3. Suppose T „ Exppλq. Then, the cdf for T is given by

F ptq “

"

0, t ă 01´ e´λt, t ě 0

.

The expected value, variance, and standard deviation of X are

ErT s “1

λ,

VarpT q “1

λ2,

σpT q “1

λ.

Proof: We first verify the cdf. Notice that F ptq “ 0 for t ă 0 since thatt-value is smaller than the smallest possible outcome for T . For non-negativevalues of t,

F ptq “ PpT ď tq

ż t

0

λe´λx dx

“ ´eλxˇ

ˇ

t

0

“ 1´ e´λt.

For the expected value, we must use integration by parts.

ErT s “ż 8

0

λte´λtdt

“ limRÑ8

ż R

0

λte´λtdt

“ limRÑ8

ˆ

´te´λt ´1

λe´λt

˙ˇ

ˇ

ˇ

ˇ

R

0

“ limRÑ8

ˆ

1

λ´Re´λR ´

1

λe´λR

˙

“1

λ.

Page 339: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 330

The variance can be found similarly.

VarpT q “

ż 8

0

λt2e´λtdt´

ˆ

1

λ

˙2

“ limRÑ8

ż R

0

λt2e´λtdt´1

λ2

“ limRÑ8

ˆ

´t2e´λt ´1

λ2te´λt ´

1

λ22e´λt

˙ˇ

ˇ

ˇ

ˇ

R

0

´1

λ2

“ limRÑ8

ˆ

2

λ2´R2e´λR ´

1

λ2Re´λR ´

1

λ22e´λR

˙

´1

λ2

“1

λ2. �

As with the uniform random variable, there is a nice formula for the proba-bility of an interval.

Lemma 7.3.4. Suppose T „ Exppλq. If rc, ds Ď r0,8q (i.e. 0 ď c ď d),then

Ppc ď T ď dq “ e´λc ´ e´λd.

Proof: Using the cdf of an exponential random variable, we find

Ppc ď T ď dq “ F pdq ´ F pcq

“`

1´ e´λd˘

´`

1´ e´λc˘

“ e´λc ´ e´λd. �

Example 7.3.3. The waiting time between customers in a checkout queueis an exponential random variable with expected value of 2 minutes. Whatis the probability that the waiting time is within one standard deviation ofthe expected value? What is the probability that the queue goes longer than12 minutes without a customer?

Answer: Since the expected value is 2, we need to take λ “ 1{2. So, thewaiting time is given by

T „ Exp

ˆ

1

2

˙

with pdf

fptq “

"

12e´t{2, t ě 00, otherwise

.

Page 340: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 331

Notice that the expected value and standard deviation are both equal to 2for this random variable. The probability that the waiting time is within onestandard deviation of the expected value is

Pp2´ 2 ď T ď 2` 2q “ Pp0 ď T ď 4q

“ e´0{2´ e´4{2

“ 1´ e´2« 0.8647.

For the probability that the waiting time is longer than 12 minutes, we find

PpT ą 12q “ 1´ Pp0 ď 12q

“ 1´`

e´0{2´ e´12{2

˘

“ e´6« 0.0025.

So, there is only about a quarter of a percent chance that the queue will gomore than 12 minutes without a customer. �

The value we found for the probability of being within one standard devi-ation of the expected value is the same for all exponential random variables.

Lemma 7.3.5. The probability that an exponential random variable is withinone standard deviation of its expected value is always

1´ e´2« 0.8647.

Proof:

1

λ´

1

λď T ď

1

λ`

1

λ

˙

“ Pˆ

0 ď T ď2

λ

˙

“ 1´ e´λp2{λq

“ 1´ e´2. �

Example 7.3.4. Suppose the time T until a particular car part fails is anexponential random variable. Data has shown that 95% of the parts will failwithin 25 years. What is the expected lifetime of the part?

Answer: We know that Pp0 ď T ď 25q “ 0.95. Using the formula for

Page 341: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 332

the cdf of an exponential random variable, we find

0.95 “ Pp0 ď T ď 25q

0.95 “ 1´ e´25λ

e´25λ“ 1´ 0.95 “

1

20

´25λ “ ln

ˆ

1

20

˙

“ ´ lnp20q

λ “lnp20q

25.

Now that we have the parameter λ, we know

ErT s “1

λ

“25

lnp20q« 8.35.

So, the expected lifetime of the part is 8.35 years. �

7.3.3 Beta Random Variables

A beta random variable with positive shape parameters α and β is any ran-dom variable X with sample space S “ r0, 1s and pdf

fpxq “

#

xα´1p1´xqβ´1

Bpα,βq, 0 ď x ď 1

0, otherwise.

The number 1{Bpα, βq is the appropriate normalizing factor for the randomvariable. We write X „ Betapα, βq to indicate that the random variable Xis distributed as a beta random variable with shape parameters α and β.

The formula for Bpα, βq is complicated in general,1 but when α and βare natural numbers, there is a closed form.

Lemma 7.3.6. When the shape parameters are positive integers m and n,the normalizing factor takes the form

Bpm,nq “pm´ 1q!pn´ 1q!

pm` n´ 1q!.

1The general form for Bpα, βq involves the gamma function which extends the notionof factorials to most real numbers.

Page 342: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 333

Proof: The form for Bpm,nq can be determined by induction. We willonly verify it for the cases when n “ 1 and n “ 2. When n “ 1, we have

fpxq “xm´1

Bpm, 1q

over 0 ď x ď 1. This means we need

1 “1

Bpm, 1q

ż 1

0

xm´1 dx

“1

Bpm, 1q

xm

m

ˇ

ˇ

ˇ

ˇ

1

0

“1

Bpm, 1q

ˆ

1

m

˙

.

So, we need

Bpm, 1q “1

m.

In the form given above

Bpm, 1q “pm´ 1q!p0q!

m!“

1

m.

When n “ 2,

fpxq “xm´1p1´ xq

Bpm, 2q

over 0 ď x ď 1. Repeating our computation above.

1 “1

Bpm, 2q

ż 1

0

xm´1p1´ xq dx

“1

Bpm, 2q

ˆ

xm

xm`1

m` 1

˙ˇ

ˇ

ˇ

ˇ

1

0

“1

Bpm, 2q

ˆ

1

1

m` 1

˙

“1

Bpm, 2q

ˆ

1

pm` 1qpmq

˙

.

So, we need

Bpm, 2q “1

pm` 1qpmq.

Page 343: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 334

In the form given above

Bpm, 2q “pm´ 1q!p1q!

pm` 1q!“

1

pm` 1qpmq. �

Lemma 7.3.7. Suppose that X „ Betapα, βq. Then

ErXs “α

α ` β,

VarpXq “αβ

pα ` βq2pα ` β ` 1q,

σpXq “

d

αβ

pα ` βq2pα ` β ` 1q.

The cdf for X is quite complicated in general.

Proof: Again, we will only verify this information for α “ m (a positiveinteger), β “ 1, and β “ 2. In the case X „ Betapm, 1q we find

ErXs “ż 1

0

x

ˆ

xm´1

Bpm, 1q

˙

dx

“1

Bpm, 1q

ż 1

0

xm dx

“1

Bpm, 1q

xm`1

m` 1

ˇ

ˇ

ˇ

ˇ

1

0

“1

Bpm, 1q

ˆ

1

m` 1

˙

“m

m` 1.

Page 344: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 335

VarpXq “

ż 1

0

x2

ˆ

xm´1

Bpm, 1q

˙

dx´

ˆ

m

m` 1

˙2

“1

Bpm, 1q

ż 1

0

xm`1 dx´m2

pm` 1q2

“1

Bpm, 1q

xm`2

m` 2

ˇ

ˇ

ˇ

ˇ

1

0

´m2

pm` 1q2

“1

Bpm, 1q

ˆ

1

m` 2

˙

´m2

pm` 1q2

“m

m` 2´

m2

pm` 1q2

“mpm` 1q2 ´m2pm` 2q

pm` 1q2pm` 2q

“mpm2 ` 2m` 1q ´m3 ´ 2m2

pm` 1q2pm` 2q

“m

pm` 1q2pm` 2q.

Both of these agree with the general forms given above.For X „ Betapm, 2q we find

ErXs “ż 1

0

x

ˆ

xm´1p1´ xq

Bpm, 2q

˙

dx

“1

Bpm, 2q

ż 1

0

xm ´ xm`1 dx

“1

Bpm, 2q

ˆ

xm`1

m` 1´

xm`2

m` 2

˙ˇ

ˇ

ˇ

ˇ

1

0

“1

Bpm, 2q

ˆ

1

m` 1´

1

m` 2

˙

“pm` 1qm

pm` 2qpm` 1q“

m

m` 2.

Page 345: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 336

VarpXq “

ż 1

0

x2

ˆ

xm´1p1´ xq

Bpm, 2q

˙

dx´

ˆ

m

m` 2

˙2

“1

Bpm, 2q

ż 1

0

xm`1´ xm`2 dx´

m2

pm` 2q2

“1

Bpm, 2q

ˆ

xm`2

m` 2´

xm`3

m` 3

˙ˇ

ˇ

ˇ

ˇ

1

0

´m2

pm` 2q2

“1

Bpm, 2q

ˆ

1

m` 2´

1

m` 3

˙

´m2

pm` 2q2

“pm` 1qm

pm` 3qpm` 2q´

m2

pm` 2q2

“mpm` 1qpm` 2q ´m2pm` 3q

pm` 3qpm` 2q2

“mpm2 ` 3m` 2q ´m3 ´ 3m2

pm` 2q2pm` 3q

“2m

pm` 2q2pm` 3q.

Once again, these agree with the general forms given above. �The beta distribution is often used to model the frequency that some

particular property occurs in a population. For example, the percentageof a population that carries a particular allele (as in the Hardy-WeinbergEquilibrium in Section 6.6) is often modeled as a beta random variable.To understand why this is the case, we use Bayesian inference. Supposethat we are considering an allele whose frequency P in the population isunknown. Initially, we will assume that P „ Unifp0, 1q. This is called a priordistribution since we assume this before having any data. Now suppose thatwe test a random sample of individuals to determine whether they have theallele. The results are that m individuals carry the allele while n do not.

The question we would like to explore is how the probabilities we associateto P should change given the data we have collected. In the considerationsbelow, we will write “Data” to stand for the results of our experiment. UsingBayes’ Formula, we find

PpP “ p|Dataq “PpData|P “ pqPpP “ pq

PpDataq

There are a number of issues with what we are trying to do. First,PpP “ p|Dataq and PpP “ pq are technically zero since P is a continuous

Page 346: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 337

random variable. Even worse, PpData|P “ pq is ill-defined since we cannotcondition on an event that has probability zero! These technical issues canbe resolved by considering pdfs rather than actual probabilities, but we willsimply pretend as though what is written above is sensible. A major problemis that we have no idea how to compute PpDataq. Nevertheless, we can findthe functional form for the pdf of P .

If we know that the allele occurs with frequency p in the population (i.ewe know P “ p), then the probability that m randomly selected individualshave the allele while n do not is a binomial random variable with m`n trialsand a probability of success p. This means

PpData|P “ pq “

ˆ

m` n

m

˙

pmp1´ pqn.

As a result,

PpP “ p|Dataq “PpData|P “ pqPpP “ pq

PpDataq

`

m`nm

˘

pmp1´ pqn

PpDataq

“ Cpmp1´ pqn.

Notice that we replaced PpP “ pq by 1 since the pdf for P is 1 according toour assumption that P is distributed uniformly over r0, 1s. Even though ithas not been normalized, we recognize this as the functional form of a betarandom variable. In particular,

P „ Betapm` 1, n` 1q.

So, the data updates our prior uniform distribution for P to a beta randomvariable. Oddly, the expected value of P due to these considerations is

ErP s “m` 1

m` n` 2

rather than the more sensible m{pm`nq. By reconsidering the choice of priordistribution, it is possible to end up with P „ Betapm,nq.2 These technical

2An intuitive argument for this would be that we need at least a minimum amountof data to come up with our prior distribution. In order to assume that P is some valuebetween 0 and 1, we at least need to know that one individual has the allele and anotherone does not. This means we have already used a portion of our data to construct theprior. This leaves m ´ 1 positive results and n ´ 1 negatives. Using this data in ourBayesian analysis gives P „ Betapm,nq.

Page 347: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 338

considerations are beyond the scope of this text. The thing to take away fromthe discussion is that the beta distribution is quite often a reasonable modelfor the unknown frequency of some characteristic of a population when wehave data about the characteristic from a sample group.

Example 7.3.5. We want to estimate the probability that paramecia willcarry a particular allele related to cilia formation. We examine 10 individualsand determine that 7 of them have the allele in question.3 Determine theexpected value and standard deviation of the frequency P that the alleleoccurs among paramecia. What is the probability that P will be within onestandard deviation of its expected value?

Answer: We can take P „ Betap7, 3q since there were 7 samples withthe allele and 3 without. We then know

ErP s “7

10,

VarpP q “21

p10q2p11q“

21

1100,

σpP q “1

10

c

21

11« 0.1382.

We also know the pdf is given by

fppq “p6p1´ pq2

Bp7, 3q

over S “ r0, 1s where

Bp7, 3q “6!2!

9!“

1

252.

3This is an absurdly small sample size, but for larger values the integrals would needto be done by computer.

Page 348: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 339

Figure 7.3.1: Graph of the pdf for Betap7, 3q

In order to find the probability that P is within one standard deviationof its expected value, we first find its cdf. We know that F ppq is zero forp ă 0 and 1 for p ą 1. For values of p between these two values, we have

F ppq “ Pp0 ď P ď pq

ż p

0

252x6p1´ xq2 dx

“ 252

ż p

0

x6p1´ 2x` x2

q dx

“ 252

ż p

0

`

x6´ 2x7

` x8˘

dx

“ 252

ˆ

x7

7´x8

4`x9

9

˙ˇ

ˇ

ˇ

ˇ

p

0

“ 252

ˆ

p7

7´p8

4`p9

9

˙

“ 36p7´ 63p8

` 28p9.

So, the probability that P is within one standard deviation of its expectedvalue is

PpErP s ´ σpXq ďP ď ErP s ` σpXqq

“ F

˜

7

10`

1

10

c

21

11

¸

´ F

˜

7

10´

1

10

c

21

11

¸

“55141509717

114382812500

c

21

11« 0.6661.

Page 349: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 340

This means that there is almost a 67% chance that the frequency of the allelein the population is between roughly 0.56 and 0.84. �

Notice that even for relatively small values of α and β, the computationsfor beta random variables can be onerous. For reasonable amounts of data,there is not much choice but to use a calculator or computer mathematicspackage to work out predictions from the beta distribution.

Example 7.3.6. Suppose that our data on the paramecia had been that76 out of 100 individuals carry the allele. What is the expected value andstandard deviation for the frequency P? What is the probability that P iswithin one standard deviation of its expected value?

Answer: We take P „ Betap76, 24q. This means that

fppq “p75p1´ pq23

Bp76, 24qon 0 ď x ď 1,

ErP s “76

100“ 0.76,

VarpP q “76p24q

p100q2p101q“

114

63125,

σpP q “

c

114

63125« 0.0425.

Figure 7.3.2: Graph of the pdf for Betap76, 24q

Notice that the larger amount of data gives us a much smaller standarddeviation. This is a consequence of the fact that the pdf for Betap76, 24q ismore strongly concentrated around its expected value.

Page 350: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 341

To compute the probability that P lies within one standard deviationof its expected value, we must compute the following integral. Given theexponents involved, the only choice we have is to use a computer or calculatorto compute the probability.

Pp0.7175 ď P ď 0.8025q “

ż 0.8025

0.7175

p75p1´ pq23

Bp76, 24qdp

« 0.6815.

So, there is just over a 68% chance that the allele occurs in between 71.75%and 80.25% of all paramecia. �

7.3.4 Normal Random Variables

Arguably the most important random variable, continuous or discrete, isthe normal random variable. A random variable X is said to be normalwith expected value µ and standard deviation σ ą 0 if its sample space isS “ p´8,8q and its pdf is

fpxq “1

?2πσ2

e´px´µq2

2σ2 .

We write X „ Npµ, σ2q to indicate that the random variable X is distributedas a normal random variable with expected value µ and variance σ2. Thegraph of this pdf is often referred to as the “bell curve” or Gaussian curve.

Figure 7.3.3: Typical Plot of a Normal pdf

Page 351: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 342

Lemma 7.3.8. For X „ Npµ, σ2q we have

ErXs “ µ,

VarpXq “ σ2,

σpXq “ σ.

Proof: These facts can be verified by integration which we omit here.Notice that the convention is to list the variance σ2 rather than the stan-dard deviation. Unfortunately, the cdf for a normal random variable is not asimple combination of the usual functions we are familiar with (that is, nota combination of polynomial, rational, exponential, logarithmic, or trigono-metric functions). �

There is one very special normal random variable. The standard normalrandom variable is Z „ Np0, 1q with sample space S “ p´8,8q and pdf

fpzq “1?

2πe´

z2

2 .

The use of the letter Z for the standard normal random variable is nearlyuniversal in the literature.

Considering the importance of the standard normal, its cdf (convention-ally written as Φ) has been extensively studied.

Φpzq “ PpZ ď zq “

ż z

´8

1?

2πe´

t2

2 dt

Before the advent of modern computing devices, textbooks used tables ofnumerical values for Φ like those found in Appendix D.

Example 7.3.7. What is the probability that a standard normal randomvariable, Z, will take on a value between 0.5 and 0.75? What is the proba-bility that Z will be within one-half of a standard deviation of its expectedvalue?

Answer: The first question is asking for

Pp0.5 ď Z ď 0.75q “ Φp0.75q ´ Φp0.5q.

To find the value Φp0.75q, we go to the second page of the table. We findthe row labeled “0.7” and then move over to the column labeled “.05.” This

Page 352: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 343

gives us Φp0.75q “ 0.7734. For Φp0.5q, we find the row labeled “0.5” and thenmove over to the first column (labeled “.00”). We find Φp0.5q “ 0.6915. So,

Pp0.5 ď Z ď 0.75q “ Φp0.75q ´ Φp0.5q “ 0.7734´ 0.6915 “ 0.0819.

Since the expected value of Z is 0 and the standard deviation is 1, the secondquestion is asking for

Pp´0.5 ď Z ď 0.5q “ Φp0.5q ´ Φp´0.5q “ 0.6915´ 0.3085 “ 0.3830. �

It turns out that the cdf for the standard normal random variable can beused to compute probabilities for any normal random variable.

Theorem 7.3.9 (Z–Scores). Suppose that X „ Npµ, σ2q. Then the randomvariable

Z “X ´ µ

σis distributed as the standard normal random variable.

Proof: Suppose that X „ Npµ, σ2q, then for the definition of Z givenabove we have

P pa ď Z ď bq “ Pˆ

a ďX ´ µ

σď b

˙

“ P pµ` aσ ď X ď µ` bσq

ż µ`bσ

µ`aσ

1?

2πσ2e´

px´µq2

2σ2 dx.

If we make the change of variables z “ px ´ µq{σ in the integral above, wefind

P pa ď Z ď bq “

ż b

a

1?

2πe´

z2

2 dz.

But this is just the pdf of the standard normal random variable. �The proof shows us how to use the standard normal to find probabilities

for any X „ Npµ, σ2q.

Ppa ď X ď bq “ Pˆ

a´ µ

σďX ´ µ

σďb´ µ

σ

˙

“ Pˆ

a´ µ

σď Z ď

b´ µ

σ

˙

“ Φ

ˆ

b´ µ

σ

˙

´ Φ´a´ µ

σ

¯

.

This process is called finding the z–scores for X.

Page 353: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 344

Example 7.3.8. Suppose that X „ Np2, 16q. Find the probability that anoutcome for X will lie between 3 and 5.

Answer: Since µ “ 2 and σ “ 4, we find

Pp3 ď X ď 5q “ Pˆ

3´ 2

4ďX ´ 2

5´ 2

4

˙

“ Pp0.25 ď Z ď 0.75q

“ Φp0.75q ´ Φp0.25q

“ 0.7734´ 0.5987 “ 0.1747. �

Example 7.3.9. Suppose that Y „ Np10, 25q. Find the probability that anoutcome for Y will lie within two standard deviations of its expected value.What is the probability that an outcome for Y will be greater than 20?

Answer: Since µ “ 10 and σ “ 5, we find

Pp10´ 10 ď Y ď 10` 10q “ Pˆ

0´ 10

5ďY ´ 10

20´ 10

5

˙

“ Pp´2 ď Z ď 2q

“ Φp2q ´ Φp´2q

“ 0.9772´ 0.0228 “ 0.9544.

For the second question, we rewrite the probability so that it directlyinvolves the cdf for standard normal random variable.

PpY ą 20q “ 1´ PpY ď 20q

“ 1´ Pˆ

Y ´ 10

20´ 10

5

˙

“ 1´ PpZ ď 2q

“ 1´ Φp2q

“ 1´ 0.9772 “ 0.0228. �

The reason that normal random variables are so important is due toa theoretical result known as the central limit theorem. Suppose thatX1, X2, ¨ ¨ ¨ , Xn are n identically distributed and independent4 real-valued

4The requirement that the Xi be independent can be relaxed. In fact, the Xi can beweakly dependent, where weak dependence has a very technical definition.

Page 354: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 345

random variables. Suppose that ErXis “ µ and VarpXiq “ σ2 (since the Xi

are all distributed the same way, they must have the same expected valueand variance). If we take the average of these n values, we get

Sn “X1 `X2 ` ¨ ¨ ¨ `Xn

n.

Since the values of all of the Xi are random, so is their average value, Sn.Since Sn is a new random variable, we can ask how it is distributed. Thecentral limit theorem says that for large n (i.e. a large sample size), the distri-bution of Sn is very well approximated by Npµ, σ2q. Notice that the averageslimit to a normal random variable regardless of the underlying probabilitydistribution of the individual Xi.

Example 7.3.10. Suppose that the height, H, of a woman in the UnitedStates is a normal random variable with expected value of 64 inches and astandard deviation of 3 inches. What is the probability that a woman in theUS is within 5 inches of the average height? What percentage of women inthe US are taller than 6 feet (72 inches)?

Answer: The first question is asking for the probability that H is be-tween 59 and 69 inches. So,

Pp59 ď H ď 69q “ Pˆ

59´ 64

3ďH ´ 64

69´ 64

3

˙

“ Pˆ

´5

3ď Z ď

5

3

˙

“ Φp1.6q ´ Φp´1.6q.

The problem is that 5{3 “ 1.6 is not in our table! We will round this numberto 1.67 and use this to get an approximation.

Pp59 ď H ď 69q « Φp1.67q ´ Φp´1.67q

« 0.9525´ 0.0475 “ 0.9050.

So, about 90.5% of women in the US are between 59 and 69 inches in height.For the second question, we need to determine the probability that H is

Page 355: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 346

greater than 72.

PpH ą 72q “ 1´ PpH ď 72q

“ 1´ Pˆ

H ´ 64

72´ 64

3

˙

“ 1´ Pˆ

Z ď8

3

˙

“ 1´ Φ`

2.6˘

« 1´ Φp2.67q

« 1´ 0.9962 “ 0.0038.

So, only about 0.4% of women in the US are 6 feet or taller. �There are several things we should mention about the last example. First,

the sample space of a normal random variable is always p´8,8q. This seemsstrange considering that the height of a person cannot possibly be a negativenumber! However

PpH ď 0q “ Pˆ

H ´ 64

3ď ´

64

3

˙

“ PpZ ď ´21.3q « 3ˆ 10´101.

In other words, the probability that H is less than zero is so incredibly smallthat it might as well be zero. This means that the normal random variableNp64, 9q is approximately restricted to r0,8q. The second issue is that werounded our z-scores so that we could use the table. This undoubtedly in-troduced some amount of error. In fact, the table entries themselves are justapproximate answers.

Before computational devices became portable, Z–Tables (and similartables for other random variables) were the best one could hope for. However,most modern graphing calculators come with pre-programmed functions thatcompute probabilities for normal random variables. You can find informationon how to use your TI–83, 84, or 89 to compute probabilities associated tonormal random variables (and others) in Appendix E.

Example 7.3.11. A machine designed to fill bottles of water is supposedto deliver 500 mL to each bottle. However, the actual volume of waterdelivered is a normal random variable with expected value 500 mL and astandard deviation of 2 mL. How often will the machine fill a bottle with lessthan 495 mL? If the maximum volume the bottle can hold is 507 mL, whatis the probability that the machine causes a bottle to overflow?

Page 356: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 347

Answer: Letting V stand for the amount of water delivered by the ma-chine, we are told that V „ Np500, 4q (remember, by convention we listvariance rather than standard deviation). The first question is asking forPpV ď 495q. Using the TI-89, we find

PpV ď 495q « 0.0062.

So, there is about a 0.62% chance that a bottle will be filled with less than495 mL. The second question is asking for the probability that V ą 507.This gives

PpV ą 507q “ 1´ PpV ď 507q « 1´ 0.9998 « 0.0002.

This means that there is only a 0.02% chance that a bottle will overflow. �The final thing we need to mention about the normal random variable

is a nice interpretation of the standard deviation σ. Consider the followinggraph of the standard normal random variable.

Figure 7.3.4: The Standard Normal Random Variable and StandardDeviation

We see that an outcome from the standard normal Z has a probability ofabout 68.2% of lying within one standard deviation of its expected value. Bytaking Z scores, we see that this is true for any normal random variable! Tobe exact, if X „ Npµ, σ2q then

Ppµ´ σ ď X ď µ` σq « 0.6827.

Similarly, the probability that the outcome from a normal random variableis within two standard deviations of its expected value is

Ppµ´ 2σ ď X ď µ` 2σq « 0.9545.

Page 357: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 348

That means there is over a 95% chance that the outcome of a normal randomvariable will be within 2 standard deviations of its expected value. If we goout to three standard deviations, we find

Ppµ´ 3σ ď X ď µ` 3σq « 0.9973.

In many disciplines, a result that is more than 3 standard deviations awayfrom the expected value is considered an extreme outlier. Physicists oftenuse a 5σ standard! Using a calculator, we can find that

PpX ă ´5σq ` PpX ą 5σq « 5.742ˆ 10´7.

So, an outcome that is more than 5 standard deviations away from the ex-pected value would almost certainly not occur by chance!

7.4 Problems

1.) Consider the random variable X whose pdf has the form

fpxq “

"

Ax4, x ě 1

0, otherwise.

What is the effective sample space for X? Normalize X, and find theprobability that an outcome for X will lie between 2 and 4.

2.) A random variable Y has pdf of the form

fpyq “

"

Ayp5´ yq, if 0 ď y ď 50, otherwise

.

What is the effective sample space for Y ? Normalize Y , and find theprobability that an outcome for Y lies between 1 and 2.

3.) A random variable R has pdf of the form

fprq “

"

A?r, 0 ă r ď 1

0, otherwise.

What is the effective sample space for R? Normalize R, and find theprobability that an outcome for R lies between 1{2 and 1.

Page 358: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 349

4.) Find the cdf, expected value, variance, and standard deviation for therandom variable X in Problem 1.

5.) Find the cdf, expected value, variance, and standard deviation for therandom variable Y in Problem 2.

6.) Find the cdf, expected value, variance, and standard deviation for therandom variable R in Problem 3.

7.) Let X be a random variable with pdf of the form

fpxq “

"

kx3p1´ xq, if 0 ď x ď 10, otherwise

.

a.) Find the correct value of k which normalizes f .

b.) Compute the probability that X lies between 0 and 1{4.

c.) Find the cdf for X.

d.) Compute the expected value of X.

e.) Compute the variance of X.

8.) Suppose we have a random variable S with pdf given by

fpsq “

"

As sinpsq, if 0 ď s ď π0, otherwise

.

a.) Find the correct value of A which normalizes f .

b.) What is the probability that S lies between 0 and π{2?

c.) What is the cdf for S?

d.) Find the expected value of S. (NOTE: We can also compute thevariance of this random variable, but it is a little messy!)

9.) Suppose that X is a random variable with pdf of the form

fpxq “

"

A1`x2

, if x ě 0

0, otherwise.

a.) Find the correct value of A which normalizes f .

b.) Find the probability that X lies between 0 and 1.

Page 359: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 350

c.) What goes wrong when you try to find the expected value orvariance of X?

10.) The median value of a random variable, X, is the value, m, in thesample space such that

PpX ď mq “1

2.

If F is the cdf for X, then the median value satisfies F pmq “ 12. Find

the medians of the random variables in Problems 1, 3, and 9. Notethat you MUST normalize these random variables before finding themedian!

11.) Another special continuous random variable is the Chi-Squared Distri-bution χ2

k which has outcomes in r0,`8q. The parameter k is a positiveinteger and is referred to as the degrees of freedom of the distribution.For k “ 4, χ2

4 (the chi-squared distribution with 4 degrees of freedom)has pdf

fpxq “

"

14xe´x{2, if x ě 0

0, otherwise.

Compute the expected value, variance, and standard deviation for thisrandom variable.

12.) Consider a random variable X „ Unifp2, 10q. What is the expectedvalue and standard deviation of X. What is the probability that X liesbetween 3 and 5?

13.) Suppose X „ Unifp0, 1q. From X, we create a new random variable:Y “ aX ` b where a and b are fixed real numbers.

a.) What is the sample space for Y ?

b.) Compute the cdf for Y . That is, find

F pyq “ PpY ď yq “ PpaX ` b ď yq.

c.) Taking the derivative of the result in b.) (over the sample spacefor Y ) gives the pdf for Y .

d.) Based on c.), what kind of random variable is Y ?

Page 360: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 351

14.) Suppose that T „ Expp3q. What is the expected value, variance, andstandard deviation of T? What is the probability that T is within 2standard deviations of its expected value? (HINT: For the last question,pay close attention to the sample space for T .)

15.) A restaurant owner finds that the time customers wait between sittingdown and their server arriving is a random variable distributed expo-nentially with an average of 2.5 minutes. What is the probability thata customer will wait for their server for more than 4 minutes?

16.) Consider the situation in the previous problem. The owner wishesto post a sign saying that customers who have waited longer then Mminutes will receive a free meal. How long should M be so that only0.1 % of customers will get a free meal?

17.) If a random variable P is distributed as Betap3, 2q, what is the prob-ability that P will lie within one standard deviation of its expectedvalue?

18.) The skewness of a random variable X is a measure of how asymmetricits pdf is about the mean. If X has pdf f , expected value ErXs “ µand standard deviation σpXq “ σ, then the skewness of X is definedto be

γpXq “ErX3s ´ 3µσ2 ´ µ3

σ3

where

ErX3s “

ż 8

´8

x3 fpxq dx.

Compute the skewness of a random variable X „ Beta(2,3).

19.) Suppose that the scores on an exam are normally distributed withan average of 73 and a standard deviation of 8. What percentage ofstudents made a score of 59 or below?

20.) One study found that the amount of paper discarded by a householdduring any given week is a normal random variable with average 10lbs and a standard deviation of 4 lbs. What percentage of householdsdiscard more than 13 pounds of paper in a given week?

Page 361: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 7. CONTINUOUS RANDOM VARIABLES 352

21.) Challenge: The moment generating function (mgf) of a randomvariable X with pdf f is

MXptq “ E“

etX‰

ż 8

´8

etxfpxq dx.

Find the moment generating function for the standard normal randomvariable Z „ Np0, 1q. Can you find the mgf for a generic normalrandom variable X „ Npµ, σ2q?

Page 362: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Chapter 8

A Primer on Matrices andVectors

In this chapter, we will explore some basic results about matrices and vectors.Many of the results below will be presented without proof, but the interestedreader can consult any textbook on Linear Algebra for more details (e.g.[FIS03]). Our goal is simply to become familiar with the small portion ofthis vast subject that will be of use to us in the remainder of this book.

This chapter begins with a discussion of systems of linear equations usingmatrix methods. This will naturally lead us to a general discussion of ma-trices – especially square matrices. In particular, we will see that a squarematrix can be interpreted as a linear function which transforms a vector ofthe right size into another vector of the same size.

The most important concept that we develop in this chapter is the ideaof eigenvalues and eigenvectors. These are sometimes called “characteristicvalues” and “characteristic vectors,” respectively. And indeed, we will seethat they give us crucial information about how a square matrix transformsvectors. There is a nice geometric interpretation of eigenvectors in the casethat the eigenvalues are real. However, eigenvalues are often complex num-bers. While the geometric interpretation can be extended in a natural wayto the complex case, the visualization becomes problematic. If you need toreview basic results about complex numbers, see Appendix A.

353

Page 363: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 354

8.1 Systems of Linear Equations

A system of linear equations is a set of m equations (m ě 2) in the variablesx1, x2, ¨ ¨ ¨ , xn of the form

a11x1 ` a12x2 ` ¨ ¨ ¨ ` a1nxn “ b1

a21x1 ` a22x2 ` ¨ ¨ ¨ ` a2nxn “ b2

...... (8.1)

am1x1 ` am2x2 ` ¨ ¨ ¨ ` amnxn “ bm.

The coefficients aij and the numbers bi are assumed to be numbers (real orcomplex makes no difference). We describe the size of a linear system with mequations and n unknowns as an mˆn system of linear equations. Note thatfor systems with 2 or 3 unknowns, x, y, and z are often used for variablesinstead of x1, x2, and x3.

The simplest set of such equations are 2ˆ2 linear systems. For this case,the tried and true method of solving one equation for one of the variablesand substituting into the other is probably the most efficient.

Example 8.1.1. Solve the following system:

2x` 3y “ 8

x´ 5y “ ´9.

Answer: Solving the second equation for x gives x “ 5y ´ 9. Substitutingthis into the first equation gives

2p5y ´ 9q ` 3y “ 8

10y ´ 18` 3y “ 8

13y “ 26

y “ 2.

This also gives x “ 5p2q ´ 9 “ 1. Hence, the solution to the system is thesingle point x “ 1 and y “ 2. �

Unfortunately, this method is not always the best way to attack problemswith more than 2 variables. In the sections below, we will develop the matrixtechnique known as row reduction which is a far easier and quicker methodof solving such problems.

Page 364: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 355

8.1.1 Basic Results for Systems of Linear Equations

We first give a number of basic results about systems of linear equations thatare important to know.

Theorem 8.1.1. For an mˆn linear system of the form 8.1, there are threepossibilities for the set of solutions.

� There are no solutions.

� There is exactly one solution.

� There are an infinite number of solutions.

A linear system with no solutions is often said to be inconsistent.

Proof: Clearly no solutions, and exactly one solution are possibilities. Nowsuppose we have two solutions to 8.1: pa1, a2, ¨ ¨ ¨ , anq and pb1, b2, ¨ ¨ ¨ , bnq.Let α and β be any two real numbers that add up to 1 (i.e. α ` β “ 1 orβ “ 1´ α). Then the list of numbers

pαa1 ` βb1, αa2 ` βb2, ¨ ¨ ¨ , αan ` βbnq

is also a solution. In order to see this, we substitute these new numbersinto each of the equations in 8.1 and verify that we have a true statement.Looking at the i-th equation, we see

ai1pαa1 ` βb1q ` ai2pαa2 ` βb2q ` ¨ ¨ ¨ ` ainpαan ` βb1nq

“ α pai1a1 ` ai2a2 ` ¨ ¨ ¨ ainanq ` β pai1b1 ` ai2b2 ` ¨ ¨ ¨ ainbnq

“ αbi ` βbi

“ pα ` βqbi

“ bi.

Hence, any two solutions to 8.1 automatically give rise to an infinite familyof solutions. �

If we look carefully at the proof above, the condition that α`β “ 1 is notnecessary if ALL of the numbers bi are zero. This leads us to the followingdefinition.

Page 365: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 356

A system of linear equations is said to be homogeneous if all of thenumbers bi appearing on the right hand side of 8.1 are zero. That is, anmˆ n linear system is homogeneous if it is of the form

a11x1 ` a12x2 ` ¨ ¨ ¨ ` a1nxn “ 0

a21x1 ` a22x2 ` ¨ ¨ ¨ ` a2nxn “ 0

...... (8.2)

am1x1 ` am2x2 ` ¨ ¨ ¨ ` amnxn “ 0.

Otherwise, the system is said to be inhomogeneous.There are a few other terms which are sometimes used to describe systems

of linear equations. If a system has more equations than unknowns (i.e.m ą n in our notation), then the system is said to be over–determined.Over–determined systems tend to have no solutions (though this is by nomeans always true). If a system has fewer equations than unknowns (i.e.n ą m), then the system is said to be under–determined. If a system is under–determined, it is likely to have an infinite number of solutions (though again,this is not true in all cases). Most of our work will be with systems wherethe number of equations exactly equals the number of unknowns (m “ n).Such systems are sometimes referred to as square systems (for reasons thatwill become apparent later).

The following theorem allows us to develop an efficient method for solvinglinear systems regardless of the number of equations or variables.

Theorem 8.1.2. Any m ˆ n system of linear equations (whether homoge-neous or inhomogeneous) can be solved by repeated application of three simpleoperations:

E1) Interchange any two equations.

E2) Replace any equation by a non-zero multiple of itself.

E3) Replace any equation by an equation obtained by adding a multiple ofanother equation to it.

We will not prove this theorem here, but a thorough discussion can befound in any textbook on linear algebra (for example, [FIS03, Ch. 3]). Wewill simply look at several (small) examples to see how to use these operationsto solve systems of equations. First, a few observations. Operation E1 allows

Page 366: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 357

us to completely reorder the equations in any way we wish. We can alsocombine operations E2 and E3 to give the auxiliary operation:

Add a non-zero multiple of one equation to a non-zero multiple of anotherequation replacing exactly one of the equations used.

Example 8.1.2. Solve the system

2x´ 7y “ ´8

3x` y “ 11

Answer: If we multiply the second equation by 7, we have

2x´ 7y “ ´8

21x` 7y “ 77.

Adding the two equations together and replacing the second gives

2x´ 7y “ ´8

23x “ 69.

Dividing the second equation by 23 gives

2x´ 7y “ ´8

x “ 3.

If we multiply the second equation by ´2 and add it to the first (keeping thesecond) gives

´7y “ ´14

x “ 3.

Dividing the first equation by ´7, and interchanging the two equations gives

x “ 3

y “ 2. �

Notice in the example above that we never substituted the value of avariable into an equation. We will develop a strategy to streamline thisprocess in the next section. For now, we consider two examples showing thecases of no solutions and infinite solutions, respectively.

Page 367: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 358

Example 8.1.3. Solve the following system of linear equations.

x` 2y ` 3z “ 5

2x´ 5y ` z “ 2

´4x` 19y ` 3z “ 7.

Answer: As we will see, a sound strategy when a variable has a coefficient of1 (as x does in the first equation) is to use this term to eliminate the variablefrom the other equations. So, if we subtract 2 copies of the first equationfrom the second and add 4 copies of the first equation to the third, we have

x` 2y ` 3z “ 5

´9y ´ 5z “ ´8

27y ` 15z “ 27.

If we divide the third equation by 3, we find

x` 2y ` 3z “ 5

´9y ´ 5z “ ´8

9y ` 5z “ 9.

Adding the second and third equations (replacing the third) gives

x` 2y ` 3z “ 5

´9y ´ 5z “ ´8

0 “ 1.

The third equation above is clearly false. Thus, we conclude that there areno solutions to the original system of equations. �

Example 8.1.4. Solve the following system of equations.

x´ 3y ` 7z “ 7

2x` y ´ 7z “ ´14

8x´ 3y ´ 7z “ ´28.

Answer: As before, we use the coefficient of 1 multiplying x in the firstequation to eliminate the variable x from the other two equations. So, we

Page 368: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 359

subtract 2 copies of the first equation from the second and 8 copies of thefirst equation from the third.

x´ 3y ` 7z “ 7

7y ´ 21z “ ´28

21y ´ 63z “ ´84.

if we divide the second equation by 7 and third by 21, we have

x´ 3y ` 7z “ 7

y ´ 3z “ ´4

y ´ 3z “ ´4.

If we subtract the second equation from the third, we are left with

x´ 3y ` 7z “ 7

y ´ 3z “ ´4

0 “ 0.

The last equation is obviously true, and this is the signal that there arean infinite number of solutions.1 To easily specify the solutions, it will bebeneficial to eliminate y from the first equation. So, if we add 3 copies ofequation 2 to equation 1, we get

x ´ 2z “ ´5

y ´ 3z “ ´4

0 “ 0.

Since the third equation has been reduced to the true statement 0 “ 0, oneof the variables is free to be any real number. It is customary to choose thefinal variable z to be free in this situation. If we then solve for the other twovariables in terms of z, we can specify the infinite family of solutions by

x “ 2z ´ 5

y “ 3z ´ 4

z is free. �

The process we have been using to solve systems of linear equations isusually referred to as Gaussian Elimination. In the next section, we willdiscuss this method in more detail and see how to streamline it.

1If the process yields both 0 “ 0 and 0 “ 1, then there are still no solutions.

Page 369: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 360

8.1.2 Augmented Matrices and Row Reduction

Our first observation in the examples above is that the variables actuallyplayed a relatively passive role. Essentially, we only worked with the coef-ficients, and the variables served as placeholders. As such, we can dispensewith the variables altogether and collect the coefficients in a matrix.

Given a system of equations of the form

a11x1 ` a12x2 ` ¨ ¨ ¨ ` a1nxn “ b1

a21x1 ` a22x2 ` ¨ ¨ ¨ ` a2nxn “ b2

......

am1x1 ` am2x2 ` ¨ ¨ ¨ ` amnxn “ bm,

we can form the associated augmented matrix»

a11 a12 ¨ ¨ ¨ a1n b1

a21 a22 ¨ ¨ ¨ a2n b2...

......

......

am1 am2 ¨ ¨ ¨ amn bm

fi

ffi

ffi

ffi

fl

.

Each row corresponds to one of the equations while all but the last columncontain the coefficients for a particular variable. The last column containsthe numbers on the right–hand sides of the equations. The line separatingthe final column is optional (sometimes displayed with a dashed line or leftout altogether), but it reinforces the fact that the numbers in this columnplay a different role in the system than the coefficients in the columns on theleft.

For example, the augmented matrix for the system in Example 8.1.2 isgiven by

2 ´7 ´83 1 11

.

Notice that the first column contains the coefficients for x while the secondcoefficient contains the coefficients for y. Notice that after we solved thesystem, we were left with a system of equations which has augmented matrix

1 0 30 1 2

.

In this form, we can easily read off the solutions.

Page 370: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 361

In order to transform the augmented matrix corresponding to the originalsystem to one where the solutions are obvious, we first need to rewrite theoperations from Theorem 8.1.2 in terms of operations on the augmentedmatrix. Since all of the operations refer to the individual equations of thesystem, the operations on the augmented matrix will refer to the individualrows.

The basic operations in Theorem 8.1.2 correspond to the following Ele-mentary Row Operations for the augmented matrix.

RO1: Interchange any two rows.

RO2: Multiply a row by a non-zero constant.

RO3: Add a multiple of one row to another.

Before we illustrate the use of these row operations (a process known as rowreduction) we need to discuss notation. First however is a word of caution.Notice that all of the operations above are applied to rows. NEVER ap-ply these operations to individual columns. For example, interchanging twocolumns would be equivalent to interchanging the coefficients of two inde-pendent variables. That will certainly change the final answer!

To describe a series of row operations, we will use the following notation.First, the i-th row of an augmented matrix will be denoted Ri. If we use RO1to interchange two rows, we will denote the operation by Ri Ø Rj. Just aswith equations, we can reorder the rows of an augmented matrix however wewish (often without explicitly noting the changes). If we use RO2 to multiplyrow i by a non-zero number m, we will write m ¨ Ri Ñ Ri. For RO3, wewould write m ¨Ri`Rj Ñ Rj to indicate that we added m copies of row i torow j (and placed the result in row j). As with equations, we can combineRO2 and RO3 to get an operation of the form m ¨Ri` n ¨Rj Ñ Ri. Noticethat we may replace either of the two rows involved in this operation (butnot any other row).

Example 8.1.5. Solve the following system of linear equations using rowreduction.

x´ 3y ´ 5z “ 7

2x` y ` 3z “ 8

´x` 4y ` z “ ´2

Page 371: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 362

Answer: The augmented matrix corresponding to this system is

»

1 ´3 ´5 72 1 3 8´1 4 1 ´2

fi

fl

We will discuss the overall goal of row reduction in the next section, but ifthere is a unique solution to this system, we should be able to reduce thematrix to one of the form

»

1 0 0 A0 1 0 B0 0 1 C

fi

fl .

In this form, we can easily read off the solution: x “ A, y “ B, and z “ C.Essentially, the goal of row reduction is to reduce an augmented matrix asclose as possible to this form. To that end, can use the 1 in the first row andfirst column to clear out the coefficients below it.

So, we begin by subtracting 2 copies of row one from row two (replacingrow two) (´2 ¨R1`R2 Ñ R2)

»

1 ´3 ´5 72 1 3 8´1 4 1 ´2

fi

fl „

»

1 ´3 ´5 70 7 13 ´6´1 4 1 ´2

fi

fl

Notice that we use „ to indicate that a matrix has been obtained fromanother by an elementary row operation. From now on, we will simply list

Page 372: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 363

the row operations in the notation mentioned above.

»

1 ´3 ´5 72 1 3 8´1 4 1 ´2

fi

fl ´2 ¨R1`R2 Ñ R2

»

1 ´3 ´5 70 7 13 ´6´1 4 1 ´2

fi

fl R1`R3 Ñ R3

»

1 ´3 ´5 70 7 13 ´60 1 ´4 5

fi

fl R2 Ø R3

»

1 ´3 ´5 70 1 ´4 50 7 13 ´6

fi

fl 3 ¨R2`R1 Ñ R1

»

1 0 ´17 220 1 ´4 50 7 13 ´6

fi

fl ´7 ¨R2`R3 Ñ R3

»

1 0 ´17 220 1 ´4 50 0 41 ´41

fi

fl

1

41¨R3 Ñ R3

»

1 0 ´17 220 1 ´4 50 0 1 ´1

fi

fl 4 ¨R3`R2 Ñ R2

»

1 0 ´17 220 1 0 10 0 1 ´1

fi

fl 17 ¨R3`R1 Ñ R1

»

1 0 0 50 1 0 10 0 1 ´1

fi

fl

Hence, the solution is x “ 5, y “ 1, and z “ ´1. �We can perform multiple row operations in one step. For example, we

could have combined the first two steps above to eliminate the coefficientsbelow the 1 in the first row and column. Be very cautious with this, however.It is probably not wise to perform two row operations simultaneously whichboth involve replacing the same row.

Page 373: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 364

Example 8.1.6. Solve the following system of equations by row reduction.

x` y ` z “ 9

x` 2y ` 4z “ 13

2x` 3y ` 5z “ 22

Answer:»

1 1 1 91 2 4 132 3 5 22

fi

fl ´R1`R2 Ñ R2 and ´ 2 ¨R1`R3 Ñ R3

»

1 1 1 90 1 3 40 1 3 4

fi

fl R1´R2 Ñ R1 and R3´R2 Ñ R3

»

1 0 ´2 50 1 3 40 0 0 0

fi

fl

Notice that it is not possible to row reduce the matrix any further due to therow of all zeros. Since this row represents the true statement 0 “ 0, we knowthat there are an infinite number of solutions. The remaining equations state

x´ 2z “ 5

y ` 3z “ 4.

Solving these equations in terms of z gives

x “ 5` 2z

y “ 4´ 3z

z is free. �

Example 8.1.7. Solve the following system of equations by row reduction.

2x` 3y ´ z “ 2

3x` 2z “ 4

5x` 3y ` z “ 5

Page 374: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 365

Answer: The augmented matrix for the system is

»

2 3 ´1 23 0 2 45 3 1 5

fi

fl

We would like to have a 1 for the entry in the first row and first column. Wecould divide the first row by 2, but there is a better way to proceed. If wesubtract row 1 from row 2, we will be left with a 1 for the first entry of row2. Interchanging rows 1 and 2 will then give us a 1 in the upper left cornerof the matrix.

»

2 3 ´1 23 0 2 45 3 1 5

fi

fl R2´R1 Ñ R2

»

2 3 ´1 21 ´3 3 25 3 1 5

fi

fl R1 Ø R2

»

1 ´3 3 22 3 ´1 25 3 1 5

fi

fl R2´ 2 ¨R1 Ñ R2 and R3´ 5 ¨R1 Ñ R3

»

1 ´3 3 20 9 ´7 ´20 18 ´14 ´5

fi

fl R3´ 2 ¨R2 Ñ R3

»

1 ´3 3 20 9 ´7 ´20 0 0 ´1

fi

fl ´1 ¨R3 Ñ R3

»

1 ´3 3 20 9 ´7 ´20 0 0 1

fi

fl

In the next section, we will discuss the ultimate goal for row reduction –reduced row echelon form. The final matrix above is not quite in this form,but the third row gives us the false statement 0 “ 1. Hence, we know thereare no solutions. �

Page 375: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 366

8.1.3 Reduced Row Echelon Form

We have seen several examples of row reduction, but so far we have beenblindly applying row reductions in order to simplify the augmented matrixto a form where the solutions are fairly obvious. It turns out there is a wayto describe the goal we should aim for in the row reduction process.

An augmented matrix is said to be in reduced row echelon form(RREF) if the following conditions are satisfied.

1) All rows of all zeros are at the bottom of the matrix.

2) The first non-zero entry in any row (known as the leading coefficient)must be a 1 and must be to the right of the leading coefficient in anyrow above it.

3) Any leading coefficient must be the only non-zero entry in its column.

Theorem 8.1.3. The reduced row echelon form of an augmented matrix isunique.

This theorem guarantees that if two people start with the same augmentedmatrix and perform completely different sets of row operations, they willnonetheless arrive at the same final form (if they take the row reduction allthe way to reduced row echelon form). In certain cases, it is not necessaryto take an augmented matrix all the way down to RREF to read off thesolutions, but it is a decent goal to aim for. We will not prove this resulthere, but any book on linear algebra will give a thorough discussion of thistheorem (c.f. [FIS03, p. 191]).

While our examples below will be 3ˆ 3 systems, the technique will workfor linear systems of any size.

Example 8.1.8. Solve the following system of linear equations.

x` 5z “ 3

2x` 7y ` 3z “ ´8

2x` 5y ` 5z “ ´4

Answer: The augmented matrix associated to this system is»

1 0 5 32 7 3 ´82 5 5 ´4

fi

fl .

Page 376: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 367

We already have a 1 in the upper left corner of the matrix, so we will beginby eliminating the coefficients below it.

»

1 0 5 32 7 3 ´82 5 5 ´4

fi

fl R2´ 2 ¨R1 Ñ R2 and R3´ 2 ¨R1 Ñ R3

»

1 0 5 30 7 ´7 ´140 5 ´5 ´10

fi

fl

1

7¨R2 Ñ R2 and

1

5¨R3 Ñ R3

»

1 0 5 30 1 ´1 ´20 1 ´1 ´2

fi

fl R3´R2 Ñ R3

»

1 0 5 30 1 ´1 ´20 0 0 0

fi

fl

This final matrix is in RREF. Note that the row of all zeros tells that thereare an infinite number of solutions, and that one of the variables is free to beany real number. As usual, we will let z be free and solve for the remainingvariables in terms of it. Rewriting the non-trivial rows as equations gives

x` 5z “ 3

y ´ z “ ´2.

Hence, the solutions to our system of equations can be expressed as

x “ 3´ 5z

y “ ´2` z

z is free. �

Example 8.1.9. Solve the following system of equations.

x` y ` z “ 4

2x´ 3y ´ 13z “ 18

3x´ 2y ´ 12z “ 23

Answer: The augmented matrix associated to the system is»

1 1 1 42 ´3 ´13 183 ´2 ´12 23

fi

fl .

Page 377: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 368

We begin by eliminating the coefficients under the 1 in the upper left cornerof the matrix.

»

1 1 1 42 ´3 ´13 183 ´2 ´12 23

fi

fl R2´ 2 ¨R1 Ñ R2 and R3´ 3 ¨R1 Ñ R3

»

1 1 1 40 ´5 ´15 100 ´5 ´15 11

fi

fl R3´R2 Ñ R3 and ´1

5¨R2 Ñ R2

»

1 1 1 40 1 3 ´20 0 0 1

fi

fl

Notice that the last row translates to 0 “ 1, and so the system has nosolutions. If this is our only goal, then we can simply stop here. However,the matrix is not yet in RREF.

»

1 1 1 40 1 3 ´20 0 0 1

fi

fl R1´R2 Ñ R1

»

1 0 ´2 60 1 3 ´20 0 0 1

fi

fl R1´ 6 ¨R3 Ñ R1 and R2` 2 ¨R3 Ñ R2

»

1 0 ´2 00 1 3 00 0 0 1

fi

fl

We have now reduced the matrix to RREF. Of course, there are still nosolutions to the original system of equations. �

Example 8.1.10. Solve the following system of linear equations.

2x` y ´ z “ ´2

3x´ 2y ` z “ ´5

5x` 4y ` 2z “ 7

Answer: The augmented matrix associated to this system is»

2 1 ´1 ´23 ´2 1 ´55 4 2 7

fi

fl .

Page 378: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 369

As we have said several times, it would be nice to have a 1 in the upper leftcorner. We could divide the first row by 2, but a slightly nicer way to beginis by subtracting row 1 from row 2.

»

2 1 ´1 ´23 ´2 1 ´55 4 2 7

fi

fl R2´R1 Ñ R2

»

2 1 ´1 ´21 ´3 2 ´35 4 2 7

fi

fl R2 Ø R1

»

1 ´3 2 ´32 1 ´1 ´25 4 2 7

fi

fl R2´ 2 ¨R1 Ñ R2 and R3´ 5 ¨R1 Ñ R3

»

1 ´3 2 ´30 7 ´5 40 19 ´8 22

fi

fl

Now, we would like a 1 for the entry in the second row and second column, butthere does not seem to be an obvious way to make that happen.2 However, ifwe note that 3 ¨19 “ 57 and 8 ¨7 “ 56, we can get a 1 by 3 ¨R3´8 ¨R2 Ñ R2.

»

1 ´3 2 ´30 7 ´5 40 19 ´8 22

fi

fl 3 ¨R3´ 8 ¨R2 Ñ R2

»

1 ´3 2 ´30 1 16 340 19 ´8 22

fi

fl 3 ¨R2`R1 Ñ R1 and R3´ 19 ¨R2 Ñ R3

»

1 0 50 990 1 16 340 0 ´312 ´624

fi

fl ´1

312¨R3 Ñ R3

»

1 0 50 990 1 16 340 0 1 2

fi

fl R1´ 50 ¨R3 Ñ R1 and R2´ 16 ¨R3 Ñ R3

2It might be tempting to use the ´3 in the second entry of the first row to get a 1 inthe second entry of the third row (6 ¨R1`R3 Ñ R3). However, this would make the firstentry of the resulting row non-zero!

Page 379: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 370

»

1 0 0 ´10 1 0 20 0 1 2

fi

fl

We are finally in RREF. So, our system of equations has the unique solutionx “ ´1, y “ 2, and z “ 2. �

Example 8.1.11. Solve the following system of linear equations.

x´ 2y ´ 5z “ 2

´3x` 6y ` 15z “ ´6

2x´ 4y ´ 10z “ 4

Answer: Writing the system as an augmented matrix and performing therow operations R2` 3 ¨R1 Ñ R2 and R3´ 2 ¨R1 Ñ R3 gives

»

1 ´2 ´5 2´3 6 15 ´62 ´4 ´10 4

fi

fl „

»

1 ´2 ´5 20 0 0 00 0 0 0

fi

fl .

Note that we have 2 rows of all zeros! This indicates that we have an infinitenumber of solutions, and two of the variables are free to be any real number.We take y and z to be free and solve the remaining equation for x. Hence,the solutions are given by

x “ 2` 2y ` 5z

y is free

z is free. �

8.2 Vectors

Often in mathematics, we can learn more about an object by looking at itfrom a slightly different point of view. This is definitely true of matrices.Before we can tackle this material, however, we need to discuss vectors.

The word vector is used in mathematics for various kinds of objects,but for our purposes, we will mean a very particular type of matrix. An

Page 380: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 371

x

y

2

1 ~v “

21

Figure 8.2.1: Geometric Interpretation of Vectors

n-dimensional vector is an nˆ 1 matrix

~v “

»

x1

x2...xn

fi

ffi

ffi

ffi

fl

,

where the xi are numbers (referred to as the components of the vector). Ifall of the xi are real numbers, we have a real vector. Otherwise, we have acomplex vector.

Notice that we will place a vector sign over quantities that are vectors. Itis also possible to use 1ˆn matrices to represent vectors, rx1 x2 ¨ ¨ ¨ xns, butwe will not develop the idea further. One–dimensional vectors (i.e. vectorsof the form rx1s) are not essentially different than numbers, so we will notmake a distinction.

Real vectors have a nice geometric interpretation. If we think of the listof numbers in the vector as the coordinate of a point in n–dimensional space,we can think of the vector as an “arrow” pointing from the origin to the point

given by the vector. For example, the vector ~v “

21

can be envisioned

as an arrow pointing from the origin to the point p2, 1q. Of course, thisinterpretation becomes difficult to visualize for vectors of dimension 4 and

Page 381: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 372

higher. There is also a similar interpretation for complex vectors, but todraw a 2ˆ 1 complex vector

~v “

a` bic` di

would require 4 dimensions (since a, b, c, and d are all independent quanti-ties). Fortunately, we will only use the geometric interpretation of vectorsto motivate some of the later definitions, and two–dimensional vectors willmore than suffice.

There are two major operations we can perform on vectors: scalar multi-plication and vector addition. In what follows, let α be a scalar (i.e. a realor complex number), and let ~v1 and ~v2 be two vectors of the same size.

� Scalar multiplication of a vector by a number is given by

α~v1 “ α

»

x1

x2...xn

fi

ffi

ffi

ffi

fl

»

αx1

αx2...

αxn

fi

ffi

ffi

ffi

fl

.

That is, we multiply each component of the vector ~v1 by the numberα.

� The vector sum of ~v1 and ~v2 is given by

~v1 ` ~v2 “

»

x1

x2...xn

fi

ffi

ffi

ffi

fl

`

»

y1

y2...yn

fi

ffi

ffi

ffi

fl

»

x1 ` y1

x2 ` y2...

xn ` yn

fi

ffi

ffi

ffi

fl

.

So, to add two vectors of the same size, we simply add together likecomponents.

Both of these operations have nice geometric interpretations.

Example 8.2.1. Let ~v “

21

. Compute 2~v, 12~v, and ´~v, and plot the

resulting vectors.

Page 382: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 373

Answer: The actual computations are easy.

2~v “ 2

21

2 ¨ 22 ¨ 1

42

1

2~v “

1

2

21

12¨ 2

12¨ 1

112

´~v “ ´

21

´1 ¨ 2´1 ¨ 1

´2´1

If we plot these vectors, we notice an interesting fact.

´1´21 2 3 4

1

2

´1

´2

y

x

~v

2~v

12~v

´~v

Notice that the positive multiples of ~v are simply stretched or shrunkin the same direction as ~v. Multiplying by a negative number rotates thevector by 180˝ (and stretches or shrinks the vector in the process). This isa general fact. Multiplying a vector by a real number results in a vector thatis stretched or shrunk on the same line determined by the original vector. Anegative multiple flips the vector by 180˝. �

Example 8.2.2. Find the sum of the vectors

~v1 “

21

and ~v2 “

13

.

Page 383: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 374

Answer: Computing the sum is easy.

~v1 ` ~v2 “

21

`

13

2` 11` 3

34

.

If we plot these vectors, we see something interesting.

y

x1 2 3 4

1

2

3

4

~v1

~v2

~v1 ` ~v2

Notice that ~v1 ` ~v2 is the result of parallel transporting the tail of ~v2 tothe head of ~v1 and connecting the tail of ~v1 (at the origin) to the head of~v2. As the diagram above shows, you get the same thing by transporting ~v1

to the head of ~v2. This result is known as the parallelogram law of vectoraddition. �

What this result indicates is that vectors do not have to be thought of aspermanently attached to the origin. We should instead think of the vector

~v1 “

21

as an instruction to move 2 units right and 1 unit up from

whatever base point we choose.A particularly nice use of this idea is the interpretation of vector subtrac-

tion. If ~v “ ~v1´~v2, then ~v1 “ ~v2`~v. So, using the geometric interpretation,~v “ ~v1 ´ ~v2 points from the tail of ~v2 to the head of ~v1.

Page 384: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 375

y

x~v1

~v2

~v1 ´ ~v2

There is one more concept we will need. The magnitude (or size) of areal vector is the overall length of the vector and is given by

~v “

»

x1

x2...xn

fi

ffi

ffi

ffi

fl

is given by

|~v| “b

x21 ` x

22 ` ¨ ¨ ¨ ` x

2n.

Example 8.2.3. Compute the magnitude of

~v “

34

.

Answer:|~v| “

?32 ` 42 “

?25 “ 5. �

The magnitude has several nice properties.

Theorem 8.2.1. Let α be a scalar and let ~v1 and ~v2 be vectors of the samesize, then we have

� |α~v1| “ |α||~v1|

� |~v1 ` ~v2| ď |~v1| ` |~v2|

Page 385: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 376

Partial Proof: The first property is easy to verify.

|α~v1| “

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

α

»

x1

x2...xn

fi

ffi

ffi

ffi

fl

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

»

αx1

αx2...

αxn

fi

ffi

ffi

ffi

fl

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

“a

pαx1q2 ` pαx2q

2 ` ¨ ¨ ¨ ` pαxnq2

b

α2px21 ` x

22 ` ¨ ¨ ¨ ` x

2nq

“?α2

b

x21 ` x

22 ` ¨ ¨ ¨ ` x

2n

“ |α||~v|.

The second property is known as the triangle inequality. The geometricreason for this fact is evident from the diagram we drew for vector addition.

y

x~v1

~v2~v1 ` ~v2

Notice that ~v1, ~v2, and ~v1 ` ~v2 form three sides of a triangle. Since followingthe single line segment given by ~v1 ` ~v2 gets us to the same point as first

Page 386: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 377

following ~v1 and then ~v2, it must be that the length of ~v1 ` ~v2 is shorterthan the sum of the lengths of the other two vectors. Even though we drewthe picture in two–dimensions, the reasoning is sound for two vectors in anynumber of dimensions. �

We can extend the definition of magnitude to include complex vectors

~v “

»

z1

z2...zn

fi

ffi

ffi

ffi

fl

.

Instead of simply squaring the entries, we have to multiply them by theirconjugates:

|~v| “?z1 ¨ z1 ` z2 ¨ z2 ` ¨ ¨ ¨ ` zn ¨ zn.

Notice that this reduces to our original definition for real vectors (x ¨ x “ x2

for real numbers). This extended version of magnitude has the same niceproperties as the real case. However, we will not need to use this fact in thisbook.

8.3 Linear Independence

A set of vectors t~v1, ~v2, ¨ ¨ ¨~vku is said to linearly dependent if there arescalars c1, c2, ¨ ¨ ¨ ck not all of which are zero so that

c1~v1 ` c2~v2 ` ¨ ¨ ¨ ` ck~vk “ ~0.

Notice that if the zero vector itself is one of the vectors in the set, say ~vi, theset of vectors is automatically linearly dependent:

1 ¨ ~vi “ 1 ¨~0 “ ~0.

Since having the zero vector makes a set trivially dependent, we will assumethat none of the vectors in our set is the zero vector from here on out.

Suppose that c1 is not zero in the equation above. Then we can solve for~v1 in terms of the other vectors in the set:

~v1 “ ´c2

c1

~v2 ´c3

c1

~v3 ´ ¨ ¨ ¨ ´ckc1

~vk.

Page 387: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 378

So, a set of non-zero vectors is linearly dependent if and only if it is possibleto write one of the vectors in the set as a combination of the others.

As an example, the set of vectors"„

12

,

1´2

,

32

*

is linearly dependent because

2 ¨

12

` 1 ¨

1´2

´ 1 ¨

32

00

.

As a result, we can solve for any one of these vectors in terms of the othertwo. In particular,

32

“ 2 ¨

12

` 1 ¨

1´2

.

If a set of non-zero vectors is not linearly dependent, then we say theset is linearly independent. In words, a set of non-zero vectors is linearlyindependent if it is impossible to write any one of the vectors as a combinationof the other vectors in the set.

There is a lot to say about linear independence in general, but we willstick the facts that are most important for us moving forward.

Theorem 8.3.1. A pair of non-zero vectors t~v1, ~v2u is linearly dependent ifand only if one is a multiple of the other.

Proof: Suppose that ~v1 “ c ¨ ~v2 (note that c ‰ 0 since ~v1 is not the zerovector and so ~v2 “ p1{cq ¨ ~v1). Then clearly we have

~v1 ´ c ¨ ~v2 “ ~0

and the vectors are linearly dependent. Conversely, if the two vectors arelinearly dependent, then

c1 ¨ ~v1 ` c2 ¨ ~v2 “ ~0

for some pair of scalars c1 and c2 at least one of which is non-zero. In fact,since neither of our vectors is the zero vector, neither of these scalars can bezero! So,

~v1 “ ´c2

c1

¨ ~v2

and ~v1 is a multiple of ~v2. Of course, ~v2 is also a multiple of ~v1! �

Page 388: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 379

Example 8.3.1. Are the vectors$

&

%

»

1´221

fi

ffi

ffi

fl

,

»

2´443

fi

ffi

ffi

fl

,

/

/

.

/

/

-

linearly dependent?

Answer: These vectors are clearly not multiples of one another. If wetry to make their first arguments the same, we find

2 ¨

»

1´221

fi

ffi

ffi

fl

»

2´442

fi

ffi

ffi

fl

»

2´443

fi

ffi

ffi

fl

.

So, these two vectors are linearly independent. �

Theorem 8.3.2. To determine if a set t~v1, ~v2, ¨ ¨ ¨~vku of 2 or more non-zerovectors is linearly dependent, form the augmented matrix

~v1 ~v2 ¨ ¨ ¨ ~vk | ~0ı

having the vectors ~vi as its columns on the left and the zero vector on theright. After row reduction, if the system has only a single solution then theset of vectors is linearly independent. If the system has an infinite numberof solutions, then the set of vectors is linearly dependent.

Proof: To see if a set of vectors is linearly dependent, we need to findcoefficients c1, c2, ¨ ¨ ¨ , ck so that

c1~v1 ` c2~v2 ` ¨ ¨ ¨ ` ck~vk “ ~0

We think about this problem as a system of linear equations where the vari-ables are the ci (this is where the augmented matrix above comes from).Notice that setting each coefficient equal to 0 definitely gives a solution (sothe system cannot be inconsistent). If this is the only solution, then thevectors are linearly independent. If there is a solution other than this trivialone, then the set of vectors is linearly dependent. In this case, there will bean infinite number of possible solutions. �

Page 389: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 380

Example 8.3.2. Is the set of vectors

$

&

%

»

110

fi

fl ,

»

011

fi

fl ,

»

101

fi

fl

,

.

-

linearly dependent or independent?

Answer: We first form the augmented matrix

»

1 0 1 01 1 0 00 1 1 0

fi

fl .

Row reducing this matrix gives

»

1 0 1 01 1 0 00 1 1 0

fi

fl „

»

1 0 1 00 1 ´1 00 1 1 0

fi

fl

»

1 0 1 00 1 ´1 00 0 2 0

fi

fl

»

1 0 0 00 1 0 00 0 1 0

fi

fl .

Since this system has only one solution (the trivial one where all coefficientsequal zero), this set of vectors is linearly independent. �

Example 8.3.3. Is the set of vectors

$

&

%

»

120

fi

fl ,

»

11´1

fi

fl ,

»

142

fi

fl

,

.

-

linearly dependent or independent?

Page 390: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 381

Answer:»

1 1 1 02 1 4 00 ´1 2 0

fi

fl „

»

1 1 1 00 ´1 2 00 ´1 2 0

fi

fl

»

1 1 1 00 ´1 2 00 0 0 0

fi

fl

»

1 0 3 00 1 ´2 00 0 0 0

fi

fl .

The row of all zeros clearly indicates that there is an infinite number ofsolutions (remember that these systems can never be inconsistent). As aresult, the set of vectors above is linearly dependent.

In fact, we can find a linear combination of these vectors that add upto the zero vector. From the reduced matrix, we must have c1 “ ´3c3 andc2 “ 2c3 while c3 is free to be any value. If we take c1 “ 1, we find

´3 ¨

»

120

fi

fl` 2 ¨

»

11´1

fi

fl` 1 ¨

»

142

fi

fl “

»

000

fi

fl .

As a result, can see that»

142

fi

fl “ 3 ¨

»

120

fi

fl´ 2 ¨

»

11´1

fi

fl . �

8.4 Matrices as Linear Transformations of Vec-

tors

So far, matrices have merely served as a kind of shorthand for systems oflinear equations. Of course, this short hand has been extremely useful sinceit led us to a very efficient method for solving such systems. But matricesare so much more than this! In this section, we will explore the notion thata matrix is a very special kind of function – one that accepts a vector as aninput and returns another vector as output.

Page 391: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 382

An m ˆ n matrix (i.e. a matrix with m rows and n columns) acts onn–dimensional vectors in the following way:

»

a11 a12 a13 ¨ ¨ ¨ a1n

a21 a22 a23 ¨ ¨ ¨ a2n...

......

......

am1 am2 am3 ¨ ¨ ¨ amn

fi

ffi

ffi

ffi

fl

»

x1

x2

x3...xn

fi

ffi

ffi

ffi

ffi

ffi

fl

»

a11x1 ` a12x2 ` a13x3 ` ¨ ¨ ¨ ` a1nxna21x1 ` a22x2 ` a23x3 ` ¨ ¨ ¨ ` a2nxn

...am1x1 ` am2x2 ` am3x3 ` ¨ ¨ ¨ ` amnxn

fi

ffi

ffi

ffi

fl

.

Notice that the output is the m–dimensional vector obtained by applying therows of the matrix as coefficients multiplying the entries of the vector.

If we think of an n–dimensional vector as an nˆ 1 matrix, the input andoutput sizes can be remembered in the following schematic way:

rmˆ nsrnˆ 1s “ rmˆ 1s.

In words, the number of columns in the matrix on the left has to match thenumber of rows in the vector on the right. This will turn out to be a specialcase of a more general pattern we will develop in this section.

Example 8.4.1. Compute

3 ´2 45 ´1 6

»

271

fi

fl .

Answer: Since we have a 2 ˆ 3 matrix, we have a function that accepts3–dimensional vectors and outputs 2 dimensional vectors. For the particular3–vector we are given, we find

3 ´2 45 ´1 6

»

271

fi

fl “

3p2q ` p´2qp7q ` 4p1q5p2q ` p´1qp7q ` 6p1q

´49

.

Page 392: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 383

Example 8.4.2. Compute»

1 24 ´30 3´1 ´2

fi

ffi

ffi

fl

32

.

Answer: The matrix we were given is 4 ˆ 2, so it accepts 2–dimensionalvectors and outputs 4–dimensional ones.

»

1 24 ´30 3´1 ´2

fi

ffi

ffi

fl

32

»

1p3q ` 2p2q4p3q ` p´3qp2q

0p3q ` 3p2q´1p3q ` p´2qp2q

fi

ffi

ffi

fl

»

766´7

fi

ffi

ffi

fl

.

If a matrix has the same number of rows as it does columns, then we saythat the matrix is a square matrix. A square matrix of size nˆ n acceptsn–dimensional vectors and outputs vectors of the same size.

Example 8.4.3. Compute»

2 ´5 31 0 4´2 2 ´7

fi

fl

»

1´36

fi

fl .

Answer: Since we have a 3ˆ3 matrix, it accepts 3–dimensional vectors andreturns 3–dimensional vectors.

»

2 ´5 31 0 4´2 2 ´7

fi

fl

»

1´36

fi

fl “

»

2p1q ` p´5qp´3q ` 3p6q1p1q ` 0p´3q ` 4p6q

´2p1q ` 2p´3q ` p´7qp6q

fi

fl

»

3525´50

fi

fl .

As functions acting on vectors, matrices have many nice properties. Themost important is that a matrix represents a linear transformation ofvectors.

Page 393: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 384

Theorem 8.4.1 (Matrices are Linear Transformations). Let M be a mˆ nmatrix, α a scalar, and ~v1 and ~v2 n–dimensional vectors. Then the followingproperties hold.

1) Mpα~v1q “ αpM~v1q

2) Mp~v1 ` ~v2q “M~v1 `M~v2

Partial Proof: We will not provide the general proof of these facts (whichcan be found in [FIS03, Ch. 2] or any other textbook on linear algebra). Wewill simply show these facts are true for 2ˆ 2 matrices. The general proof isessentially the same (just with fancier notation).

So, let

M “

a bc d

, ~v1 “

x1

y1

, and ~v2 “

x2

y2

.

First,

Mpα~v1q “

a bc d

ˆ

α

x1

y1

˙

a bc d

αx1

αy1

apαx1q ` bpαy1q

cpαx1q ` dpαy1q

αpax1 ` by1q

αpcx1 ` dy1q

“ α

ax1 ` by1

cx1 ` dy1

“ α

ˆ„

a bc d

x1

y1

˙

“ αpM~v1q.

Page 394: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 385

For the second property, we have

Mp~v1 ` ~v2q “

a bc d

ˆ„

x1

y1

`

x2

y2

˙

a bc d

x1 ` x2

y1 ` y2

apx1 ` x2q ` bpy1 ` y2q

cpx1 ` x2q ` dpy1 ` y2q

pax1 ` by1q ` pax2 ` by2q

pcx1 ` dy1q ` pcx2 ` dy2q

ax1 ` by1

cx1 ` dy1

`

ax2 ` by2

cx2 ` dy2

a bc d

x1

y1

`

a bc d

x2

y2

“M~v1 `M~v2. �

Any transformation having properties 1q and 2q above is called a lineartransformation.

Theorem 8.4.2. Let M be a linear transformation of vectors, α and β bescalars, and ~v1 and ~v2 be vectors of the appropriate size for M . For defi-niteness, we will assume that M takes as inputs n–dimensional vectors andoutputs m–dimensional ones (i.e. M can be given by a mˆn matrix). Then,

1) Mpα~v1 ` β~v2q “ αM~v1 ` βM~v2

2) M~0n “ ~0m

where ~0n represents an n–dimensional vector of all zeros.

Proof: The first property is a direct consequence of the previous theorem.

Mpα~v1 ` β~v2q “Mpα~v1q `Mpβ~v2q

“ αM~v1 ` βM~v2.

In fact, this single result is equivalent to both of the conditions in the previoustheorem.

Page 395: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 386

For the second part of the theorem, note that ~0n “ 0 ¨ ~0n since all of thecomponents of ~0n are zero.

M~0n “Mp0 ¨~0nq

“ 0 ¨M~0n

“ ~0m.

Note that the change from ~0n to ~0m in the final step occurs simply becauseM is assumed to output m–dimensional vectors. �

Thinking of matrices as linear transformations allows us to define a num-ber of operations on them. In particular, we can multiply a matrix by ascalar, add two matrices of the same size, and multiply two matrices to-gether (if their sizes are compatible). We will give definitions for each ofthese operations below and supply motivations for them as we go. To keepthe notation simple, we will examine the motivation for 2ˆ 2 matrices only.

� Scalar Multiplication: Let M be an m ˆ n matrix and α a scalar.Then the matrix αM is the matrix of the same size as M whose entriesare the entries of M multiplied by α.

In symbols,

α

»

a11 a12 ¨ ¨ ¨ a1n

a21 a22 ¨ ¨ ¨ a2n...

......

...am1 am2 ¨ ¨ ¨ amn

fi

ffi

ffi

ffi

fl

»

αa11 αa12 ¨ ¨ ¨ αa1n

αa21 αa22 ¨ ¨ ¨ αa2n...

......

...αam1 αam2 ¨ ¨ ¨ αamn

fi

ffi

ffi

ffi

fl

.

Motivation: Since αM is supposed to be a matrix of the same size as M ,we need to ask what action it should have on a vector ~v (of the appropriatesize). The property we would like to have is pαMq~v “ αpM~vq. Note that thisis a choice we are making! We would like our new operation (multiplying amatrix by a scalar) to be compatible with an operation we already understand(multiplying a vector by a scalar). It is this natural choice which leads tothe definition above.

Page 396: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 387

For a 2ˆ 2 matrix M and ~v a 2–dimensional vector, we find

αpM~vq “ α

ˆ„

a bc d

xy

˙

“ α

ax` bycx` dy

αpax` byqαpcx` dyq

pαaqx` pαbqypαcqx` pαdqy

αa αbαc αd

xy

.

So, our requirement that pαMq~v “ αpM~vq leads us to the conclusion (atleast in the 2ˆ 2 case) that

α

a bc d

αa αbαc αd

.

That is, multiplying a matrix by a scalar simply multiplies each of the entriesin the matrix by that scalar. �

� Matrix Addition: Let A and B be matrices of the same size. Thenthe matrix A ` B is the matrix of the same size as A and B obtainedby adding together corresponding entries.

In symbols, if

A “

»

a11 a12 ¨ ¨ ¨ a1n

a21 a22 ¨ ¨ ¨ a2n...

......

...am1 am2 ¨ ¨ ¨ amn

fi

ffi

ffi

ffi

fl

and B “

»

b11 b12 ¨ ¨ ¨ b1n

b21 b22 ¨ ¨ ¨ b2n...

......

...bm1 bm2 ¨ ¨ ¨ bmn

fi

ffi

ffi

ffi

fl

are matrices of the same size, then

A`B “

»

a11 ` b11 a12 ` b12 ¨ ¨ ¨ a1n ` b1n

a21 ` b21 a22 ` b22 ¨ ¨ ¨ a2n ` b2n...

......

...am1 ` bm1 am2 ` bm2 ¨ ¨ ¨ amn ` bmn

fi

ffi

ffi

ffi

fl

.

Page 397: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 388

Motivation: The natural thing to require is the distributive property:

pA`Bq~v “ A~v `B~v.

Again, this a choice we make, but it is certainly an obvious choice! In the2ˆ 2 case, if

A “

a bc d

, B “

r st u

, and ~v “

xy

,

then

A~v `B~v “

a bc d

xy

`

r st u

xy

ax` bycx` dy

`

rx` sytx` uy

pax` byq ` prx` syqpcx` dyq ` ptx` uyq

pa` rqx` pb` sqypc` tqx` pd` uqy

a` r b` sc` t d` u

xy

.

So, we must have„

a bc d

`

r st u

a` r b` sc` t d` u

as promised in the definition. �Before we discuss matrix multiplication, we should emphasize a nice bit

of notation we used in the test for linear independence. Consider an m ˆ nmatrix

M “

»

a11 a12 ¨ ¨ ¨ a1n

a21 a22 ¨ ¨ ¨ a2n...

......

...am1 am2 ¨ ¨ ¨ amn

fi

ffi

ffi

ffi

fl

.

We can think of this matrix as a list of n m–dimensional vectors

M “ r~v1 ~v2 ¨ ¨ ¨ ~vns

Page 398: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 389

where

~v1 “

»

a11

a21...am1

fi

ffi

ffi

ffi

fl

, ~v2 “

»

a12

a22...am2

fi

ffi

ffi

ffi

fl

, ¨ ¨ ¨ , ~vn “

»

a1n

a2n...

amn

fi

ffi

ffi

ffi

fl

.

In other words, we can think of each column of M as a vector in its ownright.

� Matrix Multiplication: Let A be a pˆm matrix and B a mˆn ma-trix. Let B “ r~v1 ~v2 ¨ ¨ ¨ ~vns be thought of a list of n m–dimensionalvectors. Then the product of these two matrices, AB, is the p ˆ nmatrix with columns given by

AB “ rA~v1 A~v2 ¨ ¨ ¨ A~vns .

Notice that AB being p ˆ n is a consequence of this definition. We stillhave n vectors (the columns of AB), but since A is pˆm, it transforms them–dimensional vectors from B into p–dimensional vectors. Schematically,the sizes of matrices that can be multiplied are

rpˆms ¨ rmˆ ns “ rpˆ ns.

Motivation: If A and B are matrices, then the product AB should be anew matrix. Hence, it should act on vectors of a certain size. As always,we need to ask what we want this product to mean. The natural thing torequire is that the product AB should represent the composition of these twotransformations:

pABq~v “ ApB~vq.

That is, we first let B act on ~v, and the output from this transformation isthen taken as the input for A. If B is an m ˆ n matrix, then ~v must ben–dimensional and so B~v will be m–dimensional. So, the matrix A mustaccept m–dimensional vectors as input. Hence, A must be pˆm for some p.

To see how this requirement leads to the definition given above, we willlook at the 2ˆ 2 case in detail. So, if

A “

a bc d

, B “

r st u

, and ~v “

xy

,

Page 399: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 390

then

B~v “

r st u

xy

rx` sytx` uy

.

We now input this vector into A.

ApB~vq “

a bc d

rx` sytx` uy

aprx` syq ` bptx` uyqcprx` syq ` dptx` uyq

par ` btqx` pas` buqypcr ` dtqx` pcs` duqy

ar ` bt as` bucr ` dt cs` du

xy

.

So we must have

AB “

ar ` bt as` bucr ` dt cs` du

A

rt

A

su

. �

There is an easier way to compute matrix products. Look closely at theproduct in the 2ˆ 2 case.

a bc d

r st u

ar ` bt as` bucr ` dt cs` du

If we look carefully at the p1, 1q–entry of the product (in the upper leftcorner), it looks as though it comes from applying the first row of A to thefirst column of B (in the usual way that matrices act on vectors). Similarly,the p1, 2q–entry (in the upper right corner), looks like the application of thefirst row of A on the second column of B, and so forth. Most people remembermatrix multiplication by this basic idea:

“Multiply row by column.”

Page 400: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 391

Example 8.4.4. Find the product AB where

A “

»

1 23 45 6

fi

fl and B “

2 0 ´31 ´1 4

Answer: Since A is 3 ˆ 2 and B is 2 ˆ 3, we know that AB will have size3ˆ 3.

AB “

»

c11 c12 c13

c21 c22 c23

c31 c32 c33

fi

fl

We get c11 by multiplying the first row of A by the first column of B.

c11 “ 1p2q ` 2p1q “ 4

Similarly, c12 and c13 are obtained by multiplying the first row of A with thesecond and third columns of B, respectively.

c12 “ 1p0q ` 2p´1q “ ´2

c13 “ 1p´3q ` 2p4q “ 5

For c21, we multiply the second row of A by the first column of B.

c21 “ 3p2q ` 4p1q “ 10

The remaining entries are as follows.

c22 “ 3p0q ` 4p´1q “ ´4

c23 “ 3p´3q ` 4p4q “ 7

c31 “ 5p2q ` 6p1q “ 16

c32 “ 5p0q ` 6p´1q “ ´6

c33 “ 5p´3q ` 6p4q “ 9

So, we have

AB “

»

1 23 45 6

fi

fl

2 0 ´31 ´1 4

»

4 ´2 510 ´4 716 ´6 9

fi

fl . �

An important fact about matrix multiplication is that it is not commu-tative in general. What this means is that generally AB ‰ BA. This fact isnot too surprising if you remember that matrix multiplication is essentiallyfunction composition (and typically f ˝ g ‰ g ˝ f).

Page 401: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 392

Example 8.4.5. Compute BA using the matrices given in the previous ex-ample.

Answer: Since B is 2 ˆ 3 and A is 3 ˆ 2, the product BA will have size2ˆ 2. Note that this is already enough to see that AB and BA need not bethe same. In this example, they are not even the same size!

BA “

c11 c12

c21 c22

where

c11 “ 2p1q ` 0p3q ´ 3p5q “ ´13,

c12 “ 2p2q ` 0p4q ´ 3p6q “ ´14,

c21 “ 1p1q ´ 1p3q ` 4p5q “ 18,

c22 “ 1p2q ´ 1p4q ` 4p6q “ 22.

This gives us

BA “

2 0 ´31 ´1 4

»

1 23 45 6

fi

fl “

´13 ´1418 22

. �

In some instances, not only will AB ‰ BA, but BA may not even bedefined! For example, if A is 2 ˆ 3 and B is 3 ˆ 4, then the product AB isdefined and will have size 2 ˆ 4. However, the product BA does not makesense since the dimensions of the matrices do not line up correctly. Even ifAB and BA both exist and are the same size, these two products need notbe the same!

Example 8.4.6. Given the matrices A and B below, compute both AB andBA.

A “

1 ´22 3

B “

1 34 ´5

Answer:

AB “

1 ´22 3

1 34 ´5

´7 1314 ´9

BA “

1 34 ´5

1 ´22 3

7 7´6 ´23

Page 402: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 393

Notice that even though AB and BA are both defined and have the samesize, they are definitely not equal! �

On occasion, we need a specific entry from the product of two matrices.Fortunately, there is an easy formula for exactly this purpose.

Lemma 8.4.3. Suppose that A is an m ˆ n matrix with entries aij and Bis an n ˆ p matrix with entries bjk. Then the m ˆ p matrix AB has entriesc`m given by the formula

c`m “nÿ

j“1

a`jbjm.

Proof: The entry c`m of AB is computed by taking the `-th row of A andmultiplying its entries with the m-th column of B (and summing the results).But the entries of a`j are precisely the elements of the `-th row of A whenwe let j range from 1 to n. Likewise, the elements bjm give the elements ofthe m-th column of B when j ranges from 1 to n. �

Example 8.4.7. Suppose that

A “

1 2 ´63 ´4 7

and B “

»

1 ´14 5´2 7

fi

fl .

Find the entry in the second row and first column of AB.

Answer: Notice that AB will be a 2ˆ2 matrix. We will use the notationrABs21 to stand for the entry in the second row and first column of AB.

rABs21 “

3ÿ

j“1

a2jbj1

“ a21b11 ` a22b21 ` a23b31

“ 3p1q ` p´4qp4q ` 7p´2q

“ ´27 �

Before we leave this section, there is a special square matrix we need todiscuss. First, the entries of

M “

»

a11 a12 ¨ ¨ ¨ a1n

a21 a22 ¨ ¨ ¨ a2n...

......

...an1 an2 ¨ ¨ ¨ ann

fi

ffi

ffi

ffi

fl

Page 403: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 394

of the form aii (i.e. the entries a11, a22, ¨ ¨ ¨ ann) are called the main diagonal.

The nˆ n identity matrix is the matrix with 1’s on the main diagonaland 0’s everywhere else.

In “

»

1 0 0 ¨ ¨ ¨ 00 1 0 ¨ ¨ ¨ 00 0 1 ¨ ¨ ¨ 0...

......

......

0 0 0 ¨ ¨ ¨ 1

fi

ffi

ffi

ffi

ffi

ffi

fl

The most important fact about the identity matrix is that if A is an n ˆ nmatrix

AIn “ InA “ A.

In other words, In plays an analogous role to the number 1 for multiplicationof square matrices.

8.5 Inverse Matrices and Determinants

Let us reconsider the problem that led us to matrices in the first place: findingsolutions to linear systems of equations. We will restrict ourselves to n ˆ nsystems moving forward.

a11x1 ` a12x2 ` a13x3 ` ¨ ¨ ¨ a1nxn “ b1

a21x1 ` a22x2 ` a23x3 ` ¨ ¨ ¨ a2nxn “ b2

......

an1x1 ` an2x2 ` an3x3 ` ¨ ¨ ¨ annxn “ bn

If we define an nˆ n matrix A by

A “

»

a11 a12 ¨ ¨ ¨ a1n

a21 a22 ¨ ¨ ¨ a2n...

......

...an1 an2 ¨ ¨ ¨ ann

fi

ffi

ffi

ffi

fl

,

Page 404: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 395

and n–dimensional vectors ~x and ~b by

~x “

»

x1

x2...xn

fi

ffi

ffi

ffi

fl

and ~b “

»

b1

b2...bn

fi

ffi

ffi

ffi

fl

,

then the system of equations above is equivalent to the matrix equation

A~x “ ~b.

If A were a non-zero number, we could simply divide by it to solve for ~x. Thecorresponding notion for a square matrix A is called the inverse matrix ofA.

The inverse matrix of a square matrix A (if it exists) is a square matrixdenoted by A´1 which has the same size as A and satisfies

AA´1“ A´1A “ In.

Suppose that A´1 exists for our particular matrix A. Using this matrix,the solution to our system of equations is easy to write down.

A~x “ ~b

A´1A~x “ A´1~b

In~x “ A´1~b

~x “ A´1~b.

Unfortunately, not every square matrix has an inverse. In this section, wewill discuss how to tell whether a matrix is invertible, and we will developa fairly efficient algorithm for computing inverses. We will only scratch thesurface of everything that could be said about this topic. For a more in depthdiscussion, see [FIS03, §3.2 and Ch. 4].

We will begin with the simplest possible case: 2 ˆ 2 matrices. Since theexistence of an inverse matrix is related to solving systems of linear equations,that is where we will begin. Specifically, we will try to solve for the variablesx and y in the generic 2ˆ 2 system

ax` by “ α

cx` dy “ β.

Page 405: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 396

Think of a, b, c, d, α, and β as fixed (but unspecified) numbers, and our job isto solve for x and y in terms of these quantities. We could attempt to reducethe associated augmented matrix to RREF, but for 2 ˆ 2 systems it is justas simple to solve and substitute. For simplicity, we will assume that noneof the coefficients a, b, c, or d are zero. It will end up making no difference inthe final answer.

If we solve the first equation for y, we find

y “α ´ ax

b.

We then substitute this into the second equation to find

cx` dy “ β

cx` d´α ´ ax

b

¯

“ β

bcx` dα ´ adx “ bβ

pbc´ adqx “ bβ ´ dα

pad´ bcqx “ dα ´ bβ

x “dα ´ bβ

ad´ bc,

provided that ad ´ bc ‰ 0. A little algebra shows that the correspondingvalue for y is

y “´cα ` aβ

ad´ bc.

Translating these results to matrix form shows that the solution to thematrix equation

a bc d

xy

αβ

is given by„

xy

“1

ad´ bc

d ´b´c a

αβ

provided the quantity ad ´ bc is non-zero. This quantity is known as thedeterminant of the matrix since it determines whether or not the inverseof the matrix exists. The above calculations prove the following theorem.

Page 406: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 397

Theorem 8.5.1 (Inverse of a 2ˆ 2 Matrix). A 2ˆ 2 matrix

A “

a bc d

has an inverse if and only if its determinant

detpAq “

ˇ

ˇ

ˇ

ˇ

a bc d

ˇ

ˇ

ˇ

ˇ

“ ad´ bc

is non-zero. In which case,

A´1“

1

ad´ bc

d ´b´c a

dad´bc

´bad´bc

´cad´bc

aad´bc

.

Example 8.5.1. Determine whether the following matrix has an inverse. Ifit does, find it.

A “

3 41 2

.

Answer: The determinant of the matrix is

detpAq “

ˇ

ˇ

ˇ

ˇ

3 41 2

ˇ

ˇ

ˇ

ˇ

“ 3p2q ´ 4p1q “ 2 ‰ 0.

Since the determinant is non-zero, the matrix has an inverse. The formulafrom the theorem gives us

A´1“

1

2

2 ´4´1 3

1 ´2´1

232

. �

Example 8.5.2. Determine whether the following matrix has an inverse. Ifit does, find it.

B “

2 16 3

.

Answer: The determinant of the matrix is

detpBq “

ˇ

ˇ

ˇ

ˇ

2 16 3

ˇ

ˇ

ˇ

ˇ

“ 2p3q ´ 1p6q “ 0.

Since the determinant is zero, the matrix B has no inverse. �

Page 407: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 398

Example 8.5.3. Solve the following system of equations by rewriting thesystem in matrix form and finding an inverse matrix.

5x` 3y “ 4

´x` 2y “ 7

Answer: In matrix form, the system above is given by„

5 3´1 2

xy

47

.

Sinceˇ

ˇ

ˇ

ˇ

5 3´1 2

ˇ

ˇ

ˇ

ˇ

“ 10´ p´1qp3q “ 13 ‰ 0,

the matrix has an inverse. Specifically,„

5 3´1 2

´1

“1

13

2 ´31 5

.

So, the solution to the matrix problem above is„

xy

“1

13

2 ´31 5

47

“1

13

2p4q ´ 3p7q1p4q ` 5p7q

“1

13

´1339

´13

.

So, the solution to our system of equations is x “ ´1 and y “ 3. �For square matrices of size 3ˆ 3 and larger, the story is similar but more

complicated. For an nˆ n matrix A, the minor associated to element aij isthe pn ´ 1q ˆ pn ´ 1q square matrix Aij obtained from A by deleting row iand column j (the row and column containing aij).

Example 8.5.4. Find the minors associated to the elements in the first rowof the matrix

A “

»

2 5 ´13 ´2 41 1 ´2

fi

fl .

Page 408: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 399

Answer: The minor associated to a11 “ 2 is the matrix

A11 “

´2 41 ´2

.

The minor associated to a12 “ 5 is the matrix

A12 “

3 41 ´2

.

The minor associated to a13 “ ´1 is the matrix

A13 “

3 ´21 1

.

As with 2ˆ 2 matrices, there is a quantity called the determinant whichindicates whether or not an n ˆ n matrix has an inverse. While there aremany ways to define determinants for larger square matrices, we will presenta recursive definition.

For a square matrix A of size n ˆ n (n ě 3), the determinant of A (stillsymbolized as detpAq) is defined recursively using determinants of minors. If

A “

»

a11 a12 ¨ ¨ ¨ a1n

a21 a22 ¨ ¨ ¨ a2n...

......

...an1 an2 ¨ ¨ ¨ ann

fi

ffi

ffi

ffi

fl

,

then

detpAq “ a11 detpA11q ´ a12 detpA12q ` a13 detpA13q ´ ¨ ¨ ¨ ` p´1qn`1 detpA1nq.

Each of the determinants on the right–hand–side above are determinants ofstrictly smaller matrices. Hence, they can be expanded in terms of determi-nants of smaller matrices themselves. This process continues until we reacha series of 2ˆ 2 determinants (whose definition is given above).

Notice the alternating signs on the determinants. They can be easilyremembered by writing a series of plus and minus signs above the matrix as

Page 409: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 400

follows.` ´ ` ´ ¨ ¨ ¨ p´1qn`1

ˇ

ˇ

ˇ

ˇ

a11 a12 a13 a14 ¨ ¨ ¨ a1n

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

a21 a22 a23 a24 ¨ ¨ ¨ a2n

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

......

......

......

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

an1 an2 an3 an4 ¨ ¨ ¨ ann

ˇ

ˇ

ˇ

ˇ

Example 8.5.5. Compute the determinant of the matrix

A “

»

1 3 ´52 1 43 ´2 ´1

fi

fl .

Answer: The determinant of this 3ˆ3 matrix can be found by reducing theproblem to a series of 2ˆ 2 matrices.

` ´ `

ˇ

ˇ

ˇ

ˇ

1 3 ´5

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

2 1 4

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

3 ´2 ´1

ˇ

ˇ

ˇ

ˇ

So, the determinant of the given matrix is

detpAq “ 1 ¨

ˇ

ˇ

ˇ

ˇ

1 4´2 ´1

ˇ

ˇ

ˇ

ˇ

´ 3 ¨

ˇ

ˇ

ˇ

ˇ

2 43 ´1

ˇ

ˇ

ˇ

ˇ

` p´5q ¨

ˇ

ˇ

ˇ

ˇ

2 13 ´2

ˇ

ˇ

ˇ

ˇ

“ 1 p1p´1q ´ 4p´2qq ´ 3 p2p´1q ´ 4p3qq ´ 5 p2p´2q ´ 1p3qq

“ 1p7q ´ 3p´14q ´ 5p´7q

“ 84. �

Page 410: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 401

Example 8.5.6. Compute the determinant of the matrix

B “

»

1 0 0 ´21 0 1 00 2 0 21 1 1 2

fi

ffi

ffi

fl

.

Answer: Computing a 4 ˆ 4 determinant involves first expanding the de-terminant into 4 3 ˆ 3 determinants. Each of those 3 ˆ 3 determinants isthen expanded into 3 2 ˆ 2 determinants. This means that we eventuallyhave to compute 4 ¨ 3 “ 12 2ˆ 2 determinants! Fortunately, B has a largenumber of 0 entries!

` ´ ` ´

ˇ

ˇ

ˇ

ˇ

1 0 0 ´2

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

1 0 1 0

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

0 2 0 2

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

1 1 1 2

ˇ

ˇ

ˇ

ˇ

The first expansion gives

detpBq “ 1 ¨

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

0 1 02 0 21 1 2

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

´ 0 ¨

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

1 1 00 0 21 1 2

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

` 0 ¨

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

1 0 00 2 21 1 2

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

´ p´2q ¨

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

1 0 10 2 01 1 1

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

“ 1 ¨

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

0 1 02 0 21 1 2

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

` 2 ¨

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

1 0 10 2 01 1 1

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

.

Page 411: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 402

Expanding the 3ˆ 3 determinants gives

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

0 1 02 0 21 1 2

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

“ ´1 ¨

ˇ

ˇ

ˇ

ˇ

2 21 2

ˇ

ˇ

ˇ

ˇ

“ ´1 p2p2q ´ 2p1qq

“ ´2,ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

1 0 10 2 01 1 1

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

“ 1 ¨

ˇ

ˇ

ˇ

ˇ

2 01 1

ˇ

ˇ

ˇ

ˇ

` 1 ¨

ˇ

ˇ

ˇ

ˇ

0 21 1

ˇ

ˇ

ˇ

ˇ

“ 1p2p1q ´ 0p1qq ` 1p0p1q ´ 2p1qq

“ 2` p´2q “ 0.

Finally,detpBq “ 1p´2q ` 2p0q “ ´2. �

As you can see, computing determinants is a labor intensive process. Ifwe needed to compute the determinant of a 5 ˆ 5 matrix, we would end upcomputing 5 ¨ 4 ¨ 3 “ 60 2 ˆ 2 determinants! Fortunately, 3 ˆ 3 and 4 ˆ 4will be the largest matrices we will deal with by hand. For larger matrices,calculators and computer algebra systems are more than capable of takingdeterminants for us. Even with relatively efficient algorithms, computing thedeterminant of a large matrix (for example, 100ˆ 100) will take a significantamount of time. Before we return to inverses, we have the following importanttheorem.

Theorem 8.5.2 (Properties of the Determinant). Let A and B be n ˆ nmatrices and c a scalar.

1) detpInq “ 1

2) detpcAq “ cn detpAq

3) detpABq “ detpAq detpBq

4) detpA´1q “ 1{ detpAq

5) An n ˆ n matrix has an inverse if and only if its determinant is non-zero.

Page 412: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 403

Proof: Omitted. See [FIS03, §4.3] for details.For most of what we will be studying, the determinant is the most im-

portant notion. However, there is a very efficient algorithm for finding theinverse of a square matrix. In fact, we can use this algorithm without check-ing the determinant first! If the determinant is zero, the method will clearlyshow that. Otherwise, the method will produce the inverse matrix.

To see why the method works, we look at part of the defining property:

AA´1“ In.

If we writeA´1

“ r~v1 ~v2 ¨ ¨ ¨ ~vns,

(that is, ~v1 is the first column of A´1, ~v2 is the second column of A´1, etc. )then

AA´1“ rA~v1 A~v2 ¨ ¨ ¨ A~vns “ In.

What this tells us is that

A~v1 “

»

100...0

fi

ffi

ffi

ffi

ffi

ffi

fl

A~v2 “

»

010...0

fi

ffi

ffi

ffi

ffi

ffi

fl

...

A~vn “

»

000...1

fi

ffi

ffi

ffi

ffi

ffi

fl

,

which we can solve by row reduction! Instead of performing n different rowreductions, we can combine them into one single process. The discussionabove establishes the following result.

Page 413: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 404

Theorem 8.5.3 (Algorithm for Finding Inverse Matrices). If A is an nˆ nmatrix, form the augmented matrix with A on the left half of the matrix andthe nˆ n identity matrix on the right:

A

ˇ

ˇ

ˇ

ˇ

In

.

Row reduce this matrix until it is in RREF. If the matrix is invertible, thefinal form will be

In

ˇ

ˇ

ˇ

ˇ

A´1

.

If A is not invertible, then the left hand side of the reduced matrix will notbe the identity matrix In.

Example 8.5.7. Determine whether the matrix

M “

»

0 1 02 0 21 1 2

fi

fl

is invertible. If it is, find M´1.

Answer: We actually know that the determinant of this matrix is ´2 sinceit appeared as one of the sub–determinants in the 4ˆ 4 determinant above.However, we do not need to know the determinant before starting the algo-rithm. Our job is to reduce

»

0 1 0 1 0 02 0 2 0 1 01 1 2 0 0 1

fi

fl

to RREF. The easiest way to begin is to rearrange the matrix so that row 3is on top and the other two rows have been moved down one row.

»

1 1 2 0 0 10 1 0 1 0 02 0 2 0 1 0

fi

fl

Next, we use the 1 in the upper left corner to eliminate the two in the finalrow.

»

1 1 2 0 0 10 1 0 1 0 00 ´2 ´2 0 1 ´2

fi

fl

Page 414: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 405

Now, we can use the p2, 2q–entry to eliminate the entries above and below it.

»

1 0 2 ´1 0 10 1 0 1 0 00 0 ´2 2 1 ´2

fi

fl

Dividing the third row by ´2 gives

»

1 0 2 ´1 0 10 1 0 1 0 00 0 1 ´1 ´1{2 1

fi

fl .

Finally, we eliminate the 2 in the p1, 3q–entry.

»

1 0 0 1 1 ´10 1 0 1 0 00 0 1 ´1 ´1{2 1

fi

fl .

So, the algorithm shows that M is invertible (which we already knew), and

M´1“

»

1 1 ´11 0 0´1 ´1{2 1

fi

fl . �

Example 8.5.8. Determine whether the matrix

M “

»

1 0 10 2 01 1 1

fi

fl

is invertible. If it is, find M´1.

Answer: We need to row reduce»

1 0 1 1 0 00 2 0 0 1 01 1 1 0 0 1

fi

fl .

We begin by dividing row 2 by 2, and then subtracting row 1 from row 3.

»

1 0 1 1 0 00 1 0 0 1{2 00 1 0 ´1 0 1

fi

fl

Page 415: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 406

Subtracting row 2 from row 3 gives us

»

1 0 1 1 0 00 1 0 0 1{2 00 0 0 ´1 ´1{2 1

fi

fl .

Even though this final matrix is not quite in RREF (the leading coefficientin row 3 is not a 1 and is not the only non-zero entry in its row), we can seethat the left half of this matrix will not be the identity matrix. Hence, M isnot invertible. �

Example 8.5.9. Determine whether the matrix

M “

»

1 0 0 ´21 0 1 00 2 0 21 1 1 2

fi

ffi

ffi

fl

is invertible. If it is, find M´1.

Answer: If we row reduce»

1 0 0 ´2 1 0 0 01 0 1 0 0 1 0 00 2 0 2 0 0 1 01 1 1 2 0 0 0 1

fi

ffi

ffi

fl

we find»

1 0 0 0 1 ´2 ´1 20 1 0 0 0 1 1 ´10 0 1 0 ´1 3 1 ´20 0 0 1 0 ´1 ´1{2 1

fi

ffi

ffi

fl

.

Since we have the identity matrix on the left, we know M is invertible, and

M´1“

»

1 ´2 ´1 20 1 1 ´1´1 3 1 ´20 ´1 ´1{2 1

fi

ffi

ffi

fl

. �

The inverse has several important properties as an operation. The fol-lowing theorem collects the ones most relevant for our purposes.

Page 416: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 407

Theorem 8.5.4 (Properties of the Matrix Inverse). Let A and B be invertiblematrices and c a non–zero scalar. Then the following properties hold.

1) pA´1q´1 “ A

2) pcAq´1 “ 1cA´1

3) pABq´1 “ B´1A´1

Proof: SinceA´1A “ AA´1

“ In,

it follows that the inverse of A´1 is A. Hence pA´1q´1 “ A.Since

1

cA´1

¨ cA “c

cA´1A “ In

and similarly for the other order, we see that pcAq´1 “ 1cA´1.

For the final property

pABqB´1A´1“ ApBB´1

qA´1

“ AInA´1

“ AA´1“ In,

B´1A´1pABq “ B´1

pA´1AqB

“ B´1InB

“ B´1B “ In.

So, B´1A´1 must be the inverse of AB. �

8.6 Eigenvalues and Eigenvectors

We now explore a topic of central importance for material we wish to discussin later sections. If M is an nˆn matrix, then an eigenvector for M is anynon-zero n–dimensional vector ~v such that there is a scalar λ satisfying

M~v “ λ~v.

The scalar λ is the eigenvalue associated to the eigenvector ~v.Note that only non-zero vectors are allowed to be eigenvectors. Recall

that M~0n “ ~0n, and so every possible scalar λ would be an eigenvalue if

Page 417: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 408

the zero vector is allowed to be an eigenvector. We will see that this is ahighly undesirable state of affairs. On the other hand, 0 is allowed to be aneigenvalue.

Lemma 8.6.1. Let M be a square matrix.

1) If ~v is an eigenvector of M , then there is a unique eigenvalue of Massociated to ~v.

2) If ~v1 and ~v2 are eigenvectors corresponding to the same eigenvalue λ,then α~v1`β~v2 is an eigenvector of M corresponding to the same eigen-value λ for any choice of scalars α and β (not both zero).

Proof: For 1), if ~v is an eigenvector of M , then there is a scalar eigenvalue λso that M~v “ λ~v. If there was another eigenvalue λ1 satisfying this equation,we would have

M~v “ λ~v “ λ1~v

pλ´ λ1q~v “ ~0.

Since ~v is not the zero vector (by the definition of eigenvector), we must haveλ “ λ1.

For 2), we compute

Mpα~v1 ` β~v2q “ αM~v1 ` βM~v2

“ αpλ~v1q ` βpλ~v2q

“ λpα~v1 ` β~v2q. �

Corollary 8.6.1.1. Let M be a square matrix with eigenvalue λ. Then thereis an infinite family of eigenvectors associated to λ.

Proof: Since λ is an eigenvalue, it must have a non-zero eigenvector ~v as-sociated to it. Let c be any non–zero scalar, then item 2) in the lemmaabove (with α “ c, β “ 0, and ~v2 “ ~0) shows that c~v is also an eigenvector.Since c is arbitrary (other than being non–zero), we have an infinite familyof eigenvectors associated to λ. �

Page 418: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 409

For a matrix with real entries, eigenvectors corresponding to real eigenval-ues have a particularly nice geometric interpretation. Recall that multiplyinga vector by a real scalar stretches or shrinks the vector (and possibly rotatesit by 180˝). So an eigenvector corresponding to a real eigenvalue lies alongthe same line determined by the original vector.

x

y

~v

M~v

Eigenvector with RealEigenvalue

x

y

~vM~v

Non–Eigenvector

Figure 8.6.1: Geometric Interpretation of Real Eigenvalues

Example 8.6.1. The matrix

Mθ “

cos θ ´ sin θsin θ cos θ

rotates vectors through the angle θ. If 0 ď θ ă 2π, and θ ‰ 0 or π, why doesMθ have no real eigenvalues?

Answer: First if θ “ 0,

M0 “

1 00 1

which is the identity matrix. So, every vector is an eigenvector with eigen-value 1: M0~v “ ~v. If θ “ π,

Mπ “

´1 00 ´1

.

Page 419: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 410

So, every vector is rotated by 180˝: Mπ~v “ ´~v. This means every vector isan eigenvector with eigenvalue ´1.

If θ is neither of these special values, then every vector ~v is rotated offof the line determined by ~v. Hence, no vector can be an eigenvector withreal eigenvalue. In fact, the eigenvalues of Mθ are precisely e˘iθ. When theeigenvalues are complex, the corresponding eigenvector will be complex aswell. �

Example 8.6.2. Verify that

~v “

»

121

fi

fl

is an eigenvector of the matrix

A “

»

2 0 2´1 3 30 0 4

fi

fl .

Answer:»

2 0 2´1 3 30 0 4

fi

fl

»

121

fi

fl “

»

2p1q ` 0p2q ` 2p1q´1p1q ` 3p2q ` 3p1q0p1q ` 0p2q ` 4p1q

fi

fl

»

484

fi

fl

“ 4

»

121

fi

fl

So, ~v is an eigenvector of A with eigenvalue λ “ 4. �Verifying that a given vector is an eigenvector of a particular matrix is

relatively easy. The question we need to answer is how to find the eigenvectorsfor a given matrix. It turns out that finding the eigenvalues is the first step.

Theorem 8.6.2 (Eigenvalues and the Characteristic Polynomial of a SquareMatrix). If M is an nˆ n matrix, the eigenvalues are given by the equation

det pM ´ λInq “ 0.

Page 420: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 411

The determinant in this equation yields a polynomial of degree n in the vari-able λ. Hence, a matrix has n eigenvalues (counting multiplicities) which arepossibly complex.

Partial Proof: Suppose that ~v is an eigenvector for matrix M with eigen-value λ. Then by definition, we have

M~v ´ λ~v “ ~0n.

We cannot simply “factor out” ~v since M is a matrix and λ is just a number.We can replace ~v by In~v, however.

M~v ´ λ~v “ ~0n

M~v ´ λIn~v “ ~0n

pM ´ λInq~v “ ~0n

The matrix M ´λIn is an nˆn matrix that sends ~v to ~0n. Since this matrixmust send ~0n to ~0n, and since ~v ‰ ~0n (eigenvectors are not allowed to be thezero vector), we must have two distinct vectors that are mapped to ~0n. Thismeans M ´ λIn cannot be invertible. The only way this can happen is if

det pM ´ λInq “ 0.

The fact that det pM ´ λInq is a polynomial will become apparent as wego through several examples. Ultimately, the proof comes down to the factthat taking determinants only involves products and sums of the entries of amatrix. However, we will omit the details here (c.f. [FIS03, Ch. 5]). �

Corollary 8.6.2.1. If M is a matrix with real entries, then complex eigen-values must come in complex conjugate pairs

λ “ α ˘ iβ

where α and β are real numbers.

Proof: If the entries ofM are real numbers, then the polynomial det pM ´ λInqwill have real coefficients. It is a standard fact that complex roots of realpolynomials must come in complex conjugate pairs. �

Example 8.6.3. Find the eigenvalues of the matrix

M “

1 43 2

.

Page 421: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 412

Answer:

M ´ λI2 “

1 43 2

´ λ

1 00 1

1 43 2

´

λ 00 λ

1´ λ 43 2´ λ

Notice that M ´ λIn is simply the matrix M with λ subtracted from allentries on the main diagonal. Taking the determinant of this matrix gives

det pM ´ λI2q “

ˇ

ˇ

ˇ

ˇ

1´ λ 43 2´ λ

ˇ

ˇ

ˇ

ˇ

“ p1´ λqp2´ λq ´ 4p3q

“ λ2´ 2λ´ λ` 2´ 12

“ λ2´ 3λ´ 10.

So, the characteristic polynomial of M is λ2´3λ´10 (a polynomial of degree2 as promised by the theorem). Setting this polynomial equal to zero givesus the eigenvalues of M .

λ2´ 3λ´ 10 “ 0

pλ` 2qpλ´ 5q “ 0

λ “ ´2 or 5.

So, the eigenvalues of M are precisely λ “ ´2 and λ “ 5. �

Example 8.6.4. Find the eigenvalues of the matrix

A “

´1 5´2 ´3

.

Answer:

det pA´ λI2q “

ˇ

ˇ

ˇ

ˇ

´1´ λ 5´2 ´3´ λ

ˇ

ˇ

ˇ

ˇ

“ p´1´ λqp´3´ λq ´ p5qp´2q

“ λ2` 3λ` λ` 3` 10

“ λ2` 4λ` 13

Page 422: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 413

Setting the characteristic polynomial of A equal to zero gives us

λ2` 4λ` 13 “ 0.

Since this does not factor easily, we complete the square (or use the quadraticformula).

λ2` 4λ “ ´13

λ2` 4λ` 4 “ ´13` 4

pλ` 2q2 “ ´9

λ` 2 “ ˘3i

λ “ ´2˘ 3i. �

Example 8.6.5. Find the eigenvalues of the matrix

B “

»

´4 4 ´2´9 9 ´5´6 6 ´4

fi

fl .

Answer:

det pB ´ λI3q “

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

´4´ λ 4 ´2´9 9´ λ ´5´6 6 ´4´ λ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

“ p´4´ λq ¨

ˇ

ˇ

ˇ

ˇ

9´ λ ´56 ´4´ λ

ˇ

ˇ

ˇ

ˇ

´ 4 ¨

ˇ

ˇ

ˇ

ˇ

´9 ´5´6 ´4´ λ

ˇ

ˇ

ˇ

ˇ

` p´2q ¨

ˇ

ˇ

ˇ

ˇ

´9 9´ λ´6 6

ˇ

ˇ

ˇ

ˇ

“ p´4´ λq

ˆ

p9´ λqp´4´ λq ´ p´5qp6q

˙

´ 4

ˆ

p´9qp´4´ λq ´ p´5qp´6q

˙

´ 2

ˆ

p´9qp6q ´ p9´ λqp´6q

˙

“ p´4´ λq`

λ2` 4λ´ 9λ´ 36` 30

˘

´ 4`

9λ` 36´ 30˘

´ 2`

´ 54` 54´ 6λ˘

“ p´4´ λq`

λ2´ 5λ´ 6

˘

´ 4`

9λ` 6˘

` 12λ

Page 423: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 414

“ ´λ3` 5λ2

` 6λ´ 4λ2` 20λ` 24´ 36λ´ 24` 12λ

“ ´λ3` λ2

` 2λ

Setting the characteristic polynomial equal to zero gives

´λ3` λ2

` 2λ “ 0

´λpλ2´ λ´ 2q “ 0

´λpλ´ 2qpλ` 1q “ 0.

So, the eigenvalues of B are λ “ ´1, 0, and 2. Remember, ~0n is not allowedto be an eigenvector, but 0 is allowed to be an eigenvalue. �

Now that we know how to find eigenvalues, we have to figure out how tofind the corresponding eigenvectors. We begin with the following theorem.

Theorem 8.6.3. Let M be a square matrix with eigenvalue λ0.

1) Suppose M has real entries. If λ0 is a real eigenvalue then it has anassociated eigenvector that is purely real.

2) Suppose M has real entries, and λ0 is a complex eigenvalue with asso-ciated eigenvector ~v0. Then λ0 is an eigenvalue of M with associatedeigenvector ~v0.

Proof: We begin with the following observation. If M is a real matrix, thenM (the matrix whose entries are the complex conjugates of the entries inM) is equal to M . If λ0 has an associated eigenvector ~v0, then M~v0 “ λ0~v0

implies that M~v0 “ λ0~v0. But,

M~v0 “M ~v0 “M ~v0,

λ0~v0 “ λ0 ~v0

(recall that ~v is the vector whose components are the complex conjugate ofthe components in ~v). So, we have shown that

M ~v0 “ λ0 ~v0.

This is enough to prove 2). We already know that for real matrices complexeigenvalues must come in conjugate pairs. The computation above shows thatif ~v0 is an eigenvector associated to a complex eigenvalue λ0, then ~v0 is aneigenvector associated to λ0. Incidentally, this also shows that eigenvectors

Page 424: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 415

of real matrices associated to complex eigenvalues must be complex–valued.Otherwise, ~v0 “ ~v0, and ~v0 would be associated to two different eigenvalues.

For 1), if λ0 is real, then we have

M ~v0 “ λ0 ~v0

which shows that ~v0 and ~v0 correspond to the same eigenvalue. In that case,

M`

~v0 ` ~v0

˘

“M~v0 `M~v0

“ λ0 ~v0 ` λ0 ~v0

“ λ0

`

~v0 ` ~v0

˘

.

So, ~v0 ` ~v0 is an eigenvector with the same eigenvalue λ0. But ~v0 ` ~v0 is areal vector. �

With the preliminaries out of the way, we now present the method offinding the family of eigenvectors associated to an eigenvalue.

Theorem 8.6.4. Let M be an n ˆ n matrix with eigenvalue λ0. Then theassociated family of eigenvectors can be found by row reducing the augmentedmatrix

M ´ λ0In

ˇ

ˇ

ˇ

ˇ

~0n

.

Proof: If ~v is an eigenvector associated to λ0, then we already know itsatisfies the matrix equation

pM ´ λ0Inq~v “ ~0n.

But this is equivalent to an n ˆ n system of equations, and so we can findthe solutions by row reducing the augmented matrix above. �

Remember, we are expecting an infinite family of eigenvectors. So, thereshould be an infinite number of solutions to the associated system of linearequations. This means we should get at least one row of all zeros duringthe row reduction process. If a row of all zeros does not appear, then eitherthe eigenvalue is incorrect, or there was an error during the row reductionprocess.

Example 8.6.6. Find the families of eigenvectors associated to each of theeigenvalues of the matrix in Example 8.6.3.

Page 425: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 416

Answer: We already know that the eigenvalues of M are λ “ ´2, 5. Webegin with λ “ ´2.

M ´ p´2qI2

ˇ

ˇ

ˇ

ˇ

~02

1´ p´2q 4 03 2´ p´2q 0

3 4 03 4 0

3 4 00 0 0

While this matrix is not in RREF, it is reduced enough to easily find the

family of eigenvectors. If we let ~v “

v1

v2

, then we must have

3v1 ` 4v2 “ 0.

Solving this for v1 gives v1 “ ´p4{3qv2 with v2 free. So, we can take

~v “

´p4{3qv2

v2

“ v2

´p4{3q1

as the family of eigenvectors associated to λ “ ´2. However, there is a betterway to write this family. If we take any basic solution to the equation forv1 and v2, then any multiple of that basic one will also be a solution. Thatmeans, any solution we pick (other than the trivial v1 “ 0 “ v2) will generatethe family of eigenvectors. So, we could have picked v1 “ 4 and v2 “ ´3.This gives us the equivalent form

~v “ c

4´3

for the family of eigenvectors associated to λ “ ´2.Repeating the process for λ “ 5 gives us

M ´ 5I2

ˇ

ˇ

ˇ

ˇ

~02

1´ 5 4 03 2´ 5 0

´4 4 03 ´3 0

1 ´1 01 ´1 0

1 ´1 00 0 0

.

Page 426: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 417

So, we need v1 ´ v2 “ 0 for these eigenvectors. Clearly, the simplest eigen-vector we can choose is v1 “ v2 “ 1. So,

~v “ c

11

is the family of eigenvectors associated to λ “ 5. �

Example 8.6.7. Find the families of eigenvectors associated to each of theeigenvalues of the matrix in Example 8.6.5.

Answer: We already know that the eigenvalues for B are λ “ ´1, 0, and 2.Beginning with λ “ ´1, we have

»

´4´ p´1q 4 ´2 0´9 9´ p´1q ´5 0´6 6 ´4´ p´1q 0

fi

fl “

»

´3 4 ´2 0´9 10 ´5 0´6 6 ´3 0

fi

fl

»

3 ´4 2 0´9 10 ´5 02 ´2 1 0

fi

fl

»

1 ´2 1 0´9 10 ´5 02 ´2 1 0

fi

fl

where in the first row reduction we performed ´R1 Ñ R1 and ´p1{3qR3 ÑR3. In the second row reduction, we did R1 ´ R3 Ñ R1. Next, we use the1 in the upper left corner to eliminate the entries below it: R2` 9R1 Ñ R2and R3´ 2R1 Ñ R3.

»

1 ´2 1 0´9 10 ´5 02 ´2 1 0

fi

fl „

»

1 ´2 1 00 ´8 4 00 2 ´1 0

fi

fl

»

1 ´2 1 00 2 ´1 00 2 ´1 0

fi

fl

»

1 ´2 1 00 2 ´1 00 0 0 0

fi

fl

»

1 0 0 00 2 ´1 00 0 0 0

fi

fl .

Page 427: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 418

The final steps above were ´p1{4qR2 Ñ R2, R3´R2 Ñ R3, and R1`R2 ÑR1. Even though this is not in RREF, we can easily read off the family of

eigenvectors from here. Letting ~v “

»

v1

v2

v3

fi

fl, the matrix above states

v1 “ 0

2v2 ´ v3 “ 0

v3 is free.

The simplest solution to this equation is v1 “ 0, v2 “ 1, and v3 “ 2. Thisgives us that

~v “ c

»

012

fi

fl

is the family of eigenvectors associated to λ “ ´1.For λ “ 0, we find

»

´4´ 0 4 ´2 0´9 9´ 0 ´5 0´6 6 ´4´ 0 0

fi

fl “

»

´4 4 ´2 0´9 9 ´5 0´6 6 ´4 0

fi

fl

»

1 ´1 0 00 0 1 00 0 0 0

fi

fl

(try the row reduction for yourself). So, we need

v1 ´ v2 “ 0

v3 “ 0

v2 is free.

Notice that v3 cannot be free in this system since it must be equal to 0. Thesimplest solution to this set of equations is v1 “ 1 “ v2 and v3 “ 0. Thismeans

~v “ c

»

110

fi

fl

is the family of eigenvectors associated to λ “ 0.

Page 428: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 419

For λ “ 2, we have

»

´4´ 2 4 ´2 0´9 9´ 2 ´5 0´6 6 ´4´ 2 0

fi

fl “

»

´6 4 ´2 0´9 7 ´5 0´6 6 ´6 0

fi

fl

»

1 0 ´1 00 1 ´2 00 0 0 0

fi

fl .

This tells us

v1 “ v3

v2 “ 2v3

v3 is free.

The simplest solution comes from choosing v3 “ 1. Hence,

~v “ c

»

121

fi

fl

is the family of eigenvectors associated to λ “ 2. �The process is no different for complex eigenvalues. Remember that for

real matrices, complex eigenvalues and eigenvectors come in conjugate pairs.

Example 8.6.8. Find the families of eigenvectors associated to each of theeigenvalues of the matrix in Example 8.6.4.

Answer: We have already calculated that A has eigenvaluesλ “ ´2˘ 3i. We only need to go through the row reduction process for oneof these eigenvalues. So, for λ “ ´2` 3i we have

´1´ p´2` 3iq 5 0´2 ´3´ p´2` 3iq 0

1´ 3i 5 0´2 ´1´ 3i 0

.

A step that often works in the case of complex eigenvalues is to multiplythe top row by the conjugate of the complex entry. In this case, we try

Page 429: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 420

p1` 3iqR1 Ñ R1.

1´ 3i 5 0´2 ´1´ 3i 0

p1´ 3iqp1` 3iq 5p1` 3iq 0p1` 3iq´2 ´1´ 3i 0

10 5p1` 3iq 02 1` 3i 0

2 1` 3i 02 1` 3i 0

2 1` 3i 00 0 0

.

So, we have

2v1 “ ´p1` 3iqv2

v2 is free.

There are many choices we could make, but v1 “ 1 ` 3i and v2 “ ´2 is aparticularly simple choice. So,

~v “ c

1` 3i´2

is the family of eigenvectors associated to λ “ ´2` 3i.We do not need to repeat these calculations for the other eigenvalue.

Taking conjugates, we have

~v “ c

1´ 3i´2

is the family of eigenvectors associated to λ “ ´2´ 3i. �So far, we have only considered the case when all of the eigenvalues are

distinct. The algebraic multiplicity of an eigenvalue of matrix M is itsmultiplicity as a root of the characteristic polynomial of the matrix M .

Example 8.6.9. Find the eigenvalues and eigenvectors for

M “

»

3 0 ´1´1 4 ´1´1 0 3

fi

fl .

Page 430: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 421

Answer: We begin by finding eigenvalues.ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

3´ λ 0 ´1´1 4´ λ ´1´1 0 3´ λ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

“ p3´ λq ¨

ˇ

ˇ

ˇ

ˇ

4´ λ ´10 3´ λ

ˇ

ˇ

ˇ

ˇ

` p´1q

ˇ

ˇ

ˇ

ˇ

´1 4´ λ´1 0

ˇ

ˇ

ˇ

ˇ

“ p3´ λqp4´ λqp3´ λq ´ p4´ λq

“ p4´ λq`

p3´ λq2 ´ 1˘

“ p4´ λqpλ2´ 6λ` 8q

“ ´pλ´ 2qpλ´ 4q2

So, the eigenvalues of M are λ “ 2, 4, and 4. So, 2 is an eigenvalue ofalgebraic multiplicity 1 and 4 is an eigenvalue of algebraic multiplicity 2.

For λ “ 2, the procedure is no different than before.»

3´ 2 0 ´1 0´1 4´ 2 ´1 0´1 0 3´ 2 0

fi

fl “

»

1 0 ´1 0´1 2 ´1 0´1 0 1 0

fi

fl

»

1 0 ´1 00 1 ´1 00 0 0 0

fi

fl

So,

~v “ c

»

111

fi

fl

is the family of eigenvectors associated to λ “ 2.For λ “ 4, we find

»

3´ 4 0 ´1 0´1 4´ 4 ´1 0´1 0 3´ 4 0

fi

fl “

»

´1 0 ´1 0´1 0 ´1 0´1 0 ´1 0

fi

fl

»

1 0 1 00 0 0 00 0 0 0

fi

fl .

The two rows of zeros indicate that there are two free variables.

v1 “ ´v3

v2 is free

v3 is free.

Page 431: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 422

This indicates that there are two linearly independent families of eigenvectors.The easiest way to proceed here is to choose one of the free variables to be1 and the other to be 0. Then choose the variables the other way. Choosingv2 “ 1 and v3 “ 0 gives the family

c1

»

010

fi

fl .

The other choice, v2 “ 0 and v3 “ 1 gives

c2

»

´101

fi

fl .

This means there is a “doubly infinite” family of eigenvectors for λ “ 4:

~v “ c1

»

010

fi

fl` c2

»

´101

fi

fl .

Notice that these two vectors are linearly independent (since neither is amultiple of the other). �

To make rigorous sense of what we just did, we need to introduce thenotion of a basis. Essentially, a set of non-zero vectors forms a basis for afamily of vectors if the set is linearly independent and every vector in thefamily can be expressed as a combination of the vectors in the family.3 So inthe previous example, the set of vectors

$

&

%

»

010

fi

fl ,

»

´101

fi

fl

,

.

-

is a basis for the family of eigenvectors associated to the eigenvalue λ “ 4.Clearly these vectors are linearly independent, and our work showed thatevery eigenvector in the family is a combination of these two.

3Technically, we should be using the more rigorous term vector space instead of “fam-ily.” The exact definition of a vector space will not concern us much here. Also note thatthe number of vectors in a basis is the dimension of the vector space.

Page 432: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 423

In the previous example, λ “ 4 had algebraic multiplicity 2 (i.e. 4 wastwo of the roots of the characteristic polynomial) and we found two linearlyindependent eigenvectors corresponding to it. Unfortunately, this does notalways happen. All we are guaranteed is the following theorem (whose proofcan be found in [FIS03, p. 264]).

Theorem 8.6.5. If a square matrix M has an eigenvalue λ of multiplicitym, then M has between 1 and m linearly independent families of eigenvectorscorresponding to λ.

The number of linearly independent families of eigenvectors associated toan eigenvalue is called the geometric multiplicity of the eigenvalue. Interms of the two different kinds of multiplicities, we have

1 ď geometric multiplicy of λ ď algebraic multiplicy of λ.

So, we are only guaranteed a single family of eigenvectors for any giveneigenvalue (no matter how large its multiplicity). At the other extreme, therecan be no more independent families than the algebraic multiplicity of theeigenvalue.

Example 8.6.10. Find the eigenvalues and eigenvectors for

A “

»

3 0 ´11 4 ´3´1 0 3

fi

fl .

Answer: It turns out that this matrix has the same set of eigenvalues as theprevious matrix.ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

3´ λ 0 ´11 4´ λ ´3´1 0 3´ λ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

“ p3´ λq ¨

ˇ

ˇ

ˇ

ˇ

4´ λ ´30 3´ λ

ˇ

ˇ

ˇ

ˇ

` p´1q ¨

ˇ

ˇ

ˇ

ˇ

1 4´ λ´1 0

ˇ

ˇ

ˇ

ˇ

“ ´pλ´ 2qpλ´ 4q2

Again, λ “ 2 has algebraic multiplicity 1 while λ “ 4 has algebraic multiplic-ity 2. We know that there can be only a single eigenvector family associatedto λ “ 2 (i.e. it must also have geometric multiplicity 1). Row reductiononce again gives

~v “ c

»

111

fi

fl

Page 433: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 424

is the family of eigenvectors associated to λ “ 2.When we attempt to find the eigenvectors associated to λ “ 4, we find

»

3´ 4 0 ´1 01 4´ 4 ´3 0´1 0 3´ 4 0

fi

fl “

»

´1 0 ´1 01 0 ´3 0´1 0 ´1 0

fi

fl

»

1 0 0 00 0 1 00 0 0 0

fi

fl .

This gives us v1 “ 0, v3 “ 0, and v2 is free, and we only get a single infinitefamily of eigenvectors associated to λ “ 4. So,

~v “ c

»

010

fi

fl

is the entire family of eigenvectors associated to λ “ 4. This means that thegeometric multiplicity of the eigenvalue λ “ 4 is 1 even though its algebraicmultiplicity is 2. �

If the geometric multiplicity of an eigenvalue is strictly smaller than itsalgebraic multiplicity, we say that the eigenvalue has a deficiency. In otherwords, an eigenvalue has a deficiency if it has fewer linearly independentfamilies of eigenvectors than the number of times it appears as a root of thecharacteristic polynomial.

8.7 Transposition and Eigenvalues

The transpose of a matrix M is the matrix MT whose entries are given by

rMTsij “ rM sji.

In words, the matrix MT is obtained from M by interchanging rows andcolumns.

Example 8.7.1. Find the transpose of the following matrices.

a) M1 “

»

1 20 31 5

fi

fl

Page 434: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 425

b) M2 “

2 14´7 ´3

c) M3 ““

1 2 3 4‰

Answer:

a) MT1 “

1 0 12 3 5

b) MT2 “

2 ´714 ´3

c) MT3 “

»

1234

fi

ffi

ffi

fl

Notice that if M is a mˆn matrix, MT is a nˆm matrix. In particular, thetranspose of a square matrix is another square matrix of the same size. �

The transpose has many nice properties and uses that we do not explorein this book. For later chapters, we are most interested in how the eigenvaluesof a square matrix relate to the eigenvalues of its transpose. Before tacklingthat question, we need some basic properties of transposition. The proof ofthe lemma below is omitted, but see any text on linear algebra for details(for instance, [FIS03]).

Lemma 8.7.1. Let M and N be two matrices whose sizes are appropriatefor the operations below, let c be a scalar, and let n be a positive integer.Then the transpose has the following properties.

a)`

MT˘T“M

b) pcMqT “ cMT

c) pM `NqT “MT`NT

d) pMNqT “ NTMT

e) pMnqT“`

MT˘n

f) det`

MT˘

“ detpMq

Page 435: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 426

Using these properties, we can prove the only major result we need abouttransposes.

Theorem 8.7.2. Let M be a square matrix. Then the eigenvalues of MT

are the same as the eigenvalues of M .

Proof: For the n ˆ n identity matrix, we clearly have ITn “ In. Look-ing at the characteristic polynomial for MT and using the properties of thetranspose given above, we find

det`

MT´ λIn

˘

“ det´

MT´ pλInq

“ det´

pM ´ λInqT¯

“ det pM ´ λInq .

So, the characteristic polynomial of MT is exactly the same as the character-istic polynomial of M . As a result, the eigenvalues of MT must be the sameas those of M . Note that the eigenvectors for M and MT corresponding tothe same eigenvalue are typically different! �

8.8 Diagonalization

It turns out that every square matrix is “closely related” to one of a collectionof relatively simple matrices. We will only pursue the simplest possible caseof diagonalizable matrices. Before we can explore this concept, we have tospecify what “closely related” means. Two nˆn matrices, A and B, are saidto be similar if there is an invertible nˆ n matrix M such that

A “MBM´1.

Similarity has several nice properties. We will begin with the followingtheorem.

Theorem 8.8.1. Similarity is an equivalence relation. This means it hasthe following three properties.

� Similarity is reflexive: A is similar to itself.

Page 436: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 427

� Similarity is symmetric: If A is similar to B, then B is similar toA.

� Similarity is transitive: If A is similar to B, and B is similar toC, then A is similar to C.

Proof: Let A, B, and C be nˆ n matrices. For reflexivity, we note that Inis invertible and pInq

´1 “ In. Since

A “ InAIn “ InApInq´1,

we see that A is similar to itself.For symmetry, assume A is similar to B. So, A “ MBM´1 for some

invertible matrix M . But then

M´1AM “M´1MBM´1M “ InBIn “ B.

Since pM´1q´1 “ M , this means B “ M´1ApM´1q´1 and so B is similar toA.

For transitivity, assume A is similar to be B (say, A “ M1BM´11 ), and

B is similar to C (say, B “M2CM´12 ). This means

A “M1BM´11

“M1M2CM´12 M´1

1

“ pM1M2qCpM1M2q´1.

This means A is similar to C. �Our less–than–precise statement above now becomes: every matrix is

similar to one of a family of relatively simple matrices. This is still notterribly rigorous since we have not specified the family of matrices. Thegeneral description is outside the scope of this book, so we will make do withthe simplest type of matrix in this special class.

An nˆ n matrix D is a diagonal matrix if its only non-zero entries lieon the main diagonal.

D “

»

d1 0 0 ¨ ¨ ¨ 00 d2 0 ¨ ¨ ¨ 00 0 d3 ¨ ¨ ¨ 0...

......

......

0 0 0 ¨ ¨ ¨ dn

fi

ffi

ffi

ffi

ffi

ffi

fl

Page 437: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 428

Diagonal matrices have many nice properties. The following theorem(whose proof is quite simple and left to the reader) collects the most impor-tant ones.

Theorem 8.8.2. Let D be a diagonal matrix.

1) If all of the diagonal entries of D are non-zero, then D is invertibleand

D´1“

»

1d1

0 0 ¨ ¨ ¨ 0

0 1d2

0 ¨ ¨ ¨ 0

0 0 1d3

¨ ¨ ¨ 0...

......

......

0 0 0 ¨ ¨ ¨ 1dn

fi

ffi

ffi

ffi

ffi

ffi

fl

.

2) The determinant of D is the product of the diagonal entries:

detpDq “ d1 ¨ d2 ¨ ¨ ¨ dn.

3) The eigenvalues of D are precisely the diagonal entries of D. Thegeometric multiplicity of each eigenvalue exactly equals its algebraicmultiplicity. So, no eigenvalue has a deficiency.

4) If m is a positive integer, then

Dm“

»

dm1 0 0 ¨ ¨ ¨ 00 dm2 0 ¨ ¨ ¨ 00 0 dm3 ¨ ¨ ¨ 0...

......

......

0 0 0 ¨ ¨ ¨ dmn

fi

ffi

ffi

ffi

ffi

ffi

fl

With the preliminaries out of the way, we are ready for the main definitionand theorem of this section. An n ˆ n matrix is said to be diagonalizableif it is similar to a diagonal matrix.

Theorem 8.8.3. A square matrix is diagonalizable if and only if the algebraicmultiplicity of each eigenvalue equals its geometric multiplicity. If A is adiagonalizable matrix with eigenvalues λi and associated eigenvectors ~vi, then

A “MDM´1

Page 438: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 429

where

D “

»

λ1 0 0 ¨ ¨ ¨ 00 λ2 0 ¨ ¨ ¨ 00 0 λ3 ¨ ¨ ¨ 0...

......

......

0 0 0 ¨ ¨ ¨ λn

fi

ffi

ffi

ffi

ffi

ffi

fl

,

and M “ r~v1 ~v2 ~v3 ¨ ¨ ¨ ~vns is the matrix whose columns are eigenvectorslisted in the same order as their corresponding eigenvalues in D.

We will not prove this theorem here, but [FIS03, p. 268] has all of the details.

Corollary 8.8.3.1. If a square matrix A has distinct eigenvalues (i.e. everyeigenvalue has algebraic multiplicity 1), then A is diagonalizable.

Proof: The geometric multiplicity of an eigenvalue must be at least one, andthe algebraic multiplicity is assumed to be equal to one. Then, the algebraicand geometric multiplicities must be equal for each eigenvalue (both have tobe 1). By the theorem above, the matrix must be diagonalizable. �

Example 8.8.1. Determine if the matrix in Example 8.6.3 is diagonalizable.If so, find an invertible matrix B and a diagonal matrix D such that the givenmatrix is equal to BDB´1.

Answer: We have already shown that

M “

1 43 2

has eigenvalues λ1 “ ´2 and λ2 “ 5 with corresponding eigenvectors

~v1 “

4´3

and ~v2 “

11

.

This means we can take

B “

4 1´3 1

and D “

´2 00 5

.

So,„

1 43 2

4 1´3 1

´2 00 5

4 1´3 1

´1

. �

Of course, the big question is why we should care about such a decom-position. There are many useful applications, but the following result is animportant one.

Page 439: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 430

Theorem 8.8.4. If a matrix M can be decomposed as

M “ BDB´1,

then for any positive integer n

Mn“ BDnB´1.

Proof: For M2, we have

M2“`

BDB´1˘ `

BDB´1˘

“ BD`

B´1B˘

DB´1

“ BDInDB´1

“ BD2B´1.

Now suppose we know the result is true for n´1 (i.e. Mn´1 “ BDn´1B´1),then

Mn“MMn´1

“`

BDB´1˘ `

BDn´1B´1˘

“ BD`

B´1B˘

Dn´1B´1

“ BDInDn´1B´1

“ BDnB´1. �

If we just need M2, then this method is probably not very efficient. Ifyou need M100, however, then having a diagonalization will probably saveyou quite a lot of computing time.

Example 8.8.2. Determine if the matrix in Example 8.6.5 is diagonalizable.If so, find an invertible matrix M and a diagonal matrix D such that the givenmatrix is equal to MDM´1. Use this decomposition to find B5.

Proof: We already know that the eigenvalues for B are λ1 “ ´1, λ2 “ 0,and λ3 “ 2 with corresponding eigenvectors

~v1 “

»

012

fi

fl , ~v2 “

»

110

fi

fl , and ~v3 “

»

121

fi

fl .

Page 440: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 431

If we take

M “

»

0 1 11 1 22 0 1

fi

fl and D “

»

´1 0 00 0 00 0 2

fi

fl ,

then we have

»

´4 4 ´2´9 9 ´5´6 6 ´4

fi

fl “

»

0 1 11 1 22 0 1

fi

fl

»

´1 0 00 0 00 0 2

fi

fl

»

0 1 11 1 22 0 1

fi

fl

´1

.

Per the theorem, we know that

B5“

»

´4 4 ´2´9 9 ´5´6 6 ´4

fi

fl

5

»

0 1 11 1 22 0 1

fi

fl

»

´1 0 00 0 00 0 2

fi

fl

5 »

0 1 11 1 22 0 1

fi

fl

´1

»

0 1 11 1 22 0 1

fi

fl

»

p´1q5 0 00 05 00 0 25

fi

fl

»

0 1 11 1 22 0 1

fi

fl

´1

»

0 1 11 1 22 0 1

fi

fl

»

´1 0 00 0 00 0 32

fi

fl

»

0 1 11 1 22 0 1

fi

fl

´1

»

´64 64 ´32´129 129 ´65´66 66 ´34

fi

fl . �

In the previous example, we omitted the computation of the inverse ma-trix which is another computational cost of this method. So whether B5

can be computed faster by diagonalization is not completely clear. How-ever, at some point the diagonalization procedure will become faster. Thisis especially true if we need to compute more than one power of a particularmatrix.

Finally, note that the matrix in Example 8.6.10 is not diagonalizable. Thisis because the eigenvalue λ “ 4 has algebraic multiplicity 2 but geometric

Page 441: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 432

multiplicity 1. Since the matrix has a deficiency, it cannot be diagonalized.It turns out that there is a rather nice form that every matrix is similarto (known as the Jordan Canonical Form), but this form is not a diagonalmatrix in general.

8.9 Problems

8.9.1 Systems of Linear Equations

For the following systems of linear equations, write each system as an aug-mented matrix, reduce the matrix to RREF, and use the reduced matrix togive the solutions to the system.

1.)

2x´ y “ 7

3x` 2y “ 0

2.)

x` 2y ` z “ 16

x` 3y ´ z “ 22

2x` 5y “ 2

3.)

x` y ` 3z “ 10

x` 2y ` z “ 16

2x` 3y ` 4z “ 26

4.)

x` y ` z “ 0

2x´ 2y ` z “ 11

3x` y ´ 2z “ 1

Page 442: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 433

5.)

x´ 2y ` 3z “ 4

2x` y ` z “ 8

3x` 4y ´ 5z “ 8

6.)

2x` 3y ´ z “ 7

3x` y ` 2z “ ´7

5x` 4y ` 2z “ ´4

7.)

x` y ` 5w “ 3

x` 2y ´ z ` 8w “ 4

2x` 3y ´ z ` 13w “ 7

x` 2y ´ z ` 8w “ 4

8.9.2 Basics of Vectors and Matrices

8.) Compute the following quantities for the vectors

~v1 “

3´2

and ~v2 “

54

.

a) 2~v1

b) ´3~v2

c) 2~v1 ` 3~v2

d) 3~v1 ´ 2~v2

e) |~v1| and |~v2|

9.) Compute the following quantities for the vectors

~v1 “

»

1´32

fi

fl and ~v2 “

»

42´7

fi

fl .

Page 443: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 434

a) 3~v1

b) ´12~v2

c) 3~v1 ` 2~v2

d) ~v2 ´ 4~v1

e) |~v1| and |~v2|

10.) Determine if the following set of vectors in linearly dependent or inde-pendent. If the vectors are linearly dependent, find a combination ofthem that sums to the zero vector.

$

&

%

»

10´2

fi

fl ,

»

111

fi

fl ,

»

2´31

fi

fl

,

.

-

11.) Determine if the following set of vectors in linearly dependent or inde-pendent. If the vectors are linearly dependent, find a combination ofthem that sums to the zero vector.

$

&

%

»

12´3

fi

fl ,

»

´245

fi

fl ,

»

118´5

fi

fl

,

.

-

Problems 12.) and 13.) refer to the following matrices.

A “

2 2 31 ´3 4

, B “

1 ´1 20 5 7

, C “

»

´2 0 15 2 ´3´1 ´1 ´1

fi

fl ,

D “

1 ´4´2 5

If the given quantity exists, compute it. If it does not, give a reason why not.

12.) a) 2A

b) ´3C

c) C ` 2D

d) 2A´ 3B

Page 444: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 435

13.) a) AB

b) AC

c) DA

d) D2

e) C2

8.9.3 Inverse Matrices and Determinants

14.) Find the determinants of the following matrices.

a)

1 ´32 5

b)

»

1 ´2 ´34 ´1 0´3 ´1 1

fi

fl

c)

»

1 2 ´32 1 11 ´1 4

fi

fl d)

»

1 ´2 0 00 0 1 ´11 1 1 21 ´3 2 ´1

fi

ffi

ffi

fl

15.) Determine whether the following matrices are invertible. If so, find theinverse matrix.

a)

2 4´1 6

b)

»

1 ´2 22 ´1 01 1 ´1

fi

fl

c)

»

1 2 10 1 14 0 ´1

fi

fl d)

»

1 0 1 21 1 2 10 0 1 01 ´1 5 3

fi

ffi

ffi

fl

16.) Solve the following systems of linear equations by translating them intomatrix form and finding the inverse of the resulting square matrix.

a)

2x` y “ 1

x´ 3y “ 11

Page 445: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 8. A PRIMER ON MATRICES AND VECTORS 436

b)

x` 2y ` z “ 3

2x` 3y ` z “ 2

´x` 5y ´ 2z “ 1

8.9.4 Eigenvalues and Eigenvectors

17.) – 20.) Find all eigenvalues and eigenvectors for the following 2ˆ 2 matrices.

17.)

5 ´63 ´4

18.)

´1 13 1

19.)

4 ´21 2

20.)

7 ´131 1

21.) – 24.) Find all eigenvalues and eigenvectors for the following 3ˆ 3 matrices.

21.)

»

3 ´2 ´35 ´4 ´52 ´2 ´2

fi

fl 22.)

»

3 1 ´11 3 ´11 1 1

fi

fl

23.)

»

1 ´1 ´20 2 01 ´4 ´1

fi

fl 24.)

»

´10 ´6 286 5 ´19´2 ´1 5

fi

fl

25.), 26.) Find all eigenvalues and eigenvectors for the following 4 ˆ 4 matrices.

25.q

»

1 0 0 00 ´1 0 10 0 1 00 1 0 ´1

fi

ffi

ffi

fl 26.q

»

´1 4 ´2 ´4´2 2 2 1´2 ´1 ´1 10 3 0 0

fi

ffi

ffi

fl

8.9.5 Diagonalization

For the matrices in problems 17.) – 26.), determine which are diagonalizable.For the ones that are, find an invertible matrix M and a diagonal matrix Dsuch that the given matrix is equal to MDM´1. Use this decomposition tofind the fifth power of these matrices.

Page 446: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Chapter 9

Analysis of Linear Systems

In Chapter 5, we studied systems of autonomous differential equations froma purely qualitative point of view. While we found the equilibria exactly,the determination of whether a particular equilibrium was stable or unstablewas handled in a rather haphazard way. Now that we have matrix techniquesat our disposal, we can study these systems more precisely. The key to un-derstanding the behavior of equilibria in systems of autonomous differentialequations is to first understand the solutions to linear systems of differentialequations.

9.1 Linear Systems of Differential Equations

A linear system of first–order differential equations is a set of differ-ential equations for n unknown functions x1ptq, x2ptq, . . . xnptq of the form

x11ptq “ m11x1ptq `m12x2ptq `m13x3ptq ` ¨ ¨ ¨ `m1nxnptq ` b1ptq

x12ptq “ m21x1ptq `m22x2ptq `m23x3ptq ` ¨ ¨ ¨ `m2nxnptq ` b2ptq

x13ptq “ m31x1ptq `m32x2ptq `m33x3ptq ` ¨ ¨ ¨ `m3nxnptq ` b3ptq

...

x1nptq “ mn1x1ptq `mn2x2ptq `mn3x3ptq ` ¨ ¨ ¨ `mnnxnptq ` bnptq

where the quantities mij and bi are given. If the functions biptq are all zero,then the system is said to be homogeneous ; otherwise, it is inhomogeneous.Throughout this chapter, we will assume that the coefficients mij are real

437

Page 447: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 438

numbers.1 As is readily apparent from the setup of the problem, we canre-express this system using matrices.

We begin by collecting the unknown function xiptq into a single vector–valued function ~xptq:

~xptq “

»

x1ptqx2ptqx3ptq

...xnptq

fi

ffi

ffi

ffi

ffi

ffi

fl

and ~x 1ptq “

»

x11ptqx12ptqx13ptq

...x1nptq

fi

ffi

ffi

ffi

ffi

ffi

fl

.

The inhomogeneous terms biptq can be collected into a similar vector function:

~bptq “

»

b1ptqb2ptqb3ptq

...bnptq

fi

ffi

ffi

ffi

ffi

ffi

fl

.

Finally, the coefficients mij can be collected into a square matrix M :

M “

»

m11 m12 m13 ¨ ¨ ¨ m1n

m21 m22 m23 ¨ ¨ ¨ m2n

m31 m32 m33 ¨ ¨ ¨ m3n...

......

. . ....

mn1 mn2 mn3 ¨ ¨ ¨ mnn

fi

ffi

ffi

ffi

ffi

ffi

fl

.

This allows us to write the system of differential equations in the far morecompact vector form or matrix form:

~x 1ptq “M~xptq `~bptq.

As we will see, solving these systems relies heavily on computing the eigen-values and eigenvectors of M .

Example 9.1.1. Rewrite the system of differential equations below in matrixform.

x1ptq “ xptq ´ 2yptq ` 2t` 1

y1ptq “ ´2xptq ` yptq ` t2

1Allowing the coefficients to be functions of t (i.e. mij “ mijptq) would still give us alinear system, but such systems are far more difficult to solve in general.

Page 448: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 439

Answer: Notice that this is a 2ˆ 2 inhomogeneous system. We have

~xptq “

xptqyptq

,~bptq “

2t` 1t2

, and M “

1 ´2´2 1

.

This allows us to write„

x1ptqy1ptq

1 ´2´2 1

xptqyptq

`

2t` 1t2

. �

Example 9.1.2. Rewrite the system of differential equations below in matrixform.

x1 “ 3x´ z

y1 “ x` 2y ´ z

z1 “ ´x` 3z

Answer: Notice that this is a 3ˆ 3 homogeneous system. We have

~x “

»

xyz

fi

fl and M “

»

3 0 11 2 ´1´1 0 3

fi

fl .

This allows us to write»

x1

y1

z1

fi

fl “

»

3 0 11 2 ´1´1 0 3

fi

fl

»

xyz

fi

fl . �

As with single first–order differential equations, an initial condition is alsorequired to specify a unique answer. Since we have n unknown functions, weneed initial data for each of the functions. Since such data is often given att “ 0, a typical initial condition would be of the form

~xp0q “

»

x1p0qx2p0qx3p0q

...xnp0q

fi

ffi

ffi

ffi

ffi

ffi

fl

»

a1

a2

a3...an

fi

ffi

ffi

ffi

ffi

ffi

fl

Page 449: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 440

where the ai are given real numbers.The solution to a linear system of differential equations is any particular

set of functions xiptq such that when substituted into the correct places ineach of the differential equations yields a true statement.

Example 9.1.3. Verify that the functions xptq “ ´e´t ` e3t ` 1 andyptq “ ´e´t ´ e3t ` 2 give a solution to the initial value problem

x1 “ x´ 2y ` 3

y1 “ ´2x` y

xp0q “ 1

yp0q “ 0.

Answer: Clearly xp0q “ ´1` 1` 1 “ 1 and yp0q “ ´1´ 1` 2 “ 0. For thefirst differential equation, we find

x1ptq “ e´t ` 3e3t,

xptq ´ 2yptq ` 3 “ p´e´t ` e3t` 1q ´ 2p´e´t ´ e3t

` 2q ` 3

“ e´t ` 3e3t.

Since both sides yield the same quantity, the two given functions satisfy thefirst differential equation. For the second,

y1ptq “ e´t ´ 3e3t,

´2xptq ` yptq “ ´2p´e´t ` e3t` 1q ` p´e´t ´ e3t

` 2q

“ e´t ´ 3e3t.

Since the given functions satisfy both differential equations and the initialconditions, they are a solution to the given initial value problem. �

Of course, the biggest question we need to answer is whether or not a givensystem of differential equations even has a solution and if it does whetherthat solution is unique. The following result addresses these issues.

Theorem 9.1.1 (Existence and Uniqueness). The initial value problem

~x 1ptq “M~xptq `~bptq

~xpt0q “ ~x0

Page 450: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 441

is guaranteed to have a unique solution for some interval containing the ini-tial time t0 provided that the functions b1ptq, ¨ ¨ ¨ , bnptq comprising ~bptq arecontinuous in some open interval containing the initial time t0.

The proof of this result is well beyond the scope of this text, but most anytext on dynamical systems should discuss it (c.f. [Ro95][Chpts. 4 and 5]).

In fact, the requirement that ~bptq be continuous in some interval containingt0 is a bit stronger than what is strictly necessary. However, this result willmore than suffice for the examples we consider.

9.1.1 Homogeneous Systems with Real Eigenvalues

In this section, we consider linear systems of the form ~x 1ptq “M~xptq whereM is a matrix of constant coefficients. The first result we consider is thefollowing lemma.

Lemma 9.1.2. Suppose that the matrix M has eigenvalue λ with correspond-ing eigenvector ~v. Then the function ~xptq “ ceλt~v is a solution to the systemof differential equations

~x 1ptq “M~xptq

for any constant scalar c.

Proof: Recall that ~v being an eigenvector of matrix M with eigenvalue λmeans M~v “ λ~v. On the one hand, we have

~x 1ptq “d

dt

`

ceλt~v˘

“ λceλt~v

since c and ~v are constant. On the other hand,

M~xptq “M`

ceλt~v˘

“ ceλtpM~vq

“ ceλtλ~v

“ λceλt~v

since ceλt is a scalar quantity (and matrices only act on vectors). �

This lemma immediately leads us to the following theorem.

Page 451: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 442

Theorem 9.1.3 (General Solution to Diagonalizable Homogeneous Sys-tems). Suppose that no eigenvalue of the nˆ n matrix M is deficient. Thenthe general solution to ~x 1ptq “M~xptq is of the form

~xptq “ c1eλ1t~v1 ` c2e

λ2t~v2 ` ¨ ¨ ¨ cneλnt~vn

where λi are the eigenvalues of M , ~vi the corresponding eigenvectors, and theci are arbitrary coefficients.

Recall that an eigenvalue is said to have a deficiency if its algebraic mul-tiplicity is strictly larger than its geometric multiplicity. In other words, aneigenvalue is deficient if it has fewer linearly independent eigenvectors thanits multiplicity as a root of the characteristic polynomial. Also rememberthat every eigenvalue must have at least one eigenvector associated to it!

Example 9.1.4. Find the general solution to the following system of differ-ential equations.

x1 “ x´ 2y

y1 “ ´2x` y

Answer: If we define ~xptq “

xptqyptq

, the system is given by

~x 1ptq “

1 ´2´2 1

~xptq

in matrix form. The characteristic polynomial for this matrix is

ˇ

ˇ

ˇ

ˇ

1´ λ ´2´2 1´ λ

ˇ

ˇ

ˇ

ˇ

“ p1´ λq2 ´ 4

which gives eigenvalues

p1´ λq2 ´ 4 “ 0

p1´ λq2 “ 4

1´ λ “ ˘2

λ “ 1˘ 2 “ ´1, 3.

Page 452: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 443

For λ “ ´1, we find by row reduction

1´ p´1q ´2 0´2 1´ p´1q 0

2 ´2 0´2 2 0

1 ´1 00 0 0

.

If we represent the eigenvector as ~v1 “

v1

v2

, then the row reduced matrix

above tells us that we must have v1 “ v2. So, we can take ~v1 “

11

as a

basis eigenvector for λ “ ´1.For λ “ 3, we find

1´ p3q ´2 0´2 1´ p3q 0

´2 ´2 0´2 ´2 0

1 1 00 0 0

.

Taking v1 and v2 for the components of the second eigenvector, we must have

v1 “ ´v2. So, we can take ~v2 “

1´1

as a basis eigenvector for λ “ 3.

Putting these result together gives

~xptq “ c1e´t

11

` c2e3t

1´1

.

Since the original problem was stated in component form, we ought to expressthe final answer the same way. In our definition of ~xptq, the top componentof the vector gives xptq while the bottom component is yptq. Reading thesefrom the vector form above gives

xptq “ c1e´t` c2e

3t

yptq “ c1e´t´ c2e

3t. �

A word of caution: When we studied single differential equations inChapter 4, we often absorbed numerical coefficients into the unknown coef-ficient in the general solution (i.e. replacing 2C by C or ´C by C). Thiswas perfectly acceptable in that setting so long as the unknown coefficient

Page 453: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 444

appeared only once in the solution. For systems of differential equations, thecoefficients ci appear in multiple components of the solution. As such, youshould not make changes to any single instance of an arbitrary coefficientwithout making the exact same change to all other instances of it. As anexample, you should not absorb the negative sign on c2 in the right–hand–side of yptq. If you do replace ´c2 by c2 in yptq, you would need to make theexact same change in xptq (and so a negative sign would appear there).

Example 9.1.5. Find the general solution to the following system of lineardifferential equations.

~x 1 “

»

5 1 ´21 5 ´2´1 ´1 6

fi

fl ~x.

Answer: For eigenvalues, we have

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

5´ λ 1 ´21 5´ λ ´2´1 ´1 6´ λ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

“ ´λ3` 16λ2

´ 80λ` 128

“ ´pλ´ 4q2pλ´ 8q “ 0.

We see that λ1 “ 4 has algebraic multiplicity 2. For eigenvectors, we find

»

5´ 4 1 ´2 01 5´ 4 ´2 0´1 ´1 6´ 4 0

fi

fl “

»

1 1 ´2 01 1 ´2 0´1 ´1 2 0

fi

fl

»

1 1 ´2 00 0 0 00 0 0 0

fi

fl .

The two rows of zeros tell us that there are two linearly independent familiesof eigenvectors, and the geometric multiplicity of λ1 “ 4 is also 2. Since weneed v1 ` v2 ´ 2v3 “ 0, we can take

~v1 “

»

1´10

fi

fl and ~v2 “

»

201

fi

fl

Page 454: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 445

as our independent basis eigenvectors. The other eigenvalue λ2 “ 8 hasmultiplicity 1, and we leave it to the reader to find

~v3 “

»

11´1

fi

fl .

This gives us the general solution

~xptq “ c1e4t

»

1´10

fi

fl` c2e4t

»

201

fi

fl` c3e8t

»

11´1

fi

fl . �

9.1.2 Homogeneous Systems with Complex Eigenval-ues

Recall that if a real matrix has a complex eigenvalue a` bi with eigenvector~v, then the complex conjugate a ´ bi must also be an eigenvalue with cor-responding eigenvector ~v (the vector whose components are the conjugate ofthe components of ~v). Just as with real eigenvalues, this means that

c1epa`biqt~v ` c2e

pa´biqt~v

is part of the general solution. The problem with this form of the solutionis that we expect real-values solutions if our initial data consists of all realnumbers. Fortunately, we can convert this complex form of the solution intoan equivalent real form. The key to accomplishing this transformation isusing Euler’s Formula:

ex`iy “ exeiy “ ex cospyq ` iex sinpyq.

Rather than giving a generic formula, we demonstrate the process with asimple example.

Example 9.1.6. Find the general solution to

x1 “ x´ 3y

y1 “ 6x´ 5y.

Page 455: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 446

Answer: In matrix form, the system is given by

d~x

dt“

1 ´36 ´5

~x.

The eigenvalues for this matrix are λ “ ´2˘ 3i. For λ “ ´2` 3i, we find„

1´ p´2` 3iq ´3 06 ´5´ p´2` 3iq 0

3´ 3i ´3 06 ´3´ 3i 0

1´ i ´1 02 ´1´ i 0

p1´ iqp1` iq ´1p1` iq 02 ´p1` iq 0

2 ´p1` iq 00 0 0

.

We must have 2v1 “ p1` iqv2 which means we can take

~v “

1` i2

as our basis eigenvector. Using basic facts about conjugates, the generalsolution to our system must be

~xptq “ d1ep´2`3iqt

1` i2

` d2ep´2´3iqt

1´ i2

.

The reason for using the coefficients d1 and d2 (instead of c1 and c2) willbecome apparent below.

If we examine the first part of this solution, we find the following.

ep´2`3iqt

1` i2

“ e´2te3it

1` i2

“ e´2tpcosp3tq ` i sinp3tqq

1` i2

“ e´2t

p1` iq pcosp3tq ` i sinp3tqq2 pcosp3tq ` i sinp3tqq

“ e´2t

cosp3tq ` i sinp3tq ` i cosp3tq ´ sinp3tq2 cosp3tq ` 2i sinp3tq

“ e´2t

cosp3tq ´ sinp3tq2 cosp3tq

` ie´2t

sinp3tq ` cosp3tq2 sinp3tq

Page 456: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 447

In the last step above, we separated the vector into real and imaginary parts.Since the second part of the solution is the conjugate of the first part, wehave

ep´2´3iqt

1´ i2

“ e´2t

cosp3tq ´ sinp3tq2 cosp3tq

´ ie´2t

sinp3tq ` cosp3tq2 sinp3tq

.

Combining these results, we have

~xptq “ d1

ˆ

e´2t

cosp3tq ´ sinp3tq2 cosp3tq

` ie´2t

sinp3tq ` cosp3tq2 sinp3tq

˙

` d2

ˆ

e´2t

cosp3tq ´ sinp3tq2 cosp3tq

´ ie´2t

sinp3tq ` cosp3tq2 sinp3tq

˙

“ pd1 ` d2qe´2t

cosp3tq ´ sinp3tq2 cosp3tq

` pid1 ´ id2qe´2t

sinp3tq ` cosp3tq2 sinp3tq

.

If we rename the coefficients as

c1 “ d1 ` d2

c2 “ id1 ´ id2,

we have the real form of the solution

~xptq “ c1e´2t

cosp3tq ´ sinp3tq2 cosp3tq

` c2e´2t

sinp3tq ` cosp3tq2 sinp3tq

where c1 and c2 are completely independent quantities. Note that despitetheir appearance, the coefficients c1 and c2 can both be real quantities forcertain choices of d1 and d2. In fact, c1 and c2 can be any pair of quantities wewish! The proof that these new coefficients are independent of one anotheris simply that d1 and d2 can be written uniquely in terms of c1 and c2:

d1 “c1 ´ ic2

2

d2 “c1 ` ic2

2.

If we write our answer in component form, we have

xptq “ c1e´2tpcosp3tq ´ sinp3tqq ` c2e

´2tpsinp3tq ` cosp3tqq

yptq “ 2c1e´2t cosp3tq ` 2c2e

´2t sinp3tq. �

What we learn from this example is the following fact.

Page 457: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 448

Lemma 9.1.4 (Real Form for Complex Eigenvalues). If λ “ a ˘ bi is aconjugate pair of eigenvalues for a real nˆn matrix M with basis eigenvectors~v,~v, then the portion of the general solution to ~x 1 “ M~x corresponding tothese eigenvalues is of the form

c1eat

»

r1 cospbtq ` s1 sinpbtqr2 cospbtq ` s2 sinpbtq

...rn cospbtq ` sn sinpbtq

fi

ffi

ffi

ffi

fl

` c2eat

»

u1 cospbtq ` v1 sinpbtqu2 cospbtq ` v2 sinpbtq

...un cospbtq ` vn sinpbtq

fi

ffi

ffi

ffi

fl

where the two independent solutions are the real and imaginary parts ofepa`biqt~v:

epa`biqt~v “ eat

»

r1 cospbtq ` s1 sinpbtqr2 cospbtq ` s2 sinpbtq

...rn cospbtq ` sn sinpbtq

fi

ffi

ffi

ffi

fl

` ieat

»

u1 cospbtq ` v1 sinpbtqu2 cospbtq ` v2 sinpbtq

...un cospbtq ` vn sinpbtq

fi

ffi

ffi

ffi

fl

.

Example 9.1.7. Solve the following initial value problem.

x1 “ 6x´ 13y

y1 “ 4x´ 6y

xp0q “ 2

yp0q “ ´4

Answer: The eigenvalues for this matrix are given byˇ

ˇ

ˇ

ˇ

6´ λ ´134 ´6´ λ

ˇ

ˇ

ˇ

ˇ

“ p6´ λqp´6´ λq ` 52

“ λ2` 16 “ 0.

So, the eigenvalues are λ “ ˘4i. We only need to find an eigenvector for oneof the conjugate pair. Choosing λ “ 4i, we find

6´ 4i ´13 04 ´6´ 4i 0

p6´ 4iqp6` 4iq ´13p6` 4iq 02 ´p3` 2iq 0

52 ´26p3` 2iq 02 ´p3` 2iq 0

2 ´p3` 2iq 00 0 0

.

Page 458: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 449

So, we need 2v1 “ p3` 2iqv2 and can take

~v “

3` 2i2

as a basis eigenvector. Next,

e4it

3` 2i2

“ pcosp4tq ` i sinp4tqq

3` 2i2

3 cosp4tq ` 3i sinp4tq ` 2i cosp4tq ´ 2 sinp4tq2 cosp4tq ` 2i sinp4tq

3 cosp4tq ´ 2 sinp4tq2 cosp4tq

` i

3 sinp4tq ` 2 cosp4tq2 sinp4tq

.

This form directly gives us the general solution to our system of differentialequations:

~xptq “ c1

3 cosp4tq ´ 2 sinp4tq2 cosp4tq

` c2

3 sinp4tq ` 2 cosp4tq2 sinp4tq

.

For the initial data, we need

~xp0q “ c1

32

` c2

20

2´4

.

This is equivalent to the equations

3c1 ` 2c2 “ 2

2c1 “ ´4

which have solution c1 “ ´2 and c2 “ 4. So, the solution to our initial valueproblem is

~xptq “ ´2

3 cosp4tq ´ 2 sinp4tq2 cosp4tq

` 4

3 sinp4tq ` 2 cosp4tq2 sinp4tq

.

If we write this in component form and simplify, we have

xptq “ 2 cosp4tq ` 16 sinp4tq

yptq “ ´4 cosp4tq ` 8 sinp4tq. �

Page 459: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 450

Example 9.1.8. Find the general solution to

d~x

dt“

»

5 ´16 102 ´3 00 4 ´5

fi

fl ~x.

Answer: The characteristic polynomial for this matrix isˇ

ˇ

ˇ

ˇ

ˇ

ˇ

5´ λ ´16 102 ´3´ λ 00 4 ´5´ λ

ˇ

ˇ

ˇ

ˇ

ˇ

ˇ

“ ´λ3´ 3λ2

´ 7λ´ 5 “ ´pλ` 1qpλ2` 2λ` 5q.

This gives us eigenvalues of λ “ ´1,´1˘2i. For λ1 “ ´1, a basis eigenvectoris

~v1 “

»

111

fi

fl .

We leave the details to the reader.For the two complex eigenvalues, we only need find an eigenvector for one

of them. For λ2 “ ´1` 2i, we find»

5´ p´1` 2iq ´16 10 02 ´3´ p´1` 2iq 0 00 4 ´5´ p´1` 2iq 0

fi

fl

»

6´ 2i ´16 10 02 ´2´ 2i 0 00 4 ´4´ 2i 0

fi

fl

»

2 0 ´p1` 3iq 00 2 ´p2` iq 00 0 0 0

fi

fl .

For an eigenvector, we need

2v1 “ p1` 3iqv3

2v2 “ p2` iqv3.

This means we can take

~v2 “

»

1` 3i2` i

2

fi

fl .

Page 460: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 451

Next, we find the real and imaginary parts of the solution corresponding tothis eigenvalue/eigenvector pair.

ep´1`2iqt

»

1` 3i2` i

2

fi

fl “ e´te2it

»

1` 3i2` i

2

fi

fl

“ e´t pcosp2tq ` i sinp2tqq

»

1` 3i2` i

2

fi

fl

“ e´t

»

cosp2tq ` i sinp2tq ` 3i cosp2tq ´ 3 sinp2tq2 cosp2tq ` 2i sinp2tq ` i cosp2tq ´ sinp2tq

2 cosp2tq ` 2i sinp2tq

fi

fl

“ e´t

»

cosp2tq ´ 3 sinp2tq2 cosp2tq ´ sinp2tq

2 cosp2tq

fi

fl` ie´t

»

sinp2tq ` 3 cosp2tq2 sinp2tq ` cosp2tq

2 sinp2tq

fi

fl .

Taking these two solutions together with the one from λ1 “ ´1 gives us thegeneral solution:

~xptq “ c1e´t

»

111

fi

fl`c2e´t

»

cosp2tq ´ 3 sinp2tq2 cosp2tq ´ sinp2tq

2 cosp2tq

fi

fl`c3e´t

»

sinp2tq ` 3 cosp2tq2 sinp2tq ` cosp2tq

2 sinp2tq

fi

fl . �

9.1.3 Solutions to Inhomogeneous Systems

The key to solving inhomogeneous systems is the following simple result.

Theorem 9.1.5. If ~x1ptq and ~x2ptq are two solutions to the inhomogeneoussystem

~x 1ptq “M~xptq `~bptq,

then their difference ~x1ptq´~x2ptq is a solution of the associated homogeneoussystem

~x 1ptq “M~xptq.

Page 461: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 452

Proof: Let ~xdptq “ ~x1ptq ´ ~x2ptq. Since ~x1ptq and ~x2ptq satisfy the samedifferential equation, we have

~xd1ptq “ ~x1

1ptq ´ ~x2

1ptq

“M~x1ptq `~bptq ´´

M~x2ptq `~bptq¯

“M~x1ptq ´M~x2ptq

“M p~x1ptq ´ ~x2ptqq

“M~xdptq. �

As an immediate consequence, we have the following.

Corollary 9.1.5.1 (General Solutions of Inhomogeneous Systems). Supposethat ~xpptq is any single solution to the inhomogeneous system

~x 1ptq “M~xptq `~bptq,

and ~xhptq is the general solution to the associated homogeneous system

~x 1ptq “M~xptq.

Then the general solution to the inhomogeneous system above is of the form

~xptq “ ~xpptq ` ~xhptq.

The single solution to the inhomogeneous system, ~xpptq is usually referredto as the particular solution to the inhomogeneous system. Since we al-ready know how to find the general solution to homogeneous systems (atleast for diagonalizable systems), this corollary reduces the problem of solv-ing inhomogeneous systems to finding any single solution to the system ofdifferential equations.

Of course, this leaves us the question of how to find a particular solution!The method we will develop is usually called the Method of UndeterminedCoefficients. The primary advantage of this method is that it is relativelysimple to understand. Its major drawback is that it only works for very spe-cial kinds of inhomogeneous terms, ~bptq. A more general method, Variationof Parameters, will be developed in the exercises at the end of this chapter.

We begin with a simple example.

Page 462: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 453

Example 9.1.9. Find the general solution to the following system of differ-ential equations.

x1 “ x´ 2y ` 9t

y1 “ ´2x` y

Answer: In matrix form, this system is

~x 1 “

1 ´2´2 1

~x`

9t0

.

First, we have to find the general solution to the associated homogeneousproblem

~x 1 “

1 ´2´2 1

~x.

Since this is the same system as in Example 9.1.4, we know

~xhptq “ c1e´t

11

` c2e3t

1´1

.

To finish the problem, we need to find any particular solution to

~xp1“

1 ´2´2 1

~xp `

9t0

.

Since the inhomogeneous term is linear in t, we can make a reasonable guessabout the form of the particular solution:

~xpptq “

At`BCt`D

.

In other words, we guess that both components of the particular solutionare linear functions of t. Our job is to figure out the coefficients A,B,C,and D that will make this work. This is the origin of the name “Method ofUndetermined Coefficients.”

First,

~xp1ptq “

AC

.

Page 463: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 454

The right–hand–side of the differential equation gives

1 ´2´2 1

~xpptq `

9t0

1 ´2´2 1

At`BCt`D

`

9t0

1pAt`Bq ´ 2pCt`Dq´2pAt`Bq ` 1pCt`Dq

`

9t0

pA´ 2Cqt` pB ´ 2Dqp´2A` Cqt` p´2B `Dq

`

9t0

pA´ 2C ` 9qt` pB ´ 2Dqp´2A` Cqt` p´2B `Dq

.

So, the differential equation requires

~xp1“

1 ´2´2 1

~xp `

9t0

AC

pA´ 2C ` 9qt` pB ´ 2Dqp´2A` Cqt` p´2B `Dq

.

To make this work, we need the following to be true:

0 “ A´ 2C ` 9

0 “ ´2A` C

A “ B ´ 2D

C “ ´2B `D.

The first two equations are due to the fact that the left–hand–side of thedifferential equation has no t–terms whatsoever (and so the t–terms on theright need coefficients of 0). The last two equations force the constant termson the left and right sides to agree. Solving the first two gives A “ 3 andC “ 6. Substituting these into the last two equations gives

3 “ B ´ 2D

6 “ ´2B `D

which has solution B “ ´5 and D “ ´4. So, one particular solution is givenby

~xpptq “

3t´ 56t´ 4

.

Page 464: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 455

So, the general solution to our original problem is given by

~xptq “ ~xpptq ` ~xhptq “ c1e´t

11

` c2e3t

1´1

`

3t´ 56t´ 4

.

Writing this in component form gives

xptq “ c1e´t` c2e

3t` 3t´ 5

yptq “ c1e´t´ c2e

3t` 6t´ 4. �

Essentially, the Method of Undetermined Coefficients is a viable optionwhenever the inhomogeneous term is composed of the same type of functionsthat typically show up as solutions of homogeneous problems.

Method of Undetermined Coefficients2

Table 1: Inhomogeneous Term Unrelated to Homogeneous SolutionComponent of Inhomogeneous Term Add to EACH component of ~xp

antn ` ¨ ¨ ¨ ` a1t` a0 Ant

n ` ¨ ¨ ¨ ` A1t` A0

aebt Aebt

a sinpbtq or c cospbtq A sinpbtq `B sinpbtq

Table 2: Inhomogeneous Term Related to Homogeneous SolutionComponent of Inhomogeneous Term Add to EACH component of ~xp

antn ` ¨ ¨ ¨ ` a1t` a0 An`1t

n`1 ` ¨ ¨ ¨ ` A1t` A0

aebt pA1t` A0qebt

a sinpbtq or c cospbtq pA1t` A0q sinpbtq ` pB1t`B0q sinpbtq

What this table tells us is that the appropriate guess for each component ofthe particular solution is the most general function like the given inhomoge-neous term. If the inhomogeneous term is part of the homogeneous solution,we may have to add an extra power of t to have a particular solution thatwill work correctly.

Example 9.1.10. Find the solution to the following initial value problem.Find the general solution to

x1 “ x´ 3y ` 3e´2t

y1 “ 6x´ 5y ´ 6e´2t

xp0q “ 0

yp0q “ 0.2We are still assuming that the system is diagonalizable. If an eigenvalue is deficient,

then Table 2 would need to be altered.

Page 465: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 456

Answer: In matrix form, we have

~x 1 “

1 ´36 ´5

~x`

3e´2t

´6e´2t

.

So we first need to consider the homogeneous system

~x 1 “

1 ´36 ´5

~x.

Since this is identical to the system in Example 9.1.6, we have

~xhptq “ c1e´2t

cosp3tq ´ sinp3tq2 cosp3tq

` c2e´2t

sinp3tq ` cosp3tq2 sinp3tq

.

For our particular solution, notice that the homogeneous solution involvesfunctions like e´2t cosp3tq and e´2t sinp3tq. Since our inhomogeneous termonly involves e´2t, we can simply take

~xpptq “

Ae´2t

Be´2t

.

Since

~xp1ptq “

´2Ae´2t

´2Be´2t

1 ´36 ´5

~xp `

3e´2t

´6e´2t

1 ´36 ´5

Ae´2t

Be´2t

`

3e´2t

´6e´2t

Ae´2t ´ 3Be´2t

6Ae´2t ´ 5Be´2t

`

3e´2t

´6e´2t

pA´ 3B ` 3qe´2t

p6A´ 5B ´ 6qe´2t

,

we need„

´2Ae´2t

´2Be´2t

pA´ 3B ` 3qe´2t

p6A´ 5B ´ 6qe´2t

.

This gives us the equations

´2A “ A´ 3B ` 3

´2B “ 6A´ 5B ´ 6

Page 466: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 457

which have solution A “ 3 and B “ 4. This means the general solution toour system of differential equations is

~xptq “ ~xhptq ` ~xpptq

“ c1e´2t

cosp3tq ´ sinp3tq2 cosp3tq

` c2e´2t

sinp3tq ` cosp3tq2 sinp3tq

`

3e´2t

4e´2t

.

Now that we have the general solution, we can find the solution to the ini-tial value problem. INITIAL DATA SHOULD ONLY BE CONSIDEREDAFTER YOU HAVE THE GENERAL SOLUTION.

~xp0q “ c1

12

` c2

10

`

34

00

So, we need

c1 ` c2 ` 3 “ 0

2c1 ` 4 “ 0

which has solution c1 “ ´2 and c2 “ ´1. So, the solution to our initial valueproblem is

~xptq “ ´2e´2t

cosp3tq ´ sinp3tq2 cosp3tq

´ e´2t

sinp3tq ` cosp3tq2 sinp3tq

`

3e´2t

4e´2t

or in component form

xptq “ ´3e´2t cosp3tq ` e´2t sinp3tq ` 3e´2t

yptq “ ´4e´2t cosp3tq ´ 2e´2t sinp3tq ` 4e´2t. �

Example 9.1.11. Find the general solution to

~x 1 “

1 ´2´2 1

~x`

024e3t

.

Answer: Since the homogeneous system is again like Example 9.1.4, we have

~xhptq “ c1e´t

11

` c2e3t

1´1

.

Page 467: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 458

Since e3t is part of the homogeneous solution and 3 has multiplicity 1 for thematrix, we have to guess

~xpptq “

pAt`Bqe3t

pCt`Dqe3t

.

~xp1ptq “

Ae3t ` p3At` 3Bqe3t

Ce3t ` p3Ct` 3Dqe3t

3Ate3t ` pA` 3Bqe3t

3Cte3t ` pC ` 3Dqe3t

1 ´2´2 1

~x`

024e3t

1 ´2´2 1

pAt`Bqe3t

pCt`Dqe3t

`

024e3t

pAt`Bqe3t ´ 2pCt`Dqe3t

´2pAt`Bqe3t ` pCt`Dqe3t ` 24e3t

pA´ 2Cqte3t ` pB ´ 2Dqe3t

p´2A` Cqte3t ` p´2B `D ` 24qe3t

Equating like coefficients gives

3A “ A´ 2C

3C “ ´2A` C

A` 3B “ B ´ 2D

C ` 3D “ ´2B `D ` 24.

Notice that both of the first two equations tell us that A “ ´C. Thismakes it seem as though there is some freedom in the choice of A (or C).However, using this information in the last two equations gives us

A` 3B “ B ´ 2D

´A` 3D “ ´2B `D ` 24

which simplify to

2B ` 2D “ ´A

2B ` 2D “ A` 24

So, we must have ´A “ A ` 24 which means A “ ´12 (and so C “ 12).Finally, we have to choose B and D to satisfy 2B`2D “ 12. We genuinely do

Page 468: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 459

have freedom to pick B or D anyway we wish,3 and so we choose B “ D “ 3.(B “ 0 and D “ 6 or any other combination satisfying B `D “ 6 would dojust as well). So, the general solution to our problem is

~xptq “ c1e´t

11

` c2e3t

1´1

`

p´12t` 3qe3t

p12t` 3qe3t

.

The general solution shows us why there is some freedom in the choice ofparticular solution. Note that the second term of the homogeneous solutionallows us to add any term of the form

ce3t

1´1

to the particular solution without penalty. No matter what multiple we add,we end up with

~xpptq “

p´12t` 3` cqe3t

p12t` 3´ cqe3t

,

and the new B and D coefficients still sum up to 6:

p3` cq ` p3´ cq “ 3` 3 “ 6. �

9.2 Application: Multiple Compartment Mix-

ing Problems

In this section, we examine mixing problems similar to those we studied inSection 4.9. Instead of a single tank, we will now consider several tanksconnected together. Just as with a single tank, the key idea is to considerthe total amount of solute moving into and out of each tank per unit of time.

3A more systematic way to see this is to row reduce the augmented matrix correspond-ing to this system of equations.

»

2 0 2 0 02 0 2 0 01 2 0 2 00 2 1 2 24

fi

ffi

ffi

fl

»

1 0 0 0 ´120 1 0 1 60 0 1 0 120 0 0 0 0

fi

ffi

ffi

fl

.

The row of all zeros tells us there is a free variable!

Page 469: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 460

Throughout this section, we will assume that the solutions in the varioustanks remain well–mixed.

When we had a single tank, we could easily handle cases where the volumeof fluid in the tank was increasing or decreasing. That is no longer the casewhen there are multiple tanks. While the resulting system would still belinear, the coefficients of the matrix describing the system would be functionsof t, and solving such systems is substantially more difficult than systems withconstant coefficients.

Example 9.2.1. Predict the concentration of salt as a function of t in thefollowing tank system. The tank on the left starts with 50 L at a concentra-tion of 20 g/L. The tank on the right starts with 50 L at a concentration of40 g/L.

ô ó

6 L/min

10 g/L @ 3 L/min 5 g/L @ 3 L/min

6 L/min

3 L/min

Figure 9.2.1: Tank System for Example 9.2.1

Answer: Let C`ptq be the concentration in the tank on the left and Crptqbe the concentration of salt in the tank on the right. The correspondingamounts of salt in each of the tanks are A`ptq and Arptq. Since for bothtanks the total volume of fluid in and out balances, both tanks remain attheir original 50 L for all time. This means

C`ptq “A`ptq

50,

Crptq “Arptq

50.

Analyzing the flows in and out of the tank on the left gives

dA`dt

“ 30´ 6

ˆ

A`50

˙

` 3

ˆ

Ar50

˙

.

Page 470: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 461

Similarly for the tank on the right,

dArdt

“ 15` 6

ˆ

A`50

˙

´ 9

ˆ

Ar50

˙

.

Notice that the two streams flowing out of the right tank are combined inthe differential equation for Ar. As far as the tank on the right is concerned,it is losing 9 L/min of its contents. The fact that 3 L/min is flowing intothe tank on the left is handled in the differential equation for A`. For initialdata, we have

A`p0q “ 1000,

Arp0q “ 2000.

This gives us the following inhomogeneous system.

A1`A1r

´3{25 3{503{25 ´9{50

A`Ar

`

3015

A`p0qArp0q

10002000

The homogeneous part of the differential equation has eigenvalue/eigenvectorpairs

λ1 “ ´6

25, ~v1 “

1´2

,

λ2 “ ´3

50, ~v2 “

11

.

So, the homogeneous solution is

~Ahptq “ c1e´6t{25

1´2

` c2e´3t{50

11

.

For the particular solution, we can take

~Apptq “

ab

.

Page 471: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 462

Substituting this into the differential equation gives us„

00

´3{25 3{503{25 ´9{50

ab

`

3015

.

This gives us the system

´6a` 3b` 1500 “ 0

6a´ 9b` 750 “ 0

which has solution a “ 437.5 and b “ 375. This means the general solutionto our system is

A`ptqArptq

“ c1e´6t{25

1´2

` c2e´3t{50

11

`

437.5375

.

For the initial data, we need„

10002000

“ c1

1´2

` c2

11

`

437.5375

.

This system has solution

c1 “ ´2125

6and c2 “

2750

3.

This gives

A`ptq “ ´2125

6e´6t{25

`2750

3e´3t{50

` 437.5,

Arptq “2125

3e´6t{25

`2750

3e´3t{50

` 375.

For the concentrations in each tank, we find

C`ptq “A`ptq

50“ ´

85

12e´6t{25

`55

3e´3t{50

`35

4,

Crptq “Arptq

50“

85

6e´6t{25

`55

3e´3t{50

`15

2.

Notice that the limiting concentration in the left tank is

limtÑ8

C`ptq “35

4g/L,

Page 472: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 463

while in the right tank

limtÑ8

Crptq “15

2g/L.

So, after this mixing process has gone on for a relatively long period of time,the concentration of salt in the left tank should be close to 8.75 grams perliter. In the right tank, we expect the concentration to be roughly 7.5 gramsper liter. �

Example 9.2.2. Consider the system of tanks shown below. The outer twotanks (Tanks 1 and 3) both have 35 gallons of a sugar solution while thetank in the middle (Tank 2) contains 40 gallons. All flow rates below arein gallons per minute. Do the concentrations in the tanks limit to a steadyvalue? If so, what will the concentrations limit to in the long term?

ô óô

20 oz/gal @ 2 gal/min 5 oz/gal @ 3 gal/min

5 gal/min

7

5

4

7

Tank 1 Tank 2 Tank 3

Figure 9.2.2: Tank System for Example 9.2.2

Answer: The concentrations will be labeled as C1ptq, C2ptq, and C3ptq forTanks 1, 2 and 3, respectively. Since the volume of fluid flowing into and outof each tank is perfectly balanced, the total volume of fluid in each tank isconstant. This means the total amounts of sugar in each tank (A1ptq, A2ptq,

Page 473: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 464

and A3ptq respectively) are related to the concentrations by

C1ptq “A1ptq

35,

C2ptq “A2ptq

40,

C3ptq “A3ptq

35.

The system of differential equations describing this system is»

A11A12A13

fi

fl “

»

´1{5 1{8 01{5 ´7{20 1{50 1{10 ´1{5

fi

fl

»

A1

A2

A3

fi

fl`

»

40015

fi

fl .

The characteristic polynomial for this matrix is (after much work)

´λ3´

3λ2

27λ

200´

1

200“ ´

1

200p2λ` 1qp5λ` 1qp20λ` 1q.

This means the eigenvalues are all negative. As such, the homogeneous partof the solution decays to zero as tÑ 8.

Since we only want to know the long–term behavior of the system, weonly need to find the particular solution of the form

~Apptq “

»

abc

fi

fl .

The particular solution must satisfy»

000

fi

fl “

»

´1{5 1{8 01{5 ´7{20 1{50 1{10 ´1{5

fi

fl

»

abc

fi

fl`

»

40015

fi

fl .

This system of equations has solution a “ 475, b “ 440, and c “ 295. Thismeans that the concentrations in the tank limit to

limtÑ8

C1ptq “475

35“

95

7« 13.571 oz/gal,

limtÑ8

C2ptq “440

40“ 11 oz/gal,

limtÑ8

C3ptq “295

35“

59

7« 8.429 oz/gal. �

Page 474: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 465

9.3 Application: Spring–Mass Systems

Many phenomena in nature can be described by higher order differentialequations – differential equations involving derivatives of the unknown func-tion beyond the first derivative. For example, Newton’s Second Law tellsus that the acceleration of an object is proportional to the total force act-ing on the object. Since acceleration is the second derivative of position,we naturally get a second order differential equation for the position of theobject.

Consider a block of mass m connected to a spring sliding horizontallyon a surface. We set up a coordinate system where x “ xptq measures howfar the center of the block has moved from its equilibrium position – theposition where the mass would be able to sit at rest for all time. Accordingto Hooke’s Law, the force exerted by a spring is proportional to how muchit has been stretched4: Fspring “ ´kx. The positive parameter k is called thespring constant and is determined by the particulars of how the spring wasmade. The negative sign is crucial as it indicates that the force from a springis opposite to the direction it has been stretched (or compressed).

The other major force acting on the block is friction with the surface.Friction is a complex phenomenon, and there are many ways to model it thatare useful in various situations. We will use the simplest model; the force dueto friction is proportional to and opposite the velocity of the object: Ffriction “

´bx1. The positive coefficient of friction, b, depends on the materials theblock and table are made of. Putting these two forces together gives usmx2 “ ´kx´ bx1.

It is very easy to turn a higher order differential equation into a system offirst order differential equations. The key idea is to give names to all but thehighest derivative appearing in the equation. Since our spring–mass systemis second order, we need to give a name to the first derivative: x1ptq “ vptq.Using v as a second unknown function gives us a 2ˆ 2 linear system:

x1 “ v

v1 “ x2 “ ´k

mx´

b

mv.

Notice that we replaced x1 by v in the force due to friction! If we write this

4Hooke’s Law is typically a reasonable model for the force exerted by a spring so longas the spring is not overly stretched or compressed.

Page 475: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 466

in vector form, we find

x1

v1

0 1´ km

´ bm

xv

.

This allows us to use the techniques from the previous sections.

Example 9.3.1. A block of mass m “ 2 kg is attached to a spring of strengthk “ 3 N/m and allowed to slide horizontally on a table. The coefficient oflinear friction between the table and the mass is b “ 7 N¨s/m. If the massstarts from rest half a meter to the right of equilibrium, predict the motionof the mass for all time (measured in seconds).

Answer: If we let x “ xptq be the position of the mass (measured fromequilibrium), we have the differential equation

2x2 “ ´3x´ 7x1.

For initial data, we have

xp0q “1

2vp0q “ 0.

Using vptq “ x1ptq, we have the system

x1 “ v

v1 “ ´3

2x´

7

2v

The eigenvalues of this matrix are give by

ˇ

ˇ

ˇ

ˇ

´λ 1´3

2´7

2´ λ

ˇ

ˇ

ˇ

ˇ

“ ´λ

ˆ

´7

2´ λ

˙

`3

2

“ λ2`

7

2λ`

3

2

ˆ

λ`1

2

˙

pλ` 3q “ 0.

So, the eigenvalues are λ “ ´1

2,´3.

Page 476: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 467

The eigenvectors for λ1 “ ´12

are given by

12

1 0´3

2´3 0

1 2 00 0 0

.

So we can take

~v1 “

2´1

as a basis eigenvector for the first eigenvalue. For λ2 “ ´3, we find

3 1 0´3

2´1

20

3 1 00 0 0

.

So we can take

~v2 “

1´3

as a basis eigenvector for the second eigenvalue. This means the generalsolution to our differential equation is

xptqvptq

“ c1e´t{2

2´1

` c2e´3t

1´3

.

Next, we fit the initial data.

xp0qvp0q

“ c1

2´1

` c2

1´3

1{20

This gives us the system

2c2 ` c2 “1

2´c1 ´ 3c2 “ 0

which has solution c1 “ 3{10 and c2 “ ´1{10. Substituting this into thegeneral solution gives us

xptq “3

5e´t{2 ´

1

10e´3t

vptq “ ´3

10e´t{2 `

3

10e´3t.

Page 477: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 468

Notice that vptq is just the derivative of xptq as it must be! �

If there is an external force, Fextptq, separate from the spring and frictionacting on the mass, then our second order differential equation becomes

mx2 “ ´kx´ bx1 ` Fext.

This gives us an inhomogeneous system:„

x1ptqv1ptq

0 1´ km

´ bm

xptqvptq

`

0Fextptq

.

Example 9.3.2. A mass of weight 32 lbs is suspended vertically from aspring of strength k “ 13 lbs/ft. Suppose that the coefficient of linear frictionfor the system is b “ 4 lbs ¨ s / ft. Find the general solution to the associateddifferential equation.

Answer: The first thing to note is that the pound (lb) is not a measurementof mass! In British Imperial units, the unit of mass is called the slug. Therelation between the weight, w, of an object and its mass, m, is

w “ mg

where g “ 32 ft/s is the acceleration due to gravity. Since the weight issuspended vertically, gravity is acting on the object with a constant force:

Fext “ ´mg “ ´32 lbs.

The negative sign is due to the fact that force of gravity acts downwards. So,our weight has mass m “ 1 slug. So, the motion of the weight satisfies

x2 “ ´13x´ 4x1 ´ 32.

Notice that x “ xptq measures the displacement of the weight from theequilibrium position of the system in the absence of any external force. Inparticular x “ 0 for our system would be the position that the weight wouldnaturally sit if it were set up horizontally (and gravity was not a factor). Thevector form of this differential equation is

x1ptqv1ptq

0 1´13 ´4

xptqvptq

`

0´32

.

Page 478: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 469

The matrix has eigenvalues λ “ ´2 ˘ 3i. A basis eigenvector associatedwith λ “ ´2` 3i is

~v “

´2´ 3i13

.

Using the methods from the previous section, we find

ep´2`3iqt

´2´ 3i13

“ e´2t

´2 cosp3tq ` 3 sinp3tq13 cosp3tq

` ie´2t

´2 sinp3tq ´ 3 cosp3tq13 sinp3tq

.

So, the homogeneous solution to our system is

~xhptq “ c1e´2t

´2 cosp3tq ` 3 sinp3tq13 cosp3tq

` c2e´2t

´2 sinp3tq ´ 3 cosp3tq13 sinp3tq

.

For a particular solution, we can try

~xpptq “

AB

.

Substituting this into the differential equation gives„

00

0 1´13 ´4

AB

`

0´32

.

This gives us A “ ´32{13 and B “ 0. So, the general solution to ourdifferential equation is

xptqvptq

“ c1e´2t

´2 cosp3tq ` 3 sinp3tq13 cosp3tq

` c2e´2t

´2 sinp3tq ´ 3 cosp3tq13 sinp3tq

`

´32{130

.

If we examine the position, we find

xptq “ c1e´2tp´2 cosp3tq ` 3 sinp3tqq ` c1e

´2tp´2 sinp3tq ´ 3 cosp3tqq ´

32

13.

We can rearrange this into the form

xptq “ d1e´2t cosp3tq ` d2e

´2t sinp3tq ´32

13

Page 479: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 470

where d1 and d2 are combinations of c1 and c2. Note that the only effectgravity has is to shift the natural equilibrium point of the spring–mass systemdownward 32/13 feet. What this means is that there is no essential differencebetween the motion of a mass hanging vertically from a spring and the motionof a mass connected to a spring that is sliding horizontally. After we shiftthe equilibrium downward, the motion is completely identical!5 �

If we compute the characteristic polynomial for„

0 1´ km

´ bm

then the eigenvalues are given by the equation

λ2`

b

mλ`

k

m“ 0.

If we multiply this equation by m, we get the equation

mλ2` bλ` k “ 0

which has eigenvalues

λ “´b˘

?b2 ´ 4mk

2m.

The quantity under the square root (known as the discriminant) controls thetype of solutions.

If b2´4mk ą 0, then both eigenvalues are real and negative. In this case,the system is said to be over–damped, and solutions have the form

xptq “ d1e´r1t ` d2e

´r2t.

Notice that an over–damped spring–mass system does not oscillate. Thedamping parameter is large enough that the mass creeps back toward equi-librium without ever crossing it.

5While this is mathematically accurate, there may be practical differences. Rememberthat Hooke’s Law will stop being a good model for the spring force when the springis stretched or compressed by a large amount. Since the force of gravity stretches thespring by some amount, this might be a concern. Also, air resistance when the mass issuspended vertically is likely to be very different than sliding friction when the mass ismoving horizontally!

Page 480: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 471

If b2´4mk ă 0, then the eigenvalues are complex with negative real part:

λ “ ´b

2m˘ µi

where µ “?

4mk ´ b2{2m. In this case, the spring–mass system is said tobe under–damped, and the solutions are of the form

xptq “ d1e´bt{2m cospµtq ` d2e

´bt{2m sinpµtq.

For an under–damped spring–mass system, the damping is small enough thatthe mass can oscillate while it tries to return the equilibrium.

In the event that b2 ´ 4mk “ 0, we have a repeated, negative eigenvalue.In this unlikely case, we say the system is critically damped. It turns outthat solutions in this case are of the form

xptq “ d1e´bt{2m

` d2te´bt{2m,

and the spring–mass system does not oscillate. In all three cases, the masstries to return to equilibrium exponentially fast. Only in the under–dampedcase does the system exhibit any oscillatory behavior.

9.4 Analysis of 2 ˆ 2 Homogeneous Systems

If we are only interested in long term behavior, we do not need to computethe full solution to gain a qualitative understanding of solutions to linearhomogeneous systems. In fact, the eigenvalues alone can tell us quite a lotabout the nature of the solutions. For instance, suppose a 2ˆ2 linear systemhas eigenvalues λ1 “ ´2 and λ2 “ ´1. The general solution would then looklike

~xptq “ c1e´2t~v1 ` c2e

´t~v2

where ~v1 and ~v2 are the corresponding eigenvectors. The solution in compo-nent form would be

xptq “ Ae´2t`Be´t

yptq “ Ce´2t`De´t

Page 481: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 472

for some coefficients A,B,C, and D which would be determined by the initialdata. Regardless of what these coefficients are (i.e. regardless of the initialdata), we necessarily have

limtÑ8

xptq “ limtÑ8

yptq “ 0.

To make progress in our understanding of 2 ˆ 2 homogeneous systems,we need to recall some ideas from Chapter 5. For a linear system of the form

dx

dt“ ax` by

dy

dt“ cx` dy,

the x– and y–nullclines are the lines ax ` by “ 0 and cx ` dy “ 0, respec-tively, both of which pass through the origin. Assuming these two lines aredistinct, the origin will be the only equilibrium for the system. In Chapter5, we classified equilibria based on vector plots. Without technology, vec-tor plots are difficult to draw well, and even with a machine–drawn vectorplot it can often be difficult to determine the behavior. Fortunately, we caneasily predict the long term behavior of solutions to 2ˆ 2 systems from theeigenvalues (as long as they are distinct). For 3 ˆ 3 and larger systems, theclassification becomes a lot more intricate (as we will see).

Theorem 9.4.1. Suppose that a 2 ˆ 2 system ~x 1 “ M~x has distinct eigen-values λ1 and λ2.

1. If both eigenvalues are negative, then solutions approach p0, 0q astÑ 8, and we say the origin is an asymptotically stable node.

Figure 9.4.1: Asymptotically Stable Node

Page 482: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 473

2. If both eigenvalues are positive, then solutions diverge to ˘8 astÑ 8, and we say the origin is an unstable node.

Figure 9.4.2: Unstable Node

3. If one eigenvalue is positive and the other negative, then almostall solutions diverge to ˘8 as t Ñ ˘8, and we say the origin is anunstable saddle point.

Figure 9.4.3: Saddle Point

Page 483: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 474

4. If the eigenvalues are complex with negative real part, then so-lutions approach p0, 0q as tÑ 8, and we say the origin is an asymp-totically stable spiral point.

Figure 9.4.4: Asymptotically Stable Spiral

5. If the eigenvalues are purely imaginary, then solutions startingnear p0, 0q will stay near the origin for all time, and we say the originis a stable center.

Figure 9.4.5: Stable Center

Page 484: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 475

6. If the eigenvalues are complex with positive real part, thensolutions diverge to ˘8 as tÑ 8 and we say the origin is an unstablespiral point.

Figure 9.4.6: Unstable Spiral

Proof: The proof follows from the form of solutions given the eigenvalues.If the eigenvalues are real, then

xptq “ Aeλ1t `Beλ2t

yptq “ Ceλ1t `Deλ2t,

for some coefficients A – D depending on the initial data. This readily givesus the first three behaviors in the theorem. If the eigenvalues are complex,then

xptq “ Aeλt cospµtq `Beλt sinpµtq

yptq “ Ceλt cospµtq `Deλt sinpµtq,

if the eigenvalues are λ ˘ iµ. This gives us the last three behaviors in thetheorem. �

Before we move on, there are some things to note about the theoremabove. First, the term asymptotically stable equilibrium indicates that so-lutions starting relatively close to the equilibrium will move closer to it as

Page 485: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 476

time increases. This is clearly the case for the point px, yq “ p0, 0q in cases1 and 4 above. A stable equilibrium is one where starting relatively close toit guarantees that solutions will stay close to the equilibrium for all futuretimes. In case 5 above, solutions starting near p0, 0q will stay near that pointfor all time. However, they do not necessarily approach the origin as timegoes on.

In the theorem, we have listed saddle points as being unstable. Generi-cally speaking, this is certainly true. Typically, solutions will achieve somepoint of closest approach to a saddle point before departing from the vicinityfor all future times. However, there are special initial conditions that willgenerate solutions that approach the saddle point as t tends to infinity. Ifyou look at the vector field for the saddle point case in the theorem, it looksas though an initial condition on one particular line in quadrants II and IIIleads to solutions that will limit to the origin. In fact, this line is precisely thedirection indicated by the eigenvector corresponding to the negative eigen-value! Since a randomly chosen initial condition is unlikely to lie perfectlyon this line, we do not typically expect solutions to limit to a saddle point.This is the reason for listing a saddle point as unstable.

Given the theorem above, it would be nice to have some way of deter-mining which case we are in directly from the matrix describing the system.If we try computing the eigenvalues for a generic 2ˆ 2 matrix

M “

a bc d

,

we find

det pM ´ λI2q “

ˇ

ˇ

ˇ

ˇ

a´ λ bc d´ λ

ˇ

ˇ

ˇ

ˇ

“ pa´ λqpd´ λq ´ bc

“ λ2´ pa` dqλ` pad´ bcq “ 0.

The constant term is clearly detpMq. The quantity appearing as a coefficientof λ (without the minus sign) is known as the trace of the matrix M and isdenoted trpMq. Specifically,

tr

ˆ„

a bc d

˙

“ a` d

is simply the sum of the entries on the main diagonal.

Page 486: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 477

So, the eigenvalues for a 2 ˆ 2 matrix M are controlled by trpMq anddetpMq:

λ2´ trpMqλ` detpMq “ 0.

Hence, the eigenvalues are given by

λ “trpMq ˘

a

ptrpMqq2 ´ 4 detpMq

2.

This simple observation leads us to the following classification scheme.

Theorem 9.4.2 (Classification of 2ˆ 2 Linear Systems). For a 2ˆ 2 matrixM , we can determine the behavior of solutions as follows.

� If detpMq ăptrpMqq2

4, both eigenvalues are real. Moreover,

1. If detpMq ą 0 and trpMq ă 0, the origin is an asymptoticallystable node.

2. If detpMq ą 0 and trpMq ą 0, the origin is an unstable node.

3. If detpMq ă 0, the origin is a saddle point.

� If detpMq ąptrpMqq2

4, the eigenvalues are complex (or imaginary).

Moreover,

4. If trpMq ă 0, the origin is an asymptotically stable sprial point.

5. If trpMq “ 0, the origin is a stable center point.

6. If trpMq ą 0, the origin is an unstable spiral point.

� If detpMq “ptrpMqq2

4, M has a real eigenvalue of algebraic multiplicity

2. If trpMq ă 0, the origin will be asymptotically stable, and it will beunstable if trpMq ą 0.

� If detpMq “ 0, at least one of the eigenvalues is zero (and the classifi-cation fails).

Proof: The discriminant ptrpMqq2 ´ 4 detpMq appearing under the radicalin the expression for the eigenvalues

λ “trpMq ˘

a

ptrpMqq2 ´ 4 detpMq

2

Page 487: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 478

controls whether the eigenvalues are real or complex: ptrpMqq2´4 detpMq ą 0indicates two, distinct real solutions; ptrpMqq2 ´ 4 detpMq “ 0 indicates arepeated solution; ptrpMqq2´4 detpMq ă 0 indicates complex (or imaginary)solutions. This is the main classification in the system.

If the eigenvalues are complex, then the long term behavior of solutionsis controlled by the real part of the eigenvalues (since this part appearsin the exponential part of the solution). Since Repλq “ trpMq{2, we getclassifications 4 – 6 in the theorem.

If the eigenvalues are real and detpMq ă 0, then

a

ptrpMqq2 ´ 4 detpMq ą | trpMq|

since we have added a positive quantity to ptrpMqq2 under the radical. Thismeans trpMq `

a

ptrpMqq2 ´ 4 detpMq is definitely positive while trpMq ´a

ptrpMqq2 ´ 4 detpMq is definitely negative. Hence, we have a saddle pointat the origin which is classification 3 above.

If the eigenvalues are real and detpMq ą 0, then

a

ptrpMqq2 ´ 4 detpMq ă | trpMq|

since we have subtracted a positive quantity from ptrpMqq2. Notice that

trpMq ‰ 0 in this case since 0 ă detpMq ăptrpMqq2

4. If trpMq ą 0,

then both eigenvalues will be positive (since at worst we subtract a quantitysmaller than trpMq). Likewise, if trpMq ă 0, then both eigenvalues will benegative. This gives classifications 1 and 2 in the theorem.

Finally, if one of the eigenvalues is 0 (and so the other eigenvalue mustbe real), the solutions look will look something like

xptq “ A`Beλt

yptq “ C `Deλt,

and so p0, 0q is no longer the only equilibrium! In fact, a zero eigenvaluewould mean that the two nullclines are in fact the same line giving us aninfinity of equilibria! �

Before we look at some examples, there is a convenient way of picturingthe information in the theorem above – the Trace–Determinant Plane.

Page 488: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 479

Figure 9.4.7: The Trace–Determinant Plane (Not to Scale)

The dashed parabola in Quadrants I and II dividing Nodes and Spirals is

detpMq “ptrpMqq2

4. Notice that the positive detpMq axis dividing Asymp-

totically Stable Spirals from Unstable Spirals is the only place where StableCenter Points occur! The trace axis (points with detpMq “ 0) is whereour classification theorem fails. We will illustrate the use of the trace–determinant plane in several examples below.

Example 9.4.1. Classify the behavior of solutions for the system

~x 1 “

´2 ´22 ´7

~x.

Answer: Let

M “

´2 ´22 ´7

.

Then,

trpMq “ ´2`´7 “ ´9,

detpMq “ p´2qp´7q ´ p´2qp2q “ 18,

detpMq “ 18 ăptrpMqq2

4“

81

4“ 20.25.

Page 489: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 480

Since the determinant is smaller than ptrpMqq2{4, we must be under theparabola. Since the trace is negative and determinant positive, we are in thegreen region corresponding to asymptotically stable nodes.

(Not to Scale)

So, we know that there are two negative eigenvalues and that all solutionswill limit to zero as tÑ 8. �

Example 9.4.2. Classify the behavior of solutions for the system

~x 1 “

´6 6´6 9

~x.

Answer: We have

trpMq “ ´6` 9 “ 3,

detpMq “ p´6qp9q ´ p6qp´6q “ ´18.

Page 490: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 481

(Not to Scale)

Since the determinant is negative, we are clearly in the saddle point re-gion. This means we have one negative and one positive eigenvalue andsolutions tend to ˘8 both for future times and in the past for almost allinitial data. As a result, the origin is an unstable equilibrium point. �

Example 9.4.3. Classify the behavior of solutions for the system

~x 1 “

3 ´51 1

~x.

Answer: We have

trpMq “ 3` 1 “ 4,

detpMq “ p3qp1q ´ p´5qp1q “ 8,

detpMq “ 8 ąptrpMqq2

4“

16

4“ 4.

Since the determinant is greater than ptrpMqq2{4, we must be above theparabola. Since the trace and determinant are both positive, we are in thered region corresponding to unstable spiral points.

Page 491: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 482

(Not to Scale)

So, we know that there are two complex eigenvalues with positive real part.All solutions will tend to ˘8 as tÑ 8 and that the origin is unstable. �

9.5 Partial Derivatives and Linearization of

Non–linear Systems

In Chapter 5, we looked at the stability of equilibria of 2 ˆ 2 non–linearsystems from a graphical point of view. Now that we understand the solutionsto linear systems, it turns out we can classify the behavior of solutions nearequilibrium points exactly! Before we can do that, we need to discuss partialderivatives.

9.5.1 Partial Derivatives

Suppose that we have a function f which has two or more independent vari-ables. For concreteness, we will take x and y to be our independent variables(and so, f “ fpx, yq). Since f depends on two quantities, there are twodifferent derivatives we can consider.

The partial derivative of f “ fpx, yq with respect to the variable

x is given the symbol fxpx, yq

ˆ

or sometimesBf

Bxpx, yq

˙

and is defined by

fxpx, yq “ limhÑ0

fpx` h, yq ´ fpx, yq

h.

Page 492: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 483

Similarly, the partial derivative of f “ fpx, yq with respect to the

variable y is given the symbol fypx, yq

ˆ

or sometimesBf

Bypx, yq

˙

and is

defined by

fypx, yq “ limhÑ0

fpx, y ` hq ´ fpx, yq

h.

As you can see, these definitions look extremely similar to the definitionof derivative for a function of a single variable. In fact, you should think offx as the quantity you obtain by taking the derivative of f with respect to xtreating y as a constant. Similarly, fy is the quantity you obtain by takingthe derivative of f with respect to y treating x as a constant. All derivativerules from your first course in calculus apply to partial derivatives!

Example 9.5.1. Find the x– and y–partial derivatives for

fpx, yq “ x2y2` 3x3y2

` 4x2` 2y ` 3.

Answer: For the x–partial, we find

fxpx, yq “ 2xy2` 9x2y2

` 8x.

Notice that the last two terms (2y ` 3) do not involve x at all! So, theirx-partial is 0. For the y–partial, we have

fypx, yq “ 2x2y ` 6x3y ` 2.

Again, notice that the terms 4x2 and 3 do not involve y! �

Example 9.5.2. Find the x– and y–partial derivatives for

gpx, yq “ x2 sinp5x´ 3yq.

Answer: For the x–partial, we have to use the product rule (and then thechain rule to take the x-partial of the sine term).

fxpx, yq “ 2x sinp5x´ 3yq ` 5x2 cosp5x´ 3yq

Since the x2 is a constant as far as the y–partial is concerned, we only needthe chain rule to find fy.

fypx, yq “ ´3x2 cosp5x´ 3yq �

Page 493: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 484

Example 9.5.3. Find the x– and y–partial derivatives for

wpx, yq “ xy3ex2´2xy´y2 .

Answer: For both the x– and y–partial derivatives, we need to use both theproduct and chain rules.

wxpx, yq “ y3ex2´2xy´y2

` xy3p2x´ 2yqex

2´2xy´y2

wypx, yq “ 3xy2ex2´2xy´y2

` xy3p´2x´ 2yqex

2´2xy´y2 �

The idea of partial derivatives can be extended to a function of any num-ber of independent variables!

Example 9.5.4. Find all three partial derivatives for the function

fpx, y, zq “ x3y4z2` zex

2`y2 .

Answer:

fxpx, y, zq “ 3x2y4z2` 2xzex

2`y2

fypx, y, zq “ 4x3y3z2` 2yzex

2`y2

fzpx, y, zq “ 2x3y4z ` ex2`y2 �

9.5.2 Linearization

We can now state the main theorem of this chapter. Recall that the equilib-rium points of a 2ˆ 2 system

x1 “ fpx, yq

y1 “ gpx, yq

are all simultaneous solutions to the equations fpx, yq “ 0 and gpx, yq “ 0.6

6As with single differential equations, there is an existence and uniqueness theoremfor this type of system. While we will not concern ourselves with the details too much,certainly if f and g are continuous in some region surrounding an equilibrium point, therewill be a unique solution to the system for some range of t for any initial condition closeto the equilibrium.

Page 494: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 485

Theorem 9.5.1 (Linearization Near an Equilibrium Point). Suppose thatpx˚, y˚q is an equilibrium point for

x1 “ fpx, yq

y1 “ gpx, yq.

Then the behavior of solutions near the equilibrium point is the same as thebehavior of solutions near the origin in the corresponding linear system

u1 “ fxpx˚, y˚qu` fypx

˚, y˚qv

v1 “ gxpx˚, y˚qu` gypx

˚, y˚qv

so long as this system has no eigenvalue with zero real part. Here, u “ x´x˚

and v “ y´y˚ are simply new coordinates centered on the equilibrium px˚, y˚q.This system is called the linearization of our original non–linear system nearthe equilibrium px˚, y˚q.

Proof: The proof of this theorem is beyond the scope of this text, but see[HK91, Chpt. 9] for a discussion.

For our purposes, the theorem above gives us the following useful lemma.

Lemma 9.5.2. The stability of an equilibrium px˚, y˚q for the system

x1 “ fpx, yq

y1 “ gpx, yq

is controlled by the eigenvalues of the matrix

fxpx˚, y˚q fypx

˚, y˚qgxpx

˚, y˚q gypx˚, y˚q

so long as the eigenvalues have non–zero real part.

In particular, the trace–determinant test we developed in the last sectioncan help us determine whether an equilibrium is asymptotically stable orunstable! A word of caution, however. We already know that cases wheredetpMq “ 0 are problematic (as this indicates a zero eigenvalue). Our lin-earization theorem also fails to classify equilibria if the eigenvalues are purelyimaginary. In other words, our theorem cannot directly classify an equilib-rium as a stable center!

Page 495: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 486

Example 9.5.5. Find and classify all equilibria for the system

dx

dt“ y ´ x

dy

dt“ y2

´ x.

Answer: First, we find the equilibria by solving

y ´ x “ 0

y2´ x “ 0.

The first equation clearly requires y “ x. Substituting this into the secondequation gives

x2´ x “ 0

xpx´ 1q “ 0

x “ 0, 1.

So, there are two equilibria: p0, 0q and p1, 1q.To classify these equilibria, we need the partial derivatives of the functions

fpx, yq “ y ´ x,

gpx, yq “ y2´ x.

These are given as follows.

fxpx, yq “ ´1 fypx, yq “ 1gxpx, yq “ ´1 gypx, yq “ 2y

For p0, 0q, we have

M “

fxp0, 0q fyp0, 0qgxp0, 0q gyp0, 0q

´1 1´1 0

.

So, trpMq “ ´1, detpMq “ 1, and 1 “ detpMq ą ptrpMqq2{4 “ 1{4. Thismeans that p0, 0q is an asymptotically stable spiral point.

Page 496: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 487

Figure 9.5.1: Vector Field near p0, 0q for Example 9.5.5

For p1, 1q, we have

M “

fxp1, 1q fyp1, 1qgxp1, 1q gyp1, 1q

´1 1´1 2

.

This gives us trpMq “ 1 and detpMq “ ´1. Since the determinant is negative,p1, 1q must be an unstable saddle point. �

Figure 9.5.2: Vector Field near p1, 1q for Example 9.5.5

Page 497: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 488

Example 9.5.6. Find and classify all equilibria for the system

dx

dt“ py ´ x2

qpx2´ 9q

dy

dt“ x2

` y ´ 8.

Answer: For the equilibria, we need

py ´ x2qpx2

´ 9q “ 0

x2` y ´ 8 “ 0.

The first equation clearly gives us two cases.

� Case 1: y ´ x2 “ 0

� Case 2: x2 ´ 9 “ 0

In Case 1, we must have y “ x2. Substituting this into the second equa-tion gives

x2` x2

´ 8 “ 0

2x2“ 8

x “ ˘2.

So, p´2, 4q and p2, 4q are equilibrium points for the system.For Case 2, x “ ˘3. For x “ ´3, we find

p´3q2 ` y ´ 8 “ 0

1` y “ 0

y “ ´1,

which gives us an equilibrium at p´3,´1q. Similarly, when x “ 3 we have

p3q2 ` y ´ 8 “ 0

1` y “ 0

y “ ´1.

So, there is a fourth equilibrium at p3,´1q.

Page 498: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 489

In order to classify these equilibria, we need the partial derivatives of thefunctions

fpx, yq “ py ´ x2qpx2

´ 9q,

gpx, yq “ x2` y ´ 8.

These are given as follows.

fxpx, yq “ ´2xpx2 ´ 9q ` py ´ x2qp2xq fypx, yq “ x2 ´ 9gxpx, yq “ 2x gypx, yq “ 1

If we begin with p´2, 4q, the linearization matrix near this equilibrium is

M “

fxp´2, 4q fyp´2, 4qgxp´2, 4q gyp´2, 4q

´20 ´5´4 1

.

Since trpMq “ ´19 and detpMq “ ´40, we know that p´2, 4q must be asaddle point. So, this equilibrium is unstable for almost all initial data.

For p2, 4q, we find

M “

fxp2, 4q fyp2, 4qgxp2, 4q gyp2, 4q

20 ´54 1

.

Since trpMq “ 21, detpMq “ 40, and detpMq “ 40 ă ptrpMqq2{4 “ 110.25,p2, 4q is an unstable node.

For p´3,´1q, we find

M “

fxp´3,´1q fyp´3,´1qgxp´3,´1q gyp´3,´1q

60 0´6 1

.

Since trpMq “ 61, detpMq “ 60, and detpMq “ 60 ă ptrpMqq2{4 “ 930.25,p´3,´1q is also an unstable node.

Finally, for the linearization near p3,´1q we have

M “

fxp3,´1q fyp3,´1qgxp3,´1q gyp3,´1q

´60 06 1

.

Since trpMq “ ´59 and detpMq “ ´60, p3,´1q must be an unstable saddlepoint.

The following figure shows plots of the (unscaled) vector field for thissystem near all four equilibria. The unstable nodes in the plots above are

Page 499: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 490

very clearly unstable. The saddle point at p3,´1q is a prime example ofthis class of equilibria. Notice that there seems to be a pair of directionswhere you could limit to p3,´1q (i.e. the horizontal directions in the centerof the plot). However, starting even very slightly off of the center line willcause the solution to limit to infinity as t Ñ 8. Hence, this equilibrium isunstable. The behavior at p´2, 4q is similar, though the arrows are slightlymore difficult to read in this instance. �

a) p´3,´1q: Unstable Node b) p´2, 4q: Saddle Point

c) p2, 4q: Unstable Node d) p3,´1q: Saddle Point

Figure 9.5.3: Vector Fields near Equilibria for Example 9.5.6

Page 500: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 491

9.6 Analysis of Particular Models

Linearization allows us to rigorously classify the behavior of solutions to themajor systems we studied in Chapter 5. In this section, we will revisit thePredator–Prey, Competing Species, and two of our disease models to rigor-ously verify the claims made earlier. We will also consider another interestingsystem, the chemostat.

9.6.1 The Predator–Prey Model

Recall that the Predator–Prey Model (or Lotka–Volterra Model) is a systemof differential equations designed to model two species: a prey species withpopulation R “ Rptq and a predator species with population F “ F ptq. Thesystem is given by

dR

dt“ αR ´ βRF “ Rpα ´ βF q

dF

dt“ ´γF ` δFR “ ´F pγ ´ δRq

where α, β, γ, and δ are positive parameters. The parameter α plays therole of a growth rate for the prey species. In the absence of any predators(F “ 0), the prey population grows exponentially. Similarly, γ plays the roleof a death rate for the predators, and in the absence of any prey (R “ 0),the predators die off exponentially fast. The other two parameters, β andδ, control the interaction between predator and prey. For both species, theproduct RF serves as a measure of how frequently the two species interact.Since an interaction is detrimental to the prey, their population is reducedby βRF . Likewise, an interaction increases the predator population at therate δRF .

The Lotka–Volterra Model always has two equilibria: p0, 0q and´

γδ, αβ

¯

.

Recall that in Chapter 5 we said that p0, 0q was unstable while´

γδ, αβ

¯

was a

stable center. We can now study these facts in a more rigorous fashion.

Page 501: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 492

Figure 9.6.1: Typical Solution to the Predator–Prey Model

First, solutions that start in Quadrant I must stay in Quadrant I for all time.Any solution that starts on the positive R axis stays on the axis for all t.This is because when F “ 0, dF {dt “ 0 and F stays zero forever. Similarly,any solution that starts on the positive F axis stays on the axis for all time.Hence, any solution that starts in the interior of Quadrant I cannot intersectthe axes. Therefore, solutions starting in Quadrant I must stay there forever.

To study the stability of the equilibria, we need the partial derivatives of

fpR,F q “ αR ´ βRF

gpR,F q “ ´γF ` δFR.

These arefRpR,F q “ α ´ βF, fF pR,F q “ ´βR,gRpR,F q “ δF, gF pR,F q “ ´γ ` δR.

For p0, 0q, we find

M “

fRp0, 0q fF p0, 0qgRp0, 0q gF p0, 0q

α 00 ´γ

.

Since detpMq “ ´αγ ă 0, we see that p0, 0q is an unstable saddle point. Infact, the eigenvalues are exactly α and ´γ.

Page 502: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 493

For´

γδ, αβ

¯

, we have

M “

»

fR

´

γδ, αβ

¯

fF

´

γδ, αβ

¯

gR

´

γδ, αβ

¯

gF

´

γδ, αβ

¯

fi

fl “

0 ´βγδ

αδβ

0

.

Since trpMq “ 0 and detpMq “ αγ ą 0, the linearized system has a stablecenter. However, Theorem 9.5.1 does not directly apply in this case!

It is easy to see that solutions must spiral around the equilibrium pointin counter-clockwise fashion. The linearization is just not sensitive enough

to determine whether´

γδ, αβ

¯

is unstable, stable, or asymptotically stable. A

more detailed analysis (c.f. [HS74, pp. 258 – 265]) can show that the solutionsare in fact closed orbits. So for the Predator–Prey Model, the linearizationhappens to classify both equilibria correctly. But remember that Theorem9.5.1 cannot be used to establish that an equilibrium is a stable center!

9.6.2 The Competing Species Model

The system of differential equations

da

dt“ kaa

ˆ

1´a

Na

˙

´ αab

db

dt“ kbb

ˆ

1´b

Nb

˙

´ βab

models the populations of two species, a “ aptq and b “ bptq, that competefor the same resources. The parameters ka and kb are logistic growth ratesand Na and Nb are carrying capacities for the two species. The parametersα and β are competition parameters measuring the rate at which one speciestakes resources away from the other. The nullclines for this system are lines:

� a–nullclines: a “ 0 and 1´1

Na

a´α

kab “ 0

� b–nullclines: b “ 0 and 1´1

Nb

b´β

kba “ 0

Since a “ 0 and b “ 0 are nullclines, solutions that begin in Quadrant I aredefinitely trapped there for all time (just as with the Predator–Prey Model).

Page 503: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 494

The points p0, 0q, pNa, 0q, and p0, Nbq are always equilibria. There is a fourthequilibrium if the two oblique nullclines intersect in the first quadrant. Recallthat in Chapter 5 we saw that there were three distinct behaviors.

� Competitive Exclusion (3 equilibria)

� Weak Competition (4 equilibria)

� Strong Competition (4 equilibria)

To analyze stability, we need the following partial derivatives.

fapa, bq “ ka ´2kaNaa´ αb, fbpa, bq “ ´αa

gapa, bq “ ´βb, gbpa, bq “ kb ´2kbNbb´ βa

At p0, 0q, we have

M “

fap0, 0q fbp0, 0qgap0, 0q bF p0, 0q

ka 00 kb

.

We could compute trace and determinant, but the eigenvalues of this matrixare ka and kb – both of which are positive. So, p0, 0q is unstable in all cases!

Case 1: Competitive Exclusion In this case, the two oblique nullclinesdo not intersect in the first quadrant.

Species a Dominant Species b Dominant

Figure 9.6.2: Typical Solutions for Competing Species: CompetitiveExclusion

Page 504: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 495

As we can see from the figure above, this happens in one of two cases:

case a) Nb ăkaα

andkbβă Na,

or

case b)kaαă Nb and Na ă

kbβ.

Since we have already examined p0, 0q, we need to consider the equilibriapNa, 0q and p0, Nbq. For the first of these

M1 “

fapNa, 0q fbpNa, 0qgapNa, 0q gbpNa, 0q

´ka ´αNa

0 kb ´ βNa

.

The eigenvalues for this matrix are clearly ´ka and kb ´ βNa. Similarly,

M2 “

fap0, Nbq fbp0, Nbq

gap0, Nbq gbp0, Nbq

ka ´ αNb 0´βNb ´kb

with eigenvalues ka ´ αNb and ´kb.In case a), we have ka ą αNb and kb ă βNa. This means the linearization

matrix M1 for pNa, 0q has two negative eigenvalues which makes this equilib-rium an asymptotically stable node. Likewise, p0, Nbq has one positive andone negative eigenvalue which makes it an unstable saddle point. So in casea), species a out-competes species b, and species b will die out.

Case b) is exactly the reverse. pNa, 0q has one positive and one negativeeigenvalue making it an unstable saddle point. p0, Nbq has two negativeeigenvalues which makes it an asymptotically stable node. So in case b),species b out–competes species a.

Case 2: Weak Competition In this case,

Na ăkbβ

and Nb ăkaα.

Page 505: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 496

Figure 9.6.3: Typical Solutions for Competing Species: Weak Competition

We’ve already seen that p0, 0q is unstable. The linearization matricesfor pNa, 0q and p0, Nbq are exactly the same as before. In the case of weakcompetition however, both of these equilibria are unstable saddle points (asboth have one negative and one positive eigenvalue).

The fourth equilibrium point is a bit more complicated in form:ˆ

kbNapka ´ αNbq

kakb ´ αβNaNb

,kaNbpkb ´ βNaq

kakb ´ αβNaNb

˙

.

Since ka ą αNb and kb ą βNa in this case, both the numerator and denomina-tor of each coordinate are positive numbers – verifying that this equilibiriumpoint is in Quadrant I. Instead of displaying the linearization matrix M3 forthis equilibrium, we simply give the trace and determinant.

trpM3q “ ´kakbpka ´ αNb ` kb ´ βNaq

kakb ´ αβNaNb

detpM3q “kakbpka ´ αNbqpkb ´ βNaq

kakb ´ αβNaNb

Our assumption that ka ą αNb and kb ą βNa guarantees that trpM3q ă 0while detpM3q ą 0. This means that the fourth equilibrium is asymptot-ically stable (whether it is a node or spiral point depends on the specificparameters). So, weak competition allows the two species to coexist longterm.Case 3: Strong Competition In this case,

Na ąkbβ

and Nb ąkaα.

Page 506: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 497

Figure 9.6.4: Typical Solutions for Competing Species: Strong Competition

Since we have already studied the linearization matrices for all four equi-libria (or at least the trace and determinant for the fourth equilibrium), weonly need to summarize their stability in this case.

� p0, 0q: Unstable Node

� pNa, 0q: Asymptotically Stable Node

� p0, Nbq: Asymptotically Stable Node

ˆ

kbNapka ´ αNbq

kakb ´ αβNaNb

,kaNbpkb ´ βNaq

kakb ´ αβNaNb

˙

: Unstable Saddle Point

So in the case of strong competition, the species cannot coexist long term.One of the two species will dominate while the other dies out. However,which species survives depends on the initial population sizes.

9.6.3 The SIR Model

The SIR Disease Model assumes that there are three categories of people.

� Susceptible people (with population S “ Sptq)

� Infected people (with population I “ Iptq)

� Recovered people (with population R “ Rptq)

Page 507: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 498

To make the analysis simpler, we assume that the total population is a con-stant sizeN : S`I`R “ N . This allows us to ignore the recovered populationand focus on the susceptible and infected populations. We also assume thatrecovered people are immune from the disease forever.

dS

dt“ ´αSI

dI

dt“ αSI ´ βI

As with the Predator–Prey Model, interactions between susceptible and in-fected people are modeled by the product SI; susceptible people contractthe disease at a rate αSI and so become infected. Infected people recover atthe rate βI. As usual, the parameters α and β are positive. Recall that inChapter 5 we proved that any point of the form pS, Iq “ ps, 0q is an equilib-rium point. In words, the equilibria are points where the disease dies out; allinfected people recover leaving some number of susceptible people who nevercontract the illness. Just like the Predator–Prey Model, solutions that startin Quadrant I must stay in Quadrant I for all time. In fact, solutions muststay in the region 0 ď S ` I ď N for all t (since the population is constant).

Figure 9.6.5: Typical Solutions to the SIR Model

Page 508: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 499

To explore the stability of these equilibria, we need to find the first partialderivatives of

fpS, Iq “ ´αSI

gpS, Iq “ αSI ´ βI.

These are given by

fSpS, Iq “ ´αI, fIpS, Iq “ ´αS,gSpS, Iq “ αI, gIpS, Iq “ αS ´ β.

For any equilibrium point ps, 0q, we have

M “

fSps, 0q fIps, 0qgSps, 0q gIps, 0q

0 ´αs0 αs´ β

.

This gives us detpMq “ 0 and trpMq “ αs´ β.The determinant being zero means that one of the eigenvalues of the

linearization matrix is zero. The zero eigenvalue stems from the fact thatevery point on the S–axis is an equilibrium. Even though Theorem 9.5.1does not directly apply, a slight extension of it can establish stability ofthese equilibria for solutions starting in Quadrant I. In particular, if trpMq ą0, then the non-zero eigenvalue must be positive, and the equilibrium isunstable. Likewise, trpMq ă 0 would indicate that the second eigenvalue isnegative, and the equilibrium is asymptotically stable (again, for solutionsstarting in Quadrant I). So if s ą β{α, the equilibrium ps, 0q is unstable; ifs ă β{α, the equilibrium ps, 0q is asymptotically stable. The case s “ β{α isstill ambiguous as both eigenvalues are 0.

9.6.4 The SIRS Model

If we change the SIR Model by assuming recovered individuals lose theirimmunity to the disease over time, we have the SIRS Disease Model. Notethat we still assume the population is a fixed size.

dS

dt“ ´αSI ` γR

dI

dt“ αSI ´ βI

dR

dt“ βI ´ γR

Page 509: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 500

The positive parameters α and β play the same role as before: α is theinfection rate and β is the rate that infected people recover. The positiveparameter γ represents the rate at which people who recover from the diseaselose their immunity and become susceptible to the disease again.

We can ignore the population R “ Rptq since R “ N ´ S ´ I where N isthe fixed population size. This reduces the system of differential equationsto

dS

dt“ ´αSI ` γ pN ´ S ´ Iq

dI

dt“ αSI ´ βI.

As shown in Chapter 5, there are two equilibria for this system:

pS, Iq “ pN, 0q and

ˆ

β

α,γpαN ´ βq

αpβ ` γq

˙

.

The second equilibrium only makes sense for the model when β{α ď N (as Nis the total population), and when β{α “ N , the second equilibrium reducesto the first.

Since the total population is fixed at sizeN , clearly we need 0 ď S`I ď Nfor solutions to be sensible. This is the region shown in yellow below. Lookingat the vector field for the system, we can see solutions that start in thistriangular region cannot leave it.

Page 510: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 501

(a) SIRS with 1 Equilibrium (b) SIRS with 2 Equilibria

Figure 9.6.6: Typical Vector Plots for the SIRS Model

Note that solutions on the bottom edge of the triangular region flow along ittoward S “ N . In these cases, the number of infected people is zero and anyrecovered people eventually lose their immunity. On the other two edges, thedirection arrows all point toward the interior of the region. Hence, solutionsstarting in 0 ď S ` I ď N will stay there for all time.

To determine stability, we need to following partial derivatives.

fSpS, Iq “ ´αI ´ γ fIpS, Iq “ ´αS ´ γgSpS, Iq “ αI gIpS, Iq “ αS ´ β

For pN, 0q, we find

M “

fSpN, 0q fIpN, 0qgSpN, 0q gIpN, 0q

´γ ´αN ´ γ0 αN ´ β

.

This gives us detpMq “ ´γpαN ´ βq and trpMq “ αN ´ β ´ γ. WhenαN ´ β ą 0 (which means β{α ă N), detpMq ă 0 and pN, 0q is an unstablesaddle point. Similarly, detpMq ą 0 when αN ´ β ă 0. In this case pN, 0qis either an asymptotically stable node or an asymptotically stable spiralpoint since trpMq ă 0. So, when pN, 0q is the only sensible equilibrium, itis asymptotically stable. When the second equilibrium is sensible for the

Page 511: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 502

system, pN, 0q is unstable. Notice that our analysis in inconclusive whenαN ´ β “ 0.

For the second equilibrium, a little algebra shows us that the linearizationmatrix is

M “

«

´pαN´βqγβ`γ

´ γ ´pβ ` γqpαN´βqγβ`γ

0

ff

.

The trace and determinant of this matrix are

trpMq “ ´

ˆ

γ `γpαN ´ βq

β ` γ

˙

,

detpMq “ γ pαN ´ βq .

Since this equilibrium is only meaningful when β{α ă N (and so αN´β ą 0),we know that trpMq ă 0 and detpMq ą 0. Hence, whenever

ˆ

β

α,γpαN ´ βq

αpβ ` γq

˙

is a sensible equilibrium, it is asymptotically stable. Whether the equilibriumis an asymptotically stable node or an asymptotically stable spiral pointdepends on the specific parameters.

9.6.5 Chemostats

A chemostat is a chamber that is used to continually grow microbes. Wesupply the microbes in the chamber with a sterile supply of some nutrientsolution (for example, a sugar solution) at a fixed rate (f liters per hour)and concentration (c0 grams per liter). The mixture of nutrient solution andmicrobes in the chamber is continuously agitated to make sure the materialis well–mixed. The microbe/nutrient mixture is collected from the chemostatat the same rate as the sterile nutrient solution enters the chamber.

Page 512: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 503

ô

Nutrient Solution In (f L/hr @ c0 g/L)

Microbe/NutrientMixture Out (f L/hr)

Figure 9.6.7: A Chemostat

Since the flow rates in and out are both f liters per hour, the total volumeof fluid in the chamber is constant (V liters). The quantities we are interestedin modeling are the concentration of the nutrient in the tank, CNptq, and theconcentration of microbes in the tank, CMptq, at time t (both measuredin grams per liter). These are related to the total amounts (in grams) ofnutrient, Nptq, and microbes, Mptq, in the tank at time t by

CNptq “Nptq

Vand CMptq “

Mptq

V.

The microbes consume the nutrient in the chamber, and the nutrientprovides energy for the microbes to reproduce. What we need to discussis how the growth rate of the microbes, µ, depends on the concentrationof nutrient in the chemostat, CN . We are assuming that the microbes aretotally dependent on the nutrient being supplied to the chamber. So, ifthe concentration of nutrient falls to zero, the microbes will not be able toreproduce. On the other hand, there is some fixed amount of time requiredfor the microbes to reproduce even in an over–abundance of nutrients. Themodel typically used for chemostats is known as the Monod Equation:7

µpCNq “ µmax

ˆ

CNKM ` CN

˙

“ µmax

ˆ

N

KMV `N

˙

.

The parameter µmax is the ideal growth rate (in units 1/hr) that the microbeswould reproduce at given an unlimited amount of nutrients. The parameter

7This empirical model for the growth of microbes is identical in form to the Michealis–Menten kinetics which models the rate of a chemical reaction in the presence of a enzymethat facilitates the reaction.

Page 513: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 504

KM is the concentration of nutrient at which the growth rate drops to half ofµmax. Taking into account the growth of the microbes in the chamber alongwith the flow of microbes out of the chemostat, we have

dM

dt“ µmax

ˆ

N

KMV `N

˙

M ´f

VM “

ˆ

µmaxN

KMV `N´f

V

˙

M.

For the concentration of nutrient in the tank, we clearly have nutrientflowing into the tank at a constant rate and concentration. And we havenutrient flowing out of the tank at a matching rate. In addition, the microbesare consuming the nutrient as they reproduce. We model the consumptionof nutrients as being proportional to the growth rate of the microbes:

rate of consumption “1

γ

ˆ

µmaxN

KMV `N

˙

M.

The parameter γ is called the yield constant and is in the range 0 ă γ ď 1.So,

dN

dt“ fc0 ´

1

γ

ˆ

µmaxN

KMV `N

˙

M ´ f

ˆ

N

V

˙

.

To summarize, our chemostat is modeled by the system of non-linearequations:

dM

dt“

ˆ

µmaxN

KMV `N´f

V

˙

M,

dN

dt“ fc0 ´

1

γ

ˆ

µmaxN

KMV `N

˙

M ´ f

ˆ

N

V

˙

.

This system has two equilibria:

pM1, N1q “ p0, c0V q,

pM2, N2q “`

γpc0V ´Nq, N˘

,

where

N “fKMV

µmaxV ´ f.

If we express these in terms of concentrations, then the two equilibria are

p0, c0q and pγpc0 ´ cq, cq

Page 514: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 505

where the concentration appearing in the second equilibrium is given by

c “fKM

µmaxV ´ f.

Notice that this equilibrium is physically meaningful only when µmaxV ą f .The linearization matrix for these two equilibria is a little complicated,

so we will simply give the stability results. Details can be found in [F18, pp.15 – 18].

� Case 1: f ă µmaxV

ˆ

c0

c0 `KM

˙

In this case, the equilibrium p0, c0q is an unstable saddle point. Theother equilibrium, pγpc0´ cq, cq, is an asymptotically stable node. Thismeans that in the long–term, the concentration of microbes in the tanklimits to

limtÑ8

CMptq “ γpc0 ´ cq.

� Case 2: µmaxV

ˆ

c0

c0 `KM

˙

ă f ă µmaxV

The equilibrium p0, c0q becomes an asymptotically stable node in thiscase while pγpc0´ cq, cq becomes an unstable saddle point. In this case,the microbes are completely washed out of the chemostat and

limtÑ8

CMptq “ 0.

� Case 3: f ą µmaxV

In this case, the only physically meaningful equilibrium is p0, c0q whichis asymptotically stable. So once again,

limtÑ8

CMptq “ 0,

and the microbes are completely washed out of the chemostat.

What we have learned from our study is that for a given microbial species,nutrient concentration c0, and volume V , there is a critical flow rate

fcrit “ µmaxV

ˆ

c0

c0 `KM

˙

Page 515: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 506

below which the chemostat will achieve a steady–state concentration of themicrobes. Above this critical flow rate, the microbes will be completelywashed out of the system.

Another question we might want to answer is how to maximize the rateat which microbes are collected from the chemostat (and so we must be inCase 1 above). The parameters γ and KM are particular to the microbialspecies and type of nutrient being used. The volume V is limited by the vesselbeing used for the chemostat. The concentration of the nutrient supply, c0,is somewhat under our control, but once the solution is saturated with thenutrient it will be impossible to increase the concentration. The aspect ofthe chemostat most directly under our control is the flow rate f .

The limiting microbial concentration is given by

γc0

1´fKM

c0pµmaxV ´ fq

which means that the rate at which the microbes leave the chemostat is

γc0f

1´fKM

c0pµmaxV ´ fq

This rate will be maximized as a function of f if we maximize the function

gpfq “ f

1´fKM

c0pµmaxV ´ fq

.

After some lengthy computations, it can be shown that the flow rate

f˚ “ µmaxV

ˆ

c

KM

c0 `KM

˙

maximizes the microbial harvest.

9.7 A Word on Chaotic Systems

Systems that are 3 ˆ 3 or larger can have far more complex behavior than2 ˆ 2 systems. To demonstrate this, we will look at a particularly famous

Page 516: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 507

system of differential equations known as the Lorenz System.

dx

dt“ σpy ´ xq

dy

dt“ xpρ´ zq ´ y

dz

dt“ xy ´ βz

This system was first developed in 1963 by Edward Lorenz to study convec-tion in the atmosphere. The specifics of what the variables x “ xptq, y “ yptq,and z “ zptq represent are not important for our discussion here. For demon-stration purposes, we will take σ “ 10, ρ “ 28, and β “ 3.

As in the 2ˆ 2 case, we begin by finding equilibria.

10py ´ xq “ 0

xp28´ zq ´ y “ 0

xy ´ 3z “ 0

The first equation requires x “ y. Combining this with the third equationgives

z “1

3x2.

Combining these facts with the second equation gives

x

ˆ

28´1

3x2

˙

´ x “ 0

x

ˆ

27´1

3x2

˙

“ 0

x “ ´9, 0, 9.

So, our version of the Lorenz System has three equilibria:

p´9,´9, 27q, p0, 0, 0q, and p9, 9, 27q.

To study the behavior near these equilibria, we need the first partialderivatives of the three functions appearing in the system.

fxpx, y, zq “ ´10 fypx, y, zq “ 10 fzpx, y, zq “ 0gxpx, y, zq “ 28´ z gypx, y, zq “ ´1 gzpx, y, zq “ ´xhxpx, y, zq “ y hypx, y, zq “ x hzpx, y, zq “ ´3

Page 517: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 508

Unfortunately, the trace and determinant of the linearization matrix are nolonger sufficient to determine stability. Instead, we have to look directly atthe eigenvalues.

For p0, 0, 0q, we find

M1 “

»

fxp0, 0, 0q fyp0, 0, 0q fzp0, 0, 0qgxp0, 0, 0q gyp0, 0, 0q gzp0, 0, 0qhxp0, 0, 0q hyp0, 0, 0q hzp0, 0, 0q

fi

fl “

»

´10 10 028 ´1 00 0 ´3

fi

fl .

This matrix has eigenvalues

λ1 “1

2

´

´?

1201´ 11¯

« ´22.83,

λ2 “ ´3,

λ3 “1

2

´?1201´ 11

¯

« 11.83.

The presence of one positive eigenvalue makes p0, 0, 0q makes this equilibriumunstable (in fact, a saddle point).

For p´9,´9, 27q, we find

M2 “

»

fxp´9,´9, 27q fyp´9,´9, 27q fzp´9,´9, 27qgxp´9,´9, 27q gyp´9,´9, 27q gzp´9,´9, 27qhxp´9,´9, 27q hyp´9,´9, 27q hzp´9,´9, 27q

fi

fl “

»

´10 10 01 ´1 9´9 ´9 ´3

fi

fl .

The eigenvalues for this matrix are far more difficult to compute, but theycan be estimated numerically.

λ1 « ´14.08

λ2 « 0.04` 10.73i

λ3 « 0.04´ 10.73i

It turns out that p9, 9, 27q has the same eigenvalues.

M3 “

»

fxp9, 9, 27q fyp9, 9, 27q fzp9, 9, 27qgxp9, 9, 27q gyp9, 9, 27q gzp9, 9, 27qhxp9, 9, 27q hyp9, 9, 27q hzp9, 9, 27q

fi

fl “

»

´10 10 01 ´1 ´99 9 ´3

fi

fl .

λ1 « ´14.08

λ2 « 0.04` 10.73i

λ3 « 0.04´ 10.73i

Page 518: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 509

The behavior near these equilibria is not analogous to any of the equilibriawe studied for 2 ˆ 2 systems. Solutions can be attracted to each of theseequilibria from the direction of the eigenvector associated to the negativeeigenvalue. However, solutions slowly spiral out from the equilibrium in theplane perpendicular to this eigenvector.

If we look at the trajectory of solutions we see some really interestingbehavior.

Figure 9.7.1: Lorenz Attractor: xp0q “ 1, yp0q “ 1, and zp0q “ 1

The butterfly shape eventually traced out by the solutions is generic andis known as the Lorenz Attractor. The plots below show trajectories for thesame parameters σ “ 10, ρ “ 28, and β “ 3 but with different initial data.

Page 519: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 510

Figure 9.7.2: Lorenz Attractor: xp0q “ 2, yp0q “ ´5, and zp0q “ 3

Page 520: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 511

Figure 9.7.3: Lorenz Attractor: xp0q “ ´10, yp0q “ ´30, and zp0q “ 0

In addition to the Lorenz Attractor, the other interesting fact about theLorenz System is that it was one of the earliest systems of differential equa-tions known to exhibit chaotic behavior. Chaos is a general term used toindicate that the long term behavior of a system can depend quite sensi-tively on the specific choice of initial data. More precisely, a chaotic systemis one in which two sets of initial data which are relatively close together canlead to solutions which are eventually quite different.

To see this phenomenon, we consider trajectories launched by two sets ofinitial data that are relatively close together.

1) xp0q “ 1, yp0q “ 1, and zp0q “ 1

2) xp0q “ 1.1, yp0q “ 0.9, and zp0q “ 1

In the plot below, the trajectory launched by initial data 1) is shown in bluewhile initial data 2) is shown in red.

Page 521: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 512

Figure 9.7.4: Lorenz System for Similar Initial Data

While both trajectories trace out the Lorenz Attractor, it looks as thoughthe two solutions cease to be close together after some amount of time. Thisbecomes very clear when we plot the individual functions.

Figure 9.7.5: Lorenz System for Similar Initial Data: xptq

Page 522: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 513

Figure 9.7.6: Lorenz System for Similar Initial Data: yptq

Figure 9.7.7: Lorenz System for Similar Initial Data: zptq

Despite being very similar near t “ 0 (where the red and blue curves practi-cally overlap one another), the solutions eventually diverge from one anotherafter a finite amount of time.

From a practical point of view, this means that chaotic systems are verydifficult to predict in the long term. Since in any real–world system knowl-edge of the initial data will come with some amount of error, we will even-tually lose the ability to make accurate predictions after some amount oftime.

The interesting thing about chaotic systems is that they are determin-istic (solutions are determined completely by the initial data) but they areinherently unpredictable in any realistic situation – especially over long timeperiods. Many systems in the natural sciences exhibit some degree of chaosmaking long term predictions problematic.

Page 523: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 514

9.8 Problems

1.) Find the general solution to the following system of differential equa-tions.

"

x1 “ ´2x` yy1 “ 4x` y.

2.) Solve the following initial value problem.

$

&

%

x1 “ ´x` 3yy1 “ 4x` 3yxp0q “ 1yp0q “ ´2

3.) Solve the following initial value problem.

$

&

%

x1 “ 2x´ 72y

y1 “ 52x´ 4y

xp0q “ 1yp0q “ ´3

4.) Find the general solution to the following system of differential equa-tions.

"

x1 “ ´4x` 3yy1 “ ´6x` 2y

5.) Solve the following initial value problem.

$

&

%

x1 “ 2x´ 5yy1 “ 5x` 2yxp0q “ 2yp0q “ 3

6.) Solve the following initial value problem.

$

&

%

x1 “ 2x´ 13yy1 “ 2x´ 8yxp0q “ 1yp0q “ 0

Page 524: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 515

7.) Find the general solution to the following system of differential equa-tions.

$

&

%

x1 “ 6x` 3y ´ 3zy1 “ 4x´ 4zz1 “ 10x` 3y ´ 7z

8.) Solve the following initial value problem.

$

&

%

x1 “ 12x` 3y ´ 6zy1 “ ´4x` y ` 4zz1 “ 13x` 5y ´ 7zxp0q “ 1yp0q “ 3zp0q “ 2

9.) Solve the following initial value problem.

$

&

%

x1 “ 4x` 3y ´ 5zy1 “ ´4x` y ` 5zz1 “ 4x` y ´ 3zxp0q “ 0yp0q “ 0zp0q “ 2

10.) Find the general solution to the following system of differential equa-tions.

$

&

%

x1 “ ´x´ 2zy1 “ 4x` y ` 4zz1 “ ´6x´ 4y ´ z

11.) Consider the following system of two tanks. Tank A initially contains50 L of pure water; tank B initially contains 50 L of a salt solution atconcentration 5 g/L. The rate at which salt solution is pumped intoeach tank, the rate of fluid collection out of each tank, and the variousmixing rates between the tanks are shown below.

Page 525: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 516

A B

1 Lmin

2 Lmin

3 Lmin

5 Lmin

4 Lmin

at 4 gL

4 Lmin

at 12

gL

Assuming that the solutions in both tanks remain well-mixed through-out the process, find CAptq and CBptq, the concentrations of salt intanks A and B respectively. What concentrations do the tanks limit toin the long-run?

12.) Consider the following system of two tanks. Tank A initially contains25 gallons of a sugar solution at 2/25 lb/gal; tank B initially contains25 gallons of a pure water. The rate at which sugar solution is pumpedinto each tank, the rate of fluid collection out of each tank, and thevarious mixing rates between the tanks are shown below.

A B

4 galmin

3 galmin

2 galmin

1 galmin

pure water 1 galmin

at 15

lbgal

Assuming that the solutions in both tanks remain well-mixed through-out the process, find CAptq and CBptq, the concentrations of salt intanks A and B respectively. What concentrations do the tanks limit toin the long-run?

13.) Consider the following system of three tanks. Tanks A and B contain300 L of fluid while Tank C contains 600 L. The rate at which saltsolution is pumped into each tank, the rate of fluid collection out ofeach tank, and the various mixing rates between the tanks are shownbelow.

Page 526: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 517

A B

C

3 Lmin

3 Lmin

12 Lmin

12 Lmin

15 Lmin

3 Lmin

at 23

kgL

12 Lmin

at 112

kgL

Assuming that the salt solutions in all three tanks remain well-mixedthroughout the process, what do the concentrations, CA, CB, and CC ,in each tank limit to in the long-run?

14.) Find the general solution to the following second order linear differentialequation by converting it into a system of first order equations.

d2x

dt2` 4

dx

dt` 5x “ 13 cosp2tq

15.) A block of mass m “ 1 kg is attached to a spring of strength k “ 21N/m and is allowed to slide horizontally on table. An external forceof F ptq “ 25 sinptq acts on the block. Assume the coefficient of linearresistance for the system is b “ 10 Ns/m. If the block starts fromequilibrium moving to the right at 1 m/s, solve for the position of theblock as a function of time.

16.) Find the general solution to the following third order linear differentialequation by converting it into a system of first order equations.

d3x

dt3´ 4

d2x

dt2`dx

dt´ 4x “ ´15e´2t

17.) Find and classify all equilibria for the following nonlinear system ofdifferential equations.

"

x1 “ ´px´ yqp1´ x´ yqy1 “ xpy ` 2q

Page 527: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 518

18.) Find and classify all equilibria for the following nonlinear system ofdifferential equations.

"

x1 “ xy ´ 9xy1 “ px´ 2qpy2 ` 3y ` 2q

19.) Find and classify all equilibria for the following nonlinear system ofdifferential equations.

"

x1 “ xpy2 ` 2y ´ 3qy1 “ ´ypx` 5q

20.) Consider the modified predator–prey model with logistic growth for theprey species.

dR

dt“ αR

ˆ

1´R

NR

˙

´ βRF

dF

dt“ ´γF ` δRF

a.) Show that the equilibria are pR,F q “ p0, 0q and pNR, 0q when

NR ăγ

δ. In the case NR ą

γ

δ, show that there are three equilibria:

p0, 0q, pNR, 0q, and the coexistence equilibriumˆ

γ

δ,α

β

ˆ

1´γ

δNR

˙˙

.

b.) Show that p0, 0q is always an unstable saddle point.

c.) Show that pNR, 0q is an asymptotically stable node when NR ăγ

δand an unstable saddle point when the reverse inequality holds.

d.) In the special case that α “1

6, β “

1

3, γ “

1

12, δ “

1

24, and

NR “ 4, show that the coexistence equilibrium is an asymptoti-cally stable spiral point.

21.) Recall the SEIR Disease Model discussed in Section 5.5.3.

dS

dt“ µ´ αSI ´ µS

dE

dt“ αSI ´ pµ` γqE

dI

dt“ γE ´ pµ` βqI

Page 528: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 519

a.) Verify the equilibria for this system are those given in Theorem5.5.3.

b.) For the case when α “ 1{20, β “ 1{5, γ “ 1{5, and µ “ 1{100,show that the trivial equilibrium pS,E, I, Rq “ p1, 0, 0, 0q is asymp-totically stable by showing (numerically) that all eigenvalues arenegative.

c.) For the case when α “ 1{2, β “ 1{20, γ “ 1{5, and µ “ 1{100,show that the trivial equilibrium pS,E, I, Rq “ p1, 0, 0, 0q is unsta-ble by showing (numerically) that there is a positive eigenvalue.(It can be shown that the other equilibrium in this case is asymp-totically stable).

22.) A 2ˆ 2 matrix with a repeated eigenvalue is almost certainly going tohave a deficiency in the number of independent eigenvector families. 8

If a 2ˆ 2 matrix M has a repeated eigenvalue λ and a single family ofeigenvectors with basis vector ~v, then the general solution to

~x 1 “M~x

is of the form~xptq “ c1~ve

λt` c2 pt~v ` ~ηq e

λt

where the vector ~η is any generalized eigenvector satisfying the equation

pM ´ λI2q~η “ ~v

(which is equivalent to M~η “ λ~η ` ~v). Verify that this is indeed asolution to the differential equation.

23.) Using the results discussed in the previous problem, find the generalsolution to the following systems of differential equations.

a.)

~x 1 “

1 9´1 ´5

~x

b.)

~x 1 “

3 ´41 ´1

~x

8If a 2ˆ2 matrix has a repeated eigenvalue and two independent families of eigenvectors,then the matrix must be a multiple of the 2ˆ 2 identity matrix.

Page 529: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 520

24.) a.) For any square matrix M , it is possible to define the matrix ex-ponential, eM . If a matrix is diagonalizable, then

eM “ BeDB´1

where M “ BDB´1, D is the diagonal matrix of eigenvalues sim-ilar to M , and

D “

»

λ1 0 0 ¨ ¨ ¨ 00 λ2 0 ¨ ¨ ¨ 00 0 λ3 ¨ ¨ ¨ 0...

......

. . ....

0 0 0 ¨ ¨ ¨ λn

fi

ffi

ffi

ffi

ffi

ffi

fl

ÝÑ eD

»

eλ1 0 0 ¨ ¨ ¨ 00 eλ2 0 ¨ ¨ ¨ 00 0 eλ3 ¨ ¨ ¨ 0...

......

. . ....

0 0 0 ¨ ¨ ¨ eλn

fi

ffi

ffi

ffi

ffi

ffi

fl

.

Find the matrix exponential for the matrices in problems 15.) and16.) in Section 8.9.4.

b.) For an inhomogeneous system of differential equations

~x 1 “M~x`~bptq

where M is a matrix of constant coefficients, a particular solutionis given by

~xpptq “ etMż t

0

e´τM~bpτq dτ.

Verify that this is indeed a solution to the inhomogeneous differ-ential equation above using the following facts about the matrixexponential.

etMe´tM “ e´tMetM “ Ind

dt

etM‰

“ etMM “MetM

25.) Using the results discussed in the previous problem, find a particularsolution to the following systems of differential equations.

a.)

~x 1 “

5 ´63 ´4

~x`

3e2t

0

Page 530: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 9. ANALYSIS OF LINEAR SYSTEMS 521

b.)

~x 1 “

´1 13 1

~x`

4e´2t

4e2t

26.) Challenge: Coupled Spring–Mass Systems Two blocks are con-nected by three springs as shown below.

m1 m2

k1 k2 k3

The masses of the blocks are m1 and m2, respectively; the strengthsof the three springs are given by k1, k2, and k3. If x1 “ x1ptq andx2 “ x2ptq are the horizontal positions of the blocks measured fromequilibrium, then the motion of the two springs is governed by thefollowing equations (assuming friction is negligible and the oscillationsof the blocks are not too large).9

m1x21 “ ´k1x1 ` k2px2 ´ x1q

m2x22 “ ´k2px2 ´ x1q ´ k3x2

a.) Write this second order system of differential equations as a systemof four first order differential equations.

b.) Find the general solution to this system of differential equationswhen m1 “ m2 “ 1, k1 “ k3 “ 2, and k2 “ 1.

9If the oscillations become so large that the blocks contact each other or the wall, thencertainly our model will not accurately predict the positions of the blocks. Even if theoscillations are not that big, Hooke’s Law (the force supplied by a spring is proportional tohow much the string has been stretched) is only valid for a modest amount of stretching.

Page 531: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Chapter 10

Discrete–Time StochasticProcesses

Often in applications, we have a sequence of random events which happen atdifferent times rather than a single random variable. These random eventsmay be completely independent of one another, or more typically, the nextevent in the sequence may depend on the current and previous events in someway (while still being random).

For example, suppose that we are allowed to walk along a straight line.We start out on the point labeled “0,” and every few seconds we take either astep forward or a step backwards. The decision of whether to move forwardor backwards is random – perhaps determined by the flip of a fair coin. LetXi be our position after the i-th step, and note that X0 “ 0 since we startedfrom the origin. A coin flip of heads (H) will mean we take one step forward,while tails (T) will mean we take one step backwards. The start of onepossible sequence of events is the following:

Step Old Position Coin Flip New Position

1 X0 “ 0 H X1 “ X0 ` 1 “ 12 X1 “ 1 H X2 “ X1 ` 1 “ 23 X2 “ 2 T X3 “ X2 ´ 1 “ 14 X3 “ 1 H X4 “ X3 ` 1 “ 25 X4 “ 2 T X5 “ X4 ´ 1 “ 16 X5 “ 1 T X6 “ X5 ´ 1 “ 07 X6 “ 0 T X7 “ X6 ´ 1 “ ´1...

......

...

522

Page 532: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 523

-3 -2 -1 0 321

1 2

3

4

5

67

Figure 10.0.1: The Beginning of a Random Walk

This sequence of random variables pXiq “ pX0, X1, X2, X3, ¨ ¨ ¨ q is an exampleof a discrete–time stochastic process: a dynamical system with someinherent randomness in each step and where time passes in whole blocksmarked by integers (typically n “ 0, 1, 2, 3, ¨ ¨ ¨ ). Notice that these are verysimilar to the discrete dynamical systems we discussed in Chapter 1. Thedifference is that the discrete dynamical systems we discussed before weredeterministic. If we knew q0, q1, q2, ¨ ¨ ¨ , qn, then the updating function forthe system completely determined qn`1:

qn`1 “ fpn, qn, qn´1, qn´2, ¨ ¨ ¨ , qn´mq.

With a stochastic process, however, knowing X0, X1, X2, ¨ ¨ ¨ , Xn only givesus partial information about Xn`1 because there is an element of randomnessin each step. In an extreme case, Xn`1 may be completely independent ofall the values that came before! In this chapter, our goal is to explore someof the more common discrete–time stochastic processes. In addition to timebeing discrete, all of the random variable pXiq in the stochastic processes westudy are assumed to have the same discrete sample space (usually labeled bythe integers). Since we will only deal with discrete–time stochastic processeswith discrete sample spaces, we will often just call them stochastic processesin the following sections.1 This chapter follows closely the presentation inChapter 4 of [Rs03], but there will be a number of results whose proofs willbe omitted. Appropriate references will be cited for the interested reader.

1Many of our results apply just as well to discrete–time stochastic processes with con-tinuous sample spaces. This is especially true for Markov Chains. We can also allowstochastic processes with time measured continuously, though the mathematical tools re-quired are significantly more sophisticated than what we have at our disposal.

Page 533: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 524

10.1 Markov Chains

Despite already being rather specialized, the universe of discrete–time stochas-tic processes is still too broad a subject for our purposes. We first make theassumption that our random variables, Xn, have values in the integers:

Xn “ 0,˘1,˘2,˘3, ¨ ¨ ¨

These integers are the possible states of the process. Suppose after n unitsof time, the system has the following history:

X0 “ i0, X1 “ i1, X2 “ i2, ¨ ¨ ¨ , Xn “ in.

That is, i0 is some integer (a state of the system), and the system is initiallyin this state. After one time step (n “ 1), the system transitions from statei0 to the state i1 (another integer representing a possible state of the system),and so on.

In order to make predictions, we need to know the probability distributionfor Xn`1 given this past history. In more precise language, we need to knowthe following conditional probabilities:

P pXn`1 “ i |X0 “ i0, X1 “ i1, X2 “ i2, ¨ ¨ ¨ , Xn “ inq .

These conditional probabilities are known as transition probabilities sincethey tell us the probability that the system will move to state i given all ofits previous history.

In general, these probabilities can depend on the entire history up totime n ` 1 (and perhaps on the time n itself). However, we will make thesimplifying assumption that

P pXn`1 “ i |X0 “ i0, ¨ ¨ ¨ , Xn “ inq “ P pXn`1 “ i |Xn “ inq

“ P pX1 “ i |X0 “ inq .

In other words, the probabilities for the next time step (time n ` 1) onlydepend on the current state of the system (the state at time n), and thesetransition probabilities do not change over time. Such a stochastic process iscalled a Markov Chain. Essentially, a Markov Chain is memoryless; it notonly forgets what has occurred before the present time, it is also unaware ofhow much time has passed!

Page 534: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 525

Since for a Markov Chain the transition probabilities depend only on thecurrent state (which are integers), we can refer to these probabilities withlabels:

P pXn`1 “ i |Xn “ jq “ P pX1 “ i |X0 “ jq “ Pij.

You should think of Pij as “the probability that a Markov Chain currentlyin state j will transition to state i in the next time step.” The labeling heremay seem a little strange (i.e. Pij indicates a change to state i from statej rather than the other way around), but it will make later formulas seemmore natural.

Since the Pij are supposed to be probabilities, they must satisfy certainbasic requirements. First,

Pij ě 0 for all pairs i and j.

This is clear since probabilities are supposed to be non-negative! Second, ifthe system is currently in state j, all possible transition probabilities mustadd up to be 1. That is, we require

ÿ

i

Pij “ 1 for each j.

If we make the simplifying assumption that there are only a finite numberof possible states, then we can display the transition probabilities in a squarematrix. We suppose that the possible states of the system are t0, 1, 2, ¨ ¨ ¨ ,mu.This means that for each time step i, Xi must be equal to one of 0, 1, 2, ¨ ¨ ¨ ,m. We display the probabilities as

P “

»

P00 P01 P02 ¨ ¨ ¨ P0m

P10 P11 P12 ¨ ¨ ¨ P1m

P20 P21 P22 ¨ ¨ ¨ P2m...

......

. . ....

Pm0 Pm1 Pm2 ¨ ¨ ¨ Pmm

fi

ffi

ffi

ffi

ffi

ffi

fl

.

This matrix is called a (left) stochastic matrix2 or a transition probabil-ity matrix. Note that in a transition probability matrix, the probabilitiesin each column must add up to 1.

2The “left” in “left stochastic matrix” indicates that each column must sum to 1. Aright stochastic matrix is a matrix where each row sums to 1. A doubly stochastic matrixis one where each row and each column sum to 1.

Page 535: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 526

Example 10.1.1. Consider the following overly simple weather model. Eachday, the sky is either clear, partly cloudy, or overcast. If today is clear, thentomorrow will be clear with probability 0.5, partly cloudy with probability0.3, or overcast with probability 0.2. If today is partly cloudy, then tomor-row will be clear with probability 0.3, partly cloudy with probability 0.4,or overcast with probability 0.3. If today is overcast, then tomorrow willbe clear with probability 0.2, partly cloudy with probability 0.4, or overcastwith probability 0.4. Write this process as a Markov Chain, and determinethe matrix of transition probabilities.

Answer: We begin by arbitrarily labeling the possible states with integers:let 0 stand for the state that the sky is clear, 1 for partly cloudy, and 2 forovercast. Let pXiq “ pX0, X1, X2, ¨ ¨ ¨ q be the sequence of weather states. Forthe transition probabilities, we find

P00 “ “ probability that it will be clear tomorrow given it is clear today” “ 0.5,

P01 “ “ probability that it will be clear tomorrow given that is partly cloudy today” “ 0.3,

P02 “ “ probability that it will be clear tomorrow given that is overcast today” “ 0.2,

P10 “ “ probability that it will be partly cloudy tomorrow given it is clear today” “ 0.3,

P11 “ “ probability that it will be partly cloudy tomorrow given it is partly cloudy today” “ 0.4,

P12 “ “ probability that it will be partly cloudy tomorrow given it is overcast today” “ 0.4,

P20 “ “ probability that it will be overcast tomorrow given it is clear today” “ 0.2,

P21 “ “ probability that it will be overcast tomorrow given it is partly cloudy today” “ 0.3,

P22 “ “ probability that it will be overcast tomorrow given it is overcast today” “ 0.4.

Putting this into a 3ˆ 3 matrix gives

P “

»

P00 P01 P02

P10 P11 P12

P20 P21 P22

fi

fl “

»

0.5 0.3 0.20.3 0.4 0.40.2 0.3 0.4

fi

fl .

Notice that the requirement that

ÿ

i

Pij “ 1 for each j

translates into the sum of the entries in any given column must equal 1. �

Page 536: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 527

0

12

3

4 5

Figure 10.1.1: A Circular Walk

Example 10.1.2. Suppose we take a random walk on the circular pathshown in Figure 10.1.1. At each time step, we will flip a fair coin to de-termine our next position. If the coin flip is heads, we will move one unitcounterclockwise; for tails, we will move one unit clockwise. Write this pro-cess as a Markov Chain, and determine the matrix of transition probabilities.

Answer: Clearly, the states are the positions on the circular path (which arealready labeled with integers). Let pXiq “ pX0, X1, X2, ¨ ¨ ¨ q be the sequenceof nodes we take on our random walk. We need only determine the transitionprobabilities. Suppose that we are currently standing on the node labeled0. The only possible moves that can happen are a transition to node 1 or atransition to node 5. Hence, we have the following probabilities:

P00 “ “probability of moving from node 0 to node 0” “ 0,

P01 “ “probability of moving from node 1 to node 0” “ 0.5,

P02 “ “probability of moving from node 2 to node 0” “ 0,

P03 “ “probability of moving from node 3 to node 0” “ 0,

P04 “ “probability of moving from node 4 to node 0” “ 0,

P05 “ “probability of moving from node 5 to node 0” “ 0.5.

Likewise, if we are currently standing on a particular node, then there is a50% chance of moving to the node one space counterclockwise and a 50%

Page 537: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 528

chance of moving to the node one space clockwise. All other transition prob-abilities must be zero. Putting this into a transition matrix gives

P “

»

P00 P01 P02 P03 P04 P05

P10 P11 P12 P13 P14 P15

P20 P21 P22 P23 P24 P25

P30 P31 P32 P33 P34 P35

P40 P41 P42 P43 P44 P45

P50 P51 P52 P53 P54 P55

fi

ffi

ffi

ffi

ffi

ffi

ffi

fl

»

0 0.5 0 0 0 0.50.5 0 0.5 0 0 00 0.5 0 0.5 0 00 0 0.5 0 0.5 00 0 0 0.5 0 0.5

0.5 0 0 0 0.5 0

fi

ffi

ffi

ffi

ffi

ffi

ffi

fl

.

Once again, note that each column sums up to 1. Unlike the previous exam-ple, the rows of this transition matrix also sum to 1. Such a matrix is knownas a doubly stochastic matrix. �

Example 10.1.3. Consider the following simple maze.

0 1 2

3

4

5

7

6

Figure 10.1.2: A Simple Maze

Suppose a mouse is running this maze, and Room 7 is the goal (i.e. onceit reaches that room, the mouse gets a reward and the experiment is over).If the mouse is in any other room, we assume that it chooses any of theconnecting rooms with equal probability. Write this process as a MarkovChain, and determine the matrix of transition probabilities.Answer: Let pXiq “ pX0, X1, X2, ¨ ¨ ¨ q be the sequence of rooms that themouse inhabits. If the mouse is in room 0, then it will move to either room1 or room 3 each with probability 1{2. All other transitions are impossible.

Page 538: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 529

Similarly, if the mouse is in room 1, then it will move to either of rooms 0,2, or 4 each with a probability of 1{3. We continue this way until we get toroom 7. Once the mouse is in this room, the experiment is over. Puttingthese probabilities in the transition matrix gives

P “

»

P00 P01 P02 P03 P04 P05 P06 P07

P10 P11 P12 P13 P14 P15 P16 P17

P20 P21 P22 P23 P24 P25 P26 P27

P30 P31 P32 P33 P34 P35 P36 P37

P40 P41 P42 P43 P44 P45 P46 P47

P50 P51 P52 P53 P54 P55 P56 P57

P60 P61 P62 P63 P64 P65 P66 P67

P70 P71 P72 P73 P74 P75 P76 P77

fi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

fl

»

0 1{3 0 1{2 0 0 0 01{2 0 1 0 1{2 0 0 00 1{3 0 0 0 0 0 0

1{2 0 0 0 0 1{3 0 00 1{3 0 0 0 1{3 0 00 0 0 1{2 1{2 0 1{2 00 0 0 0 0 1{3 0 00 0 0 0 0 0 1{2 1

fi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

fl

. �

10.2 The Chapman–Kolmogorov Equations

The transition probability matrix gives us the probabilities of states exactlyone time step in the future. Our next goal is to find a way of predictingprobabilities n time steps in the future. The n-step transition probabilitiesare defined by

P nij “ P pXn`m “ i|Xm “ jq “ P pXn “ i|X0 “ jq .

The two conditional probabilities are equal because Markov Chains are mem-oryless. Note that P 1

ij “ Pij while P 0ij equals one when i “ j and 0 otherwise.

In other words, the matrix giving the values of P 0ij is simply the identity

matrix.

Theorem 10.2.1 (The Chapman–Kolmogorov Equations). The n-step tran-sition probabilities satisfy the following equations

P n`mij “

ÿ

k

P nikP

mkj .

Page 539: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 530

Proof: We begin by conditioning on the state of the system at time m. Notethat we have to preserve the original condition as we go!

P n`mij “ P pXn`m “ i|X0 “ jq

“ÿ

k

P pXn`m “ i|Xm “ k,X0 “ jqP pXm “ k|X0 “ jq

“ÿ

k

P pXn`m “ i|Xm “ kqP pXm “ k|X0 “ jq .

The last step above utilizes the fact that Markov Chains are memoryless(and so we only have to keep the latest condition). Given the initial state isj, the probability that the system ends up in state k at time step m is

Pmkj “ P pXm “ k|X0 “ jq .

The other term is given by

P pXn`m “ i|Xm “ kq “ P pXn “ i|X0 “ kq “ P nik.

As a result,P n`mij “

ÿ

k

P nikP

mkj . �

Corollary 10.2.1.1. Let P be the matrix of transition probabilities and P pnq

be the matrix of n-step transition probabilities. Then P pnq can be found byraising P to the n-th power. That is

P pnq “ P n.

Proof: We already know P p0q “ P 0 “ In and P p1q “ P 1 “ P. If we considerthe two step transition probabilities, we find by the Chapman–Kolmogorovequations that

P 2ij “

ÿ

k

P 1ikP

1kj “

ÿ

k

PikPkj.

This summation multiplies the entries in a row of the matrix on the left bythe entries in a column of the matrix on the right and adds up the total. Butthat is the definition of matrix multiplication! Hence, we see that P p2q “ P 2.Assume we have already shown that P pn´1q “ P n´1 and consider P n. By theChapman–Kolmogorov equations

P pnq “ P pn´1q¨ P p1q “ P n´1

¨ P “ P n.

Page 540: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 531

Thus, the corollary follows by mathematical induction. �Since the matrix P pnq of n-step transition probabilities is simply the n-th

power of the transition matrix P , we drop this notation moving forward andsimply use P n.

Example 10.2.1. Consider the simple weather model in Example 10.1.1.Compute the 2-step transition probabilities. What do these probabilities tellus?

Answer: Recall that state 0 is clear skies, 1 is partly cloudy, and 2 isovercast. We found that the appropriate transition probability matrix is

P “

»

0.5 0.3 0.20.3 0.4 0.40.2 0.3 0.4

fi

fl .

The 2-step transition probabilities are given by

»

P 200 P 2

01 P 202

P 210 P 2

11 P 212

P 220 P 2

21 P 222

fi

fl “ P 2

»

0.5 0.3 0.20.3 0.4 0.40.2 0.3 0.4

fi

fl

»

0.5 0.3 0.20.3 0.4 0.40.2 0.3 0.4

fi

fl

»

0.38 0.33 0.30.35 0.37 0.380.27 0.3 0.32

fi

fl

This matrix gives us the probability of the weather two days in the future.For instance, if today the sky is overcast, then the probability that it will bepartly cloudy two days from now is

P 212 “ 0.38. �

Example 10.2.2. Consider the circular random walk in Example 10.1.2.Compute the 5-step transition probabilities. What do these probabilities tellus?

Page 541: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 532

Answer: Recall that the transition probability matrix is

P “

»

0 12

0 0 0 12

12

0 12

0 0 00 1

20 1

20 0

0 0 12

0 12

00 0 0 1

20 1

212

0 0 0 12

0

fi

ffi

ffi

ffi

ffi

ffi

ffi

fl

.

So, the 5-step transition probability matrix is given by

»

P 500 P 5

01 P 502 P 5

03 P 504 P 5

05

P 510 P 5

11 P 512 P 5

13 P 514 P 5

15

P 520 P 5

21 P 522 P 5

23 P 524 P 5

25

P 530 P 5

31 P 532 P 5

33 P 534 P 5

35

P 540 P 5

41 P 542 P 5

43 P 544 P 5

45

P 550 P 5

51 P 552 P 5

53 P 554 P 5

55

fi

ffi

ffi

ffi

ffi

ffi

ffi

fl

“ P p5q

“ P 5

»

0 12

0 0 0 12

12

0 12

0 0 00 1

20 1

20 0

0 0 12

0 12

00 0 0 1

20 1

212

0 0 0 12

0

fi

ffi

ffi

ffi

ffi

ffi

ffi

fl

5

»

0 1132

0 516

0 1132

1132

0 1132

0 516

00 11

320 11

320 5

16516

0 1132

0 1132

00 5

160 11

320 11

321132

0 516

0 1132

0

fi

ffi

ffi

ffi

ffi

ffi

ffi

fl

.

This matrix of transition probabilities gives us probabilities 5 time steps intothe future. For example, if we start at node 0, the probability that we landon node 3 after 5 steps is P 5

30 “ 5{16. The probabilities that we land onnodes 1 or 5 after 5 steps are both P 5

10 “ P 550 “ 11{32. The probabilities of

landing on nodes 0, 2, or 4 after 5 steps are all zero. This last fact makessense since on every step of our random walk we must change from an evennode to an odd node or vice versa. So, if we start on node 0 (or any other

Page 542: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 533

even node), one step in the future must put us on an odd node. The secondstep must put us back on an even node, and so on. �

The transition probabilities in each P pnq are conditional probabilities. Inthe example above, P 5

30 is the probability of landing on node 3 after 5 stepsgiven that we started on node 0. To go from conditional probabilities tounconditional probabilities, we have to specify the probability distribution ofthe initial state of the system. That is, we have to specify the probabilitiesPpX0 “ iq for every possible state. We can write these probabilities as acolumn vector

~p0 “

»

PpX0 “ 0qPpX0 “ 1q

...PpX0 “ mq

fi

ffi

ffi

ffi

fl

.

Notice that the entries of this vector must sum up to 1. Once we specify theinitial probability distribution, we can compute the unconditional probabili-ties for the outcome of Xn,

~pn “

»

PpXn “ 0qPpXn “ 1q

...PpXn “ mq

fi

ffi

ffi

ffi

fl

,

as follows.

Corollary 10.2.1.2. For a Markov Chain with transition probability matrixP and initial probability distribution ~p0, the unconditional probability distri-bution of Xn (the state of the system at time step n) is denoted ~pn and isgiven by

~pn “ P pnq~p0 “ P n~p0.

Proof: By conditioning,

PpXn “ iq “ÿ

j

PpXn “ i|X0 “ jqPpX0 “ jq

“ÿ

j

P nijPpX0 “ jq

“ i-th component of P n~p0. �

Page 543: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 534

Example 10.2.3. Consider the simplified weather model in Example 10.1.1.Suppose that on a given day, the probability that the sky is clear is 50%,the probability of being partly cloudy is 25%, and the probability of beingovercast is also 25%. What is the probability of having an overcast day 5days later?

Answer: The information given to us tells us that

~p0 “

»

0.50.250.25

fi

fl .

So, the probability distribution 5 days later is given by

~p5 “ P p5q~p0

»

0.5 0.3 0.20.3 0.4 0.40.2 0.3 0.4

fi

fl

5 »

0.50.250.25

fi

fl

»

0.33878 0.33789 0.337340.36591 0.36625 0.366460.29531 0.29586 0.2962

fi

fl

»

0.50.250.25

fi

fl

»

0.33819750.36613250.29567

fi

fl .

The probability that the sky will be overcast 5 days later is given by the finalcomponent of this vector.

PpX5 “ 2q “ 0.29567. �

Example 10.2.4. Consider the maze from Example 10.1.3. If the mousestarts out in room 0, what is the probability that it has reached room 7 after4 random moves?

Answer: Since the mouse must start from room 0, the initial probability

Page 544: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 535

distribution is given by the column vector

~p0 “

»

10000000

fi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

fl

.

So, the probability distribution after 4 moves is given by

~p4 “ P p4q~p0

»

0 1{3 0 1{2 0 0 0 01{2 0 1 0 1{2 0 0 00 1{3 0 0 0 0 0 0

1{2 0 0 0 0 1{3 0 00 1{3 0 0 0 1{3 0 00 0 0 1{2 1{2 0 1{2 00 0 0 0 0 1{3 0 00 0 0 0 0 0 1{2 1

fi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

fl

4 »

10000000

fi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

fl

.

»

43144

136

1136

136

1372

1172

136

0124

3772

0 1348

124

736

124

01172

0 29

136

536

136

136

0136

1372

118

1348

1172

136

18

01372

136

518

1172

14

136

19

01148

736

112

124

124

2372

0 0136

136

118

18

19

0 112

0124

136

0 112

112

14

712

1

fi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

fl

»

10000000

fi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

fl

»

43{1441{2411{721{3613{7211{481{361{24

fi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

fl

.

Page 545: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 536

So, the probability that the mouse finds room 7 after 4 random moves is

PpX4 “ 7q “1

24. �

10.3 Transient and Recurrent States

A state i is accessible from state j if it is possible that the Markov Chain isin state i at some time in the future if it starts out in state j. An equivalentdefinition is that

P nij ą 0 for some n ě 0.

Clearly a state is accessible from itself. In the case state i is accessible fromstate j, we write j Ñ i.

In our simple weather model (Example 10.1.1), state 1 is directly accessi-ble from state 0: 0 Ñ 1. In words, it is possible that tomorrow will be partlycloudy if it is clear today. In fact, each state in this example is directlyaccessible from every other state.

In our circular random walk (Example 10.1.2), we see that every state isaccessible from every other state (though not after a single step). Considerstarting from node 0. After 1 step, we could only be on nodes 1 or 5 (so0 Ñ 1 and 0 Ñ 5). After two steps, we could be on nodes 0, 2, or 4 (0 Ñ 0,0 Ñ 2, and 0 Ñ 4). After three steps, we could be on nodes 1, 3, 5 (giving usthe final 0 Ñ 3). Hence, every state is accessible from 0. This same argumentcan be applied to any of the other nodes as well.

For the maze in Example 10.1.3, the situation is a little more interesting.Starting in rooms 0 through 6, any other room in the maze is clearly acces-sible. However, in our setup of the maze, if the mouse starts in room 7 itstays in room 7. So, no other room is accessible from room 7.

Two states i and j are said to communicate if i is accessible from jAND j is accessible from i. If two states communicate with each other, wewrite i Ø j. Communication has several nice properties. First, any statecommunicates with itself: i Ø i. If a state i communicates with a statej, then j communicates with i. Finally, if i communicates with j and jcommunicates with k, then i must communicate with k: i Ø j and j Ø kimplies i Ø k. This means that communication is an equivalence relation,and it divides up the states of a Markov Chain into a number of classes.Each class consists of states that communicate with each other, and statesin separate classes do not communicate with each other.

Page 546: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 537

In Examples 10.1.1 and 10.1.2, all the states belong to the same class. AMarkov Chain in which all states communicate is said to be irreducible. Themaze in Example 10.1.3 has two classes of states: t0, 1, 2, 3, 4, 5, 6u and t7u.As another example, consider the following variant of our circular randomwalk.

Example 10.3.1. Considered the connected loops below.

0

12

3

4 5

6

78

9

10 11

Figure 10.3.1: An Alternate Walk

Page 547: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 538

For nodes 1, 2, 3, 4, 5, 7, 8, 9, 10, and 11, there is a probability of 1{2 ofmoving to the node on either side of it. For node 0, there is a probability of1{3 of moving to any of the three nodes connected to it. For node 6, thereis a probability of 1{2 of moving to nodes 7 or 11. It is impossible to movefrom node 6 back to node 0.

There are two classes of states in this example: t0, 1, 2, 3, 4, 5u andt6, 7, 8, 9, 10, 11u. Notice that 0 and 6 do not communicate. Node 6 is acces-sible from node 0, but node 0 is not accessible from node 6. �

Let qi be the probability that the Markov Chain will ever reenter state iif it starts out in state i. If qi “ 1, then the system must return to state iat some point in the future. Such states are said to be recurrent. If qi ă 1,then the system may never return to state i in the future. Such states arecalled transient.

If a state is recurrent, then it follows that the Markov Chain will visitthat state infinitely often if it ever enters that state. Indeed, if the MarkovChain starts out in a recurrent state, then it will definitely return to thatstate at some point in the future. But once it returns to that state, theprocess starts over anew. Hence, it must return to the same state again andagain.

On the other hand, if a state is transient, the number of times the systemis expected to be in that state is finite. Suppose that state i is transient withqi ă 1 being the probability that the system will return to state i if it startsthere. The probability that the system visits state i exactly n times must be

qn´1i p1´ qiq

which means that the number of times the system revisits a transient stateis a geometric random variable with probability 1´ qi. Hence, the expectednumber of times the system will visit state i is

1

1´ qi.

Theorem 10.3.1. Let pXiq be a Markov Chain. The following facts aboutrecurrent and transient states are true.3

3Infinite sums (or series as they are usually called) require care to handle correctly.Fortunately, we are dealing with the simplest possible case when all of the terms arenon-negative. See Appendix C for the relevant details.

Page 548: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 539

1.) State i is recurrent if8ÿ

n“1

P nii “ 8.

2.) State i is transient if8ÿ

n“1

P nii ă 8.

3.) If a Markov Chain has a finite number of states, then at least one statemust be recurrent.

4.) If state i is recurrent and state i communicates with state j, then state jmust also be recurrent. The same statement holds for transient states.

Proof: For any state i in the Markov Chain, let I in be the random variable

I in “

"

1, Xn “ i0, Xn ‰ i

.

In words, I in indicates whether the Markov Chain is in state i at time stepn. To determine whether i is recurrent or transient, we need to look at the

conditional expectation E

«

8ÿ

n“0

I in

ˇ

ˇ

ˇ

ˇ

ˇ

X0 “ i

ff

which is precisely the expected

total number of times the Markov Chain is in state i given that it started inthis state.

E

«

8ÿ

n“0

I in

ˇ

ˇ

ˇ

ˇ

ˇ

X0 “ i

ff

8ÿ

n“0

E“

I in|X0 “ i‰

8ÿ

n“0

P pXn “ i|X0 “ iq

8ÿ

n“0

P nii

This computation establishes the first two statements of the theorem since arecurrent state must be revisited an infinite number of times while a transientstate is only expected to be visited a finite number of times.

For the third statement, if all states in a finite state Markov Chain weretransient, then after some (possibly large) number of time steps none of

Page 549: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 540

the states in the chain are expected to be visited again. But this is clearlyimpossible since the Markov Chain continues for all future time steps!

The fourth statement of the theorem says that recurrence and transienceare properties of communication classes. Namely, every state in a communi-cation class is either recurrent or transient. We need only prove the theoremfor recurrent states since the result for transient states follows logically. Sup-pose state i communicates with state j and i is recurrent. Since there mustbe a strictly positive probability of starting in state j and transitioning tostate i in the future, there is some integer k such that P k

ij ą 0. Similarly,there is an integer m such that Pm

ji ą 0 (starting from state i, there must bea positive probability of transitioning to state j at some point in the future).Consider P k`m`n

jj which is the probability of returning to state j in k`m`nsteps if the process starts in state j. We must have

P k`m`njj ě Pm

ji PniiP

kij

since the probability on the left represents the overall probability of returningto state j in k `m` n steps while the product of probabilities on the rightrepresents the probability of going from state j to state i in k steps, returningto state i in n steps, and finally going from state i to state j in m steps (whichis only one of many possible kinds of paths from j back to itself). But then

8ÿ

`“0

P `jj ě

8ÿ

n“0

P k`m`njj

ě

8ÿ

n“0

Pmji P

niiP

kij “ Pm

ji Pkij

8ÿ

n“0

P nii .

Since i is recurrent, the sum on the right hand side of the inequality is infinite.As a result, j must also be recurrent by the first statement in the theorem.�

In the simple weather model, Example 10.1.1, all states must be recurrentsince all states communicate. The same is true for the circular random walkin Example 10.1.2. Notice that for any irreducible Markov Chain with afinite number of states, all states must be recurrent!

For the maze in Example 10.1.3, we can argue heuristically that roomst0, 1, 2, 3, 4, 5, 6u must be transient. Suppose that these rooms are recurrent.Then the process would revisit room 6 an infinite number of times. In thatcase, the probability that the system would never enter room 7 is 0. But

Page 550: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 541

once the system enters room 7, it is trapped in room 7 forever. Hence, room6 cannot be recurrent. That means rooms rooms t0, 1, 2, 3, 4, 5, 6u must allbe transient. We also know room 7 must be recurrent. A similar argumentworks for the nested loops in Example 10.3.1. Nodes t0, 1, 2, 3, 4, 5u must betransient while nodes t6, 7, 8, 9, 10, 11u are recurrent. Of course, the rigorousproof of these statements is through Theorem 10.3.1.

In all of the examples so far, there has been a single recurrent family.That need not be the case in every Markov Chain!

Example 10.3.2. In the diagram below, the nodes 0, 1, 2, 3, 4, and 5 all haveequal probability of transitioning to any of the nodes they are connected to.Nodes 6, 7, and 8 can only transition amongst themselves (according to howthey are connected). If the process enters node 9, then the system remainson that node for all future times.

Page 551: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 542

0

12

3

4 5

9 6

7

8

Figure 10.3.2: Random Walk for Example 10.3.2

As before, nodes t0, 1, 2, 3, 4, 5u communicate and are transient. Theother two families of communicating states, t6, 7, 8u and t9u, are both recur-rent. �

10.4 Application: The Gambler’s Ruin Prob-

lem

Consider a game where the player has probability p of winning (and so aprobability of q “ 1 ´ p of losing). If the player wins, they receive a fixedamount of money. For simplicity, we will assume the player receives $1 fora win. On the other hand, the player must pay $1 if they lose the game.Suppose the player starts with $M and plays the game repeatedly. Theplayer decides to stop the game if they reach $N (with N ě M ě 0) or ifthey lose all of their money. What is the probability that the player loses allof their money?

To analyze this situation, we set up a Markov Chain pXnq with statest0, 1, 2, 3, ¨ ¨ ¨ , Nu representing the different amounts of money the playercan have. The random variable Xn represents the total money the player hasafter n plays of the game. For the first state, we have X0 “ M . Since theplayer ends the process whenever Xn “ 0 or N , we must have P00 “ 1,Pi0 “ 0 pi ą 0q, PNN “ 1, and PiN “ 0 pi ă Nq. If Xn “ i (i.e. the gambler

Page 552: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 543

has i dollars after n rounds) with 0 ă i ă N , then Xn`1 “ i ` 1 withprobability p or Xn`1 “ i´ 1 with probability q. So

Pi`1,i “ p,

Pi´1,i “ q,

and all other transition probabilities are 0. The pN ` 1qˆ pN ` 1q transitionmatrix has the form

P “

»

1 q 0 0 0 0 ¨ ¨ ¨ 0 00 0 q 0 0 0 ¨ ¨ ¨ 0 00 p 0 q 0 0 ¨ ¨ ¨ 0 00 0 p 0 q 0 ¨ ¨ ¨ 0 00 0 0 p 0 q ¨ ¨ ¨ 0 0...

......

......

.... . .

......

0 0 0 0 0 0 ¨ ¨ ¨ q 00 0 0 0 0 0 ¨ ¨ ¨ 0 00 0 0 0 0 0 ¨ ¨ ¨ p 1

fi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

fl

There are three communication classes: t0u, t1, 2, 3, ¨ ¨ ¨ , N ´ 1u, and tNu.Clearly 0 and N are recurrent. All of the other states are transient.

Let PM be the probability that the Markov Chain reaches state N startingfrom state M ; clearly P0 “ 0 (since if the gambler starts with no money theystop the game immediately), and PN “ 1 (since the gambler stops the gameimmediately if they start withN dollars). To compute the other probabilities,we can condition on the outcome of the first play of the game.

PM “ PpXn “ N |X0 “Mq

“ PpXn “ N |X1 “M ` 1, X0 “MqPpX1 “M ` 1|X0 “Mq

` PpXn “ N |X1 “M ´ 1, X0 “MqPpX1 “M ´ 1|X0 “Mq

“ pPpXn “ N |X1 “M ` 1, X0 “Mq ` qPpXn “ N |X1 “M ´ 1, X0 “Mq

“ pPM`1 ` qPM´1 pM “ 1, 2, 3, ¨ ¨ ¨ , N ´ 1q

where in the last step we used the basic fact that transition probabilities donot change from one time step to the next. Using the fact that p` q “ 1, we

Page 553: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 544

have

pp` qqPM “ pPM`1 ` qPM´1

ppPM`1 ´ PMq “ qpPM ´ PM´1q

PM`1 ´ PM “q

ppPM ´ PM´1q.

If we look at these terms individually, we see a clear pattern:

P2 ´ P1 “q

ppP1 ´ P0q “

q

pP1,

P3 ´ P2 “q

ppP2 ´ P1q “

ˆ

q

p

˙2

P1,

P4 ´ P3 “q

ppP3 ´ P2q “

ˆ

q

p

˙3

P1,

...

Pi ´ Pi´1 “q

ppPi´1 ´ Pi´2q “

ˆ

q

p

˙i´1

P1,

...

PN ´ PN´1 “q

ppPN´1 ´ PN´2q “

ˆ

q

p

˙N´1

P1.

If we add up the terms pP2 ´ P1q ` pP3 ´ P2q ` ¨ ¨ ¨ ` pPi ´ Pi´1q and noticethe cancellations that occur, we find

Pi ´ P1 “

«

q

p`

ˆ

q

p

˙2

` ¨ ¨ ¨ `

ˆ

q

p

˙i´1ff

P1

or after rearranging

Pi “

«

1`q

p`

ˆ

q

p

˙2

` ¨ ¨ ¨ `

ˆ

q

p

˙i´1ff

P1.

If p “ 1{2 (and so q{p “ 1), we find that Pi “ iP1. Otherwise

Pi “1´ pq{pqi

1´ pq{pqP1.

Page 554: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 545

Finally, we use the fact that PN “ 1 to compute P1. If p “ 1{2, we haveP1 “ 1{N . In all other cases, we find

P1 “1´ pq{pq

1´ pq{pqN.

Combining this result with our previous calculations gives

PM “ P pgambler wins $N before going bankrupt | gambler started with $Mq

$

&

%

1´pq{pqM

1´pq{pqN, p ‰ 1{2

MN, p “ 1{2

Example 10.4.1. Suppose Alice and Bob play the following variant of horse-shoes. Both players throw one of their horseshoes at the stake, and the personwhose horseshoe is closest to the stake keeps both horseshoes. Both playersstart out with 10 horseshoes, and the game is over when one player has wonall of the horseshoes. Alice is more skilled at the game and has a probabilityof 0.6 of winning each round. What is the probability that Alice wins thegame?

Answer: This is a variant of the Gambler’s Ruin Problem. We want toknow that probability that the gambler (here Alice) reaches a total of N “ 20starting with M “ 10 given that her probability of winning is p “ 0.6 (whichmeans q “ 1 ´ p “ 0.4). According to our results, Alice’s probability ofwinning the game is

P10 “1´ p0.4{0.6q10

1´ p0.4{0.6q20

“59049

60073« 0.983.

So, Alice has over a 98% chance of winning the game. �In the last example, N was the total amount of winnings that could

possibly be earned. If the gambler is playing against a very wealthy opponent(like a casino), then as N Ñ 8 we find

PM Ñ

$

&

%

1´ pq{pqM , p ą 1{2

0, p ď 1{2

Page 555: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 546

since q{p ě 1 when p ď 1{2. So, a player who has a 50% chance or lessof winning will eventually go broke playing against an incredibly wealthyopponent. Even if the game is in the player’s favor (p ą 0.5), there is still apositive probability that the player will go broke since their opponent has avirtually unlimited fortune.

Example 10.4.2. Suppose a gambler finds a casino game where their proba-bility of winning is p “ 0.51. What is the probability that they still go brokeplaying the game if they start with $20 (assuming $1 bets each game play)?

Answer: We can safely let N Ñ 8 since the casino surely has far morethan $20 in its coffers! In this case,

P20 “ 1´

ˆ

0.49

0.51

˙20

« 0.551.

So, there is still roughly a 45% chance that the gambler will go bankrupteven when the game is slightly in their favor. �

Of course, casino games are set up so that the casino has at least a slightadvantage over the player. For example, the probability of winning at crapsis about p “ 0.49.4 Even though this is as close to fair as you can hopefor in a casino, the slight disadvantage to the player is enough to tilt thingsdramatically in favor of the house in the long run.

Theorem 10.4.1. For the Gambler’s Ruin Problem, let EM be the expectednumber of game plays if the player starts with $M and has a probability p ofwinning. Then if p ‰ 1{2, we have

EM “M

q ´ p´

N

q ´ p

ˆ

1´ pq{pqM

1´ pq{pqN

˙

.

In the case p “ 1{2, EM “MpN ´Mq.

Sketch of Proof: If the gambler has no money, then no games are played.Similarly, if the gambler has all of the money (X0 “ N) no games are played.Hence E0 “ EN “ 0. The proof follows the same steps as the computation of

4This is strictly the probability that the person rolling the dice wins. There are otherside bets that take place during game play which have different odds of paying out.

Page 556: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 547

PM . Namely, we condition on the outcome of the first game. If we let G bethe total number of games played, then for M “ 1, 2, 3, ¨ ¨ ¨ , N ´ 1 we have

EM “

8ÿ

n“1

nPpG “ n|X0 “Mq

8ÿ

n“1

nPpG “ n|X1 “M ` 1, X0 “MqPpX1 “M ` 1|X0 “Mq

`

8ÿ

n“1

nPpG “ n|X1 “M ´ 1, X0 “MqPpX1 “M ´ 1|X0 “Mq

“ p8ÿ

n“1

nPpG “ n|X1 “M ` 1, X0 “Mq ` q8ÿ

n“1

nPpG “ n|X1 “M ´ 1, X0 “Mq

“ p8ÿ

n“1

nPpG “ n´ 1|X0 “M ` 1q ` q8ÿ

n“1

nPpG “ n´ 1|X0 “M ´ 1q

“ p8ÿ

n“1

pn´ 1qPpG “ n´ 1|X0 “M ` 1q ` p8ÿ

n“1

PpG “ n´ 1|X0 “M ` 1q

` q8ÿ

n“1

pn´ 1qPpG “ n´ 1|X0 “M ´ 1q ` q8ÿ

n“1

PpG “ n´ 1|X0 “M ´ 1q

“ pEM`1 ` p` qEM´1 ` q

“ pEM`1 ` qEM´1 ` 1.

Rearranging as we did for PM gives the relationship

EM`1 ´ EM “q

ppEM ´ EM´1q `

1

p.

The analysis of this relationship is a bit more involved than for PM , so wesimply quote the final result above. �

Example 10.4.3. We play the following game. You are given two dice andthe game follows the basic rules of craps given in Example 6.5.6. You initiallyhave $10, and you gain or lose a dollar on each play of the game. The gamecontinues until you double your money or you go bankrupt. What is yourprobability of winning the game? How many turns is the game expected totake?

Page 557: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 548

Answer: We will take the probability of winning at craps to be p “ 0.49.Since N “ 20 and M “ 10, we have

P10 “1´ p0.51{0.49q10

1´ p0.51{0.49q20« 0.401.

So, there is only a 40% probability that you win the game. As for theexpected number of turns, the theorem above gives

E10 “10

0.51´ 0.49´

20

0.51´ 0.49

ˆ

1´ p0.51{0.49q10

1´ p0.51{0.49q20

˙

« 98.7.

So, the game is expected to take about 99 turns before finishing. �

Example 10.4.4. Suppose that we are trying to test whether a new drugtherapy for a disease is more effective than an older, well-established therapySuppose the new drug therapy has a cure rate of p1 which we believe islarger than the cure rate for the older therapy, p2 “ 0.6. To test whetherthe new therapy is more effective, we perform the following experiment. Allparticipants in a drug trial are separated into pairs. The first person in eachpair receives the new drug and the second person receives the traditionaldrug. We keep track of the net number of people cured by the new therapy:(total cured by the new drug) ´ (total cured by the old drug). We seta threshold N , and if the net total reaches N before it reaches ´N , wedecide that the new therapy has the higher cure rate. Otherwise, we decidethat the traditional drug has a higher cure rate. We have evidence from apreliminary study that suggests the new drug has a cure rate of p1 “ 0.68.What should our threshold N be to ensure that we make the correct decisionwith a probability of 0.95? How many pairs of people do we expect to needfor the trial if we use this value of N?

Answer: To relate this to the Gambler’s Ruin Problem, we first throwout all pairs where both therapies cure the illness or where both therapiesfail (since these cases do not contribute to the net number cured by therapy1). Note that for a pair pa, bq, where a receives the new drug and b receives

Page 558: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 549

the older one,

Ppa cured but not bq “ p0.68qp1´ 0.6q “ 0.272,

Ppboth curedq “ p0.68qp0.6q “ 0.408,

Ppb cured but not aq “ p1´ 0.68qp0.6q “ 0.192,

Ppneither curedq “ p1´ 0.68qp1´ 0.6q “ 0.128

(where we assume independence of the individual trials). Notice that wewill be throwing out pairs where either both are cured or neither are cured.This means that 53.6% of our pairs will not contribute to our test! For theremaining pairs, note that there is a probability p “ 0.272{0.464 « 0.586that the new drug cures the patient and the older drug does not. Likewise,q “ 0.192{0.464 « 0.414 is the probability that the traditional therapy curesthe illness in a pair while the new one fails.

We consider a Gambler’s Ruin set up with the player starting with a for-tune of N ; for each of the remaining pairs where the new therapy is effectivethe player wins 1 point while losing a point for each pair where the oldertherapy is effective. The game stops when the player’s fortune reaches 2N orzero. Notice that this is equivalent to the net number of people cured by thenew drug reaching N before reaching ´N . So, the probability of the playerwinning is

PN “1´ p0.414{0.586qN

1´ p0.414{0.586q2N

which we want to equal 0.95 or larger. Instead of trying to solve this for Ndirectly, it is easier to look at a table of values.

N PN

5 0.8506 0.8897 0.9198 0.9429 0.95810 0.970

So it would appear we need to take N “ 9 to ensure that there is a 95%chance of making the correct decision. Using our results in Theorem 10.4.1

Page 559: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 550

(with M “ 9, N “ 18) we have

E9 “9

0.464´ 0.586´

18

0.464´ 0.586

ˆ

1´ p0.414{0.586q9

1´ p0.414{0.586q18

˙

« 67.6.

So we expect to need 68 pairs where one of the therapies cures the illness butnot the other. Since such pairs only account for 46.4% of all possible pairs,we expect to need

68{0.464 « 146.6

pairs of patients. Hence, we expect that the trial will need at least 147 pairsand so 294 patients in total. �

10.5 Properties of Transition Matrices

Transition matrices for finite state Markov Chains have a number of niceproperties. Recall that the matrix of transition probabilities P has entriesPij which give the probability of transitioning from state j to state i. Asa result, each column of the transition matrix sums to 1. The followingtheorem tells us that all eigenvalues of a transition matrix are no bigger than1 in size (so all real eigenvalues lie in the range r´1, 1s ), and 1 is always aneigenvalue of a transition matrix.

Theorem 10.5.1. If P is a transition matrix for a finite state Markov Chain,then 1 must be an eigenvalue of P . Moreover, every eigenvalue λ of P sat-isfies |λ| ď 1.

Proof: Suppose that P is an n ˆ n transition matrix; then the matrixP T has rows that all sum to one. Let ~v be the column vector consisting ofall ones. Then we must have

P T~v “ ~v

since each entry in the resulting vector is the sum of a row from P T . So, P T

has an eigenvalue of one. By the results in Section 8.7, P must also have aneigenvalue of one.

For the second part of the theorem, if λ is an eigenvalue for P , it is also aneigenvalue for P T . Hence, there is a non-zero vector ~v such that P T~v “ λ~v.

Page 560: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 551

If we let the components of ~v be given by vi, then we have

P T~v “

»

p11 p21 ¨ ¨ ¨ pn1

p12 p22 ¨ ¨ ¨ pn2...

.... . .

...p1n p2n ¨ ¨ ¨ pnn

fi

ffi

ffi

ffi

fl

»

v1

v2...vn

fi

ffi

ffi

ffi

fl

»

λv1

λv2...λvn

fi

ffi

ffi

ffi

fl

“ λ~v.

Since ~v is not the zero vector, at least one of the vi must be different from zero,and so one of them must have the largest (non-zero) absolute value. Supposethis happens for component j (which means |vi| ď |vj| for i “ 1, 2, ¨ ¨ ¨n andvj ‰ 0). If we look at row j, we must have

p1jv1 ` p2jv2 ` ¨ ¨ ¨ ` pnjvn “ λvj.

Using the triangle inequality (|x` y| ď |x| ` |y|), we find

|λ||vj| “ |p1jv1 ` p2jv2 ` ¨ ¨ ¨ ` pnjvn|

ď p1j|v1| ` p2j|v2| ` ¨ ¨ ¨ ` pnj|vn|

ď pp1j ` p2j ` ¨ ¨ ¨ ` pnjq |vj|

ď |vj|.

In the third line of the inequality, we used that |vj| is larger than the othercomponents; in the final line we used the fact the rows of P T sum to one.Dividing by |vj| gives the desired result |λ| ď 1. �

To state the next result, we need the following definitions. A matrix issaid to be positive if all of its entries are strictly positive. A square matrixis said to be regular if some power of the matrix is positive. So,

M1 “

1 23 4

is a positive matrix (and regular) while

M2 “

0 12 3

is not a positive matrix. However,

M22 “

2 36 11

Page 561: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 552

is a positive matrix, and so M2 is regular. Notice that if P n is a positivematrix, then P n`1 and every higher power of P must also be a positivematrix.

It turns out that regular transition matrices have a very nice property.

Theorem 10.5.2. Let P be an n ˆ n transition matrix for a finite stateMarkov Chain. If P is a regular matrix and λ is any eigenvalue that is notequal to 1, then |λ| ă 1.

Proof: We prove that if an eigenvalue has the property |λ| “ 1, thenλ “ 1. Suppose first that the transition matrix P is positive. Since λ is alsoan eigenvalue for P T , there is a non-zero vector ~v with P T~v “ λ~v. Lookingat our proof of the previous theorem, we showed

|λ||vj| ď p1j|v1| ` p2j|v2| ` ¨ ¨ ¨ ` pnj|vn| ď |vj|

where vj was the entry of ~v with the largest magnitude. But if |λ| “ 1, all ofthe inequalities in the previous proof must actually be equalities! Hence,

p1j|v1| ` p2j|v2| ` ¨ ¨ ¨ ` pnj|vn| “ |vj| “ pp1j ` p2j ` ¨ ¨ ¨ ` pnjq |vj|

since each column of P sums to 1. Rearranging the outer equality gives

p1j p|vj| ´ |vi|q ` p2j p|vj| ´ |v2|q ` ¨ ¨ ¨ ` pnj p|vj| ´ |vn|q “ 0.

Since all of the entries of P are positive and |vj| ´ |vi| ě 0, the only way thesum above can be zero is if |vi| “ |vj| for all i “ 1, 2, ¨ ¨ ¨ , n. Since our proofof the theorem above also gives

|p1jv1 ` p2jv2 ` ¨ ¨ ¨ ` pnjvn| “ p1j|v1| ` p2j|v2| ` ¨ ¨ ¨ ` pnj|vn|

when |λ| “ 1, it must be the case that all of the vi have the same sign (sinceall of the pij are positive). Hence, one eigenvector for λ must be

~v “

»

11...1

fi

ffi

ffi

ffi

fl

since the other possibility (all entries ´1) is just a multiple of the one given.But the eigenvalue for this particular vector is definitely λ “ 1.

Page 562: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 553

If P is regular, then there is an exponent n so that P n is a positive matrix.Of course, it is still a transition matrix and the previous calculation showsthat if P n has an eigenvalue of magnitude 1, then that eigenvalue must be1. Now, if λ is an eigenvalue of P , then λn is an eigenvalue of P n with thesame eigenvector. 5 So, if P has an eigenvector satisfying |λ| “ 1, then P n

has an eigenvector λn satisfying |λn| “ |λ|n “ 1. Hence λn “ 1. But sinceP n`1 is also a positive matrix, we must have λn`1 “ 1. Therefore,

λn “ λn`1

λnpλ´ 1q “ 0

λ “ 1

since |λ| “ 1 (and so λ ‰ 0). �

Corollary 10.5.2.1. If P is a regular nˆ n transition matrix that is diago-nalizable, then 1 is an eigenvalue of P with algebraic multiplicity 1. All othereigenvalues of P must satisfy |λ| ă 1.

Proof: That 1 is an eigenvalue of P and any eigenvalue of P not equalto 1 must satisfy |λ| ă 1 are the conclusions of the previous two theorems.The new result here is that 1 can only have algebraic multiplicity 1. If Pis diagonalizable, then the algebraic multiplicity of an eigenvalue must equalits geometric multiplicity. But the considerations of the previous theoremtell us that when P is regular, the only family corresponding to λ “ 1 forP T is

~v “ c

»

11...1

fi

ffi

ffi

ffi

fl

.

5If P~v “ λ~v, then

Pn~v “ Pn´1pP~vq

“ λPn´1~v

“ λPn´2pP~vq

“ λ2Pn´2~v “ ¨ ¨ ¨ “ λn~v.

Page 563: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 554

Hence, the geometric multiplicity of λ “ 1 is 1 for P T . But this must be thecase for P as well. As a result, the algebraic multiplicity of λ “ 1 must alsobe 1. �

We can now state the most important result of this section.

Theorem 10.5.3. Let P be a regular nˆn transition matrix. Then there isan nˆ n matrix L such that

limkÑ8

P k“ L.

Each column of L is identical to the same vector ~π with entries summing toone.

Proof: We only prove this result in the special case that P is diagonal-izable. If P is diagonalizable, then the corollary above tells us that P has 1as eigenvalue with algebraic multiplicity 1, and all other eigenvalues satisfy|λ| ă 1.6 This means that we can decompose P as P “ BDB´1 where D isa diagonal matrix of the form

D “

»

1 0 0 ¨ ¨ ¨ 00 λ2 0 ¨ ¨ ¨ 00 0 λ3 ¨ ¨ ¨ 0...

......

. . . ¨ ¨ ¨

0 0 0 ¨ ¨ ¨ λn

fi

ffi

ffi

ffi

ffi

ffi

fl

.

Notice that

limkÑ8

Dk“ lim

kÑ8

»

1 0 0 ¨ ¨ ¨ 00 λk2 0 ¨ ¨ ¨ 00 0 λk3 ¨ ¨ ¨ 0...

......

. . . ¨ ¨ ¨

0 0 0 ¨ ¨ ¨ λkn

fi

ffi

ffi

ffi

ffi

ffi

fl

»

1 0 0 ¨ ¨ ¨ 00 0 0 ¨ ¨ ¨ 00 0 0 ¨ ¨ ¨ 0...

......

. . . ¨ ¨ ¨

0 0 0 ¨ ¨ ¨ 0

fi

ffi

ffi

ffi

ffi

ffi

fl

6The main difficulty in extending this theorem to the non-diagonalizable case is that1 may have a deficiency for eigenvalue 1. Handling this correctly requires the JordanCanonical Form for a matrix which is a topic beyond the scope of this text.

Page 564: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 555

since all of the other eigenvalues have size less than 1. This gives us

limkÑ8

P k“ lim

kÑ8BDkB´1

“ B

»

1 0 0 ¨ ¨ ¨ 00 0 0 ¨ ¨ ¨ 00 0 0 ¨ ¨ ¨ 0...

......

. . . ¨ ¨ ¨

0 0 0 ¨ ¨ ¨ 0

fi

ffi

ffi

ffi

ffi

ffi

fl

B´1

which proves that the limiting matrix exists.Rather than focusing on the matrix B to determine the form of the lim-

iting matrix L, we will argue in a more indirect way. Recall that one way ofthinking about matrix multiplication M1M2 is that the resulting matrix hascolumns which result from the action of M1 on each column of M2. If welook at the product PL, we find

PL “ P limkÑ8

P k“ lim

kÑ8P k`1

“ L.

This implies that each column of L is an eigenvector of P correspondingto the eigenvalue 1. Since 1 has algebraic multiplicity 1, this tells us thateach column of L is a multiple of the same eigenvector. Since P is a regularmatrix, it must be the case that L is a positive matrix. In fact, each columnof L must sum to one. To see this, let ~1 be the column vector of all ones.Since the rows of P T sum to one , we must have P T~1 “ ~1. Then

LT~1 “´

limkÑ8

P k¯T~1

“ limkÑ8

pP Tqk~1

“ limkÑ8

pP Tqk´1P T~1

“ limkÑ8

pP Tqk´1~1

“ ~1

by induction. But this means that each row of LT sums to one. Hence, eachcolumn of L must sum to one. Hence, L is a matrix of transition probabili-ties. Since the algebraic multiplicity is 1, there is a unique eigenvector of Pcorresponding to λ “ 1 with positive entries that sum to one. �

Page 565: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 556

Example 10.5.1. Consider the Markov Chain with transition matrix

P “

»

1{3 1{2 01{3 0 1{21{3 1{2 1{2

fi

fl .

Determine if P is a regular matrix. If so, find its eigenvalues and determinethe limiting matrix

L “ limkÑ8

P k.

Solution: Squaring P , we see that

P 2“

»

5{18 1{6 1{45{18 5{12 1{44{9 5{12 1{2

fi

fl .

So, P is a regular transition matrix. The characteristic polynomial for P is

detpP ´ λIq “ ´λ3`

5λ2

6`λ

1

12“ ´

1

12pλ´ 1q

`

12λ2` 2λ´ 1

˘

.

We already knew that 1 was going to be an eigenvalue (which allowed us tofactor the polynomial), the only question is whether 1 has algebraic multi-plicity 1. The remaining eigenvalues are

λ “1

12

´

´1˘?

13¯

which are both in the range ´1 ă λ ă 1. So, the limiting matrix L mustbe the matrix whose columns are all the unique eigenvector corresponding toλ “ 1 whose entries add up to 1. A basis eigenvector for λ “ 1 is given by

~v “

»

1{22{31

fi

fl ,

but the entries of this vector sum to 13/6! So to get a vector of probabilities,we take for the eigenvector

~π “6

13

»

1{22{31

fi

fl “

»

3{134{136{13

fi

fl .

Page 566: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 557

This means that the limiting matrix L is

L “ limkÑ8

P k“

»

3{13 3{13 3{134{13 4{13 4{136{13 6{13 6{13

fi

fl . �

We end this section with a useful formula for determining whether certainstates are transient or recurrent in the case that the transition matrix isdiagonalizable.

Theorem 10.5.4. Suppose that P is an pm ` 1q ˆ pm ` 1q diagonalizabletransition matrix for a Markov Chain. Let P “ BDB´1 with

D “

»

1 0 0 ¨ ¨ ¨ 00 λ1 0 ¨ ¨ ¨ 00 0 λ2 ¨ ¨ ¨ 0...

......

. . ....

0 0 0 ¨ ¨ ¨ λm

fi

ffi

ffi

ffi

ffi

ffi

fl

the matrix of eigenvalues and B the matrix whose columns consist of the cor-responding eigenvectors. Recall that 1 is guaranteed to be one of the eigen-values (here labeled λ0). Then,

P nii “

mÿ

j“0

λnj rBsij“

B´1‰

ji.

Proof: Since P n “ BDnB´1, we have

P nii “

BDnB´1‰

ii

mÿ

j“0

rBsij“

DnB´1‰

ji

mÿ

j“0

rBsij

˜

mÿ

k“0

rDnsjk

B´1‰

ki

¸

mÿ

j“0

mÿ

k“0

rBsij rDnsjk

B´1‰

ki.

Page 567: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 558

The matrix Dn is diagonal with rDnsjj “ λnj and all other entries equal tozero. As a result, the sum over k will only produce a non-zero term whenk “ j. This gives us

P nii “

mÿ

j“0

mÿ

k“0

rBsij rDnsjk

B´1‰

ki

mÿ

j“0

rBsij rDnsjj

B´1‰

ji

mÿ

j“0

λnj rBsij“

B´1‰

ji. �

As a simple example of how useful this theorem can be, we present thefollowing corollaries which allow us to easily determine whether certain statesare transient in special cases.

Corollary 10.5.4.1. Suppose that λ0 “ 1, ¨ ¨ ¨ , λk are the eigenvalues of Pwith magnitude 1 while |λj| ă 1 for k ` 1 ď j ď m. If rBsij rB

´1sji “ 0 for0 ď j ď k, then state i is transient.

Proof: We break up the sum from the previous theorem into two pieces:

P nii “

kÿ

j“0

λnj rBsij“

B´1‰

ji`

mÿ

j“k`1

λnj rBsij“

B´1‰

ji,

where the first sum is over the indices where |λj| “ 1. According to ourassumptions, the first part of the sum is zero leaving

P nii “

mÿ

j“k`1

λnj rBsij“

B´1‰

ji.

Page 568: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 559

Using the results on geometric series from Appendix C,

8ÿ

n“1

P nii “

8ÿ

n“1

˜

mÿ

j“k`1

λnj rBsij“

B´1‰

ji

¸

mÿ

j“k`1

˜

8ÿ

n“1

λnj

¸

rBsij“

B´1‰

ji

mÿ

j“k`1

ˆ

λj1´ λj

˙

rBsij“

B´1‰

ji

ă 8. �

Corollary 10.5.4.2. Suppose that λ0 “ 1 is the unique eigenvalue of magni-tude 1 for P . Then state i is transient if and only if rBsi0 rB

´1s0i “ 0. Thismeans that i is transient precisely when the i-th row of the limiting probabilitymatrix consists of all zeros.

Proof: By the theorem above,

P nii “ rBsi0

B´1‰

0i`

mÿ

j“1

λnj rBsij“

B´1‰

ji.

Since |λj| ă 1 for all j ą 0, we have

8ÿ

n“1

mÿ

j“1

λnj rBsij“

B´1‰

ji“

mÿ

j“1

˜

8ÿ

n“1

λnj

¸

rBsij“

B´1‰

ji

mÿ

j“1

ˆ

λj1´ λj

˙

rBsij“

B´1‰

ji

ă 8.

So if rBsi0 rB´1s0i “ 0, state i is definitely transient. On the other hand, if

rBsi0 rB´1s0i ‰ 0 the sum

8ÿ

n“1

P nii will definitely diverge.

From the proof of Theorem 10.5.3, we know that the limiting matrix L

Page 569: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 560

is given by

L “ lim`Ñ8

P `“ B

»

1 0 0 ¨ ¨ ¨ 00 0 0 ¨ ¨ ¨ 00 0 0 ¨ ¨ ¨ 0...

......

. . . ¨ ¨ ¨

0 0 0 ¨ ¨ ¨ 0

fi

ffi

ffi

ffi

ffi

ffi

fl

B´1.

This in turn tells us that

rLsij “ rBsi0rB´1s0j.

As a result, if rBsi0 rB´1s0i “ 0 then Lii “ 0. Since we know that the columns

of L are identical, the entire i-th row of L must be zero. �

10.6 Limiting Probabilities

The previous section showed that the transition matrix of a Markov Chainhas many nice properties – especially if the matrix is regular. In this section,we will explore some conditions that guarantee that the transition matrix ofa Markov Chain is regular. As a result, these special Markov Chains willhave a definite limiting behavior thanks to Theorem 10.5.3.

The set of possible recurrence times for a state i is

tn|P nii ą 0u.

In words, this is the set of time steps where it is possible to return to statei if the system starts in state i. If the set of recurrence times happens to beempty (i.e. if the system can never return to state i once it has visited it),then the period is undefined. The period, d, of state i is the greatest commondivisor of all of the recurrence times:

d “ gcdtn|P nii ą 0u.

A state is said to be aperiodic if its period is 1. Notice that if a MarkovChain can remain in a particular state from one time step to the next, thenthat state is necessarily aperiodic. However, a state can be aperiodic in otherways. For instance, if a state can recur after 2 steps and after 3 steps, thenthe gcd of the recurrence times is 1, and the state is aperiodic. We presentthe following lemma without proof.

Page 570: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 561

Lemma 10.6.1 (Periodicity of Classes). Periodicity is a property of com-munication classes. That is, if state i has period d and i and j communicate,then state j must also have period d.

Example 10.6.1. Consider the circular random walk in Example 10.1.2.The 1-step through 4-step transition probability matrices are

P “

»

0 0.5 0 0 0 0.50.5 0 0.5 0 0 00 0.5 0 0.5 0 00 0 0.5 0 0.5 00 0 0 0.5 0 0.5

0.5 0 0 0 0.5 0

fi

ffi

ffi

ffi

ffi

ffi

ffi

fl

,

P 2“

»

12

0 14

0 14

00 1

20 1

40 1

414

0 12

0 14

00 1

40 1

20 1

414

0 14

0 12

00 1

40 1

40 1

2

fi

ffi

ffi

ffi

ffi

ffi

ffi

fl

,

P 3“

»

0 38

0 14

0 38

38

0 38

0 14

00 3

80 3

80 1

414

0 38

0 38

00 1

40 3

80 3

838

0 14

0 38

0

fi

ffi

ffi

ffi

ffi

ffi

ffi

fl

P 4“

»

38

0 516

0 516

00 3

80 5

160 5

16516

0 38

0 516

00 5

160 3

80 5

16516

0 516

0 38

00 5

160 5

160 3

8

fi

ffi

ffi

ffi

ffi

ffi

ffi

fl

.

Notice that Pii “ P 3ii “ 0 (the diagonal elements) for all 6 states. In fact,

this pattern continues for all the odd powers of P . On the other hand P 2ii

and P 4ii are all positive, and this pattern continues for all even powers of P .

So, the set of recurrence times for any state is

t2, 4, 6, 8, ¨ ¨ ¨ u.

Page 571: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 562

The largest integer d that divides all of these possible recurrence times is2. Hence, all states in our circular random walk have period 2. This makessince you must leave a particular node on the next step, but after 2 steps,you could come back to the node you started on. �

Example 10.6.2. Consider the maze in Example 10.1.3. Recall that therooms come in two separate communication classes: t0, 1, 2, 3, 4, 5, 6u andt7u. If we look at the first few n-step transition probability matrices, we find

P “

»

0 1{3 0 1{2 0 0 0 01{2 0 1 0 1{2 0 0 00 1{3 0 0 0 0 0 0

1{2 0 0 0 0 1{3 0 00 1{3 0 0 0 1{3 0 00 0 0 1{2 1{2 0 1{2 00 0 0 0 0 1{3 0 00 0 0 0 0 0 1{2 1

fi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

fl

,

P 2“

»

512

0 13

0 16

16

0 00 2

30 1

40 1

60 0

16

0 13

0 16

0 0 00 1

60 5

1216

0 16

016

0 13

16

13

0 16

014

16

0 0 0 12

0 00 0 0 1

616

0 16

00 0 0 0 0 1

612

1

fi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

fl

,

P 3“

»

0 1136

0 724

112

118

112

01124

0 23

112

512

112

112

00 2

90 1

120 1

180 0

724

118

16

0 112

14

0 0112

518

0 112

0 29

0 0112

112

16

38

13

0 14

0112

118

0 0 0 16

0 00 0 0 1

12112

16

712

1

fi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

fl

,

Page 572: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 563

P 4“

»

43144

136

1136

136

1372

1172

136

0124

3772

0 1348

124

736

124

01172

0 29

136

536

136

136

0136

1372

118

1348

1172

136

18

01372

136

518

1172

14

136

19

01148

736

112

124

124

2372

0 0136

136

118

18

19

0 112

0124

136

0 112

112

14

712

1

fi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

fl

.

At first glance, it would seem that the class t0, 1, 2, 3, 4, 5, 6u should haveperiod 2 since the mouse must leave the room it is currently in each timestep. However, it is possible to return to Room 1 in 5 steps: 1 Ñ 4 Ñ5 Ñ 3 Ñ 0 Ñ 1 (looking at P 5 would also show that it is possible to returnin 5 steps). This means the set of possible recurrence times for Room 1 ist2, 4, 5, ¨ ¨ ¨ u. Since 2 and 5 are both prime numbers, the gcd is 1. Hence, theentire class of transient states is aperiodic. Room 7 is also aperiodic. In fact,once the mouse enters this room, it can never leave! �

If a state i is recurrent, it is said to be positive recurrent if the expectedtime to return to state i (after starting in state i) is finite. The followinglemma is again presented without proof.

Lemma 10.6.2. Positive recurrence is a property of communication classes.That is, if state i is positive recurrent and i and j communicate, then state jmust also be positive recurrent. Furthermore, all recurrent states in a finite–state Markov Chain must be positive recurrent.

For the interested reader, proofs of both these lemmas can be found in[Sh96][Chapter VIII].

For a Markov Chain with an infinite number of possible states, it ispossible for states to be recurrent but not positive recurrent. That is, a statecould be recurrent, but the expected time it takes for the system to returnto the state is infinite. Recurrent states that are not positive recurrent aresaid to be null recurrent. For a null recurrent state, the system is certainto return to the state at some point in the future, but the expected numberof time steps before a recurrence happens is unbounded (i.e. you may bewaiting a VERY long time before the system returns to the state). However,the expected number of times the system will revisit a null recurrent state isstill infinite! This is one of the bizarre things that can happen with MarkovChains with an infinite number of possible states!

Page 573: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 564

We need two final definitions. A state i in a Markov Chain is said tobe ergodic if it is aperiodic and positive recurrent. Finally, an irreducibleergodic Markov Chain is one where all the states belong to the same com-munication class, each state is aperiodic, and each state is positive recurrent.

Example 10.6.3. The simple weather model in Example 10.1.1 is an irre-ducible ergodic Markov Chain. Indeed, we know that all the states belong toa single communication class (which is the definition of irreducible). Sinceit is possible to go from any state in the chain to any other state (includ-ing the state the system is currently in), the possible recurrence times aret1, 2, 3, 4, ¨ ¨ ¨ u. Hence, each state has period 1 (i.e. each state is aperiodic).Finally, since the states are certainly recurrent, they must be positive recur-rent by the lemma above. Hence, the Markov Chain in Example 10.1.1 mustbe an irreducible ergodic Markov Chain. �.

The following theorem is crucial to what follows.

Theorem 10.6.3 (Limiting Distributions of Irreducible Ergodic MarkovChains). Let pXiq be an irreducible ergodic Markov Chain with transitionprobability matrix P . Then

limnÑ8

P n

exists. Moreover, this limiting matrix has identical columns. If we let

πi “ limnÑ8

P nij

be the entries of this limiting column of probabilities, then the πi are theunique solutions to the equations

πi “ÿ

j

Pijπj,

ÿ

i

πi “ 1.

Sketch of Proof: The basic idea is that the transition matrix for anirreducible ergodic Markov Chain must be a regular transition matrix. Sincethe Markov Chain is irreducible and ergodic, each state communicates withevery other state. This means there is a k ě 1 such that P k

ij ą 0 for everypair of states. Since the number of recurrence times for each state is infinite(since each state is positive recurrent) and each state is aperiodic, it can

Page 574: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 565

be shown that there is a single positive integer K ě 1 such that PKij ą 0

for every pair of indices i and j. Hence, the transition matrix P is regular(since PK is a positive matrix). By Theorem 10.5.3, there is a limitingmatrix L “ limkÑ8 P

k whose columns consist precisely of the eigenvector ~πcorresponding to 1 whose entries sum to 1. But this is precisely the statementof the theorem above! �

The limiting probabilities πi guaranteed by the theorem should be thoughtof as the percentage of time the process spends in state i in the long-term(i.e. after a large amount of time has passed).

Example 10.6.4. Consider again the simple weather model from Example10.1.1. Since we already know that this Markov Chain is irreducible andergodic, we know there should be a limiting probability distribution. To findit, we have to solve

~π “ P~π,

π0 ` π1 ` π2 “ 1.

In matrix form, the first equation is

»

π0

π1

π2

fi

fl “

»

0.5 0.3 0.20.3 0.4 0.40.2 0.3 0.4

fi

fl

»

π0

π1

π2

fi

fl .

This translates into the equations

π0 “1

2π0 `

3

10π1 `

1

5π2,

π1 “3

10π0 `

2

5π1 `

2

5π2,

π2 “1

5π0 `

3

10π1 `

2

5π2.

These equations do not have a unique solution. What they tell us is

π1 “13

12π0,

π2 “7

8π0.

Page 575: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 566

Combining this with the requirement that π0 ` π1 ` π2 “ 1 gives us

π0 “24

71« 0.3380, π1 “

26

71« 0.3662, and π2 “

21

71« 0.2958.

So, we see that days with clear skies, days that are partly cloudy, and daysthat are overcast are almost equally likely. Partly cloudy days are slightlymore likely in our model however. This also means that

limnÑ8

P n“

»

24{71 24{71 24{7126{71 26{71 26{7121{71 21{71 21{71

fi

fl . �

Example 10.6.5. Consider an irreducible ergodic Markov Chain pXiq withstates 0, 1, 2, and 3. The matrix of transition probabilities is given by

P “

»

1{4 1{2 1{2 1{61{4 0 0 1{31{4 0 1{2 1{31{4 1{2 0 1{6

fi

ffi

ffi

fl

.

Compute the limiting probabilities of this Markov Chain.

Answer: The equation~π “ P~π

yields the following system of four equations.

π0 “1

4π0 `

1

2π1 `

1

2π2 `

1

6π3,

π1 “1

4π0 ` 0π1 ` 0π2 `

1

3π3,

π2 “1

4π0 ` 0π1 `

1

2π2 `

1

3π3,

π3 “1

4π0 `

1

2π1 ` 0π2 `

1

6π3.

Solving these equations leads to the following infinite set of solutions.

π1 “7

16π0, π2 “

7

8π0, and π3 “

9

16π0.

Combining this with the requirement that π0 ` π1 ` π2 ` π3 “ 1 gives

π0 “8

23, π1 “

7

46, π2 “

7

23, and π3 “

9

46. �

Page 576: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 567

10.7 Application: Shape of Epithelial Cells

Epithelial cells form tissues that line the outer surfaces of many organs andblood vessels throughout the bodies of most animals. Perhaps the largest ex-ample of epithelial tissue in the human body is the outermost layer of the skin– the epidermis. From the earliest studies of these tissues, scientists have ob-served that these cells often take on roughly polygonal shapes with hexagonsbeing most common. A very elegant Markov Chain model developed by Gib-son, Patel, Nagpal, and Perrimon in 2006 explains the distribution of thesepolygons quite well.[GPNP06]

Figure 10.7.1: Epithelial Cells in the Wing of a Fruit Fly(Iyengar, Balaji (2012) from figshare)

The authors make six basic assumptions about cell division in epithelialcells (all of which are based on observational data).

1) Cells are polygons with a minimum of four sides.

2) Cells do not sort themselves after division.

3) After division, the two daughter cells retain a common side.

4) Cells have asynchronous but roughly equal cycle times.

5) Cell divisions cut through sides of polygons and not vertices.

Page 577: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 568

6) Junctions of three cells are randomly distributed among the daughtercells upon division.

From these assumptions, the authors are able to compute transition proba-bilities in a two step process. The first step is to consider the mitotic divisionof a single cell. Vastly simplifying the cell division process, suppose that anew cell wall forms joining two existing sides of a parent cell with j-sides(assumption 5 rules out new walls joining vertices). Since triangular cells areobserved exceedingly rarely (hence assumption 1 above), the new cell wallcannot connect two adjacent sides. Through various arguments regardingthe nature of mitosis, the authors effectively assume that the probability ofthe new cell wall connecting a given side A with the one of the other possiblesides follows a binomial distribution with number of trials j ´ 4 and proba-bility of success 1{2 (note that a binomial distribution with j ´ 4 trials hasj ´ 3 possible outcomes).

A

Bp“1

(a) Division of a Square

A

B2

p“1{2

B1

p“1{2

(b) Division of a Pentagon

A

B1

p“1{4 B2

p“1{2

B3

p“1{4

(c) Division of a Hexagon

A

B1

p“1{8B2

p“3{8

B3

p“3{8

B4

p“1{8

(d) Division of a Heptagon

Figure 10.7.2: Division Probabilities for Smaller Polygons

These considerations lead to the following transition probabilities for the firststep of the process:

P`

daughter cell has i sidesˇ

ˇparent cell has j sides˘

ˆ

j ´ 4

i´ 4

˙

1

2j´4

Page 578: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 569

where 4 ď i ď j. For i outside this range, the transition probabilities arezero.

The second step in the process takes into account that the division of acell can add sides to a neighboring cell. In general, the number of sides acell will gain due to the division of a neighboring cell is difficult to predict.However, general considerations led the authors to the conclusion that eachcell picks up one additional side per time step on average. If we take oneextra side as a given, we finally arrive at our transition probabilities for theentire process:

pij “

ˆ

j ´ 4

i´ 5

˙

1

2j´4

for 5 ď i ď j ` 1.At the moment, we have an “infinite matrix” of transition probabilities

of the form

»

4 5 6 7 8 9 ...

4 0 0 0 0 0 0 ¨ ¨ ¨

5 1 1{2 1{4 1{8 1{16 1{32 ¨ ¨ ¨

6 0 1{2 1{2 3{8 1{4 5{32 ¨ ¨ ¨

7 0 0 1{4 3{8 3{8 5{16 ¨ ¨ ¨

8 0 0 0 1{8 1{4 5{16 ¨ ¨ ¨

9 0 0 0 0 1{16 5{32 ¨ ¨ ¨

10 0 0 0 0 0 1{32 ¨ ¨ ¨...

......

......

......

. . .

fi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

fl

.

To use our methods, we need a genuine matrix. To proceed, we decide totruncate this matrix by only considering side lengths up to size 13. Thischoice is completely arbitrary (other than the fact that cells with more than

Page 579: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 570

13 sides are exceedingly rare), but it results in the following 10ˆ 10 matrix.

»

4 5 6 7 8 9 10 11 12 13

4 0 0 0 0 0 0 0 0 0 05 1 1{2 1{4 1{8 1{16 1{32 1{64 1{128 1{256 1{5126 0 1{2 1{2 3{8 1{4 5{32 3{32 7{128 1{32 9{5127 0 0 1{4 3{8 3{8 5{16 15{64 21{128 7{64 9{1288 0 0 0 1{8 1{4 5{16 5{16 35{128 7{32 21{1289 0 0 0 0 1{16 5{32 15{64 35{128 35{128 63{25610 0 0 0 0 0 1{32 3{32 21{128 7{32 63{25611 0 0 0 0 0 0 1{64 7{128 7{64 21{12812 0 0 0 0 0 0 0 1{128 1{32 9{12813 0 0 0 0 0 0 0 0 1{256 9{512

fi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

fl

The problem with this last matrix is that it is not a stochastic matrix! Sincewe truncated at 13, the final column is missing its final non-zero transitionprobability (which is 1{512). To fix this, we make the ridiculous assumptionthat the cell of size 14 which we have removed from the transition probabili-ties collapses to a cell of size 4! So, we take as our transition matrix for thisprocess

P “

»

0 0 0 0 0 0 0 0 0 1{5121 1{2 1{4 1{8 1{16 1{32 1{64 1{128 1{256 1{5120 1{2 1{2 3{8 1{4 5{32 3{32 7{128 1{32 9{5120 0 1{4 3{8 3{8 5{16 15{64 21{128 7{64 9{1280 0 0 1{8 1{4 5{16 5{16 35{128 7{32 21{1280 0 0 0 1{16 5{32 15{64 35{128 35{128 63{2560 0 0 0 0 1{32 3{32 21{128 7{32 63{2560 0 0 0 0 0 1{64 7{128 7{64 21{1280 0 0 0 0 0 0 1{128 1{32 9{1280 0 0 0 0 0 0 0 1{256 9{512

fi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

fl

.

This slightly silly process is certainly irreducible and ergodic. Hence,there must be a set of limiting probabilities by our previous theorem. Solvingthe associated systems of equations

~π “ P~π13ÿ

i“4

πi “ 1

Page 580: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 571

is not something anyone would want to do by hand. Thankfully, a computercan easily deal with the problem. The limiting set of probabilities turns outto be approximately

~π “

»

4 1ˆ 10´13

5 0.28886 0.46407 0.20858 0.03599 0.002710 9ˆ 10´5

11 2ˆ 10´6

12 1ˆ 10´8

13 5ˆ 10´11

fi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

fl

.

As you can see, pentagons, hexagons, and heptagons make up over 96% ofthe shapes of epithelial cells in the model with almost half being hexagons.7

The authors of this study went on to do observational studies of epithelialtissues in various animals. Their reported findings matched reasonably wellwith the probabilities listed above.

10.8 Random Walks

The very first example we discussed at the beginning of this chapter was aone–dimensional random walk. Recall that we considered a process wherethe possible states are the integers, and at each time step we are allowedto move either one step forwards or one step backwards from our currentposition. This process can be represented as a Markov Chain – though onewith an infinite number of states. As such, not all of our results from thestudy of finite state Markov Chains will apply.

In this section, we want to present the details of random walks not justin one–dimension but also in two, three, and higher dimensions. Many of theresults we give will be presented without proof. As always, a reference will begiven for the curious reader. By the way, a random walk is sometimes referredto as a “drunkard’s walk” or a “drunken walk” in older literature. This name

7Truncating the matrix at a larger number of sides does not significantly change theresults for these three polygons.

Page 581: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 572

is often the source of some funny descriptions of these stochastic processes,but we will generally stick to the name random walk in the following.

10.8.1 Random Walks in One Dimension

Consider a Markov Chain pXnq where the possible states are the integers:t0,˘1,˘2,˘3, ¨ ¨ ¨ u. If our current state is the integer j (i.e. Xn “ j), thenthe next state can only be j ` 1 or j ´ 1. So, only a single step forward orbackwards is allowed at each time step, and the process must change stateseach time step. So, the only non-zero transition probabilities are

Pj`1,j “ p,

Pj´1,j “ 1´ p “ q.

A few comments are in order. First, we have employed a slightly differentnotation for the transition probabilities: Pj`1,j. The comma that has beeninserted is purely to make the indices easier to read. The order of the coeffi-cients is still consistent with our previous notation; Pj`1,j is the probabilityof transitioning from state j to state j ` 1.

Second, notice that we have allowed for biased (or asymmetric) randomwalks. That is, the probability of a step forward (which is p) could be differentthan the probability of a step backwards (q “ 1´ p).

Third, notice that the probabilities p and q for forward and backwardtransitions are independent of the state j. In other words, the transition10 Ñ 11 has the same probability as the transition ´1000 Ñ ´999 (bothare equal to p). This requirement could be relaxed, but the analysis becomesmuch more difficult.

It is easy to see that every state in our random walk communicates withevery other state. Indeed, starting at 0, the first step will take us to either1 or ´1. The second step will take us to one of ´2, 0, or 2. The third stepwill take us to ´3,´1, 1, or 3. Continuing this line of thought shows us thatit is possible to travel from any given state to any other state given enoughtime steps. Hence, our random walk is an irreducible Markov Chain.

Since our Markov Chain is forced to change state every time step (weare not allowed to stay on the same integer during the next step), our statescannot be aperiodic. In fact, all states have period 2. This is easy to see ifwe remember that period is a common property of a communication class.Since we can only return to 0 at times t2, 4, 6, 8, ¨ ¨ ¨ u, we see that 0 musthave period 2. Hence, all states have this property.

Page 582: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 573

Since all the states belong to the same class, either all the states arerecurrent or all are transient. The way to decide is to use Theorem 10.3.1.In order to use this theorem, we need to compute the probabilities P n

ii forsome state i in the communication class. We might as well consider state 0.Recall that P n

00 is the probability of starting from state 0 and returning tostate 0 in exactly n steps. We already know that we cannot to return to 0 inan odd number of steps (each step switches between even and odd states).So, all recurrence probabilities for an odd number of steps must be zero:

P 2n`100 “ 0 for all n.

This means we only need to consider

P 2n00 “ probability of returning to 0 in 2n steps starting from 0.

If we start from 0 and then return to 0, we must have taken just as manysteps forward (which adds 1 to the state) as we have backwards (which adds´1 to the state). This is equivalent to flipping a (biased) coin 2n times andgetting heads exactly n of those times. But this is just a binomial randomvariable (with probability of success p). Therefore,

P 2n00 “

ˆ

2n

n

˙

pnp1´ pqn “p2nq!

n!n!ppp1´ pqqn.

Our question becomes whether the summation

8ÿ

n“1

P 2n00 “

8ÿ

n“1

p2nq!

n!n!ppp1´ pqqn

gives a finite quantity or infinity. This question can be decided using thewell-known result

n! «?

2πnn`1{2

enfor large n,

which is usually referred to as Stirling’s Approximation for factorials. Com-bining this with basic facts about infinite series gives the following result (see[Ro95, pp. 194, 195] for the details).

Theorem 10.8.1 (Recurrence of 1–D Random Walks). For the random walkpXnq with states labeled by the integers t0,˘1,˘2, ¨ ¨ ¨ u and transition prob-abilities

Pj`1,j “ p,

Pj´1,j “ 1´ p “ q,

Page 583: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 574

all states are recurrent if p “ q “ 1{2. If p ‰ q (i.e. neither is 1{2), then allstates are transient.

When p “ q “ 1{2, there is an equal probability of taking a step forwardor backwards. Such walks are said to be unbiased or symmetric randomwalks. If p ‰ q, then the random walk is biased. This means that eitherforward steps are more likely than backward steps or vice versa. Our theo-rem tell us that all states in an unbiased one-dimensional random walk arerecurrent (i.e. they are expected to recur an infinite number of times). Onthe other hand, all states in a biased one-dimensional random walk are tran-sient (and so, any particular state is expected to be visited at most a finitenumber of times).

Despite the fact that all states in an unbiased one-dimensional randomwalk are recurrent, none of the states are positive recurrent!

Theorem 10.8.2. For the random walk pXnq with states labeled by the inte-gers t0,˘1,˘2, ¨ ¨ ¨ u and transition probabilities

Pj`1,j “1

2,

Pj´1,j “1

2,

the expected number of steps before a state recurs is infinite. Hence, all statesare null recurrent.

See [D96, §3.1] for a discussion of this fact. In other words, we know thateach state in a symmetric random walk has to occur an infinite number oftimes. However, the expected number of time steps until a state is repeatedcan be arbitrarily large!

To clarify this rather unintuitive result, consider the first 25 steps of thefollowing symmetric random walk.

n: 0 1 2 3 4 5 6 7 8 9 10 11 12Xn: 0 ´1 0 1 2 1 2 1 0 ´1 0 1 0

n: 13 14 15 16 17 18 19 20 21 22 23 24 25Xn: 1 2 3 2 1 2 1 0 -1 0 1 2 3

Notice that the initial state (X0 “ 0) is repeated quite often. The factthat the expected time until a a state recurs is infinite does not mean that a

Page 584: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 575

state cannot be repeated in a finite amount of time! It only means that theprobabilities of very large waiting times between recurrences is significantenough that we cannot say how long we should expect to wait for a state tobe repeated. For instance, we could have started out making 10 consecutivemoves to the right (i.e. X10 “ 10). While this is not a highly likely state ofaffairs since its probability is

PpX10 “ 10|X0 “ 0q “

ˆ

1

2

˙10

“1

1024

(roughly one chance in a thousand), it is far from an impossibility. Once weare in state X10 “ 10, the chances of returning to 0 in a short amount oftime are relatively slim!

Compare the previous symmetric random walk with the following biasedrandom walk. In this example,

Pj`1,j “4

5,

Pj´1,j “1

5,

(so a step forward is four times more likely than a step backwards).

n: 0 1 2 3 4 5 6 7 8 9 10 11 12Xn: 0 1 0 1 2 3 4 3 2 3 4 5 6

n: 13 14 15 16 17 18 19 20 21 22 23 24 25Xn: 7 8 9 10 9 10 9 10 11 10 9 10 11

Since this is a biased random walk, we know that all states are transient,and we can clearly see this from the overall pattern. While we occasionallytake one or two steps backwards, there is a clear tendency toward bigger andbigger integers. So, we expect that any particular state will only be visiteda finite number of times (if at all), and that the process will more or lessstream off to positive infinity.

Another question of interest is how far from the starting location do weexpect to be after n transitions. In order to tackle such questions, it is betterto rethink how we describe our Markov Chain. Let X0 “ 0 be the initialstate of the chain. At each time step, we transition either one step forwardor one step backwards. We can think about this as

X1 “ X0 ` T1

Page 585: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 576

where the random variable T1 is either ´1 or 1 with probabilities

PpT1 “ 1q “ p,

PpT1 “ ´1q “ q “ 1´ p.

(i.e. T1 is a slight variant of the usual Bernoulli random variable). Similarly,we can think of X2 as

X2 “ X1 ` T2 “ X0 ` T1 ` T2

where T2 is identical to but independent from T1. Going on in this fashion,we can write

Xn “ X0 ` T1 ` T2 ` ¨ ¨ ¨ ` Tn

where all of the random variables Ti are identical to and independent fromT1. This allows us to easily compute expected values and standard deviationsfor the states Xn.

Theorem 10.8.3. For the random walk pXnq with states labeled by the inte-gers t0,˘1,˘2, ¨ ¨ ¨ u, X0 “ 0, and transition probabilities

Pj`1,j “ p,

Pj´1,j “ q,

we have

ErXns “ npp´ qq,

σpXnq “a

n p1´ pp´ qq2q.

Proof: We note that for each of the random variables Ti, we have

ErTis “ p1qp` p´1qq “ p´ q,

VarpTiq “ p1q2p` p´1q2q ´ pp´ qq2 “ p` q ´ pp´ qq2 “ 1´ pp´ qq2.

So, using the basic properties of expectation and variance for independentrandom variables we find

EpXnq “ ErX0s ` ErT1s ` ErT2s ` ¨ ¨ ¨ ` ErTns “ 0` npp´ qq,

VarpXnq “ VarpX0q ` VarpTiq ` VarpTiq ` ¨ ¨ ¨ ` VarpTnq “ 0` n`

1´ pp´ qq2˘

.

Page 586: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 577

Since we forced X0 “ 0 in the statement of the problem, the expected valueand variance of X0 are both 0. �

The standard deviation is particularly interesting. If we consider thesymmetric case (p “ q “ 1{2), then the expected position is always EpXnq “

0. The standard deviation grows with n, however. This means that as timegoes on, we are less certain of the state the system should be in. A moreprecise result gives us an even better indication of the long–term behavior.

Lemma 10.8.4. For the symmetric random walk in one-dimension,

limnÑ8

Ep|Xn|q?n

c

2

π.

The first proof of this result was due to Grunbaum in 1960.8 What this resultsays is that for sufficiently large n, we expect to be a distance of

c

2n

π

from our starting point after n time steps. This is yet another indicationthat while every state in the one-dimensional random walk is recurrent, thestates cannot be positive recurrent.

10.8.2 Random Walks in Two Dimensions

When we go from random walks in one-dimension to ones in two and higherdimensions, one of the difficult changes is the labeling of the states. Fortwo-dimensional random walks, we will assume that the walker must stay ona rectangular grid labeled by pairs of integers, pi, jq. You should think ofthe label pi, jq as directions for how to get to the node in question. The firstcoordinate, i, tells you how many steps left or right to take from the origin.The second coordinate, j, tells you how many steps forward or backwards totake. In the figure below, we have only labeled a few nodes around p0, 0q.

So, each state in our Markov Chain is given by a pair of integers, Xn “

pi, jq, and we will start our process at the origin X0 “ p0, 0q. At each stepin the process, the state is only allowed to change to one of the four nodesdirectly connected to it.

8Grunbaum, B. “Projection Constants.” Trans. Amer. Math. Soc. 95, 451–465, 1960.

Page 587: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 578

p0, 0q p1, 0q

p0, 1q

p´1, 0q

p0,´1q

p1, 1qp´1, 1q

p 1,´1q p1,´1q

Figure 10.8.1: Standard Rectangular Grid for 2–D Random Walks

pi, jq pi` 1, jq

pi, j`1q

pi´ 1, jq

pi, j´1q

Figure 10.8.2: Allowed Transitions for 2–D Random Walks

So, the only states directly accessible from pi, jq are the adjacent nodespi` 1, jq, pi, j ` 1q, pi´ 1, jq, and pi, j ´ 1q. We will denote the probabilitiesof these transitions as

Ppi`1,jq,pi,jq “ r,

Ppi,j`1q,pi,jq “ f,

Ppi´1,jq,pi,jq “ l,

Ppi,j´1q,pi,jq “ b,

where r ` f ` l ` b “ 1. As before, if r “ f “ l “ b “ 1{4 then the walk istotally symmetric (or unbiased). Otherwise the walk is biased. The choiceof letters is designed to make these probabilities easier to remember. Theprobability of moving right is r, of moving forward is f , of moving left is l,and of moving backward is b.

Page 588: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 579

Just as with the one-dimensional version, the generic two–dimensionalrandom walk is irreducible – each state communicates with every other state.9

The period of each state requires a little more thought. If we are currently atnode pi, jq, then we cannot stay there on the next time step. Once we moveto one of the adjacent nodes, then we could certainly return to pi, jq on thenext time step (assuming that none of the transition probabilities is zero).So, 2 is a possible recurrence time. In fact, we can make an argument thatall recurrence times must be even numbers (just as in the one-dimensionalrandom walk).

The way to think about this fact is to consider how we could possibly startfrom pi, jq and then return there. Since the x-coordinate begins and ends at i,the total number of steps to the right must be balanced by the total numberof steps to the left (both could be zero). Likewise, the total number of stepsforward must be balanced by the total number backwards. So, BOTH thenumber of left–right steps and the number of forward–backward steps mustbe even. Therefore, we can only return to a state after an even number ofsteps. Since 2 is a possible recurrence time, we find that the period of everystate is 2.

The figures below show simulations of random walks in two-dimensionswhich start from (0,0). The first two figures show symmetric random walksallowed to run for 10,000 steps. The second figure shows 10,000 steps of abiased random walk with probabilities

Ppi`1,jq,pi,jq “ 1{3,

Ppi,j`1q,pi,jq “ 1{3,

Ppi´1,jq,pi,jq “ 1{6,

Ppi,j´1q,pi,jq “ 1{6.

What this means is that the system is twice as likely to move forward orright as it is to move backward or left.

We should note that the scales of these three figures (which are not shownto keep the plots form being cluttered) are very different. The last plotis especially zoomed out from the others. As you can see, the symmetricrandom walks meander around in no preferred direction. However, our biased

9This is not quite true if some of r, f, l, or b are zero. In that case, there are somestates which will be inaccessible from a given state. In an extreme example, if f “ b “ 0,then the only states accessible from p0, 0q are states of the form pi, 0q - i.e. states to theleft or right of the origin.

Page 589: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 580

Figure 10.8.3: Sample 2–D Symmetric Random Walks: 10,000 Steps

example has a clear tendency to move up and to the right. The inset panelshows a tight zoom on the beginning of the biased walk. Clearly, movesdown and to the left are possible, but they are infrequent enough to beoverwhelmed.

Figure 10.8.4: Sample 2–D Biased Random Walk: 10,000 Steps

So far, our examples seem to indicate that the same result that was

Page 590: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 581

true in one-dimension is also true in two-dimensions. Namely, states in thesymmetric random walk are recurrent, while they are transient in biasedrandom walks. However, the situation is a bit more complicated than that.We will say that a two-dimensional random walk is directionally unbiasedif the probability of moving forwards is equal to the probability of movingbackwards AND the probability of moving right is equal to the probabilityof moving left. That is,

Ppi`1,jq,pi,jq “ r,

Ppi,j`1q,pi,jq “ f,

Ppi´1,jq,pi,jq “ r,

Ppi,j´1q,pi,jq “ f,

where r ` f ` r ` f “ 1 or equivalently, r ` f “ 1{2. We will refer to thespecial case where

r “ f “1

4

as the totally symmetric random walk in two-dimensions.

Theorem 10.8.5 (Recurrence of 2–D Random Walks). For the two-dimensionalrandom walk pXnq with states labeled by pairs of integers pi, jq and transitionprobabilities

Ppi`1,jq,pi,jq “ r,

Ppi,j`1q,pi,jq “ f,

Ppi´1,jq,pi,jq “ l,

Ppi,j´1q,pi,jq “ b,

all states are recurrent if the walk is directionally unbiased. Otherwise, allstates are transient.

A partial proof of this result can be found in [D96, §3.2]. We will only givean outline of why this is true. As with the one-dimensional random walk, weappeal to Theorem 10.3.1 and the fact that the process is irreducible. Forthe recurrence times P n

p0,0q,p0,0q, we have already observed that a state cannotrecur in an odd number of time steps:

P 2n`1p0,0q,p0,0q “ 0 for all n ě 0.

Page 591: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 582

This means we only need to consider P 2np0,0q,p0,0q. In order to start at p0, 0q

and return there, we have to take an equal number of steps to the left andright as well as an equal number of steps forward and backward. If we takei steps to the right (and so i steps to the left), we must have taken n ´ isteps forward (and n ´ i steps backward) to get a total of 2n steps. Here, icould be any integer from 0 to n. Since these steps can be in any differentorder, we need to count the number of ways the steps can be arranged. Thisis done with a multinomial coefficient:

ˆ

2n

i, i, n´ i, n´ i

˙

“p2nq!

i!i!pn´ iq!pn´ iq!.

The exact definition of multinomial coefficients is not important here, but theidea is simple enough. We have 2n steps to take, and they can be reorderedin p2nq! different ways – if all steps were distinguishable. However, the isteps to the right are essentially the same move. Since there are i! ways ofrearranging these steps to the right, we divide by i! so we do not over-countthe number of steps. The same is done for steps to the left, forward, andbackward. Using this idea, we can compute the probability of returning tothe origin in 2n steps:

P 2np0,0q,p0,0q “

nÿ

i“0

p2nq!

i!i!pn´ iq!pn´ iq!f ibirn´iln´i.

So, the determination of whether the states are transient or recurrent dependson whether the sum

8ÿ

n“1

P 2np0,0q,p0,0q “

8ÿ

n“1

nÿ

i“0

p2nq!

i!i!pn´ iq!pn´ iq!f ibirn´iln´i

is finite or infinite, respectively.When f “ r “ b “ l “ 1{4, this sum becomes

P 2np0,0q,p0,0q “

8ÿ

n“1

ˆ

1

4

˙2n nÿ

i“0

p2nq!

i!i!pn´ iq!pn´ iq!« C

8ÿ

n“1

1

n“ 8,

(C is a positive constant whose exact form does not have any bearing on theconclusion). So, the totally symmetric random walk in two-dimensions is

Page 592: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 583

recurrent. For the directionally unbiased case (i.e. f “ b and r “ l), it ispossible to show that

P 2np0,0q,p0,0q “

nÿ

i“0

p2nq!

i!i!pn´ iq!pn´ iq!

`

f i˘2 `

rn´i˘2

ě

nÿ

i“0

p2nq!

i!i!pn´ iq!pn´ iq!

ˆ

1

4

˙2iˆ1

4

˙2pn´iq

.

But this smaller term is exactly the transition probability for the totallysymmetric case! Since the recurrence probabilities are bigger in the direc-tionally unbiased random walk, the states must also be recurrent in this case.Analyzing the biased case is far more challenging.

As before, we would like to know our expected position and the standarddeviation of the distance for a two-dimensional random walk. We assumeour starting state is always X0 “ p0, 0q. Each of our independent transitionrandom variables Ti are distributed as

PpTi “ p1, 0qq “ r,

PpTi “ p0, 1qq “ f,

PpTi “ p´1, 0qq “ l,

PpTi “ p0,´1qq “ b.

Just as in the one-dimensional case, we can write

Xn “ X0 ` T1 ` T2 ` ¨ ¨ ¨ ` Tn

where addition is defined component–wise. Notice that we cannot directlytalk about the variance (or standard deviation) of the Ti since they are notnumbers! We can talk about the expected size of Ti – that is, Er|Ti|s “ 1.This is obviously true since each possible outcome for Ti is one unit from theorigin!

Theorem 10.8.6. For the random walk pXnq with states labeled by the inte-gers t0,˘1,˘2, ¨ ¨ ¨ u, X0 “ p0, 0q, and transition probabilities

Ppi`1,jq,pi,jq “ r,

Ppi,j`1q,pi,jq “ f,

Ppi´1,jq,pi,jq “ l,

Ppi,j´1q,pi,jq “ b,

Page 593: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 584

we have

ErXns “ pnpf ´ bq, npr ´ lqq,

Er|Xn|2s “ n` npn´ 1q

pf ´ bq2 ` pr ´ lq2‰

.

Proof: We note that for each of the random variables Ti, we have

ErTis “ p1, 0qf ` p0, 1qr ` p´1, 0qb` p0,´1ql “ pf ´ b, r ´ lq.

This immediately gives

ErXns “ ErX0s ` ErT1s ` ErT2s ` ¨ ¨ ¨ ` ErTns “ pnpf ´ bq, npr ´ lqq.

For the expected value of |Xn|2, we use the fact that

|Xn|2“ Xn ¨Xn

“ pT1 ` T2 ` ¨ ¨ ¨ ` Tnq ¨ pT1 ` T2 ` ¨ ¨ ¨ ` Tnq

nÿ

i“1

nÿ

j“1

Ti ¨ Tj

nÿ

i“1

Ti ¨ Ti ` 2nÿ

i“1

ÿ

j‰i

Ti ¨ Tj

“ n`nÿ

i“1

ÿ

j‰i

Ti ¨ Tj.

We intentionally left off the X0 term since it is assumed to be p0, 0q. In thelast step, we used the fact that

Ti ¨ Ti “ |Ti|2“ 1.

This shows us that

Er|Xn|2s “ n`

nÿ

i“1

ÿ

j‰i

ErTi ¨ Tjs “ n` npn´ 1qErT1 ¨ T2s.

The last equality follows because the Ti are all identically distributed. Atedious computation shows that

ErT1 ¨ T2s ““

pf ´ bq2 ` pr ´ lq2‰

. �

As in the one-dimensional case, the expected value of |Xn|2 leads us to

the conclusion that in the directionally unbiased case, the expected distancefrom the origin, Er|Xn|s, is proportional to

?n after a very large number of

time steps.

Page 594: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 585

10.8.3 Random Walks in Three and Higher Dimen-sions

Once we leave two-dimensions, the computations which tell us whether ran-dom walks are recurrent or transient become much more involved (as if thepast computations were not challenging). In this section, we will only presentresults for random walks in three and higher dimensions without discussingtheir proof. In fact, we will mostly limit ourselves to the totally symmetricrandom walk in three dimensions.

Just as in two-dimensional walks, we assume that at each node we areallowed to take a single step in one of three directions. This means that eachnode (or state) of our three-dimensional random walk can be labeled with aordered triple of integers: pi, j, kq.

pi, j, kq pi, j ` 1, kqpi, j ´ 1, kq

pi, j, k ` 1q

pi, j, k ´ 1q

pi` 1, j, kq

pi´ 1, j, kq

Figure 10.8.5: Lattice for Three-Dimensional Random Walks

From the lattice, we can see that there are 6 nodes that are accessiblefrom a given node pi, j, kq. So, the transition probabilities can be listed as

Ppi`1,j,kq,pi,j,kq “ f,

Ppi,j`1,kq,pi,j,kq “ r,

Ppi´1,j,kq,pi,j,kq “ b,

Ppi,j´1,kq,pi,j,kq “ l,

Ppi,j,k`1q,pi,j,kq “ u,

Ppi,j,k´1q,pi,j,kq “ d,

Page 595: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 586

where f`r`b` l`u`d “ 1. The letters here have been chosen to make theprobabilities easier to remember (f for forward, r for right, b for backward,l for left, u for up, and d for down). As long as none of these 6 probabilitiesare 0, each state in the process communicates with every other state, and sothe Markov Chain is irreducible.

Page 596: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 587

Figure 10.8.6: Three Viewpoints of a Single Symmetric 3-D Random Walk

Page 597: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 588

We will mostly be interested in the case when

f “ r “ b “ l “ u “ d “1

6.

In Figure 10.8.6, we see three different views of the same totally symmetricthree-dimensional random walk which starts from the origin, p0, 0, 0q. Itcertainly appears that we eventually leave the vicinity of our starting pointand never seem to return. While it is never a good idea to jump to conclusionsbased on a single example, it turns out that this situation is completelyindicative of the long-term behavior for random walks in three (and higher)dimensions.

Theorem 10.8.7 (Totally Symmetric Random Walks in Three Dimensions).Every state in the totally symmetric random walk in three (and higher) di-mensions is transient. Moreover, the expected distance from the origin aftern time steps is roughly proportional to

?n for sufficiently large n.

Of course, if the totally symmetric case is not recurrent, then we have nohope of the biased cases being recurrent either!10 For a proof of this resultsee [D96, §3.2].

A famous joke by the mathematician Shizuo Kakutani sums up theseresults nicely: “A drunk man will find his way home, but a drunk bird mayget lost forever.” The idea behind this joke is that people essentially walk ina two-dimensional space (where random walks are recurrent) while birds flyaround in three dimensions. Whether or not the motion of drunk people (oranimals) is accurately modeled by a random walk is left to the opinion of thereader.

10.9 Markov Chain Monte Carlo Methods

Often in simulations of real–world systems, we are faced with the problemof generating random samples from a given probability distribution (discreteor continuous). Most computer programs have routines for sampling fromuniform distributions. For example, the histogram below shows the resultsfrom having the computer algebra system Mathematica choose 10,000 randomsamples uniformly (and independently) from the set 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (soeach outcome has probability 1{10).

10Unless some of the transition probabilities are zero. In such cases, we may haverecurrent states, but the random walk will not be “truly three-dimensional.”

Page 598: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 589

Figure 10.9.1: 10,000 Random Samples from the Digits 0 – 9

Suppose instead that we want to sample this set according to the proba-bility distribution

P pX “ 0q “ P pX “ 9q “1

30,

P pX “ 1q “ P pX “ 8q “1

15,

P pX “ 2q “ P pX “ 7q “1

10,

P pX “ 3q “ P pX “ 6q “2

15,

P pX “ 4q “ P pX “ 5q “1

6.

While there are several schemes that could generate samples in this simplesituation, we would like a procedure that has some chance of being appli-cable to a wide range of situations. The idea we will develop is to designa Markov Chain whose limiting probabilities are precisely the probabilitiesof the distribution we want to sample from. Such techniques go under the

Page 599: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 590

name Markov Chain Monte Carlo Methods (or MCMC Methods).11

The specific MCMC Method we will develop is known as the Metropolis–Hastings Algorithm. We will begin by describing how this algorithm worksfor discrete random variables and then indicate how it can be extended tothe continuous case with a couple of examples. For our setup, assume thatthe set of possible outcomes for our random variable X is t0, 1, 2, 3, ¨ ¨ ¨ u. Wealso assume that there is a function βpiq such that the probabilities of theseoutcomes are given by

P pX “ iq “βpiq

B

where B is the appropriate normalization constant

B “ÿ

i“0

βpiq.

One of the advantages of the Metropolis–Hastings Algorithm is that we donot need to know B to produce the random samples! This is particularlyuseful in the continuous case where the normalization constant may involvean integral that is difficult to evaluate exactly.

Our job is to design an irreducible Markov Chain such that the limitingprobabilities πi satisfy

πi “βpiq

B.

To do this, we start with an auxiliary Markov Chain, pXnq which we caneasily simulate (for example, a simple random walk). Since this MarkovChain will not be our final one, we will denote its transition probabilities asPij (as before, this is the probability of the auxiliary process transitioningfrom state j to state i). We will also need to be able to simulate Bernoullirandom variables with arbitrary probability of success (which will be denotedby α). Our final product will be the Markov Chain pXnq with transitionprobabilities Pij. The choice of initial state X0 for the Markov Chain turnsout to be irrelevant in practice.

Assume that our Markov Chain is in state j at time step n, Xn “ j. Wefirst go to our auxiliary Markov Chain and let it start in state j, X0 “ j.Suppose the next step in our auxiliary process is X1 “ i (which happens withprobability Pij). For our actual Markov Chain, we will either let Xn`1 “ i

11Monte Carlo Methods are a broad class of techniques that use random sampling toperform numerical computations.

Page 600: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 591

or Xn`1 “ j. To decide, we simulate a Bernoulli random variable withprobability of success

αij “ min

ˆ

βpiqPjiβpjqPij

, 1

˙

.

The function ‘min’ means to take the minimum of the two numbers listedwhich prevents the probability αij from being greater than 1. If this Bernoullitrial is successful, we let our Markov Chain transition to state i (so, Xn`1 “ i.Otherwise, the chain remains in state j, Xn`1 “ j.

To analyze this new Markov Chain, we need the transition probabilities.If Xn “ j, then the probability of transitioning to a different state i is

Pij “ Pijαij pi ‰ jq

since we need our auxiliary Markov chain to transition from j to i, and weneed our Bernoulli trial to be successful (and these are independent events).If the Markov Chain stays in state j, then there are two different ways thatcould happen (which are mutually exclusive). First, the auxiliary chain couldstay in state j (in which case our actual process will definitely stay in state jas well). Second, the auxiliary chain could transition to some different statek but the Bernoulli trial fails. Altogether, the probability of the processremaining in state j is

Pjj “ Pjj `ÿ

k‰j

Pkjp1´ αkjq.

Recall that the equation for limiting probabilities is

~π “ P~π

or in component formπi “

ÿ

j

Pijπj

(together with the requirement that the probabilities add up to one). Theclaim is that these limiting probabilities are precisely

πi “βpiq

B.

Page 601: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 592

Rather than deriving this, we will simply verify that this is correct.

ÿ

j

Pijπj “ÿ

j

Pijβpjq

B

“1

B

˜

Piiβpiq `ÿ

j‰i

Pijβpjq

¸

Looking at the quantity in the parentheses, we find

Piiβpiq `ÿ

j‰i

Pijβpjq

˜

Pii `ÿ

j‰i

Pjip1´ αjiq

¸

βpiq `ÿ

j‰i

Pijαijβpjq

˜

Pii `ÿ

j‰i

Pji ´ÿ

j‰i

Pjiαji

¸

βpiq `ÿ

j‰i

Pijαijβpjq

˜

Pii `ÿ

j‰i

Pji

¸

βpiq ´ÿ

j‰i

Pjiαjiβpiq `ÿ

j‰i

Pijαijβpjq.

The quantity in the parentheses above is just 1 since it is the total probabilitythat our auxiliary Markov Chain transitions from state i to any other state(which must be one). So, we have

Piiβpiq `ÿ

j‰i

Pijβpjq

“ βpiq ´ÿ

j‰i

Pjiαjiβpiq `ÿ

j‰i

Pijαijβpjq.

Notice, if

αij “βpiqPjiβpjqPij

ď 1,

then αji “ 1 sinceβpjqPijβpiqPji

“1

αijě 1.

Similarly, if

αji “βpjqPijβpiqPji

ď 1,

Page 602: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 593

then αij “ 1. In either case,

Pijαijβpjq “ Pjiαjiβpiq.

This meansÿ

j‰i

Pijαijβpjq ´ÿ

j‰i

Pjiαjiβpiq

“ÿ

j‰i

˜

Pijαijβpjq ´ÿ

j‰i

Pjiαjiβpiq

¸

“ 0.

Therefore,Piiβpiq `

ÿ

j‰i

Pijβpjq “ βpiq,

and the limiting probabilities of our Markov Chain pXnq are precisely

πi “βpiq

B.

This derivation also shows why this algorithm is independent of the normal-ization constant B (i.e. we only use ratios of the quantities βpiq).

Before we look at some specific examples, we discuss some practical mat-ters in the usage of the algorithm. First, most implementations of Metropolis–Hastings allow for a burn-in period before beginning to accept samples. Theidea is that the Markov Chain we develop is only guaranteed to have limitingprobabilities that match the target distribution. So, an initial state for thechain, X0, is picked at random, and the system is allowed to run for somelarge number of steps before keeping any samples. This prevents a bad choiceof initial state from distorting the samples.

Another common practice when using Metropolis–Hastings is sample thin-ning ; instead of keeping all samples after the burn-in period, a large numberof samples (perhaps the majority) are thrown away. An alternate way tothink about this process is that the sampling device only keeps every n-thsample after the burn-in period (e.g. the device keeps every 20-th sampleafter the burn-in period). The reason for this practice is that we want togenerate (approximately) independent samples from the target distribution.The problem with keeping all samples is that state of Xn`1 depends on thestate of Xn. Of course, Xn`1 is dependent on all states that came before it,but after a large enough number of steps this dependence should hopefullybe negligible.

Page 603: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 594

Example 10.9.1. Use the Metropolis–Hastings Algorithm to set up a MarkovChain that will sample the digits 0 – 9 according to the distribution

P pX “ 0q “ P pX “ 9q “1

30,

P pX “ 1q “ P pX “ 8q “1

15,

P pX “ 2q “ P pX “ 7q “1

10,

P pX “ 3q “ P pX “ 6q “2

15,

P pX “ 4q “ P pX “ 5q “1

6.

Answer: We take our auxiliary Markov Chain pXnq to be the symmetricrandom walk on the integers 0 – 9 (with 0 and 9 considered neighbors). Inother words Pi´1,i “ Pi`1,i “ 1{2 for i “ 1, 2, 3, 4, 5, 6, 7, and 8. For nodes 0and 9, we have P90 “ P10 “ 1{2 and P89 “ P09 “ 1{2. All other transitionprobabilities are 0. For the numbers βpiq, we can take

βp0q “ βp9q “ 1,

βp1q “ βp8q “ 2,

βp2q “ βp7q “ 3,

βp3q “ βp6q “ 4,

βp4q “ βp5q “ 5.

Notice that these 10 numbers sum to 30 (which is the least common denom-inator of all the probabilities).

We will let the first element of our new Markov Chain be X0 “ 0. Sincewe will allow for a burn-in period, this initial choice should not make muchof a difference. We will go through a few first steps in our new Markov Chainto get the idea of how the process plays out. For this example, we will notimplement any sample thinning.Step 1: Since X0 “ 0, we consider our auxiliary Markov Chain with startingstate X0 “ 0. The next state will either be X1 “ 9 or X1 “ 1 each withprobability 1{2. Suppose our auxiliary chain transitions to X1 “ 1. Then weknow X1 “ 1 or X1 “ 0. To decide which, we need the acceptance probability

α10 “ min

ˆ

βp1qP01

βp0qP10

, 1

˙

“ min

ˆ

2p1{2q

1p1{2q, 1

˙

“ minp2, 1q “ 1.

Page 604: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 595

So, the acceptance probability is 1, and we definitely transition from X0 “ 0to X1 “ 1. This makes sense as 1 is twice as likely to occur in our targetprobability distribution as 0.Step 2: Since X1 “ 1, we consider our auxiliary Markov Chain with startingstate X0 “ 1. The next state will either be X1 “ 0 or X1 “ 2 each withprobability 1{2. Suppose our auxiliary chain transitions to X1 “ 2. Then weknow X2 “ 2 or X2 “ 1. To decide which, we need the acceptance probability

α21 “ min

ˆ

βp2qP12

βp1qP21

, 1

˙

“ min

ˆ

3p1{2q

2p1{2q, 1

˙

“ minp3{2, 1q “ 1.

So, the acceptance probability is 1, and we definitely transition from X1 “ 1to X2 “ 2.Step 3: Since X2 “ 2, we consider our auxiliary Markov Chain with startingstate X0 “ 2. The next state will either be X1 “ 1 or X1 “ 3 each withprobability 1{2. Suppose our auxiliary chain transitions to X1 “ 1. Then weknow X3 “ 1 or X2 “ 2. To decide which, we need the acceptance probability

α12 “ min

ˆ

βp1qP21

βp2qP12

, 1

˙

“ min

ˆ

2p1{2q

3p1{2q, 1

˙

“ minp2{3, 1q “2

3.

So, the acceptance probability is 23. We have to simulate a Bernoullip2{3q

random variable to decide whether or not we will accept the transition tostate 1. Suppose this random variable returns a success. Then we transitionto X3 “ 1.Step 4: Since X3 “ 1, we consider our auxiliary Markov Chain with startingstate X0 “ 1. The next state will either be X1 “ 0 or X1 “ 2 each withprobability 1{2. Suppose our auxiliary chain transitions to X1 “ 0. Then weknow X4 “ 0 or X4 “ 1. To decide which, we need the acceptance probability

α01 “ min

ˆ

βp0qP10

βp1qP01

, 1

˙

“ min

ˆ

1p1{2q

2p1{2q, 1

˙

“ minp1{2, 1q “1

2.

So, the acceptance probability is 1{2, and we have to simulate a Bernoullip1{2qrandom variable to decide whether or not we will accept the transition tostate 0. Suppose this random variable returns a failure. Then we do nottransition to 0, and so X4 “ 1.

So, the first four steps of our process are X0 “ 0, X1 “ 1, X2 “ 2, X3 “ 1,and X4 “ 1. Notice that the first few steps spends a good amount of time

Page 605: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 596

in states that are far less likely than our target distribution would suggest.This is why the burn–in period is useful.

This process is easy to set up in most computer programming languages.We decided to run this procedure in Mathematica. The histogram belowshows the results of a run of 10,100 steps in this process where we thendropped the first 100 time steps for burn–in.

Figure 10.9.2: 10,000 Random Samples from the Target Distribution inExample 10.9.1

Notice that the Markov Chain we designed spends far more time in states4 and 5 than in states 0 and 9. In fact, the Markov Chain visits state 4 atotal of 1,623 times. Since PpX “ 4q “ 1{6, we would expect the Markovchain to visit this state

10000

6“ 1666.6 times.

Similarly, our Markov Chain visits state 5 a total of 1,667 times (which isalso close to the expected value). The other states are visited roughly closeto their expected number of times. �

Example 10.9.2. Suppose we want to generate random samples from a

Page 606: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 597

binomialp20, 1{3q random variable. Set up a Markov Chain using the Metropolis–Hastings Algorithm which will generate these samples.12

Answer: For binomialp20, 2{3q, the possible outcomes are t0, 1, 2, 3, ¨ ¨ ¨ 20u.So we take as our underlying Markov Chain a symmetric random walk onthese integers (once again, we will let the endpoints, 0 and 20, be neighbors).The underlying probabilities for the binomial are

PpX “ iq “

ˆ

20

i

˙ˆ

2

3

˙iˆ1

3

˙20´i

“20!

i!p20´ iq!

2i

320

“20!

320

2i

i!p20´ iq!.

For βpiq, we can ignore the factor of 20!{320 (since it plays the role of anormalization). So, we can define

βpiq “2i

i!p20´ iq!.

Our acceptance probabilities become

αij “ min

ˆ

βpiqPjiβpjqPij

, 1

˙

“ min

ˆ

2ij!p20´ jq!

2ji!p20´ iq!

PjiPij

, 1

˙

.

Remember that Pij is the probability that our auxiliary Markov Chain willtransition from state j to state i. Since we are using a symmetric randomwalk, we will only use these acceptance probabilities when i is a neighboringstate to j. In that case, Pji{Pij “ 1 (since all non-zero transition probabilitiesare 1{2).

Since the expected value of a binomialp20, 2{3q is 40{3 “ 13.3, we willtake X0 “ 13. As before, we will allow a burn–in time of 100 steps beforeaccepting samples from our new Markov Chain. The first histogram showsthe output from the Metropolis–Hastings Algorithm. The second one showsa histogram from a binomial sampler directly built into Mathematica. Noticethe similarity in the two samples! �

12Any decent software package that is designed for mathematical or statistical analysisprobably has a built–in method for generating samples from most well–known randomvariables.

Page 607: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 598

Figure 10.9.3: 10,000 Random Samples from binomialp20, 2{3q byMetropolis–Hastings

Figure 10.9.4: 10,000 Random Samples directly from binomialp20, 2{3q

Page 608: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 599

Example 10.9.3. Suppose we want to generate random samples distributedaccording to Betap30, 50q. Set up a Markov Chain using the Metropolis–Hastings Algorithm which will generate these samples.

Answer: Since the state space of any beta random variable is r0, 1s, we needour Markov Chain to have states in this range. However, we do not have thetools to deal with a continuous process. Instead, we will assume both of ourMarkov Chains (the auxiliary and our actual one) have states labeled withintegers from 1 to 99 (so there are 99 possible states). We will interpret statei as corresponding to the fraction i{100. The reason for excluding states 0and 100 will be clear soon enough.

For our auxiliary Markov Chain, we will again choose a symmetric randomwalk (with 1 and 99 being considered neighbors). For the numbers βpiq, weuse the form of the distribution for Betap30, 50q:

p

ˆ

i

100

˙

“pi{100q29p1´ i{100q49

Bp30, 50q

“i29p100´ iq49

10078Bp30, 50q.

So, we can takeβpiq “ i29

p100´ iq49

since the normalization factor is not important. Notice that βp0q “ βp100q “0 which is why we have excluded states 0 and 100.

The acceptance probabilities are given by

αij “ min

ˆ

βpiqPjiβpjqPij

, 1

˙

“ min

ˆ

i29p100´ iq49Pjij29p100´ jq49Pij

, 1

˙

“ min

˜

ˆ

i

j

˙29 ˆ100´ i

100´ j

˙49 PjiPij

, 1

¸

.

Of course, Pij is zero unless i “ j´1 or i “ j`1 (in which case our auxiliaryMarkov Chain has transition probabilities of 1{2). So, in any cases wherethese acceptance probabilities are used, the ratio Pji{Pij “ 1.

Since the expected value of Betap30, 50q is 3{8 “ 0.375, we will start ourfinal Markov Chain in state 38 (since 38{100 “ 0.38 is close to the expected

Page 609: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 600

value). We again generate 10,000 samples after a burn–in period of 100 steps.This gives the following results. Notice how similar the distribution is to thepdf for Betap30, 50q.

Figure 10.9.5: 10,000 Random Samples from Betap30, 50q

Example 10.9.4. Suppose we want to generate random samples from adistribution whose sample space is r1, 3s and whose pdf is of the form

ppxq “Cx4.

Set up a Markov Chain using the Metropolis–Hastings Algorithm which willgenerate these samples

Answer: While we could easily normalize the given pdf (by requiring thatthe integral over the sample space yields 1), we do not need to do this!Remember, the Metropolis–Hastings Algorithm does not depend on knowingany normalization constants!

Page 610: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 601

Since we need to discretize the sample space, we will again take samplesthat are 1/100 apart (from 1.00 to 3.00). So, we will take our auxiliaryMarkov Chain to be a symmetric random walk on the integers from 0 to 200(with 0 and 200 being neighbors). State i in our walk will correspond to thenumber 1 ` i{100 in the range r1, 3s. We do not have to exclude states 0and 200 (as we did for the example above) because the pdf for our randomvariable is non-zero at the corresponding values (1 and 3).

Since

p

ˆ

1`i

100

˙

“C

p1` i{100q4“

1004Cp100` iq4

,

we can take

βpiq “1

p100` iq4.

On a practical note, we should be careful about how to choose βpiq. While wecan ignore any common normalization factor, it could be that the resultingβpiq is extremely small or extremely large. In such a case, your computermay have trouble working accurately with these numbers. Most moderncomputers are capable of dealing with such issues, but care should be takennonetheless!

As above, the acceptance probabilities are

αij “ min

ˆ

βpiqPjiβpjqPij

, 1

˙

“ min

˜

ˆ

100` j

100` i

˙4 PjiPij

, 1

¸

,

and the ratio Pji{Pij “ 1 in any case where these probabilities are used.Since our target pdf is a decreasing function, it seems reasonable to start

our Markov Chain in state X0 “ 0 (which corresponds to the left–hand sideof the sample space x “ 1). We will still use a burn–in period of 100 timesteps, but we will actually keep 100,000 samples for this simulation. Thenumber of samples you produce should increase with the number of statesin your auxiliary Markov Chain. As an extreme example, if your underlyingMarkov Chain has 20,000 possible states, then you cannot possibly visit everylocation in 10,000 steps!

While the random samples seem to have a frequency that roughly matchesthe target pdf, we still do not have great agreement after 100,000 samples.

Page 611: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 602

Figure 10.9.6: 100,000 Random Samples from the pdf in Example 10.9.3

If we run our simulation again, but ask for 1,000,000 samples, we get closerto the target distribution. �

You should get the impression that simulating continuous random vari-ables using MCMC methods can be very tricky, and much effort has beenspent on developing efficient algorithms for just that purpose.

As a final note on this subject, determining how long an appropriateburn-in period should be and how much sample thinning is appropriate fora given target distribution is a rather subtle art. All that our results tellus is that if we run our Markov Chain for long enough, the frequency ofthe samples will eventually match the target distribution. Much effort hasbeen spent to study these questions, and some results are known for partic-ular target distributions. Largely, the burn-in and sample acceptance ratesare determined by trial and error – especially for more unusual probabilitydistributions.

Page 612: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 603

Figure 10.9.7: 1,000,000 Random Samples from the pdf in Example 10.9.3

10.10 Problems

1.) Consider a random walk on the hexagon shown below. At each step inthe process, there is a probability of 1/5 that the walker will stay onthe current node and a probability of 2/5 of moving to either of theadjacent nodes.

a.) Determine the transition matrix for this process, and classify thestates into communication classes and determine whether eachclass is transient or recurrent.

b.) What is the period for each class?

c.) If we start at node 1, what is the probability that we land on node3 after 4 moves?

Page 613: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 604

3

2 1

0

54

2.) Consider a random walk on the graph below. For nodes 1 – 4, there isa probability of 1/5 that the walker will stay on the current node and aprobability of 2/5 of transitioning to either adjacent node. For node 0,there is a a probability of 1/5 to transition to node 6 and a probabilityof 2/5 to transition to either nodes 1 or 5. For node 5, there is a aprobability of 1/5 to transition to node 7 and a probability of 2/5 totransition to either nodes 0 or 4. Node 6 transitions to node 7 withprobability 1, and node 7 transitions to node 6 with probability 1.

a.) Determine the transition matrix for this process, and classify thestates into communication classes and determine whether eachclass is transient or recurrent.

b.) What is the period for each class?

c.) If we start at node 3, what is the probability that we land on node7 after 5 moves?

3

2 1

0

5

4

6

7

3.) Consider a random walk on the graph below. A walker on any of nodes1 – 4 and 6 – 8 has an equal probability of transitioning to any node

Page 614: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 605

directly connected (and no probability of staying on the current node).On node 0, there is a probability of 3/4 of staying on node 0 and aprobability of 1/4 of transitioning to node 1. A walker on node 5 canonly transition to nodes 6 or 8 each with probability 1/2.

a.) Determine the transition matrix for this process, and classify thestates into communication classes and determine whether eachclass is transient or recurrent.

b.) What is the period for each class?

c.) If we start at node 0, what is the probability that we have notentered the loop consisting of nodes 5 – 8 after 5 steps? Whatabout after 10 and 20 steps?

01

4

2

35

6

7

8

4.) For the maze in example 10.1.3, suppose that the mouse starts in room2. What is the probability that a mouse gets to room 7 in the leastnumber of steps possible simply by chance?

5.) Consider the following maze.

Page 615: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 606

01

2

3

4

5

6

7

8

9

An untrained mouse starts in room 0 and the goal is room 9. Assumethat the mouse makes room changes randomly, and each connectingroom is equally likely for rooms 0 – 8. Once the mouse reaches room9, the experiment is over.

a.) What is the minimum number of room changes before the mousecan reach room 9?

b.) How many room changes before the probability of reaching room9 is 50% or greater?

c.) How many room changes before we can be 95% certain the mousehas reached room 9?

6.) The mouse in the previous problem grew frustrated with the maze andchewed new doors connecting rooms 2 and 3 and rooms 3 and 7. Howdoes this change the answers?

7.) Find the limiting probabilities for the stochastic process in problem 1.).

Page 616: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 607

8.) A Markov Chain has 4 states (labeled 1, 2, 3, and 4) and a transitionmatrix

P “

»

1{4 1{3 0 11{4 0 0 01{4 1{3 1{2 01{4 1{3 1{2 0

fi

ffi

ffi

fl

.

Explain why this process has a set of limiting probabilities. In the longrun, which of the four states is least likely?

9.) Consider a random walk around the circle shown below. At each timestep, the process must transition from its current position to one of thetwo adjacent nodes. For nodes 1, 2, and 3, the move counterclockwiseis three times more likely than the clockwise move. For nodes 5, 6, and7, the opposite is true. All possible transitions from nodes 0 and 4 areequally likely.

4 0

2

6

13

5 7

Since this process is not ergodic (why?), we cannot discuss transitionprobabilities for this Markov Chain. However, if we only look at the twostep process between the odd nodes, we do get an irreducible MarkovProcess (the same is true for the even nodes). Write down the tran-sition matrix for the odd nodes after two steps and find the limitingprobabilities of the odd nodes for this new process.

10.) Suppose in the random walk above that a walker on node 0 has aprobability of 1/3 to remain on 0, 1/3 to transition to 1, and 1/3 to

Page 617: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 608

transition to 7. All other transitions have the same probability. Theanalogous statement applies to node 4. Why is this Markov Chainergodic? What are the limiting probabilities of the nodes?

11.) Consider the following process. We have 4 red and 4 green balls thatare randomly placed into 1 of two urns (each urn receiving 4 balls intotal). At each time step, we simultaneously pick one ball at randomfrom each urn to place into the other urn. Let Xi be the total numberof red balls in urn 1 at each time step (so Xi “ 0, 1, 2, 3, or 4). Writedown the transition matrix from this Markov Process. Explain why theprocess has a set of limiting probabilities, and determine these limitingprobabilities.

12.) Rework problem 11.) but for the case that two balls from each urn areswapped at each time step.

13.) Consider the distribution of shapes in epithelial tissue presented inSection 10.7. Suppose that the possible shapes for daughter cells areall equally likely (e.g. a hexagon-shaped cell will produce cells with4, 5, or 6 sides all with probability 1{3 rather than by the binomialdistribution). Numerically compute the new distribution of side lengths(again assuming no cells have more than 13 sides and the anomalous14 sided cell collapses to a 4 sided cell).

14.) Suppose that two people are repeatedly playing rounds of a game. Eachtime a player wins, they receive $1 from the other player, and the roundscontinue until one player has lost all of their money. Player A startsout with $20, Player B with $15, but the game is slightly unfair. PlayerA only has a probability p “ 15{32 of winning each round.

a.) What is the probability that Player A wins all of the money? Giveyour answer as a percentage rounded to two decimal places.

b.) How much of the total $35 would player A need to start with tohave a 50% chance of winning the entire amount? (Only wholedollar amounts are allowed in the game.)

15.) Consider the situation described in problem 14.), but now let the prob-ability that Player A wins each round be some value p strictly less than1

2. If Player A starts out with $20 out of the $35 total, approximately

Page 618: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

CHAPTER 10. DISCRETE–TIME STOCHASTIC PROCESSES 609

how small does p need to be to ensure that Player A only has a 50%chance of winning all of the money? Give p as a percentage roundedto 1 decimal place.

16.) Challenge: Suppose that in the Gambler’s Ruin Problem the proba-bility of winning a bet is dependent on the current size of the player’sfortune. Specifically, assume that if a player’s fortune is 0 or N , thenthe game is over. If a player’s fortune at time i is 1, 2, 3, ¨ ¨ ¨ , N ´ 1,then the probability of winning is given by

Ppwin 1 unit|Xi “ mq “

ˆ

3

4

˙m

.

Compute PM , the probability of reaching a fortune of N before reaching0 starting from a fortune of size M .

Page 619: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Appendix A

Complex NumbersThe complex numbers, C, are an extension of the real numbers obtained byadjoining a new element i having the property

i2 “ ´1.

This new element is referred to as the imaginary unit.1 Specifically, we canthink of the complex numbers as

C “ ta` bi | a and b are real numbersu.

In words, a complex number is the combination of a purely real quantity (thea in a` bi) with a real multiple of i (the bi in a` bi). The number a is calledthe real part of the complex number while the coefficient b multiplying i iscalled the imaginary part. Traditionally, complex numbers are representedby the letter z. If we have a complex number z “ a ` bi, then we representthe real part of z by

Repzq “ a

while the imaginary part is denoted

Impzq “ b.

Note that the imaginary part of a complex number is a real number.We can also give complex numbers a nice geometric interpretation. Recall

that the real numbers, R, can be represented on a number line by choosingtwo arbitrary points on a line (a point labeled 0 and a second point labeled1). Since a complex number consists of two independent real numbers (thereal and imaginary parts), it stands to reason that we should represent thesenumbers in a two dimensional plane. First, we chose an arbitrary point inthe plane and label it as the number 0 “ 0`0i. We then choose an arbitraryline through this point to represent the axis of purely real numbers (choosinga second arbitrary point to represent the number 1 “ 1 ` 0i). We then usethe line that is perpendicular to the real axis passing through 0 to represent

1In a few disciplines (such as electrical engineering), the imaginary unit is denoted byj since i is reserved for other uses.

610

Page 620: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX A. COMPLEX NUMBERS 611

1

i

Repzq

Impzq ¨ i

a

bi z “ a` bi

Figure A.0.1: The Complex Plane

the axis of purely imaginary numbers (choosing an arbitrary point on thisline to represent the point i “ 0 ` 1i). The typical choice is to have thehorizontal axis represent purely real numbers (with 1 to the right of 0) whilethe vertical axis represents the purely imaginary axis (with i above 0). Thisgives us the complex plane.

As the name would suggest, complex numbers are in fact numbers – mean-ing that we can add, subtract, multiply, and divide them. Before looking atthese operations in detail, a word about terminology is in order. The names“real number,” “imaginary number,” and “complex number” are purely his-torical terms, and it is important not to read too much into them. In partic-ular, it is very tempting for people to believe that imaginary numbers (andby extension, complex numbers with non-zero imaginary part) are somehow“less real” than real numbers in the sense that real numbers really exist whileimaginary numbers do not. This is completely the wrong conclusion to draw!In the modern understanding of these concepts, i exists in more or less thesame sense as ´1. Since most people no longer have major issues with theexistence of negative numbers (as most people have been in debt at one timeor another), the existence of i should not be any more or less mysterious. Infact, this persistent misunderstanding led Gauss to propose the names direct,inverse, and lateral unity for 1,´1, and i, respectively. Unfortunately, thehistorical names are far too ingrained in the mathematical community to be

Page 621: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX A. COMPLEX NUMBERS 612

changed. For a delightful (and informative) review of the history of complexnumbers, see the excellent book by Nahin.[N10]

A.1 Basic Operations

The arithmetic of complex numbers is relatively simple. With the exceptionof division, the usual algebraic rules (together with the fact i2 “ ´1) suffice.Division requires the notion of complex conjugate (which we develop below).

Addition and Subtraction: To add and subtract complex numbers, wesimply combine like terms:

pa` biq ˘ pc` diq “ pa˘ cq ` pb˘ dqi.

In particular, note that ´pa` biq “ ´a´ bi.

Example A.1.1. Find the sum and difference of the following pairs of com-plex numbers:

1q z1 “ 1` 3i and z2 “ ´2` 5i

2q z1 “ ´4` 7i and z2 “ ´3´ 9i

Solution:1)

z1 ` z2 “ p1` 3iq ` p´2` 5iq

“ p1´ 2q ` p3` 5qi “ ´1` 8i

z1 ´ z2 “ p1` 3iq ´ p´2` 5iq

“ p1` 2q ` p3´ 5qi “ 3´ 2i

2)

z1 ` z2 “ p´4` 7iq ` p´3´ 9iq

“ p´4´ 3q ` p7´ 9qi “ ´7´ 2i

z1 ´ z2 “ p´4` 7iq ´ p´3´ 9iq

“ p´4` 3q ` p7` 9qi “ ´1` 16i �

Addition of complex numbers has the same nice properties as for realnumbers. In particular:

Page 622: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX A. COMPLEX NUMBERS 613

1) z1 ` z2 “ z2 ` z1,

2) z ` 0 “ z,

3) z ` p´zq “ 0.

Multiplication: Multiplication of complex numbers is performed using thedistributive law:

pa` biqpc` diq “ ac` adi` bci` bdi2

“ pac´ bdq ` pad` bcqi

Example A.1.2. Find the product following pairs of complex numbers:

1q z1 “ 1` 3i and z2 “ ´2` 5i

2q z1 “ ´4` 7i and z2 “ ´3´ 9i

Solution:1)

z1 ¨ z2 “ p1` 3iqp´2` 5iq

“ 1p´2q ` 1p5iq ´ 2p3iq ` p3iqp5iq

“ ´2` 5i´ 6i´ 15

“ ´17´ i

2)

z1 ¨ z2 “ p´4` 7iqp´3´ 9iq

“ ´4p´3q ´ 4p´9iq ´ 3p7iq ` p7iqp´9iq

“ 12` 36i´ 21i` 63

“ 75` 15i �

Multiplication of complex numbers retains the same basic properties asfor real numbers:

1) z1 ¨ z2 “ z2 ¨ z1,

2) 0 ¨ z “ 0,

3) 1 ¨ z “ z,

Page 623: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX A. COMPLEX NUMBERS 614

4) z1pz2 ` z3q “ z1 ¨ z2 ` z1 ¨ z3.

Complex Conjugation: Complex numbers come with one new operation:complex conjugation.

z “ a` bi “ a´ bi.

In other words, the complex conjugate of a complex number z is the complexnumber obtained from z by changing the sign of the imaginary part.

The crucial property of the conjugate is that a complex number z multi-plied by its conjugate always gives a real result:

z ¨ z “ pa` biqpa´ biq

“ a2` abi´ abi´ b2i2

“ a2` b2.

In other symbols,z ¨ z “ pRepzqq2 ` pImpzqq2.

Example A.1.3. Find the conjugate and compute z ¨ z for the followingcomplex numbers:

1q z1 “ ´1` 3i

2q z2 “ 2´ 5i

Solution:1)

z1 “ ´1` 3i “ ´1´ 3i

z1 ¨ z1 “ p´1q2 ` p3q2 “ 10

2)

z2 “ 2´ 5i “ 2` 5i

z2 ¨ z2 “ p2q2` p´5q2 “ 29 �

Conjugation interacts nicely with addition and multiplication:

1) z1 ` z2 “ z1 ` z2,

2) z1z2 “ z1 ¨ z2.

Page 624: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX A. COMPLEX NUMBERS 615

Another nice use of conjugates is that it gives us a way to compute thereal and imaginary parts of a complex number.

Theorem A.1.1. If z is a complex number, then

� z ` z “ 2Repzq,

� z ´ z “ 2iImpzq.

Proof: Let z “ x` iy where x and y are real numbers. Then Repzq “ x andImpzq “ y.

z ` z “ x` iy ` x` iy

“ x` iy ` x´ iy

“ 2x

“ 2Repxq,

z ´ z “ x` iy ´ x` iy

“ x` iy ´ px´ iyq

“ 2iy

“ 2iImpyq. �

Corollary A.1.1.1. For any complex number z, z ` z is a real number.

Division: Thanks to complex conjugation, we can replace division by acomplex number with division by a real number.

a` bi

c` di“a` bi

c` di¨c´ di

c´ di“pa` biqpc´ diq

c2 ` d2.

Example A.1.4. Compute the following:

1q1` 3i

2` i

2q´4` i

3´ 5i

Solution:

Page 625: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX A. COMPLEX NUMBERS 616

1)

1` 3i

2` i“

1` 3i

2` i¨

2´ i

2´ i

“p1` 3iqp2´ iq

22 ` 12

“5` 5i

5“ 1` i

2)

´4` i

3´ 5i“´4` i

3´ 5i¨

3` 5i

3` 5i

“p´4` iqp3` 5iq

32 ` 52

“´17´ 17i

34“ ´

1

1

2i �

Magnitude: The final operation we discuss is the idea of the magnitude (orabsolute value) of a complex number.

|z| “?z ¨ z.

If z “ a ` bi, then |z| “?a2 ` b2. Just as with the absolute value of a real

number, the magnitude of a complex number measures the distance of thenumber from the origin.

The symbol for the magnitude of a complex number is the same as theabsolute value of a real number for a reason. Namely, they have the samebasic properties.

Page 626: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX A. COMPLEX NUMBERS 617

Repzq

Impzq ¨ i

a

bi z “ a` bi|z|

Figure A.1.1: The Magnitude of a Complex Number

1) |z1 ¨ z2| “ |z1| ¨ |z2|,

2)ˇ

ˇ

ˇ

z1z2

ˇ

ˇ

ˇ“

|z1||z2|,

3) |z1 ` z2| ď |z1| ` |z2|,

4) |z| “ 0 if and only if z “ 0.

Note that the magnitude of a purely real complex number (z “ a ` 0i) isexactly the same as the absolute value of the corresponding real number(|a` 0i| “

?a2 “ |a|).

A.2 The Fundamental Theorem of Algebra

One of the most important facts about complex numbers is the followingtheorem and its corollary.

Theorem A.2.1 (Fundamental Theorem of Algebra). Every polynomialequation of the form

xn ` cn´1xn´1

` cn´2xn´2

` ¨ ¨ ¨ ` c1x` c0 “ 0

with complex coefficients ci has at least one solution in the complex plane.

Page 627: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX A. COMPLEX NUMBERS 618

Corollary A.2.1.1. Every polynomial of the form

fpxq “ xn ` cn´1xn´1

` cn´2xn´2

` ¨ ¨ ¨ ` c1x` c0

factors completely over the complex numbers:

fpxq “ px´ z1qpx´ z2q ¨ ¨ ¨ px´ znq.

For a proof see [Ah79, p.122]. Note that the roots in the factored form of fneed not be distinct.

Example A.2.1. Find all solutions of the equation

x3´ x2

` 9x´ 9 “ 0.

Solution:

x3´ x2

` 9x´ 9 “ x2px´ 1q ` 9px´ 1q

“ px´ 1qpx2` 9q

“ px´ 1qpx´?´9qpx`

?´9q

“ px´ 1qpx´ 3iqpx` 3iq

So, the solutions to this polynomial equation are

x “ 1, 3i,´3i. �

Example A.2.2. Find all solutions of the equation

x4` 15x2

´ 16 “ 0.

Solution:

x4` 15x2

´ 16 “ px2` 16qpx2

´ 1q

“ px´?´16qpx`

?´16qpx´ 1qpx` 1q

“ px´ 4iqpx` 4iqpx´ 1qpx` 1q

So, the solutions to this polynomial equation are

x “ 1,´1, 4i,´4i. �

Of course, you should be familiar with the quadratic formula:

Page 628: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX A. COMPLEX NUMBERS 619

Lemma A.2.2 (Quadratic Formula). The solutions to

ax2` bx` c “ 0

where a ‰ 0 are given by

x “´b˘

?b2 ´ 4ac

2a.

The quantity under the square root is known as the discriminant sinceit determines whether the roots are real or complex. In particular, the rootsgiven by the quadratic formula are complex precisely when b2 ´ 4ac ă 0.

A.3 Euler’s Formula and Polar Form

Many of the most important functions in mathematics can be extended toaccept complex arguments. Here, we focus on the most important one – theexponential function. Suppose that z “ x ` iy. Then it is reasonable toexpect that

ez “ ex`iy “ exeiy

by the usual law of exponents. So, we really only need to make sense of eiy.This is accomplished by Euler’s Formula.

Definition A.3.1 (Euler’s Formula).

eiθ “ cospθq ` i sinpθq

Definition A.3.2 (The Complex Exponential). If z “ x` iy, then

ez “ ex`iy “ exeiy “ ex pcospyq ` i sinpyqq .

Note that both of these facts are given as definitions. In more advancedtreatments, the motivation for these definitions is usually discussed, but itinvolves concepts beyond the scope of this text. Suffice it to say that these arethe only sensible definitions if certain facts about the exponential functionfor real numbers are expected to remain true for complex numbers. Here is auseful corollary of our definition (which follows directly from basic propertiesof sine and cosine).

Page 629: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX A. COMPLEX NUMBERS 620

Corollary A.3.0.1.

e´iθ “ cosp´θq ` i sinp´θq

“ cospθq ´ i sinpθq,

eiθ “ e´iθ.

Example A.3.1. Compute the following:

1qeiπ{4

2qe3´iπ{2

3qe2´3i

Solution:1)

eiπ{4 “ cos´π

4

¯

` i sin´π

4

¯

?2

2` i

?2

2

2)

e3´iπ{2“ e3e´iπ{2

“ e3´

cos´π

2

¯

´ i sin´π

2

¯¯

“ e3p0´ iq

“ ´e3i

3)

e2´3i“ e2e´3i

“ e2pcos p3q ´ i sin p3qq

“ e2 cosp3q ´ ie2 sinp3q �

We should note a very special consequence of Euler’s Formula: eiπ “ ´1.This equation is usually presented as

eiπ ` 1 “ 0,

which the noted physicist Richard Feynman declared to be the most beautifulequation in all of mathematics.

The complex exponential gives us another way to represent complex num-bers – the polar form of a complex number.

Page 630: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX A. COMPLEX NUMBERS 621

Theorem A.3.1 (Polar Form of a Complex Number). Let z “ x` iy be anycomplex number other than 0, and let θ be the angle between the line segmentfrom the origin ending at z and the positive real axis. Then

z “ x` iy “ |z|eiθ.

Repzq

Impzq ¨ i

x

iy z “ x` iy “ |z|eiθ

|z|

θ

Figure A.3.1: The Polar Form of a Complex Number

Note that the angle θ satisfies

tanpθq “y

x

when x ‰ 0.Proof: The fact that this is true is a simple application of right triangletrigonometry (and the Pythagorean Theorem). Note in the diagram abovethat

cospθq “x

a

x2 ` y2“

x

|z|,

sinpθq “y

a

x2 ` y2“

y

|z|.

Page 631: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX A. COMPLEX NUMBERS 622

Using these facts gives

z “ x` iy

“ |z| cospθq ` i|z| sinpθq

“ |z| pcospθq ` i sinpθqq

“ |z|eiθ.

At the origin, we certainly have |z| “ 0, but the angle θ is not defined. Infact, for any angle θ, 0 ¨ eiθ “ 0. As a result, the origin does not have aunique representation in polar form. �

Example A.3.2. Find the polar form of z “ 2` 2i.

Solution: First, we note that

|2` 2i| “?

22 ` 22 “ 2?

2.

As for the angle θ, note that 2 ` 2i lies on the line y “ x in the complexplane. Since this line is at 45˝, we can take θ “ π{4. Hence,

2` 2i “ 2?

2eiπ{4. �

One of the many uses of the polar form is that it makes it easier to takepowers of complex numbers.

Example A.3.3. Compute p2` 2iq10.

Solution: We could multiply the given number by itself 10 times in a row,but the polar form makes this process far easier.

p2` 2iq10“

´

2?

2eiπ{4¯10

“ 210p?

2q10ei10π{4

“ 32768

ˆ

cos

ˆ

2

˙

` i sin

ˆ

2

˙˙

“ 32768´

cos´π

2

¯

` i sin´π

2

¯¯

“ 32768i �

The polar form of a complex number even allows us to take roots ofcomplex numbers. Since this process will not be important for us goingforward, we leave its development to the exercises.

Page 632: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX A. COMPLEX NUMBERS 623

A.4 Exercises

1.) In the following problems, write the given complex number in the forma` bi.

aq p7` 2iq ´ p10´ 5iq bq 32i

cq p´2` 3iq2 dq 7i´3i

eq 2`3i1`2i

´ 8`i6´i

fq”

2`i6i´p1´2iq

ı2

2.) In the following problems, solve the equation for z.

aq z “ 3` 2zi bq iz “ 5` 2z

cq 1z“ 2` i dq z

1´z“ 1´ 5i

3.) In the following problems, find all solutions (with multiplicities) to thegiven equation.

a) z2 ` 2z ` 2 “ 0 b) z4 ´ 16 “ 0

c) z3 ` 8 “ 0 d) 2z3 ´ z2 ` 8z ´ 4 “ 0

e) z4 ´ 8z2 ` 16 “ 0 f) z5 ` 2z3 ` z “ 0

g) z6 ´ z4 ´ z2 ` 1 “ 0 h) pz4 ` 18z2 ` 18qpz4 ´ 2z ` 1q “ 0

4.) In the following problems, write the given complex number in the forma` bi.

aq e´iπ{4 bq e2πi{3 cq e3i ´ e´3i

dq eei

eq 2e3`iπ{6 fq e2`i arctanp2q

5.) In the following problems, write the given complex number in polar formreiθ.

aq ´ 2i bq 1´i3

cq p1` iq6

dq 2i3e4`i

eq 2`2i´?

3`ifq 3 sinp2q ` 3i cosp2q

6.) Let n be a natural number. The solutions to

zn ´ 1 “ 0

Page 633: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX A. COMPLEX NUMBERS 624

are known as the n-th roots of unity (since xn “ 1). We can show that thereare exactly n distinct n-th roots of unity which are given by

ei2kπ{n “ cos

ˆ

2kπ

n

˙

` i sin

ˆ

2kπ

n

˙

, k “ 0, 1, 2, . . . , n´ 1.

a) Find all third roots of unity (i.e. solutions to z3 ´ 1 “ 0).

b) Find all sixth roots of unity (i.e. solutions to z6 ´ 1 “ 0).

c) Find all solutions to z5 ´ 32 “ 0.

d) Find all solutions to x5 ` 1 “ 0

7. ) The principal value of the logarithm2 for a complex number z “ reiθ isgiven by

Log z “ ln r ` iθ

where we take ´π ă θ ď π.

For for the following problems, find the indicated (principal value) loga-rithm:

aq Logpiq bq Logp´1q

cq Logp1´ iq cq Logp?

3` iq

8.) We can use the principal value of the logarithm to define principal valuesfor complex powers: For a complex number α and z ‰ 0, we define

zα “ eαLogpzq.

For the following problems, compute the indicated (principal value) power:

aq ii bq 2πi

cq p1` iq1´i dq p?

3` iq´i

2Since for any complex number z “ reiθ we also have

z “ reipθ˘2πq “ reipθ˘4πq “ ¨ ¨ ¨ ,

there is an inherent ambiguity in what we mean by the polar angle θ. “Principal value”refers to the requirement ´π ă θ ď π which remedies this problem.

Page 634: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Appendix B

Basic Derivatives and IntegralsTable I: General Rules

Derivative Rule Integration Rule

Sum/Difference Rule Sum/Difference Ruleddx

fpxq ˘ gpxq‰

“ f 1pxq ˘ g1pxqş “

fpxq ˘ gpxq‰

dx “ş

fpxqdx˘ş

gpxqdxConstant Multiple Rule Constant Multiple Rule

ddx

cfpxq‰

“ cf 1pxqş

cfpxqdx “ cş

fpxqdxProduct Rule Integration by Parts

ddx

fpxqgpxq‰

“ f 1pxqgpxq ` fpxqg1pxqş

fpxqg1pxqdx “ fpxqgpxq ´ş

f 1pxqgpxqdxQuotient Rule (no simple rule corresponds)

ddx

fpxqgpxq

ı

“f 1pxqgpxq´fpxqg1pxq

rgpxqs2

Chain Rule U-Substitutionddx

fpgpxqq‰

“ f 1pgpxqqg1pxqş

fpgpxqqg1pxqdx “ş

fpuqduwhere u “ gpxq

625

Page 635: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX B. BASIC DERIVATIVES AND INTEGRALS 626

Table II: Rules for Specific Functions

Derivative Rule Integration Rule

Constant Rule Constant Ruleddxrcs “ 0

ş

c dx “ cx` CPower Rule Power Rule

ddxrxps “ pxp´1

ş

xpdx “ 1p`1

xp`1 ` C

for p ‰ ´1ddx

ln |x| “ 1x

ş

dxx“ ln |x| ` C

ddx

logb |x| “1

x ln bsame as above

ddxex “ ex

ş

exdx “ ex ` C

ddxbx “ pln bqbx

ş

bxdx “ 1ln bbx ` C

ddx

sinpxq “ cospxqş

cospxqdx “ sinpxq ` C

ddx

cospxq “ ´ sinpxqş

sinpxqdx “ ´ cospxq ` C

ddx

tanpxq “ sec2pxqş

sec2pxqdx “ tanpxq ` C

ddx

secpxq “ secpxq tanpxqş

secpxq tanpxqdx “ secpxq ` C

ddx

cscpxq “ ´ cscpxq cotpxqş

cscpxq cotpxqdx “ ´ cscpxq ` C

ddx

cotpxq “ ´ csc2pxqş

csc2pxqdx “ ´ cotpxq ` C

ddx

arctanpxq “ 11`x2

ş

dx1`x2

“ arctan pxq ` C

ddx

arcsinpxq “ 1?1´x2

ş

dx?1´x2

“ arcsin pxq ` C

ddx

arccospxq “ ´ 1?1´x2

same as above

(NOTE: arccospxq “ π2´ arcsinpxq)

Page 636: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX B. BASIC DERIVATIVES AND INTEGRALS 627

Table III: Additional Integralsş

sin2pxqdx “ x2´

sinp2xq4

` Cş

cos2pxqdx “ x2`

sinp2xq4

` Cş

tanpxqdx “ ln | secpxq| ` Cş

cotpxqdx “ ln | sinpxq| ` Cş

secpxqdx “ ln | secpxq ` tanpxq| ` Cş

cscpxqdx “ ´ ln | cscpxq ` cotpxq| ` Cş

lnpxqdx “ x lnpxq ´ x` Cş

logbpxqdx “1

ln bpx lnpxq ´ xq ` C

Table IV: Useful Integralsş

arctanpxqdx “ x arctanpxq ´ 12

lnp1` x2q ` Cş

arcsinpxqdx “ x arcsinpxq `?

1´ x2 ` Cş

arccospxqdx “ x arccospxq ´?

1´ x2 ` C

Page 637: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Appendix C

Positive Infinite SeriesIn Chapter 10, several results involve summing an infinite number of positiveterms. Such sums are known as positive infinite series (or just positiveseries). In this appendix, we present the relevant facts we need about thesesums. See [RA15, Chap. 10] for details and proofs of the major results below.

C.1 Definitions of Sequences and Series

A sequence is simply a list of numbers (real or complex) indexed by a setof increasing, sequential integers. For example,

a0 “ 1, a1 “1

2, a2 “

1

4, a3 “

1

8, ¨ ¨ ¨ , an “

1

2n, ¨ ¨ ¨

is a sequence beginning at index n “ 0. Sequences of numbers often be-gin at index 0 or 1 (though this is not a requirement). Very often, a se-quence is specified by giving the general term an “ fpnq (as we did above)along with the range of the index variable n. So, the sequence above can be

denoted

ˆ

1

2n

˙8

n“0

. As another example, the series

ˆ

1´1

n

˙8

n“1

has terms

0,1

2,

2

3,

3

4, ¨ ¨ ¨ If the range of the index variable is understood (or unim-

portant) for a result, we often write panq to stand for the sequence.If the general term of a sequence is given by a function, an “ fpnq, then

we say that the limit of the sequence is

limnÑ8

an “ limxÑ8

fpxq

provided the function f has a limit at infinity. If the limit of the sequencepaNq is the number L, we often write

an Ñ L

to denote it. In the examples above

1

2nÑ 0,

1´1

nÑ 1.

628

Page 638: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX C. POSITIVE INFINITE SERIES 629

An infinite series (or simply series, for short) is a special kind of se-quence constructed by successively adding up the terms from a given se-quence. If the given sequence is panq

8n“1, then the associated series

8ÿ

n“1

an

represents the limit of the sequence of partial sums pSnq8n“1 defined by

S1 “ a1,

S2 “ S1 ` a2 “ a1 ` a2,

S3 “ S2 ` a3 “ a1 ` a2 ` a3,

...

Sn “ a1 ` a2 ` a3 ` ¨ ¨ ¨ ` an´1 ` an...

In other words, the infinite series associated to the sequence panq is simplythe limit of the sequence obtained by successively adding up more and moreof the terms an. Notice that the series need not start at n “ 1! As withsequences, if the range of indices is understood (or unimportant) in a result,we often suppress them.

If the partial sums have a finite limit, Sn Ñ L, then we write

8ÿ

n“1

an “ L,

and we say the series converges to L. Otherwise, we say the series diverges.In the special case that Sn Ñ 8, we often say the series diverges to positiveinfinity.

Before we look at specific series, we list some basic facts about convergenceof series.

Theorem C.1.1. Ifř

an “ L,ř

bn “M , and c is a constant, then

�ÿ

pan ˘ bnq “ L˘M ,

�ÿ

can “ cL.

Page 639: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX C. POSITIVE INFINITE SERIES 630

Proof: This follows from basic facts about limits. �

Theorem C.1.2 (The n-th Term Test for Divergence). If the sequence panq

does not converge to 0, thenÿ

an necessarily diverges.

Proof: Since Sn “ Sn´1` an, we must have Sn´Sn´1 “ an. If the seriesconverges to L, then by definition Sn Ñ L. This gives us

limnÑ8

an “ limnÑ8

pSn ´ Sn´1q

“ limnÑ8

Sn ´ limnÑ8

Sn´1

“ L´ L “ 0. �

WARNING: This theorem cannot be used to show that series converges! Ifpanq does not converge to zero, then the theorem states that the correspond-ing series must diverge. However, an Ñ 0 does not guarantee that

ř

an willconverge. We will see a famous example of this fact later!

C.2 Geometric Series

Arguably the most important type of infinite series are geometric series:

8ÿ

n“0

arn.

The number a is the first term of the series while r is usually called the ratioof the series.

It turns out that we can give a very useful formula for the n-th partialsum of a geometric series (with a “ 1).

Lemma C.2.1. For a geometric series8ÿ

n“0

rn with r ‰ 1, the n-th partial

sum is given by

Sn “ 1` r ` r2` r3

` ¨ ¨ ¨ rn “1´ rn`1

1´ r.

Proof: Since this is a finite sum for any given n, we do not have to worryabout convergence issues. If we take Sn and multiply it by r, we get

rSn “ r ` r2` r3

` ¨ ¨ ¨ ` rn ` rn`1.

Page 640: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX C. POSITIVE INFINITE SERIES 631

Subtracting Sn and rSn gives

Sn ´ rSn “`

1` r ` r2` r3

` ¨ ¨ ¨ rn˘

´`

r ` r2` r3

` ¨ ¨ ¨ ` rn ` rn`1˘

p1´ rqSn “ 1´ rn`1.

If r ‰ 1, we can divide by 1´ r to produce the formula in the lemma. �

Theorem C.2.2. If |r| ă 1, then

8ÿ

n“0

arn “a

1´ r.

So, the sum of a geometric series is the first term of the series divided by oneminus the ratio when the ratio has magnitude less than 1. When |r| ě 1, thegeometric series diverges.1

Proof: If |r| ă 1, then rn`1 Ñ 0 and the partial sums from the previouslemma converge. If |r| ą 1, then rn`1 definitely diverges. In the two specialcases r “ ˘1, the corresponding geometric series are easily seen to diverge.For r “ 1,

8ÿ

n“0

ap1qn “ a` a` a` ¨ ¨ ¨ “ ˘8.

For r “ ´1, we look at the sequence of partial sums:

S0 “ a

S1 “ a´ a “ 0

S2 “ a´ a` a “ a

S3 “ a´ a` a´ a “ 0

...

Since the partial sums alternate between a and 0, they have no limit, and sothe geometric series diverges. �

Example C.2.1. Find the sums of the following convergent geometric series.

1q8ÿ

n“0

1

2n, 2q

8ÿ

n“0

2

3n, 3q

8ÿ

n“2

5n

7n

1This result is also true for geometric series with complex terms! The proof is more orless the same with some modifications for the case |r| “ 1.

Page 641: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX C. POSITIVE INFINITE SERIES 632

Answer: For the the first series,

8ÿ

n“0

1

2n“

8ÿ

n“0

ˆ

1

2

˙n

“ 1`1

2`

1

4`

1

8` ¨ ¨ ¨ ,

and so the first term is 1 and the ratio is 1{2. This gives

8ÿ

n“0

1

2n“

1

1´ 1{2“

1

1{2“ 2.

For the second series,

8ÿ

n“0

2

3n“ 2

8ÿ

n“0

ˆ

1

3

˙n

“ 2`2

3`

2

9`

2

27` ¨ ¨ ¨ ,

and so the first term is 2 and the ratio is 1{3. This gives

8ÿ

n“0

2

3n“

2

1´ 1{3“

2

2{3“ 3.

For the final series,

8ÿ

n“2

5n

7n“

8ÿ

n“2

ˆ

5

7

˙n

“25

49`

125

343`

625

2401` ¨ ¨ ¨ ,

and so the first term is 25{49 and the ratio is 5{7. This gives

8ÿ

n“2

5n

7n“

25{49

1´ 5{7“

25{49

2{7“

25

14. �

C.3 Positive Series

If the sequence panq consists of both positive and negative terms, then the

convergence ofÿ

an can be a delicate issue in general. However, if we havea sequence of positive terms an ě 0, things are considerably easier. Noticethat we really mean non-negative terms, but the use of “positive” in this caseis a common misnomer in mathematics. If the terms are definitely greaterthan zero (an ą 0), you often see the term strictly positive series.

Page 642: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX C. POSITIVE INFINITE SERIES 633

Theorem C.3.1 (The Dichotomy Property for Positive Series). For a seriesř

an of positive terms, there are only two possibilities for convergence:

� the sequence of partial sums, Sn, is bounded above, and so the seriesconverges to a finite value,

� the sequence of partial sums is unbounded, and the series diverges topositive infinity.

Heuristic Proof: Since Sn “ Sn´1`an and an ě 0, it must be that Sn ěSn´1. So, the sequence of partial sums, pSnq, is an increasing sequence. If thepartial sums are unbounded, then they must stream off to positive infinity.Otherwise, all of the partial sums are bounded above by some number, Sn ďU for all n. It can be shown in this case that the sequence of partial sumsmust converge to a finite value. �

While there is a lot we could say about positive series, we choose topresent a few basic results (without proof) which allow us to conclude thatcertain kinds of positive series converge or diverge. Along the way, we willexamine some particular examples.

Theorem C.3.2 (The Integral Test). If a sequence has general term givenby an “ fpnq where f is positive, decreasing, and continuous on r1,8q, thenthe following results are true.

� If

ż 8

1

fpxq dx converges, then so will8ÿ

n“1

an.

� If

ż 8

1

fpxq dx diverges to positive infinity, then so will8ÿ

n“1

an.

Example C.3.1 (The Harmonic Series). The series

8ÿ

n“1

1

n“ 1`

1

2`

1

3`

1

4` ¨ ¨ ¨

is known as the harmonic series and is the most famous example of a serieswhose terms go to zero but nonetheless fails to converge. Use the integraltest to show that this series diverges.

Page 643: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX C. POSITIVE INFINITE SERIES 634

Answer: Since fpxq “ 1{x is positive, continuous, and decreasing onr1,8q, we can apply the Integral Test.

ż 8

1

1

xdx “ lim

RÑ8

ż R

1

1

xdx

“ limRÑ8

lnpRq ´ lnp1q

“ limRÑ8

lnpRq

“ 8

By the Integral Test, the harmonic series must also diverge. �A p-series is any series of the form

8ÿ

n“1

1

np

where p is traditionally taken to be a real number greater than zero. Noticethat the harmonic series is the p-series with p “ 1. The Integral Test alongwith results from Section 3.3 give us the following lemma.

Lemma C.3.3 (Convergence of p-Series). The p-series8ÿ

n“1

1

np

� converges when p ą 1,

� diverges when p ď 1.

Theorem C.3.4 (The Ratio Test). Suppose that panq is a sequence of strictlypositive terms. Also, suppose that

limnÑ8

an`1

an“ L.

In particular, we are assuming that this limit exists! Then the followingresults are true.

� If L ă 1, thenÿ

an converges.

� If L ą 1, thenÿ

an diverges to positive infinity.

� If L “ 1, then the test is inconclusive (that is,ÿ

an could converge or

diverge to infinity).

Page 644: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX C. POSITIVE INFINITE SERIES 635

Notice that the ratio test is only helpful when the ratio of consecutiveterms an`1{an has a limit at infinity that is not equal to 1!

Example C.3.2. Show that the series

8ÿ

n“0

n

3n

converges.

Answer: The general term is given by an “n

3n. So,

an`1

an“n` 1

3n`1¨

3n

n

“n` 1

3n.

This shows us that

limnÑ8

an`1

an“ lim

nÑ8

1

3

ˆ

n` 1

n

˙

“1

3,

and the series converges by the ratio test. �

Example C.3.3. Show that the series

8ÿ

n“0

2n

n!

converges.

Answer: The general term is given by an “2n

n!. So,

an`1

an“

2n`1

pn` 1q!¨n!

2n

“2pn!q

pn` 1qn!

“2

n` 1.

Page 645: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX C. POSITIVE INFINITE SERIES 636

This shows us that

limnÑ8

an`1

an“ lim

nÑ8

2

n` 1“ 0,

and the series converges by the ratio test.2 �

Example C.3.4. Show that the series

8ÿ

n“0

5n

n2

diverges.

Answer: The general term is given by an “5n

n2. So,

an`1

an“

5n`1

pn` 1q2¨n2

5n

“5n2

pn` 1q2

“ 5

ˆ

n

n` 1

˙2

.

This shows us that

limnÑ8

an`1

an“ lim

nÑ85

ˆ

n

n` 1

˙2

“ 5,

and the series diverges by the ratio test. �

2More advanced techniques can show that

8ÿ

n“0

2n

n!“ e2.

Page 646: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Appendix D

Standard Normal Probabilities

Table entry

Table entry for z is the area under the standard normal curveto the left of z.

Standard Normal Probabilities

z

z .00

–3.4–3.3–3.2–3.1–3.0–2.9–2.8–2.7–2.6–2.5–2.4–2.3–2.2–2.1–2.0–1.9–1.8–1.7–1.6–1.5–1.4–1.3–1.2–1.1–1.0–0.9–0.8–0.7–0.6–0.5–0.4–0.3–0.2–0.1–0.0

.0003

.0005

.0007

.0010

.0013

.0019

.0026

.0035

.0047

.0062

.0082

.0107

.0139

.0179

.0228

.0287

.0359

.0446

.0548

.0668

.0808

.0968

.1151

.1357

.1587

.1841

.2119

.2420

.2743

.3085

.3446

.3821

.4207

.4602

.5000

.0003

.0005

.0007

.0009

.0013

.0018

.0025

.0034

.0045

.0060

.0080

.0104

.0136

.0174

.0222

.0281

.0351

.0436

.0537

.0655

.0793

.0951

.1131

.1335

.1562

.1814

.2090

.2389

.2709

.3050

.3409

.3783

.4168

.4562

.4960

.0003

.0005

.0006

.0009

.0013

.0018

.0024

.0033

.0044

.0059

.0078

.0102

.0132

.0170

.0217

.0274

.0344

.0427

.0526

.0643

.0778

.0934

.1112

.1314

.1539

.1788

.2061

.2358

.2676

.3015

.3372

.3745

.4129

.4522

.4920

.0003

.0004

.0006

.0009

.0012

.0017

.0023

.0032

.0043

.0057

.0075

.0099

.0129

.0166

.0212

.0268

.0336

.0418

.0516

.0630

.0764

.0918

.1093

.1292

.1515

.1762

.2033

.2327

.2643

.2981

.3336

.3707

.4090

.4483

.4880

.0003

.0004

.0006

.0008

.0012

.0016

.0023

.0031

.0041

.0055

.0073

.0096

.0125

.0162

.0207

.0262

.0329

.0409

.0505

.0618

.0749

.0901

.1075

.1271

.1492

.1736

.2005

.2296

.2611

.2946

.3300

.3669

.4052

.4443

.4840

.0003

.0004

.0006

.0008

.0011

.0016

.0022

.0030

.0040

.0054

.0071

.0094

.0122

.0158

.0202

.0256

.0322

.0401

.0495

.0606

.0735

.0885

.1056

.1251

.1469

.1711

.1977

.2266

.2578

.2912

.3264

.3632

.4013

.4404

.4801

.0003

.0004

.0006

.0008

.0011

.0015

.0021

.0029

.0039

.0052

.0069

.0091

.0119

.0154

.0197

.0250

.0314

.0392

.0485

.0594

.0721

.0869

.1038

.1230

.1446

.1685

.1949

.2236

.2546

.2877

.3228

.3594

.3974

.4364

.4761

.0003

.0004

.0005

.0008

.0011

.0015

.0021

.0028

.0038

.0051

.0068

.0089

.0116

.0150

.0192

.0244

.0307

.0384

.0475

.0582

.0708

.0853

.1020

.1210

.1423

.1660

.1922

.2206

.2514

.2843

.3192

.3557

.3936

.4325

.4721

.0003

.0004

.0005

.0007

.0010

.0014

.0020

.0027

.0037

.0049

.0066

.0087

.0113

.0146

.0188

.0239

.0301

.0375

.0465

.0571

.0694

.0838

.1003

.1190

.1401

.1635

.1894

.2177

.2483

.2810

.3156

.3520

.3897

.4286

.4681

.0002

.0003

.0005

.0007

.0010

.0014

.0019

.0026

.0036

.0048

.0064

.0084

.0110

.0143

.0183

.0233

.0294

.0367

.0455

.0559

.0681

.0823

.0985

.1170

.1379

.1611

.1867

.2148

.2451

.2776

.3121

.3483

.3859

.4247

.4641

.01 .02 .03 .04 .05 .06 .07 .08 .09

637

Page 647: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX D. STANDARD NORMAL PROBABILITIES 638

Table entry

Table entry for z is the area under the standard normal curveto the left of z.

z

z .00

0.00.10.20.30.40.50.60.70.80.91.01.11.21.31.41.51.61.71.81.92.02.12.22.32.42.52.62.72.82.93.03.13.23.33.4

.5000

.5398

.5793

.6179

.6554

.6915

.7257

.7580

.7881

.8159

.8413

.8643

.8849

.9032

.9192

.9332

.9452

.9554

.9641

.9713

.9772

.9821

.9861

.9893

.9918

.9938

.9953

.9965

.9974

.9981

.9987

.9990

.9993

.9995

.9997

.5040

.5438

.5832

.6217

.6591

.6950

.7291

.7611

.7910

.8186

.8438

.8665

.8869

.9049

.9207

.9345

.9463

.9564

.9649

.9719

.9778

.9826

.9864

.9896

.9920

.9940

.9955

.9966

.9975

.9982

.9987

.9991

.9993

.9995

.9997

.5080

.5478

.5871

.6255

.6628

.6985

.7324

.7642

.7939

.8212

.8461

.8686

.8888

.9066

.9222

.9357

.9474

.9573

.9656

.9726

.9783

.9830

.9868

.9898

.9922

.9941

.9956

.9967

.9976

.9982

.9987

.9991

.9994

.9995

.9997

.5120

.5517

.5910

.6293

.6664

.7019

.7357

.7673

.7967

.8238

.8485

.8708

.8907

.9082

.9236

.9370

.9484

.9582

.9664

.9732

.9788

.9834

.9871

.9901

.9925

.9943

.9957

.9968

.9977

.9983

.9988

.9991

.9994

.9996

.9997

.5160

.5557

.5948

.6331

.6700

.7054

.7389

.7704

.7995

.8264

.8508

.8729

.8925

.9099

.9251

.9382

.9495

.9591

.9671

.9738

.9793

.9838

.9875

.9904

.9927

.9945

.9959

.9969

.9977

.9984

.9988

.9992

.9994

.9996

.9997

.5199

.5596

.5987

.6368

.6736

.7088

.7422

.7734

.8023

.8289

.8531

.8749

.8944

.9115

.9265

.9394

.9505

.9599

.9678

.9744

.9798

.9842

.9878

.9906

.9929

.9946

.9960

.9970

.9978

.9984

.9989

.9992

.9994

.9996

.9997

.5239

.5636

.6026

.6406

.6772

.7123

.7454

.7764

.8051

.8315

.8554

.8770

.8962

.9131

.9279

.9406

.9515

.9608

.9686

.9750

.9803

.9846

.9881

.9909

.9931

.9948

.9961

.9971

.9979

.9985

.9989

.9992

.9994

.9996

.9997

.5279

.5675

.6064

.6443

.6808

.7157

.7486

.7794

.8078

.8340

.8577

.8790

.8980

.9147

.9292

.9418

.9525

.9616

.9693

.9756

.9808

.9850

.9884

.9911

.9932

.9949

.9962

.9972

.9979

.9985

.9989

.9992

.9995

.9996

.9997

.5319

.5714

.6103

.6480

.6844

.7190

.7517

.7823

.8106

.8365

.8599

.8810

.8997

.9162

.9306

.9429

.9535

.9625

.9699

.9761

.9812

.9854

.9887

.9913

.9934

.9951

.9963

.9973

.9980

.9986

.9990

.9993

.9995

.9996

.9997

.5359

.5753

.6141

.6517

.6879

.7224

.7549

.7852

.8133

.8389

.8621

.8830

.9015

.9177

.9319

.9441

.9545

.9633

.9706

.9767

.9817

.9857

.9890

.9916

.9936

.9952

.9964

.9974

.9981

.9986

.9990

.9993

.9995

.9997

.9998

.01 .02 .03 .04 .05 .06 .07 .08 .09

Standard Normal Probabilities

Page 648: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Appendix E

TI–83/84 and TI–89 MaterialE.1 Cobweb Plots

E.1.1 Cobweb Plots on the TI–83/84

To create cobweb plots on a TI–83/84 the calculator must be in sequencemode. Press the MODE button and use the arrow keys to move down tothe row that begins with FUNC and use the arrow keys to move across tohighlight SEQ. Hit the ENTER key to save the change to sequence mode.

(a) TI–84 Plus Silver (b) TI–84 Plus CE

Next we tell the calculator to use the cobweb plot format by pressingFORMAT F3 (obtained using the 2nd key and then ZOOM) and using thearrow keys to highlight WEB. Again hit ENTER to save the change.

(a) TI–84 Plus Silver (b) TI–84 Plus CE

639

Page 649: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 640

To enter the updating function, go to the graphing screen using the Y “(or F1) key. The TI–84 uses the variables u, v, and w as the names of thepossible updating functions. We can type these variables on the calculatorusing the 2nd key and then 7, 8 or 9 respectively. The calculator uses nMinto represent the smallest value of the time variable n. The default value is 1.The TI–84 expects the updating function to be specified using upnq in termsof upn´ 1q instead of qn`1 in terms of qn.

To set up a cobweb plot for the system qn`1 “ 2qn´1 with initial conditionq0 “ 1.2 we type in the formulas upnq “ 2upn ´ 1q ´ 1 and upnMinq “ 1.2.To type the time variable n use the variable key labeled X,T,θ, n. The resultshould look like:

(a) TI–84 Plus Silver (b) TI–84 Plus CE

We also should choose a window appropriate for the plot we are graphing.Press the WINDOW key to set the parameters for the window. nMin andnMax represent the smallest and largest values of the time variable n. Xmin,Xmax, Xscl, Ymin, Ymax, and Yscl describe the size of the window and themarkings on the x-axis and y-axis. Set them as shown below:

(a) TI–84 Plus Silver (b) TI–84 Plus CE

Page 650: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 641

Finally we are ready to graph the cobweb plot. Press the GRAPH key andthe calculator draws a graph of the updating function and a graph of y “ x.For our example the updating function will be a line. To start generating thecobweb, press the TRACE button and then use the right arrow key to stepthrough the cobweb plot. At the bottom of the screen the calculator displaysthe current value of n, and at first X “ upn´1q and Y “ upnq while showingthe cobweb moving vertically to the the graph of the updating function andthen after we press the right arrow again it shows X “ upnq and Y “ upnqwhile showing the cobweb moving horizontally to the line y “ x. After youpress the right arrow four times you should see:

(a) TI–84 Plus Silver (b) TI–84 Plus CE

We can see more and more of the cobweb by repeatedly pressing the rightarrow key.

E.1.2 Cobweb Plots on the TI-89

The TI-89 graphing calculator has built-in programming to produce cobwebplots. The first step is to change the Graph Mode. Pressing the MODEbutton should bring up the following options menu:

Page 651: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 642

Pressing the right arrow key on the Graph option will bring up a list ofdifferent graphing environments. Select 4:SEQUENCE and then ENTER tosave the change.

When you enter the graphing screen ( + F1), you should see a screenwith prompts starting “u1 =.” Open the F7:Axes tab (by pressing F5 andthe right arrow key twice). This brings up the following menu screen.

Page 652: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 643

With Axes set to TIME, you can produce sequential plots of discrete dynam-ical systems. Since we want to produce cobweb plots, press the right arrowkey and select 2:WEB.

The Build Web option can be set to 1:TRACE or 2:AUTO. TRACE modewill allow you to see the cobweb plot built up step-by-step (by pressingF3:TRACE and then using the right arrow key after having the calculatorproduce the graph of the updating function). We will set the option onAUTO which will build up the entire cobweb plot in one step. Press ENTERto save your choices.

To produce the cobweb plot for

qn`1 “ 2qn ´ 1

q0 “ 1.2,

we enter the graphing screen ( + F1) and enter the dynamical system interms of u1. The TI-89 is looking for u1(n) in terms of u1(n-1) (rather than

Page 653: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 644

u1(n+1) in terms of u1(n)). So, we select u1 by pressing ENTER and typingu1(n) = 2¨u1(n-1) – 1. Pressing ENTER again will save this to the u1 entry.The initial data for the system is entered just below labeled ui1.

We can set the various limits for the axes by entering the WINDOW menu(pressing + F2).

the nmin and nmax options determine how many time steps out the dynam-ical system will be plotted. Note that the TI-89 starts at n “ 1 rather thann “ 0. Start out with a modest number of steps to begin with (5 to 10 shoulddo). The options xmin, xmax, ymin, and ymax are just as they are in thetraditional graphing mode. Since the cobweb plot always includes the graphy “ x, it is reasonable to start with the exact same values for xmin and ymin(and similarly for xmax and ymax).

Once you have entered the appropriate ranges, instruct the TI-89 toGRAPH the dynamical system (pressing + F3). You should end upwith a graph like the one below!

Page 654: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 645

Remember to change the graphing mode back to FUNCTION if you need toproduce a traditional graph of a function.

Page 655: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 646

E.2 Piecewise Functions

E.2.1 Piecewise Functions on the TI–83/84

To enter piecewise defined functions with the TI–84 family of calculators,you define the function using both functional expressions and logical expres-sions. The functional expressions represent the formulas you want to includeand the logical expressions will contain the conditions used to decide whichfunctional expressions contribute for a given value of the variable x. Eachlogical expression will be used in the computations with a value of 1 whentrue and a value of 0 when false. The complete functional formula is a sumof pieces each of which is a product of a functional expression and the corre-sponding condition when it should be used. You should probably make sureyour conditions do not overlap.

For example, you enter the formula ´1px ď 0q ` 1px ą 0q to enter thepiecewise function

fpxq “

"

´1 x ď 01 x ą 0

.

For any x less than or equal to 0, the calculator evaluates the logical expres-sion px ď 0q with a value of 1 for true and the logical expression px ą 0qwith a value of 0 for false. For such x it computes ´1 times 1 plus 1 times 0to get a value of ´1 for the function as a whole.

Similarly, for any x greater than 0, the calculator evaluates the logicalexpression px ď 0q with a value of 0 for false and the logical expressionpx ą 0q with a value of 1 for true. For such x it computes ´1 times 0 plus 1times 1 to get a value of 1 for the function as a whole.

The expression and its graph are shown below on the TI–84 CE Plus.The older TI-83/84 calculators have a similar format and graph. (Details oftyping these expressions are shown later.)

You can substitute any function formulas for the ´1 and the 1 and youcan change the logical conditions.

Page 656: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 647

(a) The y= screen (b) The graph

Figure E.2.1: TI-84 Plus CE

You can find the comparison symbols and the logical operators to createmore complicated logical expressions in the TEST menu (press 2nd thenMATH to get the TEST menu). When typing a formula for a piecewisefunction in the y “ environment, you navigate to these menus when youneed one of these symbols and scroll down to the symbol you want and hitthe ENTER button to put the symbol in your formula and return to the y “environment.

The comparison symbols are listed in the TEST sub-menu while logi-cal commands are found in the LOGIC sub-menu (scroll over to highlightLOGIC) as shown below on the older TI–83/84 Silver calculators.

(a) TEST (b) LOGIC

Figure E.2.2: TI–84 Plus SIlver

On the newer TI–84 Plus CE models there is a third menu option thatgives pre-defined conditions that can be used to more quickly set up theseformulas.

Page 657: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 648

(a) TEST (b) LOGIC (c) CONDITIONS

Figure E.2.3: TI-84 Plus CE

For more complicated piecewise functions, you will need to use the logicaloperators. A compound inequality like 0 ă x ă 1 will not be evaluated asyou expect. Instead use the logical operators in the LOGIC menu to rewritecompound inequalities in terms of simpler conditions: pp0 ă xqandpx ă 1qq.

You would enter ´xpx ă 0q ` 1pp0 ď xqandpx ď 1qq ` px2 ` 2qpx ą 1q tograph this function:

fpxq “

$

&

%

´x x ă 01 0 ď x ď 1x2 ` 2 x ą 1

On the TI–83/84 calculators this would look like:

(a) y= (b) graph

Figure E.2.4: TI–84 Plus SIlver

You can also find these symbols and logical operators in the CATALOGif you prefer.

Page 658: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 649

E.2.2 Piecewise Functions on the TI–89

Piecewise function on the TI–89 are inputted using the when function whichcan be obtained from the CATALOG.

Figure E.2.5: TI–89 when Function

Press “W” to scroll through the CATALOG faster. The usual syntax for thisfunction is

when(condition to check, value if true, value if false).1

As a simple example, the piecewise function

fpxq “

"

´1, x ă 01, x ě 0

can be graphed by entering

when(x ă 0,´1, 1).

1The “value if false” argument is optional. There is a fourth (optional) argument thatis used to specify a default value if the condition cannot be evaluated.

Page 659: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 650

Figure E.2.6: Sample Piecewise Function in the TI–89

Notice that the TI–89 will actually display a nicer version of the piecewisefunction after you enter it.

Inputting a more complicated piecewise function often requires the use ofnested when statements. As an example, the function

gpxq “

$

&

%

´x, x ă 01, 0 ď x ď 1x2, x ą 1

can be input as

when(x ă 0,´x, when(x ą 1, x2, 1)).

Figure E.2.7: Sample Piecewise Function in the TI–89

Page 660: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 651

Notice that we use the simpler condition x ą 1 for the second when state-ment since the greater than and less than symbols are directly on the TI–89keyboard (using the 2nd key and period or 0, respectively). The graph ofthis function makes it clear that we entered it correctly.

Figure E.2.8: Graph of y “ gpxq

You can also enter g as

when(x ă 0,´x, when(0 ď x ď 1, 1, x2))

where less–than–or–equal–to can be found in the CATALOG (before theentries starting with A).

Figure E.2.9: TI–89 CATALOG Symbols

This gives us a slightly different looking version of the function in the TI–89.

Page 661: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 652

Figure E.2.10: Sample Piecewise Function in the TI–89

The graph will verify that this is exactly the same function as before.

Page 662: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 653

E.3 Producing Vector Plots on the TI–89

Unfortunately, vector plots cannot be easily produced on TI–83/84 calcula-tors. As such, we only present information for the TI–89.

First, we have to get the TI–89 in differential equations mode by firstpressing MODE and the selecting option 6:DIFF EQUATIONS under theGraph options.

After saving the new configuration by pressing ENTER, go into the equationediting environment by selecting Y= (pressing + F1). Next, press F1to open the Tools menu, and then scroll down to option 9:Format...

Press ENTER. In the GRAPH FORMATS menu that pops up, scroll downto Fields and select 2:DIRFLD (for “direction field”).

Page 663: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 654

Once you press ENTER, the TI–89 is ready to plot vector fields.The t0 prompt on the Y “ screen is used to indicate the time when initial

data is given. You can safely leave this setting as t0 “ 0 for our purposes.

The variables y1, y2, etc. are the names of the unknown functions in thesystem of differential equations. So, to plot a system like

dx

dt“ xpx´ yq

dy

dt“ x` y ` 2,

we enter the following:

Page 664: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 655

Notice that y1 is playing the role of x in our system and y2 the role ofy. Also note that you do not need to enter y1ptq and y2ptq when enteringthe differential equations. We have intentionally left the initial data optionsblank (i.e. the entries for yi1 and yi2 are empty). To control the displayoptions, press + F2 to bring up the WINDOW menu.

Since we are not plotting a solution curve (we did not give any initial data),the t–settings are not very important for us. The xmin, xmax, xscl, ymin, ymax,and yscl are the ones most likely needing adjustment. The remaining op-tions you can safely ignore. Selecting the GRAPH option ( + F3) shouldproduce the vector plot.

Page 665: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 656

If you would like to see a numerical solution curve for a particular ini-tial condition, you can enter the initial data below each equation instead ofleaving those options blank. For example, entering

produces the same vector plot as above, but it overlays the numerical solutioncorresponding to the initial condition xp0q “ 2 and yp0q “ 0.5.

Page 666: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 657

E.4 Probability

E.4.1 Probability on the TI–83/84

The built-in probability functions (pdfs and cdfs) are found in the DISTRmenu (obtained by pressing the 2nd key and then the VARS key). There aremenu items 1 through G. You can use the arrow keys to scroll down throughthe menu.

(a) TI–84 Plus Silver (b) TI–84 Plus CE

Figure E.4.1: DISTR Menu on the TI–84

When you select a function from the menu on the older TI–83/84 calcula-tors, the function appears in the home screen, you then type the arguments(separated by commas), and then close the parentheses. Newer TI–83/84models and the TI–84 Plus CE have a dialog box that appears when youselect one of these functions. You enter your arguments into this dialog box,and then highlight Paste and press the Enter key. The function completewith your arguments will then appear in the home screen. In either case,you press the Enter key when at the home screen to evaluate the function.

We illustrate this for the binompdf function below, and then explainthe arguments for all relevant functions in the order that the correspondingrandom variables appear in the text.

� Choice A on the menu is binompdfpn, p, xq which gives the probabilityof exactly x successes in n independent trials of a Bernoullippq randomvariable. Thus it gives the value of PpX “ xq for X „ binomialpn, pq.If you omit the x you get a list of values for all the possible x’s.

Page 667: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 658

(a) binompdf chosenfrom the menu

(b) binompdfarguments filled in

(c) home screenafter pressing Enter

Figure E.4.2: TI–84 Plus Silver

(a) binompdfdialog box

(b) dialog boxwith values

(c) choose Pasteand press Enter

(d) press Enteron the home

screen

Figure E.4.3: TI–84 Plus CE

� Choice B on the menu is binomcdfpn, p, xq which gives the probabilityof x or fewer successes in n independent trials of a Bernoullippq randomvariable. Thus it gives the value of PpX ď xq for X „ binomialpn, pq.If you omit the x you get a list of values for all the possible x’s.

� Choice E on the menu is geometpdfpp, tq which gives the probabilityof the first success occurring on the tth when independent trials of aBernoullippq random variable are repeated until a success occurs. Thusit gives the value of PpT “ tq for T „ geometricppq.

� Choice F on the menu is geometcdfpp, tq which gives the probability ofthe first success occurring on the tth trial or sooner when independenttrials of a Bernoullippq random variable are repeated until a successoccurs. Thus it gives the value of PpT ď tq for T „ geometricppq.

� Choice C on the menu is poissonpdfpλ, xq which gives the probabilityPpX “ xq for X „ Poissonpλq.

� Choice D on the menu is poissoncdfpλ, xq which gives the probability

Page 668: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 659

PpX ď xq for X „ Poissonpλq.

� Choice 1 on the menu is normalpdfpx, µ, σq which gives the value of thepdf (i.e. the height of the curve) at x for a normal distribution with amean of µ and a standard deviation of σ. The default values are µ “ 0and σ “ 1 and those values will be used if you omit the second andthird arguments. We will not need this value computationally in ourwork. If you want to graph a normal curve you can use this in the y “editor.

� Choice 2 on the menu is normalcdfplower, upper, µ, σq which gives thevalue of the cdf between the x-values lower and upper (i.e. the areaunder the normal curve to the right of lower and to the left of upper)for a normal distribution with a mean of µ and a standard deviationof σ. The default values are µ “ 0 and σ “ 1 and those values will beused if you omit the last two arguments. Thus it gives the probabilityPpX ď xq for X „ Npµ, σ2q. You can use ´1E99 to represent ´8 and1E99 to represent 8.

� Choice 3 on the menu is invNormparea, µ, σq which gives the valueof x so that normalcdfp´8, x, µ, σq “ area, i.e. the value of x sothat PpX ď xq “ area for X „ Npµ, σ2q. On the newer TI–84 PlusCE the dialog box includes an additional argument of either LEFT,RIGHT or CENTER. The choice of LEFT is what is described above.If you choose CENTER the answer is two numbers ´x and x so thatnormalcdfp´x, x, µ, σq “ area and if you choose RIGHT you get an xso that normalcdfpx,8, µ, σq “ area.

E.4.2 Probabilty on the TI–89

The built–in probability functions for the TI–89 can be accessed through theStats/List Editor App.

Page 669: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 660

Figure E.4.4: TI–89 Stats/List Editor App

This brings up a list editor from which you can access various probabilitytools by selecting F5:Distr.

Figure E.4.5: TI–89 Stats/List Editor Distr Menu

Selecting any of the options in this menu will bring up a dialog box allow-ing you to obtain information from the chosen distribution. For example,choosing 4:Normal Cdf brings up the following dialog box.

Page 670: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 661

Figure E.4.6: TI–89 Dialog Box for 4:Normal Cdf

Note that the infinity symbol can be obtained by pressing + CATALOG.After entering the appropriate information and preeing ENTER, we obtainoutput about the chosen distribution.

Figure E.4.7: TI–89 Output from the 4:Normal Cdf Dialog

Here are the functions we will use, listed in the order they appear in thetext:

� Choice B:Binomial Pdf brings up a dialog box for the pdf of the bino-mial random variable. The first input field is for the total number ofindependent trials, n, for a Bernoullippq random variable where p is theprobability of success (which is the second input field). The final inputfield is for the total number of successes, x. Thus it gives the value of

Page 671: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 662

PpX “ xq for X „ binomialpn, pq. If you omit the x you get a list ofvalues for all the possible x’s.

� Choice C:Binomial Cdf gives the probability of having a number ofsuccesses between the Lower Value and Upper Value in n independenttrials of a Bernoullippq random variable. The parameters n and p arethe same as for B:Binomial Pdf.

� Choice F:Geometric Pdf brings up a dialog box for the pdf of the geo-metric random variable which gives the probability of the first successoccurring on the xth when independent trials of a Bernoullippq randomvariable are repeated until a success occurs. Thus it gives the value ofPpT “ xq for T „ geometricppq.

� Choice G:Geometric Cdf is for the corresponding cdf for the geometricrandom variable. This will compute the probability of the first suc-cess occuring between Lower Value and Upper Value when performingindependent trials of a Bernoullippq random variable.

� Choice D:Poisson Pdf brings up a dialog box for the pdf of the Poissonrandom variable with parameter λ. This gives the probability PpX “ xqfor X „ Poissonpλq.

� Choice E:Poisson Cdf is for the corresponding cdf for the Poisson ran-dom variable. It computes the probability of obtaining an outcome froma Poisson random variable with parameter λ between Lower Value andUpper Value.

� Choice 3:Normal Pdf on the menu brings up a dialog box for the pdf(i.e. the height of the curve) at x for a normal distribution with a meanof µ and a standard deviation of σ. The default values are µ “ 0 andσ “ 1 and those values will be used if you omit the second and thirdarguments. We will not need this value computationally in our work.

� Choice 4:Normal Cdf on the menu gives the value of the cdf betweenLower Value and Upper Value (i.e. the area under the normal curve tothe right of Lower and to the left of Upper) for a normal distributionwith a mean of µ and a standard deviation of σ. Thus it gives theprobability PpX ď xq for X „ Npµ, σ2q.

Page 672: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 663

� The inverse normal dialog box can be found under the sub–menu 2:In-verse. In this sub–menu. 1:Inverse Normal... brings up the dialog boxfor this function. The parameters µ and σ are the mean and standarddeviation of the normal random variable. The first input field, Area,is the total probability for which you want to find a correspondingx-value. The function returns the (approximate) x-value such that

Pp´8 ă X ď xq “ Area

for X „ Npµ, σ2q.

Page 673: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 664

E.5 Matrices

E.5.1 Matrix Operations on the TI–83/84

The built-in matrix manipulation tools are found in the MATRIX menu(obtained by pressing the 2nd key and then the x´1 key). In these calculators,matrices have names like rAs. You can see the list of recognized matrix nameswhen either NAMES or EDIT is highlighted on the MATRIX menu. (IfMATH is highlighted you see instead a list of matrix functions or commands.)

(a) TI-84 PlusSilver

(b) TI-84 PlusCE

(c) TI-84 PlusSilver

(d) TI-84 PlusCE

Figure E.5.1: NAMES and MATH Menus

To create a matrix, highlight EDIT and select the name. (See figures Abelow.) After you press enter, the current dimensions and values of the ma-trix are displayed. The default dimensions are 1ˆ 1. You change dimensionsby over-typing the defaults and pressing enter. (See figures B where enter hasnot yet been pressed for the number of columns.) Then you will see a displaywith the correct number of rows and columns. The default entries are all 0.Use the arrow keys to move to any entry and type a new value. (See figuresC.) You will see the new value in the matrix after you press the enter key.To get out of matrix entry mode use QUIT (obtained by pressing 2nd andthen MODE). If you display the name of a matrix on the home screen (bychoosing it from NAMES in the MATRIX menu), the calculator will displaythe matrix. (See figures D.) On older TI 83/84 models the matrix will bedisplayed in a square bracketed list notation.

Page 674: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 665

(a) edit matrix[A]

(b) setdimensions

(c) enter matrixvalues

(d) home screenview

Figure E.5.2: TI-84 Plus CE

(a) edit matrix[A]

(b) setdimensions

(c) enter matrixvalues

(d) home screenview

Figure E.5.3: TI-84 Plus Silver

You can also enter a matrix in the square bracketed list notation. Thesquare brackets are typed using 2nd ˆ and 2nd ´. Note that you use commaswithin the rows as you enter the matrix, but when the calculator displaysthe matrix there are no commas.

(a) TI-84 CEPlus

(b) after pressingEnter

(c) TI 84 PlusSilver

(d) after pressingEnter

Figure E.5.4: Bracket matrix entry

Matrix addition and subtraction can be done using the same keys we usefor arithmetic with numbers. Matrix multiplication can be done either withthe multiplication key or by writing the two matrix names next to each other.

Page 675: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 666

See the examples below using our 2 by 3 matrix rAs from above and the 3by 3 matrices rBs, rCs and rDs shown below.

rBs “

»

1 2 33 2 11 2 2

fi

fl , rCs “

»

1 0 ´10 1 13 2 1

fi

fl , and rDs “

»

1 2 31 2 30 0 1

fi

fl

Remember that to get the names of the matrices onto the screen to per-form operations use the MATRIX menu with NAMES highlighted and selectthe name you wish to appear and hit enter. Be sure you have already definedthe matrix as shown above using EDIT.

(a) TI-84 CEPlus

(b) TI-84 CEPlus

(c) TI 84 PlusSilver

(d) TI 84 PlusSilver

Figure E.5.5: Matrix Operations

If the matrices you are trying to add or multiply do not have compatibledimensions you will see a dimension mismatch error message:

(a) TI-84 CEPlus

(b) TI-84 CEPlus

(c) TI 84 PlusSilver

(d) TI 84 PlusSilver

Figure E.5.6: Mismatched Dimensions

If a square matrix is invertible, you can find its inverse using the x´1

key. If you are trying to invert a non-square matrix you will get an invaliddimension error message, and if you are trying to invert a singular matrixyou will get a singular matrix error message. On the CE Plus you will see a

Page 676: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 667

notation on the home screen that your request resulted in a error but on theolder TI–83/84 models you only see that there is no result shown.

(a) InverseMatrices

(b) Non-squareMatrix [A]

(c) SingularMatrix [D]

Figure E.5.7: Inverses on TI-84 CE Plus

(a) InverseMatrices

(b) Non-squareMatrix [A]

(c) SingularMatrix [D]

Figure E.5.8: Inverses on TI 84 Plus Silver

To find determinants of square matrices you use the determinant com-mand, det, which is the first entry in the MATRIX menu when MATH ishighlighted. You can also find it in the CATALOG. If you try to take thedeterminant of a non-square matrix you will see the invalid dimension errormessage.

(a) TI-84 CEPlus

(b) Non-square[A]

(c) TI 84 PlusSilver

(d) Non-square[A]

Figure E.5.9: Matrix Determinants

Page 677: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 668

You can raise a square matrix to a power using the ^ key. If your matrixis not square you will again get the invalid dimension error message.

(a) TI-84 PlusSilver

(b) TI-84 PlusCE

Figure E.5.10: Matrix Powers

To row reduce matrices you use the command rref which is found in theMATRIX menu when MATH is highlighted. You can also find it in theCATALOG. For example, if we redefine our matrix rAs to correspond to theaugmented matrix for the system of equations below, we can row reduce tofind the solution to the system (x “ 1, y “ 2, z “ ´1).

x` 2y ´ z “ 6

3x` 8y ` 9z “ 10

2x´ y ` 2z “ ´2

(a) TI-84 PlusSilver

(b) TI-84 PlusCE

Figure E.5.11: Row Reduction

E.5.2 Matrix Operations on the TI–89

Matrices can be entered into the TI–89 in many ways, but we will focus onusing the Data/Matrix Editor App.

Page 678: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 669

Figure E.5.12: TI–89 Data/Matrix Editor App

To create a new matrix, select 3:New... This will bring up a dialog box. ForType, you should select 2:Matrix. Leave the Folder option on its defaultvalue of main. The Variable field is where you give the name of the matrix(usually a single letter is easiest to remember). Finally, enter the row andcolumn dimensions in the fields provided.

Figure E.5.13: TI–89 New Matrix Dialog

This will bring up a data entry screen with zero entries for the matrix of thespecified size. Simply input the correct entries for your matrix.

Page 679: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 670

Figure E.5.14: TI–89 Data Entry Screen

After data entry, your matrix can be accessed from the HOME screen usingwhatever variable name you specified.

Figure E.5.15: Matrix on the TI–89 Home Screen

Many simple matrix operations can be carried out from the HOME screenjust as for real numbers. The following figure shows matrix addition, sub-traction, and multiplication for the matrices

m “

»

1 2 33 2 11 2 2

fi

fl and n “

»

1 0 ´10 1 13 2 1

fi

fl .

Page 680: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 671

Figure E.5.16: Basic Matrix Arithmetic on the TI–89

If you attempt a binary operation between two matrices of incompatible sizes,you will get an error message warning you about mismatched dimensions.

Figure E.5.17: TI–89 Dimension Error

You can compute positive integer powers of a square matrix by using theusual exponentiation command.

Page 681: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 672

Figure E.5.18: Powers of a Square Matrix on the TI–89

If a square matrix is invertible, you can find the inverse by raising the matrixto the power ´1.

Figure E.5.19: Inverting a Square Matrix on the TI–89

If you attempt to invert a matrix that has no inverse, you will receive anerror message that the matrix is singular.

Suppose that we want to edit an existing matrix. For instance, if we wantto change the matrix m above to

m “

»

1 2 ´1 63 8 9 102 ´1 2 ´2

fi

fl ,

we first select 2:Open from the main Data/Matrix Editor application menu.This will bring up a menu where you can reselect m. Once we have reopened

Page 682: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 673

m, we must resize it (since our new m is a 3 ˆ 4 matrix). This can beaccomplished by opening the F6:Util menu and selecting option 6:ResizeMatrix.

Figure E.5.20: Resizing a Matrix on the TI–89

Once you have entered the new data, the new m can be accessed from theHOME screen as usual.

Figure E.5.21: Resized Matrix m

If you want to completely clear out all currently defined matrices (along withany other stored variables), you can choose F6:Clean Up from the HOMEscreen and then select 1:Clear a–z...

Page 683: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 674

Figure E.5.22: Clearing Stored Variables on the TI–89

The TI–89 can also row reduce matrices. For example, to row reduce thenewly defined matrix m, we use the row reduction command, rref, which canbe easily accessed from the CATALOG. Hit the “R” key to scroll throughfaster.

Figure E.5.23: TI–89 Catalog: rref

Selecting this function and inputting the variable name of the matrix to berow reduced returns the equivalent matrix in reduced row echelon form.

Page 684: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 675

Figure E.5.24: Row Reduction on the TI–89 Catalog

The determinant of a square matrix can be computed similarly by select-ing the det command from the CATALOG.

Figure E.5.25: Determinants on the TI–89 Catalog

The TI–89 is capable of computing eigenvalues and eigenvectors numeri-cally. Since a real matrix is capable of having complex eigenvalue/eigenvectorpairs, you must change the mode to allow complex numbers. Press MODEand change the Complex Format from 1:REAL to 2:RECTANGULAR.

Page 685: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 676

Figure E.5.26: Complex Format on the TI–89

Once the calculator is in complex mode, eigenvalues can be computed usingthe eigVl command from the CATALOG while the corresponding eigenvec-tors are computed using eigVc. For example, we can compute the eigenvaluesof the matrix

p “

3 5´2 1

as shown below.

Figure E.5.27: Eigenvalues/Eigenvectors on the TI–89

The matrix p clearly has eigenvalues 2 ˘ 3i. The eigVc command returns amatrix whose columns are (approximate) representative eigenvectors for thecorresponding eigenvalue from eigVl. For instance, an approximate eigenvec-

Page 686: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX E. TI INFORMATION 677

tor for 2` 3i is

~v1 “

0.845154´0.169031` 0.507093i

.

For the eigenvector corresponding to 2´ 3i, we scroll over to find

~v2 “

0.845154´0.169031´ 0.507093i

.

Figure E.5.28: Eigenvectors on the TI–89

Page 687: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Appendix F

Answers to Selected ExercisesF.1 Chapter 1

1.) a.) q1 “ 24, q2 “ 36, q3 “ 54, q4 “ 81

b.) qn “

ˆ

3

2

˙n

q0 so qn “

ˆ

3

2

˙n

16 when q0 “ 16

c.) qn “2

3qn`1

d.) q0 “ 16

3.) a.) p1 “1

4, p2 “

1

16, p3 “

1

256, p4 “

1

65536

b.) pn “

ˆ

1

2

˙2n

so p10 “

ˆ

1

2

˙1024

c.) Yes, pn “?pn`1

5.) 11 time periods

7.) q˚ “1

2unstable(no spiraling)

9.) L˚ “ ´1 unstable (no spiraling) and L˚ “ 0 asymptotically stable (nospiraling)

11.) P ˚ “1

2asymptotically stable (no spiraling), P ˚ “ 1 unstable (no

spiraling) and P ˚ “ ´1 unstable (no spiraling)

13.) p˚ “ 0 asymptotically stable (no spiraling) and p˚ “ 1 unstable (nospiraling)

15.) r “ 2s and p˚ “1

3. For any reasonable case we need ´1 ă 1´r´s ă 1

which says 0 ă r ` s ă 2 and then we get an asymptotically stable

equilibrium. So here for asymptotically stable we must have 0 ă s ă2

3.

678

Page 688: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX F. ANSWERS TO SELECTED EXERCISES 679

To get spiraling we need ´1 ă 1´r´s ă 0 or equivalently 1 ă r`s ă 2

which here means1

3ă s ă

2

3.

17.) No equilibrium point sincecu

1´ cą Vc. Cobweb plots show Wenckebach

phenomenon.

19.) No equilibrium point sincecu

1´ cą Vc. Cobweb plots show 2:1 AV

block.

21.) q˚ “ 0 unstable (no spiraling) and q˚ “1

3asymptotically stable (no

spiraling)

23.) a.) q˚ “ 0 unstable (no spiraling) and q˚ “1

3asymptotically stable

(no spiraling)

b.) qn “qn`1

2´ 3qn`1

c.) q˚ “ 0 asymptotically stable (no spiraling) and q˚ “1

3unstable

(no spiraling)

25.) a.) 0 ă α ď27

4

b.) For 0 ă α ă 4 the only equilibrium is 0.

For α “ 4 there are two equilibria, 0 and1

2.

For 4 ă α ď 27{4 there are three equilibria, 0 and1

c

1

1

α.

c.) In all cases, the equilibrium of 0 is stable (no spiral).

For α “ 4 the second equilibrium,1

2, is also stable (no spiral).

For 4 ă α ă27

4the equilibrium

1

c

1

1

αis unstable (no

spiral).

For 4 ă α ď9

2the third equilibrium

1

2`

c

1

1

αis stable (no

spiral).

Page 689: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX F. ANSWERS TO SELECTED EXERCISES 680

For9

2ă α ď

49

10the third equilibrium

1

2`

c

1

1

αis stable

(spiral).

For49

10ă α ď

27

4the third equilibrium

1

2`

c

1

1

αis unstable

(spiral).

F.2 Chapter 2

1.) ´1

2ln |1´ x2

| ` C

3.)4?

2` π?

2´ 8

8

5.) ´

?2

2

7.) ln |x` 3| ´ ln |x` 2| ´2

x` 3` C

9.) tanx` C

11.)1

2ln |2x´ 1| ´ ln |x` 1| ` x` C

13.)4832

15

15.)5e4 ´ 1

4

17.)1

4ln |x| ´

1

8ln px2

` 4q ´1

2arctan

x

2` C

19.) arctan x´1

2ln px2

` 1q ` C

Page 690: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX F. ANSWERS TO SELECTED EXERCISES 681

F.3 Chapter 3

1.) integral:20

3area:

28

3They are different because some of the area is

below the x-axis.

3.) 72

5.)71

6

7.)1

3

9.)121π

10

11.)2π

35

13.)128π

15

15.)

ż h

0

πpr

hyq2dy

17.)e3

3

19.)2

e

21.)3

2

23.) 8?

3

25.) 1

F.4 Chapter 4

1.) dependent: vindependent: t

Page 691: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX F. ANSWERS TO SELECTED EXERCISES 682

verify:dv

dt“ 10e´3t

“ 10´ 3v and vp0q “10

10

3e0“ 0

3.) dependent: xindependent: t

verify: tdx

dt` x “ t

ˆ

3

4t2 ´

7

4t´2

˙

`

ˆ

1

4t3 `

7

4t´1

˙

“ t3 and xp1q “

1

4`

7

4“ 2

5.) x “3

4´ t3

7.) x “?t2 ` 25

9.) x “et

et ´ 56

11.) x “1` e´t

2

2

13.) x “ ´2 is a source (unstable) and x “ 3 is a sink (asymptoticallystable)

15.) x “ 1 is a source (unstable), x “ ´2

3is a node (semi-stable) and both

x “ ´5 and x “ 4 are sinks (asymptotically stable)

17.) x “ 2nπ for any integer n is a source (unstable) and x “ p2n` 1qπ forany integer n is a sink (asymptotically stable)

19.) there will be 10000 bacteria after8 ln 20

ln 3hours

21.) there will be 20µg left after12 ln 5

ln 2hours

23.) the rod will be 100˝C after5 ln 2

87

ln 45

hours

25.) the growth rate is1000

3, the carrying capacity is 1000 and if the initial

Page 692: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX F. ANSWERS TO SELECTED EXERCISES 683

population is 300 then the population will be 600 after3 ln 3.5

1000time

units

27.) Cp20q “ 35e´2{3« 17.97 g/L

29.) Cp400q “25´

?5

100« 0.228 lbs/gal

30.) the carrying capacity is54

5and the growth rate is ln 7

F.5 Chapter 5

1.) p1, 1q is an asymptotically stable equilibrium and p´1,´1q is an unsta-ble equilibrium.

3.)

ˆ

3,1

2

˙

is a stable center point equilibrium and p0, 0q is an unstable

saddle point equilibrium.

5.) Every point pc, 0q is an equilibrium. If c ă 6 then the equilibrium isasymptotically stable.

6.) Stable equilibrium is 500 mice and 30 owls. If initially there are 600mice and 20 owls then the populations of mice and owls will both startout increasing.

7.) Stable equilibrium is 1200 grasshoppers and 60 frogs. If initially thereare 1300 grasshoppers and 70 frogs then the population of grasshopperswill start out decreasing and the population of frogs will start outincreasing.

8.) Largest stable number of susceptible people isβ

α“ 500.

9.) The equilibrium is 500 susceptible and approximately 186 infected, sothe disease is endemic.

10.) Here N ăβ

αso the only equilibrium is p3000, 0q In the long run the

number of infected people goes to 0 so the disease is not endemic.

Page 693: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX F. ANSWERS TO SELECTED EXERCISES 684

11.) We have competitive exclusion and in the long run there are 250 ofspecies a and none of species b.

12.) We have weak competition with an equilibrium of approximately 57.14of species a and approximately 107.14 of species b.

13.) We have competitive exclusion and in the long run there are 300 ofspecies b and none of species a.

14.) We have strong competition and both pa, bq “ p100, 0q and pa, bq “p0, 300q are asymptotically stable. Without initial values we cannotpredict which species will win out but we do know that in the long runonly one will survive.

15.) If NR ăγ

δthere are two equilibria: p0, 0q, an unstable saddle point, and

the asymptotically stable pNR, 0q. If NR ąγ

δthere are three equilibria.

p0, 0q and pNR, 0q are unstable saddle points. The third equilibrium is

an asymptotically stable

ˆ

γ

δ,α

β

ˆ

1´γ

δNR

˙˙

. If NR is not close toγ

δthere will likely be spiral behavior.

F.6 Chapter 6

1.) PpX “ 5q “1

3, EpXq “ 3 and σpXq “

2?

7

3

3.) PpX “ 1q “ 1631

, PpX “ 2q “ 831

, PpX “ 3q “ 431

, PpX “ 4q “ 231

,PpX “ 5q “ 1

31

EpXq “ 5731« 1.8387, VarpXq “ 1122

961« 1.1675 and σpXq “

?1122

31«

1.0805

5.) S “ t3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18u, PpR “ 5q “ 136

7.) Ppboth greenq “1

4, Ppone green and one yellowq “

3

10

9.) PpR “ 5|at least one 1q “2

11, not independent

Page 694: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX F. ANSWERS TO SELECTED EXERCISES 685

11.) Ppone ball is yellow|both balls have odd numbersq “2

5, not indepen-

dent

13.) Ppknew right answer|gave right answerq “70

76« .9211

15.) PpIq “15

985« 1.5228%

17.) binomial, .3352

19.) the question asks for the expected number of tails in 12 tosses of a faircoin which is 6

21.) EpT q “ 1.45“ 20

9, σpT q “

?.55

.45« 1.648, PpT ě 5q “ 1 ´ PpT ă 5q «

.0915

23.) Pp0 accidentsq « .0498, Pp1 accidentq « .1494,Pp5 accidents|at least 4 accidentsq « .2858

25.) Ppwq “ q “?

0.36 “ 0.6, PpW q “ p “ 1 ´ q “ 0.4, PpWwq “ 2pq “0.48

27.) PpDq “ p “ 0.35, Ppdq “ q “ 0.65, Ppddq “ q2 “ 0.4225

29.) PpAAAAq “ p4, PpAAAaq “ 4p3q, PpAAaaq “ 6p2q2, PpAaaaq “4pq3, and Ppaaaaq “ q4

F.7 Chapter 7

1.) Sample space: r1,8q, to normalize let A “ 3, and Pp2 ď X ď 4q “7

64

3.) Sample space: p0, 1s, to normalize let A “1

2, and P

ˆ

1

2ď R ď 1

˙

1´1?

2

5.) Sample space: [0,5], to normalize let A “6

175, the cdf is F pyq “

Page 695: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX F. ANSWERS TO SELECTED EXERCISES 686

y2p2y ´ 3q

175, and

EpY q “55

14, VarpY q “

125

96and σpY q “

5?

5

4?

6

7.) a.) To normalize, let k “ 20

b.) Pˆ

0 ď X ď1

4

˙

“1

64

c.) EpXq “2

3

d.) VarpXq “2

63

9.) a.) To normalize, let A “2

π

b.) Pp0 ď X ď 1q “1

2

c.) The integrals do not converge.

11.) EpXq “ 4, VarpXq “ 8 and σpXq “ 2?

2

13.) a.) rb, a` bs

b.) F pyq “y ´ b

a

c.) F 1pyq “1

a

d.) Uniform

15.) e´85

17.)16

25

19.) 4.01%

21.) For standard normal: et2

2

For normal with mean µ and standard deviation σ: etµ`t2σ2

2

Page 696: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX F. ANSWERS TO SELECTED EXERCISES 687

F.8 Chapter 8

1.) Original:

2 ´1 73 2 0

Reduced:

1 0 20 1 ´3

Solution: x “ 2, y “ ´3

3.) Original:

»

1 1 3 101 2 1 162 3 4 26

fi

fl Reduced:

»

1 0 5 40 1 ´2 60 0 0 0

fi

fl

Solution: x “ 4´ 5t, y “ 6` 2t, z “ t

5.) Original:

»

1 ´2 3 42 1 1 83 4 ´5 8

fi

fl Reduced:

»

1 0 0 30 1 0 10 0 1 1

fi

fl Solution: x “

3, y “ 1, z “ 1

7.) Original:

»

1 1 0 5 31 2 ´1 8 42 3 ´1 13 71 2 ´1 8 4

fi

ffi

ffi

fl

Reduced:

»

1 0 1 2 20 1 ´1 3 10 0 0 0 00 0 0 0 0

fi

ffi

ffi

fl

Solution: x “ 2´ s´ 2t, y “ 1` s´ 3t, z “ s, w “ t

9.) a.)

»

3´96

fi

fl

b.)

»

´2´1

72

fi

fl

c.)

»

11´5´8

fi

fl

d.)

»

014´15

fi

fl

e.)?

14,?

69

Page 697: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX F. ANSWERS TO SELECTED EXERCISES 688

11.) linearly dependent:

5 ¨

»

12´3

fi

fl` 2 ¨

»

´245

fi

fl´

»

118´5

fi

fl “

»

000

fi

fl

13.) a.) Cannot be done.

b.)

3 1 ´7´21 ´10 6

c.)

´2 14 ´131 ´19 14

d.)

9 ´24´12 33

e.)

»

3 ´1 ´33 7 2´2 ´1 3

fi

fl

15.) a.) Invertible.

38´1

4116

18

b.) Invertible.

»

13

0 23

23´1 4

3

1 ´1 1

fi

fl

c.) Invertible.

»

´13

23

13

43

´53´1

3

´43

83

13

fi

fl

d.) Not invertible.

17.) λ1 “ ´1, associated eigenvectors: c

11

; λ2 “ 2, associated eigenvec-

tors: c

21

.

19.) λ1 “ 3` i, associated eigenvectors: c

1` i1

;

Page 698: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX F. ANSWERS TO SELECTED EXERCISES 689

λ2 “ 3´ i, associated eigenvectors: c

1´ i1

.

21.) λ1 “ ´4, associated eigenvectors: c

»

121

fi

fl ;

λ2 “ 0, associated eigenvectors: c

»

101

fi

fl ;

λ3 “ 1, associated eigenvectors: c

»

110

fi

fl .

23.) λ1 “ 2, associated eigenvectors: c

»

´1´11

fi

fl ;

λ2 “ i, associated eigenvectors: c

»

1` i01

fi

fl ;

λ3 “ ´i, associated eigenvectors: c

»

1´ i01

fi

fl .

25.) λ1 “ ´2, associated eigenvectors: c

»

0´101

fi

ffi

ffi

fl

;

λ2 “ 0, associated eigenvectors: c

»

0101

fi

ffi

ffi

fl

;

λ3 “ λ4 “ 1, associated eigenvectors: c

»

0231

fi

ffi

ffi

fl

` d

»

1000

fi

ffi

ffi

fl

.

17diag.) M “

1 21 1

, D “

´1 00 2

, M´1 “

´1 21 ´1

, M5 “

65 ´6633 ´34

.

Page 699: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX F. ANSWERS TO SELECTED EXERCISES 690

19diag.) M “

1` i 1´ i1 1

, D “

3` i 00 3´ i

, M´1 “

´ i2

12` i

2i2

12´ i

2

,

M5 “

304 ´632316 ´328

.

21diag.) M “

»

1 1 12 0 11 1 0

fi

fl , D “

»

´4 0 00 0 00 0 1

fi

fl , M´1 “

»

´12

12

12

12

´12

12

1 0 ´1

fi

fl,

M5 “

»

513 ´512 ´5131025 ´1024 ´1025512 ´512 ´512

fi

fl .

23diag.) M “

»

´1 1` i 1´ i´1 0 01 1 1

fi

fl, D “

»

2 0 00 i 00 0 ´i

fi

fl , M´1 “

»

0 ´1 0´ i

212` i 1

2` i

2i2

12´ i 1

2´ i

2

fi

fl,

M5 “

»

1 29 ´20 32 01 ´34 ´1

fi

fl .

25diag.) M “

»

0 0 0 1´1 1 2 00 0 3 01 1 1 0

fi

ffi

ffi

fl

, D “

»

´2 0 0 00 0 0 00 0 1 00 0 0 1

fi

ffi

ffi

fl

, M´1 “

»

0 ´12

16

12

0 12

´12

12

0 0 13

01 0 0 0

fi

ffi

ffi

fl

,

M5 “

»

1 0 0 00 ´16 6 160 0 1 00 16 ´5 ´16

fi

ffi

ffi

fl

.

F.9 Chapter 9

1.)

xptq “ c1e´3t` c2e

2t

yptq “ ´c1e´3t` 4c2e

2t

Page 700: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX F. ANSWERS TO SELECTED EXERCISES 691

3.)

xptq “ ´13e´3t{2` 14e´t{2

yptq “ ´13e´3t{2` 10e´t{2

5.)

xptq “ 2e2t cosp5tq ´ 3e2t sinp5tq

yptq “ 3e2t cosp5tq ` 2e2t sinp5tq

7.)

xptq “ c2 ` c3e3t

yptq “ c1e´4t´ c2

zptq “ c1e´4t` c2 ` c3e

3t

9.)

xptq “ e2t´ cosp4tq ´ 3 sinp4tq

yptq “ e2t´ cosp4tq ` 2 sinp4tq

zptq “ e2t` cosp4tq ´ 2 sinp4tq

11.)

CAptq “ ´14

3e´

7t50 `

5

3e´

2t25 ` 3

CBptq “7

3e´

7t50 `

5

3e´

2t25 ` 1

limtÑ8

CAptq “ 3 g/L

limtÑ8

CBptq “ 1 g/L

13.)

limtÑ8

CAptq “2

9kg/L

limtÑ8

CBptq “1

9kg/L

limtÑ8

CCptq “1

5kg/L

Page 701: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX F. ANSWERS TO SELECTED EXERCISES 692

15.)

x1

v1

0 1´21 ´10

xv

`

025 sinptq

xp0qvp0q

01

xptq “ ´3

8e´7t

`7

8e´3t

` sinptq ´1

2cosptq

17.)

Equilibrium Classification

p´2,´2q Asymptotically Stable Nodep0, 0q Unstable Saddle Pointp0, 1q Asymptotically Stable Spiral Pointp3,´2q Unstable Node

19.)

Equilibrium Classification

p´5,´3q Unstable Saddle Pointp0, 0q Asymptotically Stable Nodep´5, 1q Unstable Saddle Point

21.) a.) See Theorem 5.5.3

b.) Eigenvalues: ´31

100,´

11

100,´

1

100

c.) Eigenvalues: ´23

50,´

1

100,

19

100

23.) a.)

~xptq “ c1

3´1

e´2t` c2

ˆ

t

3´1

`

10

˙

e´2t

b.)

~xptq “ c1

21

et ` c2

ˆ

t

21

`

31

˙

et

25.) a.)

~xpptq “

6te2t ` e´t ´ e2t

3te2t ` e´t ´ e2t

Page 702: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX F. ANSWERS TO SELECTED EXERCISES 693

b.)

~xpptq “

3te´2t ` te2t

´3te´2t ` 3te2t ´ e´2t ` e2t

F.10 Chapter 10

1.) a.) P “

»

15

25

0 0 0 25

25

15

25

0 0 00 2

515

25

0 00 0 2

515

25

00 0 0 2

515

25

25

0 0 0 25

15

fi

ffi

ffi

ffi

ffi

ffi

ffi

fl

, all states communicate and all states

are recurrent

b.) all states have period 1

c.) PpX4 “ 3|X0 “ 1q “104

625

3.) a.) P “

»

34

13

0 0 0 0 0 0 014

0 13

0 13

0 0 0 00 1

30 1

30 0 0 0 0

0 0 13

0 13

0 0 0 00 1

30 1

30 0 0 0 0

0 0 13

13

13

0 12

0 12

0 0 0 0 0 12

0 12

00 0 0 0 0 0 1

20 1

2

0 0 0 0 0 12

0 12

0

fi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

ffi

fl

, t0, 1, 2, 3, 4u is transient

and t5, 6, 7, 8u is recurrent

b.) Each state in t0, 1, 2, 3, 4u has period 1, and each state in t5, 6, 7, 8uhas period 2.

c.)

PpX5 ‰ 5, 6, 7, 8|X0 “ 0q “2099

2592« 80.98%

PpX10 ‰ 5, 6, 7, 8|X0 “ 0q “318787727

644972544« 49.43%

PpX20 ‰ 5, 6, 7, 8|X0 “ 0q « 17.16%

Page 703: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

APPENDIX F. ANSWERS TO SELECTED EXERCISES 694

5.) a.) 4 room changes

b.) 17 room changes

c.) 62 room changes

7.) The limiting probability for each state is 1/6.

9.) All states in the original process have period 2. The transition proba-bilities for the odd nodes (1, 3, 5, and 7) after two steps is

P “

»

5{16 1{16 0 1{89{16 9{16 3{8 0

0 3{8 9{16 9{161{8 0 1{16 5{16

fi

ffi

ffi

fl

.

Nodes 3 and 5 both having limiting probabilities of 9/20 while nodes 1and 7 have limiting probabilities of 1/20.

11.) P “

»

0 1{16 0 0 01 3{8 1{4 0 00 9{16 1{2 9{16 00 0 1{4 3{8 10 0 0 1{16 0

fi

ffi

ffi

ffi

ffi

fl

, all states communicate and have

period 1, the limiting vector of probabilities is

~π “

»

1{708{3518{358{351{70

fi

ffi

ffi

ffi

ffi

fl

13.) Pentagons: 36.79%, Hexagons: 36.79%, Heptagons: 18.39%, Oc-togons: 6.13%, Nonagons: 1.53% (all other shapes combined accountfor « 0.37% of cells)

15.) p « 49.6%

Page 704: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Bibliography

[Ad13] Adler, F., Modeling the Dynamics of Life: Calculus and Probabilityfor Life Scientists, 3e., Boston, MA, USA: Brooks/Cole (2013).

[Ah79] Ahlfors, L., Complex Analysis, 3e., Singapore: McGraw–Hill Inter-national (1979).

[Al07] Allen, L., An Introduction to Mathematical Biology, Upper SaddleRiver, NJ, USA: Pearson Education Inc. (2007).

[BDH12] Blanchard, P., Devaney, R., Hall, G., Differential Equations (4ed.), Boston, MA, USA: Brooks/Cole (2012).

[D96] Durrett, R., Probability: Theory and Examples (2 ed.), Belmont, CA,USA: Wadsworth Publishing Co. (1996).

[FIS03] Friedberg, S., Insel, A., Spence, L., Linear Algebra (4 ed.), UpperSaddle River, NJ, USA: Pearson Education (2003).

[F18] Friedman, A., Mathematical Biology: Modeling and Analysis, Provi-dence, RI, USA: American Mathematical Society (2018).

[GPNP06] Gibson, M., Patel, A., Nagpal, R., Perrimon, N,, The Emergenceof Geometric Order in Proliferating Metazoan Epithelia, Nature 442,1038=1041 (2006).

[HK91] Hale, J., Kocak, H., Dynamics and Bifurcations, New York, NY,USA: Springer–Verlag (1991).

[Hj12] Hajek, A., Interpretations of Probability, The Stanford Encyclopediaof Philosophy (Winter 2012 Edition), https://plato.stanford.edu/

archives/win2012/entries/probability-interpret/.

695

Page 705: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

BIBLIOGRAPHY 696

[HS74] Hirsch, M., Smale, S., Differential Equations, Dynamical Systems,and Linear Algebra, New Yourk, NY, USA: Academic Proess, Inc.(1974).

[HWT16] Hass, J., Weir, M., Thomas, G., University Calculus: Early Tran-scendentals (3 ed.), Boston, MA, USA: Pearson (2016).

[Kh07] Khoshnevisan, D., Probability, Providence, RI, USA: AmericanMathematical Society (2007).

[Li78] Li, C., First Course in Population Genetics, Pacific Grove, CA, USA:The Boxwood Press (1978).

[Ma69] Malecot, G., The Mathematics of Heredity, San Francisco, CA, USA:W.H. Freeman and Co. (1969).

[N10] Nahin, P., An Imaginary Tale: The Story of?´1, Princeton, NJ,

USA: Princeton University Press (2010).

[P15] Poole, D., Linear Algebra, A Modern Introduction (4 ed.), Stamford,CT, USA: Cengage Learning (2015).

[Ro95] Robinson, C., Dynamical Systems: Stability, Symbolic Dynamics,and Chaos, Boca Raton, FL, USA: CRC Press (1995).

[RA15] Rogawski, J., Adams, C., Calculus: Early Transcendentals (3 ed.),New York, NY, USA: W.H. Freeman and Co. (2015).

[Rs03] Ross, S., Introduction to Probability Models (8 ed.), San Diego, CA,USA: Academic Press (2003).

[S03] Stewart, J., Calculus: Early Transcendentals (5 ed.), Belmont, CA,USA: Brooks/Cole (2003).

[Sh96] Shiryaev, A., Probability (2 ed.), New York, NY, USA: Springer(1996).

Page 706: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

Index

Aaccessible state . . . . . . . . . . . . . . . . . 536aperiodic state . . . . . . . . . . . . . . . . . 560

Bbasis . . . . . . . . . . . . . . . . . . . . . . . . . . . 422Bayes’ Formula . . . . . . . . . . . . . . . . . 271Bernoulli r.v. . . . . . . . . . . . . . . . . . . . 286beta r.v. . . . . . . . . . . . . . . . . . . . . . . . 332binomial coefficients . . . . . . . . . . . . 248binomial r.v. . . . . . . . . . . . . . . . . . . . 287

Ccdf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313chaos . . . . . . . . . . . . . . . . . . . . . . . . . . . 511Chapman–Kolmogorov Equations 529characteristic polynomial . . . . . . . 410cobweb plot . . . . . . . . . . . . . . . . . . . . . 13communicating states . . . . . . . . . . .536complex conjugate . . . . . . . . . . . . . .614complex exponential . . . . . . . . . . . . 619complex number . . . . . . . . . . . . . . . . 610

imaginary part . . . . . . . . . . . . . 610magnitude . . . . . . . . . . . . . . . . . . 616polar form . . . . . . . . . . . . . . . . . . 620real part . . . . . . . . . . . . . . . . . . . .610

complex plane . . . . . . . . . . . . . . . . . . 611conditioning . . . . . . . . . . . . . . . . . . . . 261conditonal probability . . . . . . . . . . 255

cumulative distribution function 313

Ddependent variable . . . . . . . . . . . . . 124determinant

2ˆ 2 matrix . . . . . . . . . . . . . . . . 396nˆ n matrix . . . . . . . . . . . . . . . 399

diagonal matrix . . . . . . . . . . . . . . . . 428diagonalizable matrix . . . . . . . . . . . 428differential equation . . . . . . . . . . . . 125

general solution . . . . . . . . . . . . .127autonomous . . . . . . . . . . . . . . . . 167

system . . . . . . . . . . . . . . . . . . . .190first order linear . . . . . . . . . . . . 135higher order . . . . . . . . . . . . . . . . 465initial data . . . . . . . . . . . . . . . . . 126linear systems of . . . . . . . . . . . .437order . . . . . . . . . . . . . . . . . . . . . . . 125separable . . . . . . . . . . . . . . . . . . . 130solution . . . . . . . . . . . . . . . . . . . . 126

discrete–time stochastic process .523dynamical system . . . . . . . . . . . . . . . . .1

autonomous . . . . . . . . . . . . . . . . . . 7continuous . . . . . . . . . . . . . . . . . .124discrete . . . . . . . . . . . . . . . . . . . . . . . 5memoryless . . . . . . . . . . . . . . . . . . . 7parameter . . . . . . . . . . . . . . 33, 125

697

Page 707: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

INDEX 698

Eeigenvalue . . . . . . . . . . . . . . . . . . . . . . 407

characteristic polynomial . . . 410deficiency . . . . . . . . . . . . . . . . . . .424multiplicity, algebraic . . . . . . . 420multiplicity, geometric . . . . . . 423

eigenvector . . . . . . . . . . . . . . . . . . . . . 407Elementary Row Operations . . . . 361equilibrium . . . . . . . . . . . . . . . . . . . . . . 19

asymptotically stable . . . . . . . . 23autonomous system . . . . . . . . . 190continuous . . . . . . . . . . . . . . . . . .168discrete . . . . . . . . . . . . . . . . . . . . . . 20semi-stable . . . . . . . . . . . . . . . . . . 26stable . . . . . . . . . . . . . . . . . . . . . . . .26unstable . . . . . . . . . . . . . . . . . . . . . 22unstable spiral . . . . . . . . . . . . . . . 25

ergodic states . . . . . . . . . . . . . . . . . . 564Euler’s Formula . . . . . . . . . . . . . . . . 619event . . . . . . . . . . . . . . . . . . . . . . . . . . . 234expected value

continuous . . . . . . . . . . . . . . . . . .317discrete . . . . . . . . . . . . . . . . . . . . .280

exponential growth/decay . . . . . . 148doubling time . . . . . . . . . . . . . . 152equilibria . . . . . . . . . . . . . . . . . . . 181half-life . . . . . . . . . . . . . . . . . . . . . 151

exponential r.v. . . . . . . . . . . . . . . . . 328

FFundamental Theorem of Algebra 617

GGaussian Elimination . . . . . . . . . . . 359geometric r.v. . . . . . . . . . . . . . . . . . . 291

HHardy–Weinberg

equilibrium . . . . . . . . . . . . . . . . . 269

harmonic series . . . . . . . . . . . . . . . . . 633homogeneous system . . . . . . . . . . . 355

Iidentity matrix . . . . . . . . . . . . . . . . . 394improper integral . . . . . . . . . . . . . . . 108

type I . . . . . . . . . . . . . . . . . . . . . . 112type II . . . . . . . . . . . . . . . . . . . . . 118

independent events . . . . . . . . 242, 257independent variable . . . . . . . . . . . 124infinite series . . . . . . . . . . . . . . . . . . . 629inhomogeneous system . . . . . . . . . .356initial data . . . . . . . . . . . . . . . . . . . . . . . 2initial value problem (IVP) . . . . . 126integration . . . . . . . . . . . . . . . . . . . . . . 59

by parts . . . . . . . . . . . . . . . . . . . . . 64by substitution . . . . . . . . . . . . . . 60partial fractions . . . . . . . . . . . . . 72

Llaw of total probability . . . . . . . . . 261leading coefficient . . . . . . . . . . . . . . 366linear dependence . . . . . . . . . . . . . . 377linear independence . . . . . . . . . . . . 378linear system . . . . . . . . . . . . . . . . . . . 354

homogeneous . . . . . . . . . . . . . . . 355inhomogeneous . . . . . . . . . . . . . 356of differential equations . . . . . 437over–determined . . . . . . . . . . . . 356square system . . . . . . . . . . . . . . 356under–determined . . . . . . . . . . 356

linear transformation . . . . . . . . . . . 383linearization . . . . . . . . . . . . . . . . . . . . 485logistic growth . . . . . . . . . . . . . . . . . 154

carrying capacity . . . . . . . . . . . 154equilibria . . . . . . . . . . . . . . . . . . . 183

logistic map . . . . . . . . . . . . . . . . . . . . . 47Lorenz Attractor . . . . . . . . . . . . . . . 509

Page 708: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

INDEX 699

Lorenz System . . . . . . . . . . . . . . . . . 507

MMarkov Chain . . . . . . . . . . . . . . . . . . 524

irreducible . . . . . . . . . . . . . . . . . . 537irreducible ergodic . . . . . . . . . . 564period . . . . . . . . . . . . . . . . . . . . . . 560recurrent state . . . . . . . . . . . . . .538transient state . . . . . . . . . . . . . . 538

Markov Chain Monte Carlo . . . . .590matrix . . . . . . . . . . . . . . . . . . . . . . . . . 381

characteristic polynomial . . . 410diagonal . . . . . . . . . . . . . . . . . . . . 428diagonalizable . . . . . . . . . . . . . . 428eigenvalues and eigenvectors 407inverse matrix . . . . . . . . . . . . . . 395main diagonal . . . . . . . . . . . . . . 394matrix addition . . . . . . . . . . . . .387matrix multiplication . . . . . . . 389minor . . . . . . . . . . . . . . . . . . . . . . 398positive matrix . . . . . . . . . . . . . 551regular matrix . . . . . . . . . . . . . . 551scalar multiplication . . . . . . . . 386similarity . . . . . . . . . . . . . . . . . . . 426square matrix . . . . . . . . . . . . . . 383transpose . . . . . . . . . . . . . . . . . . . 424

median value . . . . . . . . . . . . . . . . . . . 350Metropolis–Hastings Algorithm . 590moment generating function . . . . 352mutually exclusive events . . . . . . . 235

Nnegative predictove value . . . . . . . 277Netwon’s Law of Cooling . . . . . . . 139Newton’s Law of Cooling

equilibrium . . . . . . . . . . . . . . . . . 180normal r.v. . . . . . . . . . . . . . . . . . . . . . 341

standard normal r.v. . . . . . . . 342

Pparallelogram law . . . . . . . . . . . . . . 374particular solution . . . . . . . . . . . . . . 452pdf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306phase line . . . . . . . . . . . . . . . . . . . . . . 170phase plane . . . . . . . . . . . . . . . . . . . . 193Poisson r.v. . . . . . . . . . . . . . . . . . . . . 294positive predictive value . . . . . . . . 277positive series . . . . . . . . . . . . . . . . . . 628probability . . . . . . . . . . . . . . . . . . . . . 235probability density function . . . . 306

Qquadratic formula . . . . . . . . . . . . . . 618

discriminant . . . . . . . . . . . . . . . . 619

Rrandom variable . . . . . . . . . . . . . . . . 237

continuous . . . . . . . . . . . . . . . . . .305discrete . . . . . . . . . . . . . . . . . . . . .238

random walk . . . . . . . . . . . . . . . . . . . 571directionally unbiased . . . . . . 581

recurrent state . . . . . . . . . . . . . . . . . 538null recurrent . . . . . . . . . . . . . . . 563positive recurrent . . . . . . . . . . . 563

reduced row echelon form . . . . . . .366row reduction . . . . . . . . . . . . . . . . . . 361

Ssample space . . . . . . . . . . . . . . . . . . . 234scalar . . . . . . . . . . . . . . . . . . . . . . . . . . 372selective diffusion . . . . . . . . . . . . . . . 143

equilibrium . . . . . . . . . . . . . . . . . 181sequence . . . . . . . . . . . . . . . . . . . . . . . 628sequential plot . . . . . . . . . . . . . . . . . . . 12series . . . . . . . . . . . . . . . . . . . . . . . . . . . 629similar matrices . . . . . . . . . . . . . . . . 426SIR model . . . . . . . . . . . . . . . . . . . . . .215SIRS model . . . . . . . . . . . . . . . . . . . . 218

Page 709: Calculus and Modeling for the Biological, Health, and ... · Contents Acknowledgementsi Prerequisitesii Contentsiii 0 Introduction1 1 Discrete Dynamical Systems5 1.1 Introduction

INDEX 700

skewness . . . . . . . . . . . . . . . . . . . . . . . 351solid of revolution . . . . . . . . . . . . . . 101standard deviation

continuous . . . . . . . . . . . . . . . . . .319discrete . . . . . . . . . . . . . . . . . . . . .282

Stirling’s Approximation . . . . . . . .573stochastic matrix . . . . . . . . . . . . . . . 525stochastic process . . . . . . . . . . . . . . 523system of differential equations . 437

homogeneous) . . . . . . . . . . . . . . 437matrix form (or vector form) 438

Ttrace . . . . . . . . . . . . . . . . . . . . . . . . . . . 476trace–determinant plane . . . . . . . . 478transient state . . . . . . . . . . . . . . . . . . 538transition probabilities . . . . . . . . . 524

matrix of . . . . . . . . . . . . . . . . . . . 525transpose . . . . . . . . . . . . . . . . . . . . . . .424triangle inequality . . . . . . . . . . . . . . 376

Uundetermined coefficients . . . . . . . 452uniform r.v. . . . . . . . . . . . . . . . . . . . . 325updating function . . . . . . . . . . . . . . . . .5

Vvariance

continuous . . . . . . . . . . . . . . . . . .319discrete . . . . . . . . . . . . . . . . . . . . .282

vector . . . . . . . . . . . . . . . . . . . . . . . . . . 370component . . . . . . . . . . . . . . . . . 370magnitude . . . . . . . . . . . . . . . . . . 375scalar multiplication . . . . . . . . 372vector addition . . . . . . . . . . . . . 372

vector plots . . . . . . . . . . . . . . . . . . . . 203

Zz-score . . . . . . . . . . . . . . . . . . . . . . . . . 343