Transcript
Page 1: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

A Calculus Approach to Mathematical Modeling

Marcel B. FinanArkansas Tech University©All Rights Reserved

Page 2: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

2

PREFACEMathematical modeling is a fastly developing science which is vitally importantto students majoring in the disciplince of mathematics. Not only should they beexposed to its utility, but they should also gain some basic experience and skillin using mathematics to provide quantified solutions to an increasing numberof society’s technical problems.The aim of this course is to teach undergraduate students how to become notonly competent mathematicians but also skilled users of mathematics in thesolution of problems arising in the real world. This will be achieved by requir-ing students to work on problems which give them some experience of applyingtheir mathematical knowledge to the sort of problems that arise in industry andcommerce.The only prerequisite for this course is a course in differential and integral cal-culus of one single variable.

Marcel B. FinanRussellville, ArkansasMay 2002.

Page 3: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

Contents

1 The Modeling Process 51.1 Introductory Remarks . . . . . . . . . . . . . . . . . . . . . . . . 51.2 A Mathematical Modeling Approach . . . . . . . . . . . . . . . . 51.3 An Example of a Mathematical Model . . . . . . . . . . . . . . . 6

2 Models in Management and Economics 112.1 Mathematics of Finance . . . . . . . . . . . . . . . . . . . . . . . 11

2.1.1 Short-Term Financing: Simple Interest . . . . . . . . . . . 112.1.2 Long-Term Financing: Compound Interest . . . . . . . . 142.1.3 Loans or Investments Problems: Annuity . . . . . . . . . 152.1.4 Amortization and Sinking Funds . . . . . . . . . . . . . . 23

2.2 Linear Programming and the Simplex Method . . . . . . . . . . . 252.3 Miscellaneous Models . . . . . . . . . . . . . . . . . . . . . . . . 34

3 Models in Physics and Engineering Sciences 513.1 Models Based on 1st Order Differential Equations . . . . . . . . 513.2 Models Based on 2nd Order Linear Differential Equations . . . . 573.3 Models Based on 1st Order Linear Difference Equations . . . . . 613.4 Models Based on Second Order Difference Equations . . . . . . . 653.5 Miscellaneous Models . . . . . . . . . . . . . . . . . . . . . . . . 72

4 Models in Computer Sciences 1014.1 Cryptography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1014.2 Basic Cryptographic Algorithms . . . . . . . . . . . . . . . . . . 1064.3 Asymmetric Algorithms: RSA Algorithm . . . . . . . . . . . . . 1084.4 Finite-State Automaton . . . . . . . . . . . . . . . . . . . . . . . 1104.5 Introduction to the Analysis of Algorithms . . . . . . . . . . . . 115

4.5.1 Time Complexity and O-Notation . . . . . . . . . . . . . 1154.6 Logarithmic and Exponential Complexities . . . . . . . . . . . . 1254.7 Θ- and Ω-Notations . . . . . . . . . . . . . . . . . . . . . . . . . 130

3

Page 4: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

4 CONTENTS

Page 5: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

Chapter 1

The Modeling Process

1.1 Introductory Remarks

The process of representing a phenomenon mathematically, i.e. by means of afunction or an equation, is referred to as mathematical modeling. In thischapter we will introduce the reader to the basic elements of mathematicalmodeling. We will discuss how mathematical models are formulated, solved andapplied, and a concise description of the mathematical techniques used in theprocess.The models in this course have been taken mainly from management, economics,physics, engineering, life sciences, and computer sciences.

1.2 A Mathematical Modeling Approach

The mathematical modeling approach to problem solving that we will adopt inthis course consists of the following five steps:1. Ask a question.2. Set up a model.3. Formulate the mathematical model.4. Solve the mathematical model.5. Answer the question.We can summarise these steps of modeling into three stages:formulation, solu-tion, and application. The formulation stage consists of steps 1 through 3. Thesolution stage consists of step 4, and the application stage consists of step 5.These stages are important in modeling however not all modeling will followthis exact pattern. This is just a guide to what modeling is about.

5

Page 6: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

6 CHAPTER 1. THE MODELING PROCESS

1.3 An Example of a Mathematical Model

In this section we discuss a simple example to illustrate the modeling processdiscussed in the previous section:

Ms. Brown has $1, 000 to invest. If invested with the NBA bank, interest willbe compounded annually at 7%, but if invested with the NFL bank, interest ispaid at the nominal annual rate of 6.9% but compounded monthly. Ms. Brown’sproblem is to know which account will, at the end of the year, have the largervalue.

Step 1. We would like to know which choice is the best for Ms. Brown. Wouldit be investing with NBA bank or the NFL bank?

Step 2. We introduce the variables that we need in our model. Let P be thepresent value or the money to be invested, i.e. P = $1, 000; S be the futurevalue or the amount to which P would have grown if deposited in an interestbearing bank account; r be the annual nominal rate (APR) compounded n timesa year; and t be the period of investment.

Step 3. In this step we will find the relationship between P,A, r, n, and t. Atthe end of the first period, the balance is P + r

nP = P (1+ rn ). At the end of the

second period the balance in the account is P (1+ rn )+ r

nP (1+ rn ) = P (1+ r

n )2.Continuing in this fashion, we find that the balance at the end of the thirdperiod is P (1 + r

n )3 and at the end of the first year the balance in the accountwill be P (1 + r

n )n. Repeating this, we find that the balance at the end of thesecond year of investment is P (1 + r

n )2n and if the investment is over t yearsthen the amount of money in the account will be

A = P (1 +r

n)nt.

Step 4. Next we use the data given in the problem. We will see which deal isbetter by computing the effective annual rate. In this case, t = 1. If money isinvested in the NBA bank, then r = .07 and n = 1 so that

A = 1, 000(1 + .07) = $1, 070

and therefore the effective annual rate is 7% which is the nominal interest rate.If money is rather invested in the NFL bank then r = .069 and n = 12 so that

A = 1, 000(1 +0.06912

)12 ≈ $1071.22

and in this case the effective annual rate is 7.1%.

Step 5. As a conclusion to our solution, Ms. Brown would be advised to in-vest with NFL bank.

Page 7: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

1.3. AN EXAMPLE OF A MATHEMATICAL MODEL 7

Class Activity 1.1:• Let P be the amount of deposit and r the interest per unit time period for anaccount which pays simple interest, that is, at the end of each time period, theinterest payable is rP. Let A be the total amount in the account after n timeperiods. Find the relationship among A,P, r, and n.• Assuming simple interest at 7% per year, what is the present value of receiving$1, 000 in 4 years’ time?

Solution.

Page 8: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

8 CHAPTER 1. THE MODELING PROCESS

Class Activity 1.2Two years ago your parents purchased a home by financing $80, 000 for 20 years,paying monthly payments of $880.87 with a monthly interest of 1%. They havemade 24 payments and wish to know how much they owe on the mortgage,which they are considering paying off with an inheritance they received. Hint:Let bn be the amount owed after n months. Find a relationship between bn+1

and bn.The important mathematical concept introduced in this problem is the conceptof a sequence. A sequence is a function f with domain the set of nonnegativeintegers. We write f(n) = an or simply an∞n=0. We call an the nth term.Solution.

Page 9: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

1.3. AN EXAMPLE OF A MATHEMATICAL MODEL 9

Class Activity 1.3Find a formula for the nth term of the sequence.

(a) 1, 4, 16, 64, 256, · · ·.(b) 2, 0, 2, 0, 2, 0, · · ·.

Solution.

Page 10: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

10 CHAPTER 1. THE MODELING PROCESS

Project IYou wish to buy a new car and narrow your choices to a Saturn, Cavalier, andHyundai. Each company offers its best deal:

Saturn $13, 990 $1, 000 down 3.5% interest for up to 60 monthsCavalier $13, 550 $1, 500 down 4.5% interest for up to 60 monthsHyundai $12, 400 $500 down 6.5% interest for up to 48 months

You are able to spend at most $475 a month on a car payment. Determinewhich car to buy.

Solution.

Page 11: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

Chapter 2

Models in Management andEconomics

2.1 Mathematics of Finance

In this chapter we will develop the formulas to solve various sorts of present-valueor future-value problems such as loans, savings accounts and other investments,mortgages, and annuities. As you’ll notice, though there are lots of names forthese problems they’re really all the same thing looked at from different angles.

2.1.1 Short-Term Financing: Simple Interest

Interest is the rent or fee charged for the use of money. In other words interestis what you pay for the use of somebody else’s money. Or it is what somebodyelse pays for the use of your money.The principal is the amount of money borrowed or loaned.The rate of interest is the percentage of the principal that will be chargedto the borrower or paid to the lender over a specific period of time usually oneyear.Most people are both borrowers and lenders. They owe money on a home mort-gage or on a car loan. However, when you make a deposit into your savingsaccount you are lending the money to the bank.

Simple interest is only charged on the original principal and is paid at theend of the term of the loan:

Interest = Principal ×Rate× Time

orI = Prt

11

Page 12: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

12 CHAPTER 2. MODELS IN MANAGEMENT AND ECONOMICS

where I is the amount of simple interest, P is the principal amount invested, ris the annual interest rate, and t is the time period in years.Note that if any three of the four variables I, P, r, or t are known the formulashown above may be easily manipulated to solve for the unknown variable.

Class Activity 2.1• What amount of interest will be charged if $5, 000 is borrowed for 8 monthsat a simple rate of interest of 8.5% per year?• What principal will earn $75 in interest if it is invested at 7.5% simple interestfor 6 months?• Determine the annual rate of simple interest required for $900 to earn $90 ininterest in 16 months?• How long will it take a principal of $1, 200 to earn $80 in interest at 9.5%simple interest?

Solution.

Page 13: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

2.1. MATHEMATICS OF FINANCE 13

The maturity value or future value S of an investment is defined to be asthe sum of the principal and the interest. That is,

S = P + I = P (1 + rt).

Class Activity 2.2• Find the maturity value of $2, 000 invested for 2 years at 7.5% simple interest.• Find the principal that will amount to $3, 000.00 in 18 months if money isworth 6.5% simple interest.• A debt can be paid off by making payments of $1, 000 two years from nowand $2, 500 five years from now. Determine the single equivalent payment madenow that would settle the debt if money is worth 8.5% simple interest.

Solution.

Page 14: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

14 CHAPTER 2. MODELS IN MANAGEMENT AND ECONOMICS

2.1.2 Long-Term Financing: Compound Interest

The term compound interest refers to a procedure for computing interestwhereby the interest for a specified interest period is added to the originalprincipal. The resulting sum becomes a new principal for the next interestperiod. The interest earned in the earlier interest periods earn interest in thefuture interest periods.The future value is the total amount due on the maturity date of the loanor the investment. The maturity value is calculated by using the compoundamount formula which is given by

A = P (1 +r

n)nt

where P is the present value or principal, r is the nominal annual interest rate,n is the number of periods in a year, and t is the time in years.Possible values of n are: 1 (annually), 2 (semiannually), 4 (quarterly), 12(monthly), and 365 (daily).When interest is compounded more frequently than once a year, the accounteffectively earns more than the nominal rate. Thus, we distinguish betweennominal rate and effective rate. The effective annual rate tells how much in-terest the investment actually earns. The quantity (1+ r

n )n− 1 is known as theeffective interest rate.

Class Activity 2.3• Translating a value to the future is referred to as compounding. What willbe the maturity value of an investment of $15, 000 invested for four years at9.5% compounded semi-annually?• Translating a value to the present is referred to as discounting. We call(1 + r

n )−nt the discount factor. What principal invested today will amountto $8, 000 in 4 years if it is invested at 8% compounded quarterly?• What is the effective rate of interest corresponding to a nominal interest rateof 5% compounded quarterly?

Solution.

Page 15: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

2.1. MATHEMATICS OF FINANCE 15

2.1.3 Loans or Investments Problems: Annuity

An annuity is an account to which regular payments are made. We start bylooking at a loan type problems. Let A be the original amount of a loan; P bethe amount of each payment of a loan or periodic payment; r is interest rateper unit period; and Bn the loan balance after n payments have been made alsoknown as payoff amount.We start first by finding a formula for Bn.

Class Activity 2.4:• What is the value of B0?• What are the values of B1, B2, B3?• Find a compact form for the sum

Sn = 1 + (1 + r) + (1 + r)2 + · · ·+ (1 + r)n−1.

• Find a formula for Bn in terms of A, n, P, and r.• You have a $18, 000 car loan at 14.25% for 36 months. You have just madeyour 24th payment of $617.39 and you would like to know the payoff payment.

Solution.

Page 16: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

16 CHAPTER 2. MODELS IN MANAGEMENT AND ECONOMICS

Class Activity 2.5:• What will the payment amount P be for a certain number of payments?• You are buying a $250, 000 house, with 10% down, on a 30-year mortgageat a fixed rate of 7.8%. What is the monthly payment? What is B12? Whatconclusion can you make from that?

Solution.

Page 17: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

2.1. MATHEMATICS OF FINANCE 17

Class Activity 2.6:• Suppose now that you know your periodic payment P and you want to figureout a formula for the total number of payments n. Find that formula.• Mr. X offers to lend you $3, 500 at 6% for that new stereo you want. Ifyou pay him back $100 a month, how long will it take? What will be the finalpayment?

Solution.

Page 18: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

18 CHAPTER 2. MODELS IN MANAGEMENT AND ECONOMICS

Class Activity 2.7:• Suppose you know what monthly payment you can afford, and about whatinterest rate you’d be paying. From that, can you figure how big a purchaseyou can afford? So suppose you know the payment amount P, the interest rater, and the number of payments n. How much are you actually borrowing (i.e.what is A?)• You’re looking to buy furniture for your living room. You can afford to payabout $60 a month over the next three years, and your credit card charges 16.9%interest. How much furniture can you buy?

Solution.

Page 19: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

2.1. MATHEMATICS OF FINANCE 19

Now, solving a problem of an investment type or annuity type is just a varia-tion of the loan type discussed above. For example, a savings account can beregarded as a loan from you to the bank. The difference is that payments canbe made into the account or withdrawn from the account: In the first case wecall them deposits while in the second they are referred to as withdrawals. Inthe formula for Bn, We count a withdrawal as positive P and a deposit as anegative P (since deposit must increase your balance whereas withdrawals mustdecrease your balance.)

Class Activity 2.8:At the end of every month, you put $100 into a mutual fund that pays 6%. Howmuch will you have at the end of five years?

Solution.

Page 20: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

20 CHAPTER 2. MODELS IN MANAGEMENT AND ECONOMICS

An annuity is a contract, usually with an insurance company, for you to receivea fixed amount of money at stated intervals, usually monthly. This is also thesame as a loan, except that the payments move only one way.Whole life insurance works this way once you cash it in: you can take the cashvalue of the insurance or use it to buy an annuity. You can also purchase theannuity with a lump sum. (An insurance annuity is typically more complicated,because it factors in your life expectancy. The payments are lower than theywould otherwise be, because the company guarantees to pay you until you die,or to pay your heirs for the stated period if you die early. Here we’re just con-cerned with a straight annuity that pays for a definite period.)

Class Activity 2.9:You want to purchase a 20-year annuity that will pay $500 a month. If theguaranteed interest rate is 4%, how much will the annuity cost?

Solution.

Page 21: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

2.1. MATHEMATICS OF FINANCE 21

Class Activity 2.10:Suppose you have a goal, and you need to come out with a plan for how toreach it. In other words, you know a future value F that you want to reach, bymaking n periodic payments P that earn interest r.• Find an explicit formula for the periodic payment P in terms of F, n, and r.• You’re saving up for a down payment on a house. You expect to buy in aboutfive years, and you’ll be looking in the $250, 000 range. You need to make atleast a 10% down payment, plus $2, 500 for closing costs. If your money fundpays 5.5%, how much a month do you need to deposit?

Solution.

Page 22: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

22 CHAPTER 2. MODELS IN MANAGEMENT AND ECONOMICS

Class Activity 2.11:• Suppose you need to meet an investment goal. You know how much a monthyou can save, and what interest you’ll earn. How long it will take to reach yourgoal?• On the same day every year, you put $2, 000 into stocks. If the market rises8% a year, how many years will it take you to accumulate $40, 000?

Solution.

Page 23: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

2.1. MATHEMATICS OF FINANCE 23

2.1.4 Amortization and Sinking Funds

Some loans are made so that only interest payments are made on a periodic ba-sis with the principal due in whole at some future dates. In order to accumulatemoney to pay off the principal one might set up a seperate fund, called a sink-ing fund. The interest earned on the sinking fund will in general be differentfrom that on the loan. Now, the question of finding P in Class Activity 2.5 isreferred to as the amortization problem.

Class Activity 2.12A car loan for $20, 000 can be made for 5 years at 12% with interest only at theend of each year, the balance is due at the end of 5 years. A sinking fund canbe set up at 9% to accumulate the balance at the end of 5 years.

(a) What are the total annual payments needed to cover the interest on thecar loan and the payments to the sinking fund?(b) What interest rate r on an amortized loan result in the same payments?

Solution.

Page 24: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

24 CHAPTER 2. MODELS IN MANAGEMENT AND ECONOMICS

Project IIConsider the value of a savings certificate initially worth $1000 that accumulatesinterest paid each month at 1% per month. Let an be the value of the certificateafter n months. Find a formula for an in terms of n.

Solution.

Page 25: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

2.2. LINEAR PROGRAMMING AND THE SIMPLEX METHOD 25

2.2 Linear Programming and the Simplex Method

In this section we discuss a powerful method in optimizing a function subject tocertain constraints. Mathematical programming is a field of mathematicsthat deals with the maximization or minimization of objective functions thatare subject to constraints. A word of caution of what is meant by the word”programmig.” In this context, ”programming” stands for ”planning.”By an objective function we mean a function in one or more variables thatone is interested in either maximizing or minimizing. The function could repre-sent the cost or profit of some manufacturing process.Constraints are equalities or inequalities that describe restrictions involvedwith the minimization or maximization of the objective function.Linear Programming (LP) is a subcategory of mathematical programming.As the name suggests, both the objective function and the constraints are linear,i.e. of the form a1x1 + a2x2 + · · ·+ anxn + b.

A standard form LP has the following characteristics:

• the objective function must be maximized,• all variables in the problem are nonnegative,• all constraints are in the form

a1x1 + a2x2 + · · ·+ anxn ≤ nonnegative number

ExampleBecause of new federal regulations on pollution, a chemical plant introduced anew, more expensive process to supplement or replace an older process used inthe production of a particular chemical. The older process emitted 15 grams ofsulfur dioxide and 40 grams of particulate matter into the atmosphere for eachgallon of chemical produced. The new process emits 5 grams of sulfur dioxideand 20 grams of particulate matter for each gallon of chemical produced. Thecompany makes a profit of 30 cents per gallon and 20 cents per gallon on theold and new processes respectively. If the government allows the plant to emitno more than 10,500 grams of sulfur dioxide and no more than 30,000 grams ofparticulate matter daily, how many gallons of the chemical should be producedby each process to maximize daily profit? What is the maximum profit?

Let x1 be the number of gallons produced by the old process and x2 be thenumber of gallons produced by the new process. Then the problem is an LPproblem.

Maximize: P = .3x1 + .2x2

Subject to:

15x1 + 5x2 ≤ 10, 50040x1 + 20x2 ≤ 30, 000x1, x2, ≥ 0

Page 26: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

26 CHAPTER 2. MODELS IN MANAGEMENT AND ECONOMICS

By graphing the constraints we find the following region known as the feasibleregion.

Feasible Region in Red

–2

–1

1

2

–1 –0.5 0.5 1

Thus, the feasible region is the set of points that satisfy all of the constraints ofa linear program. A point in the feasible region is called a feasible solution.Note that a feasible region can be either bounded or unbounded. The graphs ofthe constraints when considered as equalities are called the edges of the feasibleregion. The intersection of two edges is called a vertex.

Linear programming problems are usually solved by the Simplex Method whichwe start by discussing its steps. We will use the previous example as a reference.

Step 1.All inequality constraints must be converted to equalities by using slack vari-ables.

15x1 + 5x2 + s1 = 10.540x1 + 20x2 + s2 = 30−.3x1 − .2x2 + P = 0x1, x2, s1, s2, ≥ 0

Step 2.Set up the initial tableau. Label the rows. The bottom row always has the labelP . The other rows are labeled by the variable that heads the column with a 1in that row and zeros as all other entries in that column obtaining

x1 x2 s1 s2 Ps1 15 5 1 0 0 10.5s2 40 20 0 1 0 30P −.3 −.2 0 0 1 0

At this stage, s1, s2 are referred to as basic variables and x1, x2 as non-basic variables.

Page 27: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

2.2. LINEAR PROGRAMMING AND THE SIMPLEX METHOD 27

Step 3.Decide which non-basic variable to make basic, i.e. which variable should ”en-ter” the set of basic variables. This is the pivot column which is the columncontaining the negative number of largest magnitude in the bottom row (otherthan the last column.) In this case, the entering variable is x1. Note that ifthere are more than one candidates then you can choose either one. Now, ifnone of the numbers is negative then stop.

x1 x2 s1 s2 Ps1 15 5 1 0 0 10.5s2 40 20 0 1 0 30P −.3 −.2 0 0 1 0

↑Step 4.Decide which basic variable to make nonbasic. This is the variable ”exiting” theset of basic variables. Its row is called the pivot row. It is found as follows. Ineach row except the one for the objective variable (bottom row), calculate theratio

entry in rightmost column

entry in the pivot column.

The pivot row is the row for which this ratio is the smallest non-negative num-ber. Since 10.5

15 = 0.70 and 3040 = 0.75 then the exiting variable is s1. Note that

if all entries in the pivot column are nonpositive (i.e. ≤ 0) then the feasibleregion is unbounded and there is no solution. Note also that 0÷ 1 is consideredpositive and 0÷ (−1) is considered negative even though both are numericallyzero.

Step 5.The pivot element is the intersection of the pivot column and the pivot row.In this case, it is 15. Now, divide the pivot row by 15 to make the pivot element1. Thus, obtaining

x1 x2 s1 s2 Px1 1 .333 .066 0 0 .70s2 40 20 0 1 0 30P −.3 −.2 0 0 1 0

Step 6.Get a 0 in every entry of the pivot column except the pivot element obtaining acolumn of a basic variable. In our problem we perform the following elementaryrow operations: Replace the second row R2 by R2− 40R1 and R3 by R3 + .3R1

to obtain the new tableau

Page 28: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

28 CHAPTER 2. MODELS IN MANAGEMENT AND ECONOMICS

x1 x2 s1 s2 Px1 1 .333 .066 0 0 .70s2 0 6.666 −2.66 1 0 2P 0 −.1 .02 0 1 .21

This tableau corresponds to the feasible basic solution (i.e. a vertex of fea-sible region) (.7, 0). Now we repeat the above algorithm.

Step 3.The entering variable is x2 so that the column of x2 is the pivot column.Step 4.Since .7

.333≈ 2.1 and 2

6.666≈ .3 then the exiting variable is s2 so that the row of

s2 is the pivot row.Step 5.Divide the pivot row by the pivot element 6.666 obtaining

x1 x2 s1 s2 Px1 1 .333 .066 0 0 .70x2 0 1 −.4 .15 0 .3P 0 −.1 .02 0 1 .21

Step 6.To get zeros in the x2 column (except in the second row) we perform the fol-lowing operations: Replace R1 by R1 − 0.333R2 and replace R3 by R3 + .1R2

obtaining

x1 x2 s1 s2 Px1 1 0 .2 −0.05 0 .6x2 0 1 −.4 .15 0 .3P 0 0 −.02 0.015 1 .24

This tableau corresponds to the basic feasible solution (.6, .3)

Step 3.The entering variable is s1 so that the column of s1 is the pivot column.Step 4.Since .6

.2 = 3 and .3−.4 < 0 (ignore) then the exiting variable is x1 so that the

row of x1 is the pivot row.Step 5.Divide the pivot row by the pivot element .2 obtaining

x1 x2 s1 s2 Ps1 5 0 1 −.25 0 3x2 0 1 −.4 .15 0 .3P 0 0 −.02 0.015 1 .24

Step 6.To get zeros in the s1 column (except in the first row) we perform the follow-

Page 29: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

2.2. LINEAR PROGRAMMING AND THE SIMPLEX METHOD 29

ing operations: Replace R2 by R2− .4R1 and replace R3 by R3− .2R1 obtaining

x1 x2 s1 s2 Ps1 5 0 1 −.25 0 3x2 2 1 0 .05 0 1.5P .1 0 0 0.01 1 .3

Thus, the bottom row has all nonnegative entries so that the optimal solutionaccurs at (0, 1.5) and the maximum profit is $300.

Page 30: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

30 CHAPTER 2. MODELS IN MANAGEMENT AND ECONOMICS

Class Activity 2.13Maximize: P = 10x1 + 50x2 + 10x3

Subject to:

3x1 + 3x2 + 3x3 ≤ 666x1 − 2x2 + 4x3 ≤ 483x1 + 6x2 + 9x3 ≤ 108x1, x2, x3, ≥ 0

Solution.

Page 31: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

2.2. LINEAR PROGRAMMING AND THE SIMPLEX METHOD 31

Class Activity 2.14The Precision Tool Company is a manufacturer of precision screws. It has twomain lines, wood screws and metal screws, which it sells for $20 and $25 re-spectively per box. The material costs for each box are $10 and $8 respectively,and overhead costs are $5, 000 per week. All the screws have to pass through aslotting and a threading machine. A box of wood screws requires 3 minutes inthe slotting machine and 2 minutes on the threading machine, whereas a boxof metal screws requires 2 minutes on the slotting machine and 8 minutes onthe threading machine. In a week, each machine is available for 60 hours. Thecompany wishes to maximize its weekly earnings.

Solution.

Page 32: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

32 CHAPTER 2. MODELS IN MANAGEMENT AND ECONOMICS

Class Activity 2.15A finance company has a total of $20 million between home loans and car loans.Home loans return 10% and car loans return 12% per year. However, the amountin home loans must be at least four times the amount in car loans. How muchon each type of loan in order to maximize the return?

Solution.

Page 33: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

2.2. LINEAR PROGRAMMING AND THE SIMPLEX METHOD 33

Project IIIA carpenter makes tables and bookcases. He is trying to determine how manyof each type of furniture he should make each week. The carpenter wishes to de-termine a weekly production for tables and bookcases that maximize his profits.It costs $5 and $7 to produce tables and bookcases respectively. The carpenterrealizes a net unit profit of $25 per table and $30 per bookcase. He has up to 600board feet of lumber to devote weekly and up to 40 hours of labor. He estimatesthat it requires 20 board feet of lumber and 5 hours of labor to complete a tableand 30 board feet of lumber and 4 hours of labor for a bookcase. Moreover,he has signed a contract to deliver four tables and two bookcases every week.The carpenter wishes to determine a weekly production schedule for tables andbookcases that maximizes his profits.(Remark: When using slack variables, a constraint in the form ax + by ≥ c isreplaced by ax + by − s = c, where s ≥ 0.)Solution.

Page 34: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

34 CHAPTER 2. MODELS IN MANAGEMENT AND ECONOMICS

2.3 Miscellaneous Models

We conclude this chapter by discussing various models that arise in the field ofEconomics.Background: A polynomial of degree n is an expression of the form P (x) =anxn + an−1x

n−1 + · · ·+ a1x + a0. A rational function is a function that canbe written as the ratio of two polynomials. If in the long run the functionapproaches a value a then we call the line y = a a horizontal asymptote.Geometrically, this says that as x → ∞ or x → −∞ the graph of the functionis close to the value a. Be aware that a graph can cross a horizontal asymptotein the short run behavior but not in the long run behavior. Another importantfact to remember here is the limit

limx→±∞

c

xn= 0.

Model Problem 1. The Bakewell Organization has spent an increasing per-centage of gross income from its sale of baked beans on media advertising bothin the press and on television. There has been no doubt that this effort has beensuccessful in achieving widespread awareness of Bakewell’s product. The issuethat the Chairman has posed to his marketing director is how much should theyspend on overall advertising. While their experience so far suggests that adver-tising increases sales, there is some doubt whether this effect will be maintainedindefinitely.Fitting a curve to the graph of company profits y the total advertising expen-diture x has produced the formula

y =22x + 11

x + 2

linking profits and advertising, where x and y are measured in $100, 000s.Before presenting these results to his chairman, the marketing director wishesto determine:(i) Is the model realistic in that profit increases with advertising expenditure?(ii) Do profits increase indefinitely with advertising expenditure, or is there somefixed value which they can never exceed?

Solution.

Page 35: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

2.3. MISCELLANEOUS MODELS 35

Background: Recall that if q is the quantity demanded of a product at a unitprice p then the revenue function R is the product of p and q. If C is the costfunction and R is the revenue function then the profit function P is the differ-ence R− C.

Model Problem 2. An old establishing engineering firm, Wonder Works, hasdesigned a stabilized children’s bicycle of revolutionary design which is aboutto be put into production, but the board has met to discuss the recommendedselling price of the Wonderbike, as the marketing division believes that thiswill strongly influence the number sold and thus the production ordered. Themarketing director estimates that if the selling price is fixed at $50 then 5500bicycles will be sold in the first month, whereas if the price is doubled to $100only 1000 will be sold. He believes that the relation between selling price p andthe quantity demanded q is linear and therefore given by the demand equation

q = 10, 000− 90p

The marketing director suggests that the selling price be fixed at the value p forwhich revenue achieves its maximum. The production manager is quick to pointout that this need not maximize profits. The Chairman then puts the question”What should the selling price p of each Wonderbike be in order to give thelargest possible company profit”? Assume that the cost function is linear andis given by C(p) = 704, 000− 6300p.

Solution.

Page 36: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

36 CHAPTER 2. MODELS IN MANAGEMENT AND ECONOMICS

Background: Piecewise Defined Functions. A piecewise defined function isa function which is defined explicitly by more than one expression. For example,the absolute value function f(x) = |x| is a piecewise defined function since

f(x) =

x, if x ≥ 0−x, if x < 0

Model Problem 3. A bus charter company offers a travel club the followingarrangements: If no more than 100 people go on a certain tour, the cost will be$500 per person, but the cost per person will be reduced by $4 for each personin excess of 100 who takes the tour.

a. Express the total revenue R obtained by the charter company as a func-tion of the number of people who go on the tour.b. Sketch the graph R. Estimate the number of people that results in the great-est total revenue for the charter company.

Solution.

Page 37: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

2.3. MISCELLANEOUS MODELS 37

Background: This model requires the use of the concept of piecewise definedfunctions and the process of finding the coordinates of the point of intersectionof two curves. Recall that in order to find the point of intersection of two curves,express y in terms of x in the first equation and plug in this expression in thesecond equation to obtain an equation in the variable x. Solve this new equationfor x and then use either of the original equations to find the value of y.Model Problem 4. The famous author John Uptight must decide betweentwo publishers who are vying for the rights to his new book, Zen and the Artof Taxidermy. Publisher A offers royalties of 1% of net proceeds on the first30, 000 copies sold and 3.5% on all copies in excess of that figure, and expectsto net $2 on each copy sold. Publisher B will pay no royalties on the first 4, 000copies sold but will pay 2% on the net proceeds of all copies sold in excess of4,000 copies, and expects to net $3 on each copy sold.

a. Express the revenue PA John should expect if he signs with Publisher Aas a function of books sold, x. Likewise, find the revenue PB associated withPublisher B.b. Sketch the graphs of PA(x) and PB(x) on the same coordinates axes.c. For what value(s) of x are the two offers equivalent?d. With whom should he sign if he expects to sell 5,000 copies? 100,000 copies?e. State a simple criterion for determining which publisher he should choose ifhe expects to sell N copies.

Solution.

Page 38: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

38 CHAPTER 2. MODELS IN MANAGEMENT AND ECONOMICS

Background: The sensitivity of demand to changes in price varies with theproduct. For example, a change in the price of light bulbs may not affectthe demand for light bulbs much, whereas a change in the price of a particularmake of a car have a significant effect on the demand for that car. An importantquantity in economic analysis is the elasticity of demand, defined by

E =∣∣∣∣p

q

dq

dp

∣∣∣∣

where q is the number of units of a commodity demanded when the price is pdollars per unit. Changing the price of an item by 1% causes a change of E %in the quantity of goods sold. If E > 1, a one percent increase in price causesdemand to drop by more than one percent. In this case we say that demand iselastic. If 0 ≤ E < 1, a one percent increase in price causes demand to dropby less than one percent, and we say that the demand is inelastic. In general,if the elasticity is large, then a change in price will cause a large change in thenumber of sales.Model Problem 5.(a) Show that

dR

dq=

R

q

[1± 1

E

].

That is the marginal revenue is (1± 1E ) times the average revenue.

(b) Raising the price of hotel rooms from $ 75 to $ 80 per night reduces weeklysales from 100 rooms to 90 rooms. What is the elasticity of demand for roomsat a price of $ 75? Should the owner raise the price?

Solution.

Page 39: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

2.3. MISCELLANEOUS MODELS 39

Background: In economics and business, the terms marginal cost, marginalrevenue, and marginal profit are used for the rate of change of cost, revenue,and profit. The term marginal is used to highlight the rate of change as anindicator of how the cost, revenue, or profit changes in response to a one unit(i.e. marginal) change in the independent variable.The net earnings of an industrial process for the production range a ≤ x ≤ bare given by the definite integral

∫ b

a

P ′(x)dx

where P (x) = R(x)−C(x). Geometrically, the net earnings is the area betweenthe curves R′(x) and C ′(x).Model Problem 6. For a certain industrial process, the marginal cost andmarginal revenue (in thousands of dollars) associated with producing x unitsare

C ′(x) = 0.1x2 + 4x + 10 and R′(x) = 70− x

respectively. What are the net earnings of the process as x ranges from x = 0to x = xm, where xm is the level of production at which marginal cost equalsmarginal revenue?

Solution.

Page 40: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

40 CHAPTER 2. MODELS IN MANAGEMENT AND ECONOMICS

Background: The process of finding the maximum or minimum of a functionis called optimization. A general optimization procedure consists of the fol-lowing steps:

a. Draw a figure if possible and label all the quantities relevant to the problem.b. Focus on the quantity to be optimized. Name it. Find a formula for thequantity to be maximized or minimized.c. Use conditions in the problem to eliminate variables in order to express thequantity to be optimized in terms of a single variable.d. Find the practical domain for the variables in step c.e. Use the method of calculus to find the maximum or the minimum.

Model Problem 7. An efficiency study of the morning shift at a factory in-dicates that the number of units produced by an average worker t hours after8:00 A.M. may be modeled by the formula

Q(t) = −t3 + 9t2 + 12t.

At what time in the morning is the worker performing most efficiently?

Solution.

Page 41: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

2.3. MISCELLANEOUS MODELS 41

Background: To optimize a continuous function over an interval [a, b] we pro-ceed as follows:

(a) Find the critical points of f in the interval [a, b].(b) Evaluate f at the critical points found in (a).(c) Evaluate f at the endpoints.(d) The largest value in (b)-(c) is the maximum of f and the smallest value isthe minimum of f.

Model Problem 8. A manufacturer can produce a pair of earrings at a cost of$3. The earrings have been selling for $ 5 per pair and at this price, consumershave been buying 4,000 pairs per month. The manufacturer is planning to raisethe price of the earrings and estimates that for each $ 1 increase in the price,400 fewer pairs of earrings will be sold each month. At what price should themanufacturer sell the earrings to maximize profit?

Solution.

Page 42: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

42 CHAPTER 2. MODELS IN MANAGEMENT AND ECONOMICS

Background: The revenue function can be expressed in terms of p and q by theformula R(q) = pq. Now, recall from calculus that if the derivative of a functionf is given then one can find f by integration. That is,

f(x) =∫

f ′(x)dx

Model Problem 9. A manufacturer estimates that the marginal revenue of acertain commodity is R′(q) = 240 + 0.1q when q units are produced. Find thedemand function p as a function of q.

Solution.

Page 43: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

2.3. MISCELLANEOUS MODELS 43

Background: This problem requires the understanding of the content of Sec-tion 3.1. The reader is encouraged to read that section before attempting tosolve the problem. Also, integration by parts is needed in the process.

Model Problem 10. The Evans price-adjustment model assumes that ifthere is an excess demand D over supply S in any time period, the price pchanges at a rate proportional to the excess,D − S, that is,

dp

dt= k(D − S).

Suppose that for a certain commodity, demand is linear,

D(p) = c− pd

and supply is cyclicalS(t) = a sin (bt).

Solve the differential equation to express price p(t) in terms of a, b, c, and d.

Solution.

Page 44: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

44 CHAPTER 2. MODELS IN MANAGEMENT AND ECONOMICS

Background: The geometric series∑∞

k=0 axk diverges for |x| ≥ 1 and convergesfor |x| < 1 with sum

∞∑

k=0

axk =a

1− x.

Model Problem 11. Suppose that nationwide approximately 90% of all in-come is spent and 10% is saved. How much total spending will be generated bya $40 billion tax rebate if savings habits do not change?

Solution.

Page 45: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

2.3. MISCELLANEOUS MODELS 45

Background: The graph of a function is concave up if it bends upward aswe move left to right. This means that the slope of the tangent line gets eithermore and more positive or less and less negative. The garph is concave down-ward if it bends downward. This happens when the slope of the tangent line iseither getting less and less positive or more and more negative. A line is neitherconcave up nor concave down.

Model Problem 12. When a new product is advertised, more and more peo-ple try it. However, the rate at which new people try it slows as time goes on.

(i) Sketch a graph of the total number of people who have tried such prod-uct against time.(ii) What do you know about the concavity of the graph?

Solution.

Page 46: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

46 CHAPTER 2. MODELS IN MANAGEMENT AND ECONOMICS

Background: Recall that a function takes an x-value to a unique y-value. Insome cases, one can consider the opposite process. That is, for each y-valuethere is a unique x-value. In this case we say that the given function has aninverse function. Geometrically, a function has an inverse function if and onlyif its graph intersects any horizontal line at most once. Algebraically, to findthe formula for the inverse function, we solve for x in terms of y.

Model Problem 13. The cost of producing q articles is given by the followingfunction f(q) = 100 + 2q.

(i) Find a formula for the inverse function f−1.(ii) Explain in practical terms what the inverse function tells you.

Solution.

Page 47: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

2.3. MISCELLANEOUS MODELS 47

Background: Recall the definition of the derivative:

f ′(a) = limh→0

f(a + h)− f(a)h

.

Thus, for h small, we can write

f ′(a) ≈ f(a + h)− f(a)h

orf(a + h) ≈ hf ′(a) + f(a).

Model Problem 14. The ”Rule of 70” is a rule of thumb to estimate how longit takes money in a bank to double. Suppose the money is in an account earningi% annual interest rate, compounded yearly. The Rule of 70 says that the timeit takes the amount of money to double is approximately 70

i years, assuming iis small. Find a local linearization of ln (1 + x), and use it to explain why thisrule works.

Solution.

Page 48: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

48 CHAPTER 2. MODELS IN MANAGEMENT AND ECONOMICS

Background: Optimization problem.

Model Problem 15. A company manufactures only one product. The quan-tity, q, of this product produced per month depends on the amount of capital ,K, invested and the amount of labor , L, available each month. Assume that qcan be expressed as a Cobb-Douglas production function:

q = cKαLβ

where c, α, β, are positive constants, with 0 < α < 1 and 0 < β < 1. In this prob-lem we will see how the Russian government could use a Cobb-Douglas functionto estimate how many people a newly privatized industry might employ. Acompany in such an industry has only a small amount of capital available to itand needs to use all of it, so K is fixed. Suppose L is measured in man-hours permonth, and that each man-hour costs the company w rubles (Russian currency).Suppose the company has no other costs besides labor, and that each unit ofthe good can be sold for a fixed price of p rubles. How many man-hours of laborper month should the company use in order to maximize its profit?

Solution.

Page 49: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

2.3. MISCELLANEOUS MODELS 49

Background: Geometric series. See Problem 11.

Model Problem 16. This problem illustrates how banks create credit and canthereby lend out more money than has been deposited. Suppose that initially$100 is deposited in a bank. Experience has shown bankers that on the averageonly 8% of the money deposited is withdrawn by the owner at any time. Con-sequently, bankers feel free to lend out 92% of their deposits. Thus, $ 92 of theoriginal $ 100 is loaned out to other customers( to start a business, for exam-ple). This $ 92 will become someone’s else income and, sooner or later, will beredeposited in the bank. Then 92% of $ 92, is loaned out again and eventuallyredeposited. Of the $92(0.92)=$ 84.64, the bank again loans out 92%, and so on.

(i) Find the total amount of money deposited in the bank as a result of thesetransactions.(ii) The total amount of money deposited divided by the original deposit iscalled the credit multiplier. Calculate the credit multiplier for this exampleand explain what this number tells us.

Solution.

Page 50: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

50 CHAPTER 2. MODELS IN MANAGEMENT AND ECONOMICS

Background: Every solution to the equation

dy

dt= ky

can be written in the formy = y(0)ekt

where k > 0 represents growth, whereas k < 0 represents decay.

Model Problem 17. A bank account earns interest continuously at a rateof 5% of the current balance per year. Assume that the initial deposit is $1,000,and no other deposits or withdrawals are made.

(i) Write the differential equation satisfied by the balance in the account.(ii) Solve the differential equation and graph the solution.

Solution.

Page 51: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

Chapter 3

Models in Physics andEngineering Sciences

In many models, we will have information relating a rate of change of a de-pendent variable with respect to one or more independent variables and areinterested in discovering the function relating the variables.

3.1 Models Based on 1st Order Differential Equa-tions

Many problems in applied mathematics and engineering are described by ordi-nary differential equations:

(i) Decay of a radioactive material: dydx = −ky.

(ii) Newton’s Second Law: md2xdt2 = F (t).

By a first order differential equation we mean an equation of the form

dy

dx= F (x, y) (3.1)

Suppose first that F (x, y) = f(x)g(y) . In this case, g(y)dy = f(x)dx. Integrating to

obtain ∫g(y)dy =

∫f(x)dx + C

where C is a constant of integration. This method of solution is called themethod of seperation of variables.

Class Activity 3.1Find the general solution to the equation dy

dx = ky.

51

Page 52: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

52 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Solution.

Page 53: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.1. MODELS BASED ON 1ST ORDER DIFFERENTIAL EQUATIONS 53

Next, suppose that (3.1) is rewritten in the form

dy

dx+ p(x)y = q(x) (3.2)

We call (3.2) a first order linear differential equation. Let’s try and solvethe above equation. Let r(x) be a function such that

d(r(x)y)dx

= r(x)q(x)

that is,r(x)y′ + r′(x)y = r(x)q(x).

Comparing this with (3.2) to obtain

r′(x) = p(x)r(x)

ordr

r= p(x)dx.

Integrating to obtain

ln |r| =∫

p(x)dx + C

Class Activity 3.2

(i) Show that r(x) = Ke∫

p(x)dx.

(ii) Show that K can be chosen to be 1 and hence r(x) = e∫

p(x)dx. We call r(x)an integrating factor.(iii) Show that y = 1

r(x)

∫q(x)r(x)dx + C

r(x) .

(iv) Find the general solution to the first order ODE

y′ +110

y =x

10+

1110

.

Solution.

Page 54: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

54 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Class Activity 3.3(Population Growth)The first population growth was formulated by Thomas Malthus in 1798. Inthis model, the births and deaths are assumed to be proportinal to both thetotal size of population N(t) and to time over small time intervals δt.Show that N(t) satisfies a first order linear differential equation. Solve the equa-tion.

Solution.

Page 55: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.1. MODELS BASED ON 1ST ORDER DIFFERENTIAL EQUATIONS 55

Class Activity 3.4Infusion of glucose into the bloodstream is modeled by the differential equation

dG

dt= c− aG.

Here G is the amount of glucose in the bloodstream at time t, c the constantrate of infusion, and a is a positive constant governing the removal rate fromthe bloodstream.Determine the predicted glucose level in the bloodstream, and show that G → c

aas t →∞.

Solution.

Page 56: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

56 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Project IVConsider a population growth problem of the form

dP

dt= kP

where k satisfies the equation

k = r(M − P ),

r > 0 is a constant, and M is the maximum population.

(a) Find an explicit formula for P.(b) What is the value of P (t) in the long run?(c) Graph the function P (t).

Solution.

Page 57: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.2. MODELS BASED ON 2ND ORDER LINEAR DIFFERENTIAL EQUATIONS57

3.2 Models Based on 2nd Order Linear Differ-ential Equations

By a homogeneous linear second order differential equation with con-stant coefficients we mean an equation of the form

ay′′ + by′ + cy = 0 (3.3)

One usually assumes a solution of the form u(x) = eλx (for constant λ.) Sub-stitution of this expression into (3.3) gives

aλ2eλx + bλeλx + ceλx = 0

Dividing by eλx > 0 gives the characteristic equation

aλ2 + bλ + c = 0 (3.4)

To solve this equation for λ we need to consider the following three cases:

• If b2 − 4ac > 0 then (3.4) has two distinct solutions λ1 = −b−√b2−4ac2a and

λ2 = −b+√

b2−4ac2a . Thus, C1e

λ1x and C2eλ2x, where C1 and C2 are arbitrary

constants, are two solutions of (3.3). The general solution to (3.3) is the func-tion

y = C1eλ1x + C2e

λ2x

• If b2− 4ac = 0 then (3.4) has only one solution, λ = − b2a . By substitution, we

can check that both y = C1eλx and y = C2xeλx are solutions to (3.3) so that

the general solution is given by

y = (C1 + C2x)eλx

• If b2 − 4ac < 0 then (3.4) has complex conjugate roots λ1 = −b−i√

4ac−b2

2a andλ2 = −b+i

√4ac−b2

2a . By substitution, we can check that both y = C1e− b

2a x cos (√

4ac−b2

2a )xand y = C2e

− b2a x sin (

√4ac−b2

2a )x are solutions to (3.4) and the general solutionis given by

y = C1e− b

2a x cos (√

4ac− b2

2a)x+C2e

− b2a x sin (

√4ac− b2

2a)x = Ce−

b2a x sin (

√4ac− b2

2ax + ω)

Page 58: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

58 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Class Activity 3.5(i) Find the solution of y′′ − 3y′ + 2y = 0 satisfying y(0) = 1 and y′(0) = 0.(ii) Find the solution of y′′ + y = 0 satisfying y(0) = 1 and y′(0) = 0.(iii) Find the solution of y′′ − 2y′ + y = 0 satisfying y(0) = 2 and y(1) = 0.

Solution.

Page 59: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.2. MODELS BASED ON 2ND ORDER LINEAR DIFFERENTIAL EQUATIONS59

Class Activity 3.6(Oscilation of a Mass on a Spring)Consider a mass m attached to the end of a spring hanging from the ceiling. Weassume that the mass of the spring is negligible in comparison with the massm. When the system is left undisturbed, no net force acts on the mass. Theforce of gravity is balanced by the force the spring exerts on the mass, and thespring is in the equilibrium position. Pulling down on the mass stretches thespring, increasing the tension, so the combination of gravity and spring force isupward so that we feel a force pulling upward. Pushing up the spring, decreasesthe tension, so the combination of gravity and spring force is downward.What happens if we push the mass upward and then release it? That is describethe motion of the mass with respect to time.(Hint: Hooke’s Law states that the net force F exerted on the mass m satisfiesthe equation F = −ks where k > 0 is a constant that depends on the physicalproporties of the particular spring; s is the displacement from the equilibriumposition. The negative sign in the formula means that the net force is in theopposite direction to the displacement.)

Solution.

Page 60: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

60 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Project V (Electrical Circuits)The charge Q (in Amperes) on a capacitor in a circuit with inductance L (inhenries), capacitance C (in farads), and resistance R (in ohms) satisfies thedifferential equation

Ld2Q

dt2+ R

dQ

dt+

1C

Q = 0.

(i) Find an expression for Q(t).(ii) What happens to Q(t) as t →∞?

RL

C

Inductor

Resistor

Capacitor

+Q−Q

Solution.

Page 61: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.3. MODELS BASED ON 1ST ORDER LINEAR DIFFERENCE EQUATIONS61

3.3 Models Based on 1st Order Linear Differ-ence Equations

Consider a sequence of numbers x0, x1, x2, x3, · · · for which an explicit formof the nth term is not given. An equation which expresses a value of a sequenceas a function of the other terms in the sequence is called a difference equa-tion. In particular, an equation which expresses xn in terms of xn−1 is calleda first-order difference equation.

Class Activity 3.7Radium is a radioactive element which decays at a rate of 1% every 25 years.This means that the amount left at the beginning of any given 25 year period isequal to the amount at the beginning of the previous 25 year period minus 1%of that amount. Let x0 be the initial amount of radium and xn be the amountof radium still remaining after 25n years (n = 0, 1, 2 · · ·).

(i) Find the relationship between xn and xn−1.(ii) Find an explicit formula for xn in terms of n and x0.(iii) The half-life of a radioactive element is the number of years required forone-half of an initial amount to decay. Find the half-life of Radium.

Solution.

Page 62: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

62 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

A first-order linear difference equation with constants coefficients is adifference equation of the form

xn = Axn−1 + B.

Class Activity 3.8Show that

xn =

Anx0 + B 1−An

1−A (A 6= 1)x0 + nB (A = 1)

Solution.

Page 63: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.3. MODELS BASED ON 1ST ORDER LINEAR DIFFERENCE EQUATIONS63

Class Activity 3.9• An interesting example that arises in modeling is the problem of change oftemperature of an object placed in an environment held at some constant tem-perature , such as a cup of tea cooling to room temperature or a glass of lemon-ade warming to room temperature. If T0 represents the initial temperature ofthe object, S the constant temperature of the surrounding environment, and Tn

the temperature of the object after n units of time, then according to Newton’sLaw of Cooling the change in temperature over one unit of time is given by

Tn+1 − Tn = k(Tn − S),

where k is a constant which depends upon the object. Find a formula for Tn interms of n.

• Suppose a cup of tea, initially at a temperature of 180F, is placed in aroom which is held at a constant temperature of 80F. Moreover, suppose thatafter one minute the tea has cooled to 175F. What will the temperature beafter 20 minutes?

Solution.

Page 64: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

64 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Project VIA sewage treatment plant processes raw sewage to produce usable fertilizer andclean water by removing all other contaminants. The process is such that eachhour 12% of remaining contaminants in a processing tank are removed. Whatpercentage of the sewage would remain after 1 day? How long would it take tolower the amount of sewage by half? How long until the level of sewage is downto 10% of the original level?

Solution.

Page 65: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.4. MODELS BASED ON SECOND ORDER DIFFERENCE EQUATIONS65

3.4 Models Based on Second Order DifferenceEquations

By a second order linear difference equation with constant coefficientswe mean an equation of the form

an = Aan−1 + Ban−2 (3.5)

where A and B are given constants with B 6= 0.

Class Activity 3.10The Fibonacci sequence

1, 1, 2, 3, 5, · · ·is a sequence in which every number after the first two is the sum of the pre-ceding two numbers. Find the generating rule and the initial conditions.

Solution.

Page 66: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

66 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

The following theorem gives a technique for finding solutions to (3.5).

Theorem 1Equation (3.5) is satisfied by the sequence 1, t, t2, · · · , tn, · · · where t 6= 0 if andonly if t is a solution to the characteristic equation

t2 −At−B = 0 (3.6)

Proof.(=⇒): Suppose that t is a nonzero real number such that the sequence 1, t, t2, · · ·satisfies (3.5). We will show that t satisfies the equation t2−At−B = 0. Indeed,for n ≥ k we have

tn = Atn−1 + Btn−2.

Since t 6= 0 we can devide through by tn−2 and obtain t2 −At−B = 0.(⇐=) : Suppose that t is a nonzero real number such that t2 − At − B = 0.Multiply both sides of this equation by tn−2 to obtain

tn = Atn−1 + Btn−2.

This says that the sequence 1, t, t2, · · · satisfies (3.5)

Class Activity 3.11Consider the second-order difference equation

an = an−1 + 2an−2, n ≥ 2.

Find two sequences that satisfy the given generating rule and have the form1, t, t2, · · · .

Solution.

Page 67: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.4. MODELS BASED ON SECOND ORDER DIFFERENCE EQUATIONS67

Are there other solutions then the ones provided by Theorem 1? The answer isyes according to the following theorem.

Theorem 2If sn and tn are solutions to (3.5) then for any real numbers C and D thesequence

an = Csn + Dtn, n ≥ 0

is also a solution.

Proof.Since sn and tn are solutions to (3.5) then for n ≥ 2 we have

sn = Asn−1 + Bsn−2

tn = Atn−1 + Btn−2

Therefore,

Aan−1 + Ban−2 = A(Csn−1 + Dtn−1) + B(Csn−2 + Dtn−2)= C(Asn−1 + Bsn−2) + D(Atn−1 + Btn−2)= Csn + Dtn = an

so that an satisfies (3.5)

Class Activity 3.12Find a solution to the difference equation

a0 = 1, a1 = 8

an = an−1 + 2an−2, n ≥ 2.

Solution.

Page 68: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

68 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Class Activity 3.13Find an explicit formula for the Fibonacci sequence

a0 = 1, a1 = 1

an = an−1 + an−2, n ≥ 2.

Solution.

Page 69: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.4. MODELS BASED ON SECOND ORDER DIFFERENCE EQUATIONS69

Next, we discuss the case when the characteristic equation has a single root.

Theorem 3Let A and B be real numbers and suppose that the characteristic equation

t2 −At−B = 0

has a single root r. Then the sequences 1, r, r2, · · · and 0, r, 2r2, 3r3, · · · , nrn, · · ·both satisfy the recurrence relation

an = Aan−1 + Ban−2.

Proof.Since r is a root to the characteristic equation then the sequence 1, r, r2, · · ·is a solution to the recurrence relation

an = Aan−1 + Ban−2.

Now, since r is the only solution to the characteristic equation then

(t− r)2 = t2 −At−B.

This implies that A = 2r and B = −r2. Let sn = nrn, n ≥ 0. Then

Asn−1 + Bsn−2 = A(n− 1)rn−1 + B(n− 2)rn−2

= 2r(n− 1)rn−1 − r2(n− 2)rn−2

= 2(n− 1)rn − (n− 2)rn

= nrn = sn

So sn is a solution to an = Aan−1 + Ban−2.

Class Activity 3.14Find an explicit formula for

a0 = 1, a1 = 3

an = 4an−1 − 4an−2, n ≥ 2

Solution.

Page 70: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

70 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Class Activity 3.15Simple games of chance can sometimes be at least partially analyzed usingdifference equations. In roulette, the wheel has numbers 1 through 36 togetherwith 0 and 00, for a total of 38 numbers. Half of the 36 numbers are red andhalf are black, while 0 and 00 are green. A simple bet consists of choosing oneof the colors red or black and betting that the ball will land on a number of thatcolor. If the ball comes to rest on the selected color, the payoff returns twicethe original wager; otherwise the amount wagered is lost. If a person enters thecasino with $100 and bets $1 on each spin of the wheel, what is the probabilitythat the person will reach a total fortune of $200 before losing everything?Let Pk denote the probability of reaching a total fortune of $200 before losingeverything if the person currently has k dollars. If the person currently has kdollars, then after one play the person will either have k + 1 or k − 1 dollars.Hence

Pk = (18/38)Pk+1 + (20/38)Pk−1.

Solve this equation for Pk under the assumption that the person quits when herfortune reaches either $0 or $200, i.e. P0 = 0 and P200 = 1.

Solution.

Page 71: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.4. MODELS BASED ON SECOND ORDER DIFFERENCE EQUATIONS71

Project VII (The Rabbit Problem)In his book Liber Abaci, Leonardo of Pisa, also known as Fibonacci, posed thefollowing question: How many pairs of rabbits will be produced in a year, be-ginning with a single pair, if in every month each pair bears a new pair whichbecomes productive from the second month on?

(a) Let fn be the number of pairs of rabbits in the nth month. Explain whyf0 = f1 = 1.(b) Find a relationship between fn, fn−1, and fn−2.(c) Find an explicit formula for fn in terms of n.(d) What is limn→∞ fn?(e) Let rn = fn

fn+1. Show that limn→∞ rn exists.

(f) Show that

rn+1 =1

1 + rn.

(g) Show that limn→∞ rn =√

5−12 .

Solution.

Page 72: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

72 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

3.5 Miscellaneous Models

Background: Recall that |u(x)−a| ≤ b, b ≥ 0 is equivalent to −b+a ≤ u(x) ≤b+a whereas |u(x)−a| ≥ b is equivalent to either u(x) ≤ −b+a or u(x) ≥ b+a.

Model Problem 1. Suppose you purchase a 90-lb bag of cement. It will notweigh exactly 90 lb. The material must be measured, and the measurement isapproximate. Some bags will weigh as much as 2 lb over 90 lb, and some willweigh as much as 2 lb under 90 lb. If so, the bag could weigh as much as 92 lbor as little as 88 lb. State this as an absolute value inequality.

Solution.

Page 73: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.5. MISCELLANEOUS MODELS 73

Background: A linear function is a function of the form f(x) = mx + b.Geometrically, the graph of a linear function is a straight line with slope m andy-intercept b (i.e. f(0) = b.) If given two points (x1, y1) and (x2, y2) on the linethen the slope is given by

m =y2 − y1

x2 − x1

Model Problem 2. When a weight is attached to a spring, it causes the springto lengthen. According to Hooke’s law, the length d of the spring is linearly re-lated to the weight w. If d = 4 cm when w = 3 g and d = 6 cm when w = 6 g,what is the original length of the spring, and what weight will cause the springto lengthen to 5 cm?

Solution.

Page 74: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

74 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Background: Recall that the graph of a linear function is a straight line.

Model Problem 3.Charles’s law of gases states that if the pressure remainsconstant, then

V (T ) = V0

(1 +

T

273

)

where V is the volume (in cubic inch), V0 is the initial volume, and T is thetemperature (in degrees Celsius).

(i) Sketch the graph of V (T ) for V0 = 100 and T ≥ −273.(ii) What is the temperature needed for the volume to double?

Solution.

Page 75: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.5. MISCELLANEOUS MODELS 75

Background: Recall that in a right triangle, the tangent of an acute angle isdefined as the ratio of the opposite side to the adjacent side. Also, recall thefollowing trigonometric identity:

tan (α + β) =tanα + tan β

1− tan α tanβ

Model Problem 4. A mural 7 feet high is hung on a wall in such a way thatits lower edge is 5 feet higher than the eye of an observer standing 12 feet fromthe wall. Find the angle θ subtended by the mural at the observer’s eye.

Solution.

Page 76: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

76 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Background: If s(t) denotes the position function of a moving object at timet and v(t) is its velocity then the quantity s(0) represents the initial position ofthe object and the quantity v(0) represents the initial velocity. If the object isthrown upward then the maximum height it reaches occurs at the time whenthe velocity is zero. When the object hits the ground then in this case s(t) = 0.

Model Problem 5. A ball is thrown directly upward from the edge of a cliffand travels in such a way that t seconds later, its height (in feet) above theground at the base of the cliff is

s(t) = −16t2 + 40t + 24.

a. Compute the limit

limx→t

s(x)− s(t)x− t

to find the instantaneous velocity of the ball at time t.b. What is the ball’s initial velocity?c. When does the ball hit the ground, and what is its impact velocity at thattime?d. When does the ball have velocity 0? What physical interpretation should begiven to this time?

Solution.

Page 77: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.5. MISCELLANEOUS MODELS 77

Background: Recall that y = ax is equivalent to x = loga y where a > 0 anda 6= 1. If a = 10 then we write y = log x.

Model Problem 6. The Richter scale measures the intensity of earthquakes.Specifically, if E is the energy (watt/cm3) released by a quake, then it is saidto have magnitude M, where

M =log E − 11.4

1.5

a. Express E in terms of M.b. How much more energy is released in an M = 8.5 earthquake (Alaska’s quakein 1964) than in an average quake of magnitude M = 6.5( the Los Angelos quakeof 1994)?

Solution.

Page 78: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

78 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Background: This problem requires solving a logarithmic equation. Thus, thehint in the previous problem is useful.

Model Problem 7.A decibel is the smallest increase in loudness of a soundthat is detectable by the human ear. In Physics, it is shown that when twosounds of intensity I1 and I2 (watts/cm3) occur, the difference in loudness is Ddecibels, where

D = 10 log (I1

I2)

when sound is rated in relation to the threshold of human hearing (I0 = 10−16)the level on normal conversation is 50 decibels, whereas that of a rock concertis 110 decibels. Show that a rock concert is 60 decibels louder as normal con-versation but a million times as intense.

Solution.

Page 79: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.5. MISCELLANEOUS MODELS 79

Background: We say that a function f(x) is continuous at x = a if and only if

limx→a

f(x) = f(a).

That is, the right limit and left limit at x = a are equal to f(a), i.e.

limx → ax < a

f(x) = limx → ax > a

f(x) = f(a).

Model Problem 8. The windchill temperature in degrees Fahrenheit is a func-tion of the air temperature T (in degrees Fahrenheit) and the wind speed v (inmi/h). If we hold T constant and consider the windchill as a function of v, wehave

W (v) =

T if 0 ≤ v ≤ 491.4 + (91.4− T )(0.0203v − 0.304

√v − 0.474) if 4 < v < 45

1.6T − 55 if v ≥ 45

a. If T = 30F, what is the windchill for v = 20 mi/h? What is it forv = 50 mi/h?b. For T = 30F, what wind speed corresponds to a windchill temperature of0F?c. For what value of T is the windchill function continuous at v = 4 mi/h? atv = 45 mi/h?

Solution.

Page 80: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

80 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Background: We say that a function f(x) is inversely proportional to the nthpower of x if and only if there is a constant k such that f(x) = k

xn . We call kthe constant of proportionality.

Model Problem 9. According to Newton’s Law of Universal gravita-tion, if an object of mass M is seperated by a distance r from a second objectof mass m, then the two objects are attracted to one another by a force thatacts along the line joining them and has magnitude

F =GmM

r2

where G is a positive constant. Show that the rate of change of F with respectto r is inversely proportional to r3. What is the constant of proportionality?

Solution.

Page 81: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.5. MISCELLANEOUS MODELS 81

Background: Recall the rules of differentiation.

Model Problem 10. Van der Waal’s equation states that a gas occupiesa volume V at temperature T (Kelvin) exerts pressure P, where

(P +

A

V 2

)(V −B) = kT

where A,B, and k are physical constants. Find the rate of change of pressurewith respect to volume, assuming fixed temperature.

Solution.

Page 82: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

82 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Background: Implicit Differentiation. Suppose an equation defines y im-plicitely as a differentiable function of x. To find dy

dx :

(i) Differentiate both sides of the equation with respect to x. Remember thaty is really a function of x and use the chain rule when differentiating termscontaining y.(ii) Solve the differential equation algebraically for dy

dx .Also recall that when the derivative of a function is positive (resp. negative)then the function is increasing (resp. decreasing).

Model Problem 11. Boyle’s law states that when gas is compressed at con-stant temperature, the pressure P of a given sample satisfies the equation

PV = C

where C is a constant and V is the volume of the sample. Suppose that at acertain time the volume is 30 cubic inches, the pressure is 90 lb/in2, and thevolume is increasing at the rate of 10 in3/s. How fast is the pressure changingat this instant? Is it increasing or decreasing?

Solution.

Page 83: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.5. MISCELLANEOUS MODELS 83

Background: If a function is monotone over an interval I then we can define itsinverse function. For example, the tangent function is always increasing on theinterval (−π

2 , π2 ) so it possesses an inverse function denoted by tan−1 θ. Aslo,

recalld

dθ(tan−1 u(x)) =

u′(x)1 + u(x)2

.

Model Problem 12. A worker stands 4 m from a hoist being raised at therate of 2 m/s. Model the worker’s angle of sight using an inverse trigonometricfunction, and then determine how fast θ is changing at the instant when thehoist is 1.5 m above eye level.

Solution.

Page 84: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

84 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Background: Recall the rules of differentiation and the significance of the signof the rate of change in terms of the monotonicity of a function.

Model Problem 13. The ideal gas law states that for an ideal gas, pres-sure P is given by the formula

P =kT

V

where V is the volume, T is the temperature, and k is a constant. Suppose thetemperature is kept fixed at 100C, and the pressure decreases at the rate of7 lb/in2 per minute. At what rate is the volume changing at the instant thepressure is 25 lb/in2 and the volume is 30 in3?

Solution.

Page 85: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.5. MISCELLANEOUS MODELS 85

Background: Related Rates Problems. The following is one of the proce-dures for solving related rates problems:

(i) Draw a figure, if appropriate, and assign variables to the quantities thatvary.(ii) Find a formula or equation that relates the variables.(iii) Differentiate the equation. You will usually differentiate implicitly withrespect to time.(iv) Substitute specific numerical values and solve algebraically for the requiredrate.

Model Problem 14. A bag is tied to the top of a 5-m ladder resting againsta vertical wall. Suppose the ladder begins sliding down the wall in such a waythat the foot of the ladder is moving away from the wall. How fast is the bagdescending at the instant the foot of the ladder is 4 m from the wall and thefoot is moving away at the rate of 2 m/s?

Solution.

Page 86: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

86 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Background: Use the procedure discussed in the previous problem. Recallthat the volume of a circular cone of radius of base r and height h is given bythe formula V = 1

3πr2h. Finally, the concept of similar triangles is also needed.

Model Problem 15. A tank filled with water is in the shape of an invertedcone 20 ft high with a circular top base whose radius is 5 ft. Water is runningout of the bottom of the tank at the constant rate of 2 ft3/min. How fast isthe water level falling when the water is 8 ft deep? Recall that the volume of acone of height h and radius of circular base r is given by the formula V = 1

3πr2h.

Solution.

Page 87: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.5. MISCELLANEOUS MODELS 87

Background: The Mean Value Theorem states that if a function f(x) is con-tinuous on [a,b] and differentiable on (a,b) then there exists at least one numbera < c < b such that

f(b)− f(a) = f ′(c)(b− a)

Model Problem 16. Two radar patrol cars are located at a fixed positions 6miles apart on a long, straight road where the speed limit is 55 mph. A sportscar passes the first patrol car traveling at 53 mph, and then 5 minutes later, itpasses the second patrol car going 48 mph. Analyze a model of this situationto show that at some time between the two clockings, the sports car exceededthe speed limit.

Solution.

Page 88: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

88 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Background: Recall that

limθ→0

sin θ

θ= 1.

Also, recall that if a number c is such that f ′(c) = 0 or f ′(c) does not exist butf(c) exists is called a critical number and the point (c, f(c)) on the graph off(x) is called a critical point.

Model Problem 17. In Physics, the formula

I = I0

(sin θ

θ

)2

where I(0) = limθ→0 I(θ) and I0 is a constant, is used to model light intensityin the study of Fraunhofer diffraction.

a. Show that I(0) = I0.b. Sketch the graph for [−3π, 3π]. What are the critical points on this interval?

Solution.

Page 89: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.5. MISCELLANEOUS MODELS 89

Background: L’Hopital’s Rule. Let f(x) and g(x) be two differentiablefunctions with g′(x) 6= 0 on an open interval containing c (except possibly atc itself). Suppose that limx→c

f(x)g(x) produces an indeterminate form 0

0 or ∞∞

and that limx→cf ′(x)g′(x) = L, where L is either a finite number, ∞, or −∞. Then

limx→cf(x)g(x) = L.

Model Problem 18. A weight hanging by a spring is made to vibrate by ap-plying a sinusoidol force, and the displacement at time t is given by

s(t) =C

β2 − α2(sinαt− sin βt)

where C,α, β are constants such that α 6= β. What happens to the displacementas β → α? You may assume that α is fixed.

Solution.

Page 90: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

90 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Background: The work done by a variable force F (x) in moving an objectalong the x-axis from x = a to x = b is given by

W =∫ b

a

F (x)dx

Model Problem 19. Hooke’s law states that when a spring is pulled x unitspast its equilibrium position, there is a restoring force F (x) = kx that pulls thespring back toward equilibrium. The constant k is called the spring constant.The natural length of a certain spring is 10 cm. If it requires 2 ergs of work tostretch the spring to a total length of 18 cm, how much work will be performedin stretching the spring to a total length of 20 cm?

Solution.

Page 91: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.5. MISCELLANEOUS MODELS 91

Background: Suppose that f(x) is a bounded function on a closed interval[a, b]. Partition the interval into n equal subintervals by means of the meshpoints xi = a + i b−a

n where 0 ≤ i ≤ n. Form the Riemann sum

n∑

i=1

f(xi)∆x.

Then ∫ b

a

f(x)dx = limn→∞

n∑

i=1

f(xi)∆x.

Quantities from geometry, physics, economics, and other applications are ex-pressed in terms of Riemann sums. That is, Riemann sums are generally usedto model a quantity for a particular application.

Model Problem 20. A tank in the shape of a right circular cone of height 12ft and radius 3 ft is inserted into the ground with its vertex pointing down andits top at ground level. If the tank is filled with water (density ρ = 62.4 lb/ft3)to a depth of 6 ft, how much work is performed in pumping all the water in thetank to ground level? What changes if the water is pumped to a height of 3 ftabove ground level?

Solution.

Page 92: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

92 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Background: Recall that work = force ·displacemet. Also, recall that a func-tion f(x) is inversely proportional to the nth power of x if there is a constant ksuch that f(x) = k

xn .

Model Problem 21. According to Coulomb’s law in Physics, two similarlycharges particles repel each other with a force inversely proportional to thesquare of the distance between them. Suppose that the force is 12 dynes whenthey are 5 cm apart.

a. How much work is done in moving one particle from a distance of 10 cmto a distance of 8 cm from the other?b. Set up and analyze a model to determine the amount of work performed inmoving one particle from an ”infinite” distance to a distance of 8 cm from theother.

Solution.

Page 93: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.5. MISCELLANEOUS MODELS 93

Background: This problem requires information about the behaviour of thenatural exponential function in the long run. It is recommended that you reviewthis topic before attemtping to solve the probelm below.

Model Problem 22. A cool drink is removed from a refrigerator and is placedin a room where the temperature is 70F . According to Newton’s Law of Cool-ing, the temperature of the drink in t minutes will be

F (t) = 70−Ae−kt

where A and k are positive constants. Suppose the temperature of the drinkwas 35F when it left the refrigerator, and 30 minutes later, it was 50F.

(a) Find A and k.(b) What will the temperature of the drink be after one hour?Find the answerto the nearest degree.(c) What would you expect to happen to the temperature in the ”long run”?

Solution.

Page 94: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

94 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Background: The chain rule is a rule for finding the derivative of a compositefunction. If f is a function depending on u which in term depends on x then

df

dx=

df

du

du

dx.

Model Problem 23. An environmental study of a certain suburban commu-nity suggests that the average daily level of carbon monoxide in the air may bemodeled by the formula

C(p) =√

0.5p2 + 17

parts per million (ppm) when the population is p thousand. It is estimated thatt years from now, the population of the community will be

p(t) = 3.1 + 0.1t2

thousand. At what rate will the carbon monoxide level be changing with respectto time 3 years from now?

Solution.

Page 95: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.5. MISCELLANEOUS MODELS 95

Background: Differential of a Function. The differential of a differentiablefunction f(x) is df = f ′(x)dx. If x0 represents the measured value of a variableand x0+∆x represents the exact value, then ∆x is the error in measurement.The difference

∆f = f(x0 + ∆x)− f(x0)

is called the propagated error at x0. The relative error is

∆f

f≈ df

f

and the percentage error is

100(

∆f

f

)%.

Model Problem 24. A certain container is modeled by a right circular cy-clinder whose height is twice the radius of the base. The radius is measuredto be 17.3 cm, with a maximum measurement error of 0.02 cm. Estimate thecorresponding propagated error, the relative error, and the percentage errorwhen calculating the surface area S. Recall that the surface area of a circularcylinder of height h and radius of base r is given by the formula S = 2πrh+2πr2.

Solution.

Page 96: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

96 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Background: Recall that a line x = b is a vertical asymptote of a given func-tion f(x) if and only if the graph of the function increases or decreases withoutbound as x is close enough to the value b.

Model Problem 25. According to Einstein’s special theory of relativity, themass of a body is modeled by the formula

m =m0√1− v2

c2

where m0 is the mass of the body at rest in relation to the abserver, m is themass of the body when it moves with speed v in relation to the observer, and cis the speed of light. Sketch the graph of m as a function of v. What happensas v → c−?

Solution.

Page 97: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.5. MISCELLANEOUS MODELS 97

Background: Use the integration by substitution techniques.

Model Problem 26. Water is flowing into a tank at the rate of√

3t + 1 ft3/min.If the tank is empty when t = 0, how much water does it contain 5 min later?

Solution.

Page 98: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

98 CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Background: The total distance traveled by a particle over an interval [a,b] isfound by ∫ b

a

v(t)dt.

Model Problem 27. A particle moves along the x-axis in such a way that theacceleration at time t is a(t) = sin2 t. What is the total distance traveled by theparticle over the time interval [0, π] if its initial velocity is v(0) = 2 units persecond?

Solution.

Page 99: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

3.5. MISCELLANEOUS MODELS 99

Background: Use trigonometric substitution.Model Problem 28. An object moves along the x-axis in such a way that itsvelocity at time t is v(t) = sin t + sin2 t cos3 t. Find the distance moved by theobject between times t = 0 and t = π

3 .

Solution.

Page 100: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

100CHAPTER 3. MODELS IN PHYSICS AND ENGINEERING SCIENCES

Background: A geometric series is a series of the form∑∞

n=0 axn. If |x| < 1then the sum is finite and is equal to a

1−x .Model Problem 29. A ball is dropped from a height of 10 ft. Each time theball bounces, it rises 0.6 the distance it had previously fallen. What is the totaldistance traveled by the ball?

Solution.

Page 101: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

Chapter 4

Models in ComputerSciences

In this chapter we will discuss computer sciences related topics consisting ofcryptography, finite state automata, and analysis of algorithms.

4.1 Cryptography

Cryptography is the art or science of keeping messages secret. Cryptol-ogy is the branch of mathematics that studies the mathematical foundations ofcryptographic methods. The word ”cryptography” is derived from Greek andwhen literally translated, means ”secret writing”. Before the advent of digitalcommunications, cryptography was used primarily by military for purposes ofespionage. With the advances in modern communication, technology has en-abled businesses and individulas to transport information at a very low cost viapublic networks such as the Internet. This development comes at the cost ofpotentially exposing the data transmitted over such a medium. Therefore, itbecomes imperative for businesses to make sure that sensitive data is transferredfrom one point to another in an airtight, secure manner over public networks.Cryptography can help us achieve this goal by making messages unintelligibleto all but the intended recipient.In cryptographic terminology, the message is called plaintext. Encoding thecontents of the message in such a way that hides its contents from outsidersis called encryption. The encrypted message is called the ciphertext. Theprocess of retrieving the plaintext from the ciphertext is called decryption.Encryption and decryption usually make use of a key, and the coding methodis such that decryption can be performed only by knowing the proper key. Acipher is an algorithm that encrypts or decrypts a message.Cryptanalysis is the art of breaking ciphers, i.e. retrieving the plaintext with-out knowing the proper key. People who do cryptography are cryptographers,and practitioners of cryptanalysis are cryptanalysts.

101

Page 102: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

102 CHAPTER 4. MODELS IN COMPUTER SCIENCES

Cryptography deals with all aspects of secure messaging, authentication, digitalsignatures, electronic money, and other applications.

Page 103: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

4.1. CRYPTOGRAPHY 103

Class Activity 4.1

In this problem we shall consider the Caesar’s cipher. Julius Caesar used thiscipher to transmit orders to his army. The encryption process consists of assign-ing the 26 letters of the alphabet A, B,C, · · · , Z by the integers 0, 1, 2, · · · , 25.Then the encrypted version of the message, the letter represented by p is re-placed by the letter represented by the remainder of the division of (p+3) by 26.For example, the letter represented by 2 is C so the corresponding encryptedletter is the one represented by 5 (i.e. F). The letter represented by 23 is theletter X so the corresponding encrytped letter is A since the remainder of thedivision of 26 by 26 is zero.In the decryption process the letter represented by p is replaced by the letterrepresented by the remainder of the division of (p-3) by 25. For example, theletter represented by 13 is N and the corresponding decrypted letter is K sincethe remainder of the division of (13-3) by 25 is 10.The following are useful tables:

Plaintext letter A B C D E F G H I J K L M0 1 2 3 4 5 6 7 8 9 10 11 12

Ciphertext letter D E F G H I J K L M N O P

Plaintext letter N O P Q R S T U V W X Y Z13 14 15 16 17 18 19 20 21 22 23 24 25

Ciphertext letter Q R S T U V W X Y Z A B C

• What is the encrypted message produced from the message ”MEET YOUIN THE PARK”?• What is the message produced from the encrypted message ”L FDPH L VDZL FRQTXHUHG”?

Solution.

Page 104: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

104 CHAPTER 4. MODELS IN COMPUTER SCIENCES

Class Activity 4.2

Consider the following arrangement of letters:Plaintext letter A B C D E F G H I J K L MCiphertext letter a c t q g w r z d e v f b

Plaintext letter N O P Q R S T U V W X Y ZCiphertext letter h i n s y m u j x p l o k

Find the ciphertext of the following plaintext:

THE SECURITY OF THE RSA ENCODING SCHEME RELIES ON THEFACT THAT NOBODY HAS BEEN ABLE TO DISCOVER HOW TO TAKECUBE ROOTS MOD N WITHOUT KNOWING NS FACTORS

Solution.

Page 105: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

4.1. CRYPTOGRAPHY 105

Project VIII: The Vigenere CipherThis cipher works by replacing each letter by another letter a specified numberof positions further in the alphabet. For example J is 5 positions further than E,D is 5 positions after Y. (Y,Z,A,B,C,D) The key is a sequence of shift amounts.If the sequence is of length 10, the 1st, 11th, 21st, ...letters of the plaintext areprocessed using the first member of the key. The second member of the keyprocesses plaintext letters 2, 12, 22, ...and so forth .Consider the following key

(3, 1, 7, 23, 10, 5, 19, 14, 19, 24)

Use this cipher to encrypt the message

” THE SECURITY OF THE RSA ENCODING SCHEME RELIES ON THEFACT THAT NOBODY HAS BEEN ABLE TO DISCOVER HOW TO TAKECUBE ROOTS MOD N WITHOUT KNOWING NS FACTORS ”

Solution.

Page 106: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

106 CHAPTER 4. MODELS IN COMPUTER SCIENCES

4.2 Basic Cryptographic Algorithms

Cryptographic algorithms use a key to control encryption and decryption; amessage can be decrypted only if the key matches the encryption key.There are two classes of key-based encryption algorithms, symmetric (or secret-key) and asymmetric (or public-key) algorithms. The difference is thatsymmetric algorithms use the same key for encryption and decryption (or thedecryption key is easily derived from the encryption key), whereas asymmetricalgorithms use a different key for encryption and decryption, and the decryptionkey cannot be derived from the encryption key. The next case study considersan example of a symmetric algorithm.

Project IX: Encryption via One-Time Pad The one-time pad (OTP) or Ver-nam cipher, has the merit of being considered completely secure and so hasgreat value in certain specialized situations, typically during war time.A one-time pad is essentially a pad of papers on which each page has a uniqueset of random letters. The sender and receiver have identical pads. Each letteron the pad is used to determine a single letter of the enciphered message. Sincethe letters on the pad are random, there is no formula that can be determinedby studying the letters. Assuming that the pad is not compromised, and eachpage is used only once, then the OTP system is unbreakable.The key letters on the pad, and the messages themselves, are typically written in5-letter groups. This helped the communicators to collate and verify the lengthof the message, and if something was misunderstood, the receiving person couldask for a certain group to be repeated, etc.To use the OTP, a method is needed for correlating a letter of plain text withthe letter of the key text (from the pad), to produce a letter of enciphered text.The method used is called a ”Vigenere’s Tableau”, or Vigenere’s square. Thetable has the alphabet in the left-most column, and also across the top. Foreach row, there is a shifted-reverse alphabet. So, the ”A” row lists the alpha-bet backwards, beginning with Z. The ”B” row begins with Y and ends with”DCBAZ”, etc. The first 3 rows of the table look like this

ABCDEFGHIJKLMNOPQRSTUV WXY ZA ZY XWV UTSRQPONMLKJIHGFEDCBAB Y XWV UTSRQPONMLKJIHGFEDCBAZC XWV UTSRQPONMLKJIHGFEDCBAZY

(a) Complete Vigenere’s square.

To encipher the first letter in a message, go to the row corresponding to theplain-text letter, then go to the column indicated by the first letter on yourOTP. The letter at the row-column intersection is the enciphered letter. Notethat the Vigenere’s table itself does not contain any ’secret’ information - it sim-ply provides the mechanism for combining plain and key text into encipheredtext.

Page 107: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

4.2. BASIC CRYPTOGRAPHIC ALGORITHMS 107

(b) Find the plaintext corresponding to the ciphertext

V IQSZ Y V V Y M ZTXJX TLCFP QGFEN CKY LJ

given the OTP’s text

BNJEX KQPBC LZCXV PKTUY QFHNG QWERT

Solution.

Page 108: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

108 CHAPTER 4. MODELS IN COMPUTER SCIENCES

4.3 Asymmetric Algorithms: RSA Algorithm

What is RSA? RSA is a public-key cryptosystem for both encryption and au-thentication; it was invented in 1977 by Ron Rivest, Adi Shamir, and LeonardAdleman. The RSA algorithm works as follows: take two large prime numbers,p and q, and compute their product n = pq; where n is called the modu-lus. Choose a number,e, (for encryption) less than n and relatively prime to(p− 1)(q− 1), which means e and (p− 1)(q− 1) have no common facotrs except1. Find another number d (for decryption) such that (ed − 1) is divisible by(p− 1)(q − 1). The values e and d are called public and private exponents,respectively. The public key is the pair (n, e); the private key is (n, d). Thefactors p and q must be kept secret or destroyed.It is difficult to obtain the private key d from the public key (n, e). However, ifone could factor n into p and q, then one could obtain the private key d. Thus thesecurity of the RSA system is based on the assumption that factoring is difficult.

Class Activity 4.3

Suppose that p = 5 and q = 11. Find both a public key and a private key.

Solution.

Page 109: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

4.3. ASYMMETRIC ALGORITHMS: RSA ALGORITHM 109

Project X:RSAIn this case study we consider how the RSA can be used for privacy.

RSA Privacy (Encryption): A plaintext message is easily converted to anumber by using the alphabet position of each letter (a=01, b=02, ..., z=26).Suppose Alice wants to send a private message , m < n, to Bob. Alice createsthe ciphertext c by exponentiating: c = memod n, where e and n are Bob’spublic key. To decrypt, Bob also exponentiates: m = cdmod n, and recovers theoriginal message m; the relationship between e and d ensures that Bob correctlyrecovers m. Since only Bob knows d, only Bob can decrypt.

So, assume that n = 55, e = 27, and d = 3 as in Class Activity 4.3. Sup-pose that Alice wants to send the following message to Bob:

WE MUST MEET TODAY TO DISCUSS THE MATTER

What is the encrypted text?

Now, suppose that Alice sends the following ciphertext to Bob:

04 02011525 15020424 4223012424

What is the plaintext?

Solution.

Page 110: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

110 CHAPTER 4. MODELS IN COMPUTER SCIENCES

4.4 Finite-State Automaton

A finite-state machine can be looked at as a mathematical model that canaccept input, store and process information and produce output. Examples in-clude digital computers, compilers, vending machines, coin changers, telephones,and elevators.This model has an input/output unit, and, consequently, has a way of commu-nicating with the world using a set of symbols. Let I be the set of input symbolsand O, the set of output symbols. In the case of an elevator I might be up,down, and floor selection, while O might be stops on particular floors. Besidesinput and output symbols, there is a set of states S for our model. A stateis like a snapshot of what is happening in the machine at a particular instant.An elevator might be in a state of going down to the first floor to pick up apassenger or in a state of stopping on the third floor on the way up to the fifthfloor. There are always an intial state of our model, denoted by s0, and final oraccepting state(s).Also, our model has a function, called the next state function. This functionreturns the next state based on the present state and input. For instance, ifthe elevator is in the state of moving up to the fifth floor and has an input ofsomeone pressing the down button on the third floor, it goes to a state thatsays,” Remember, when coming back down from stopping and picking someoneon the third floor.”The above discussion is formalized as follows:A finite-state automaton A consists of five objects:1. a set I, called the input alphabet, of input symbols;2. a set O, called the output alphabet, of output symbols;3. a set S of states the machine can be in;4. a subset of S whose elements are called accepting states;5. a next-state function or transition function N : S × I → S. If s ∈ S andm ∈ I then N(s,m) is the state to which A goes if m is input to A when A isin state s. The initial state of the machine is s0.

The operation of a finite-state machine is commomly described by a diagramcalled a transition diagram. The edges labeled with inputs and nodes withstates. A double circle stands for the final or accepting state(s).

Page 111: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

4.4. FINITE-STATE AUTOMATON 111

Class Activity 4.4Consider the finite-state automaton defined by the transition diagram given be-low.a. What are the elements of S?b. What are the input symbols?c. What is the initial state?d. What are the accepting states?e. Find N(s3, 1) and N(s3, 0).

0s s s

21

0 1

1

0

s 30

s4

0,1

0,1

1

Solution.

Page 112: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

112 CHAPTER 4. MODELS IN COMPUTER SCIENCES

Let A be a finite-state automaton with input alphabet I. Let I∗ be the set ofall words with letters from I. A word w ∈ I∗ is said to be accepted by A if,and only if, A goes to an accepting state when the symbols of w are input to Ain sequence starting when A is in its initial state. The language accepted byA, denoted by L(A), is the set of all words that are accepted by A.

Class Activity 4.5Consider the finite-state automaton defined by the following transition diagram

os s1

0

1

s2

1

0,1

0

a. To what states does A go if the symbols of the following words are input toA in sequence starting from the initial state?(i) 1101 (ii) 0011 (iii) 0101010.b. Which of the words in part (a) send A to an accepting state?c. Show that L(A) = 0(10)n : n ≥ 0 where (10)n = 1010 · · · with n copies of10 juxtaposed into one word.

Solution.

Page 113: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

4.4. FINITE-STATE AUTOMATON 113

Let A be a finite-state automaton with input alphabet I and states S. LetN∗ : S × I∗ → S be the function defined as follows: N∗(s, w) is the state towhich A goes if the symbols of w are input to A in sequence starting when A isin state s. We call N∗ the eventual -state function.

Class Activity 4.6A finite-state automaton A, given by the transition diagram below, has transi-tion function N and eventual-state functioin N∗.

s0

s

ss

3

1 2

01

1

0

1 0

1

0

a. Find N(s2, 0) and N(s1, 0).b. Find N∗(s2, 11010) and N∗(s0, 01000).

Solution.

Page 114: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

114 CHAPTER 4. MODELS IN COMPUTER SCIENCES

Project XIDesign a finite-state machine that recognizes words of the form 01, 011, 0111, 01111, · · · .

Solution.

Page 115: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

4.5. INTRODUCTION TO THE ANALYSIS OF ALGORITHMS 115

4.5 Introduction to the Analysis of Algorithms

Informally, an algorithm is any well-defined computational procedure thattakes a set of values as input and produces a set of values as output.The subject of the analysis of algorithms consists of the study of efficiency ofalgorithms. Two aspects of the algorithm efficiency are: the amount of timerequired to execute the algorithm and the memory space it consumes. In thischapter we introduce the basic techniques for calculating time efficiency.

4.5.1 Time Complexity and O-Notation

The primary efficiency criterion for analyzing the efficiency of an algorithm isthe running time of the algorithm as a function of the number of values itprocesses. The running time of an algorithm is not measured by counting theminutes and seconds for the algorithm written in a particular language andrunning on a particular machine. Rather it is defined to be an estimate of thenumber of operations performed by the algorithm given a particular number ofinput values.Generally, given an algorithm that performs a task, we will be interested inestimating the running time as a function of the problem size. For example, letus consider the sequential search of an item X from a list of n items. Here,we say that the problem size is n. Let T (n) be a measure of the time requiredto execute an algorithm of problem size n. We call T (n) the time complexityfunction of the algorithm. If n is sufficiently small then the algorithm willnot have a long running time. Thus, the interesting question is:”How fast T (n)increases as n increases?” This is called the asymptotic behavior of the timecomplexity function.In our time analysis we will restrict ourselves to the worst case behavior of analgorithm; that is, the longest running time for any input of size n.Since we are considering asymptotic efficiency of algorithms, basically we will befocusing on the leading term of T (n). For example, if T (n) = 4n3 − 2n2 + n + 5then T (n) = n3(4− 2

n + 1n + 5

n ) and for large n we have T (n) ∼ n3. We say thatT (n) has a growth of order n3.We say that one algorithm is more efficient then another if its worse case runningtime has a lower order of growth.

Page 116: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

116 CHAPTER 4. MODELS IN COMPUTER SCIENCES

Class Activity 4.7

Estimate the time complexity of the following algorithm:

i := 1p := 1for i := 1 to n

p := p · ii := i + 1next i

Solution.

Page 117: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

4.5. INTRODUCTION TO THE ANALYSIS OF ALGORITHMS 117

Class Activity 4.8

What is the run-time complexity based on n for the following program sege-ment:

for i := 1 To nfor j := 1 To n

A(i,j) := xnext j

next i

Solution.

Page 118: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

118 CHAPTER 4. MODELS IN COMPUTER SCIENCES

In the previous two problems we found a precise expression for the time com-plexity of the algorithm. What usually interests us is the order of growth. Wenext introduce some of the concepts of growth orders. Let g : IN → IR. Wedefine the set

O(g(n)) = f(n) : there exist positive constants n0 and C such that|f(n)| ≤ C|g(n)|, for n ≥ n0.

We say that a function f is order at most g or f big-oh of g if and only iff(n) ∈ O(g(n)). Sometimes We write f(n) = O(g(n)). Graphically, this meansthat for n ≥ n0 the graph of f is below the graph of g.

Class Activity 4.9

Show that the time complexity found in Class Activity 4.7 is O(n).

Solution.

Page 119: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

4.5. INTRODUCTION TO THE ANALYSIS OF ALGORITHMS 119

Class Activity 4.10

Show that the run-time complexity based on n for the following program sege-ment is O(n2).

s := 0for i := 1 To n

for j := 1 To is := s + j · (i− j + 1)

next jnext i

Solution.

Page 120: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

120 CHAPTER 4. MODELS IN COMPUTER SCIENCES

We say that a function f is of polynomial complexity if and only if f ∈ O(np)for some p ∈ IN. If p = 0 then we say that f is of constant complexity. If p = 1we say that the complexity is linear.

Class Activity 4.11

Show that1 + 2 + 3 + · · ·+ n = O(n2).

Solution.

Page 121: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

4.5. INTRODUCTION TO THE ANALYSIS OF ALGORITHMS 121

Class Activity 4.12

Find the worst case running time of the following segment of an algorithm:

for i := 1 to nfor j := 1 to 2n

for k := 1 to nx := i · j · k

next knext j

next i

Solution.

Page 122: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

122 CHAPTER 4. MODELS IN COMPUTER SCIENCES

Class Activity 4.13

Construct a table showing the result of each step when insertion sort is ap-plied to the array a[1] = 6, a[2] = 2, a[3] = 1, a[4] = 8, a[5] = 4.

Solution.

Page 123: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

4.5. INTRODUCTION TO THE ANALYSIS OF ALGORITHMS 123

Class Activity 4.14

How many comparisons actually occur when insertion sort is applied to thearray of the previous exercise?

Page 124: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

124 CHAPTER 4. MODELS IN COMPUTER SCIENCES

Project XII Part ISuppose we want to arrange the elements of a one dimensional array a[1], a[2], · · · , a[n]in increasing order. An insertion sort compares every pair of elements, switch-ing the values of those that are out of order, a[i− 1] > a[i].a. How many possible pairs are compared?b. What is the maximum number of exchanges?c. What time the complexity of this algorithm in the worst case?d. Is this a polynomial-time algorithm?

Part II

Selection sort is another algorithm for arranging the elements of a one-dimensionalarray a[1], a[2], · · · , a[n] in increasing order. The sorting works by selecting thesmallest item in the list, moving it to the front of the list, and then finding thesmallest of the remaining items and moving it to the second position in the list,and so on. When two items in the list, say a[k] and a[m], have to be inter-changed, we write switch(a[k], a[m]). The following is the selection algorithm:

for i := 1 to n− 1min := ifor j := i + 1 to n

if a[min] > a[j] thenswitch(a[min], a[i])

next jnext i

(i) Construct a table showing the result of each step when selection sort isapplied to the array a[1] = 5, a[2] = 3, a[3] = 4, a[4] = 6, a[5] = 2.(ii) How many comparisons actually occur when selection sort is applied to thearray of the previous exercise?

Solution.

Page 125: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

4.6. LOGARITHMIC AND EXPONENTIAL COMPLEXITIES 125

4.6 Logarithmic and Exponential Complexities

In this section we assume that the reader is familiar with the definitions andrules of both exponential and logarithmic functions. Unless explicitly stated, alllogarithms in this chapter are to base 2 mainly because of the following theorem

Theorem 4For any a > 1, O(loga n) = O(log2 n).

Proof.We must show that there exist constants C1, C2 and n0 such that loga n ≤C1 log2 n and log2 n ≤ C2 loga n for all n ≥ n0. By the change of bases formulawe have

loga n =log2 n

log2 a.

Now, let C1 = 1log2 a , C2 = log2 a, and n0 = 1.

If f(n) ∈ O(log2 n) we say that f(n) has logarithmic complexity. A func-tion f(n) is said to be of exponential complexity if and only if f(n) ∈ O(an)for some a > 1.

Class Activity 4.15

Show that n + n log2 n ∈ O(n log2 n).

Solution.

Page 126: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

126 CHAPTER 4. MODELS IN COMPUTER SCIENCES

Class Activity 4.16

a. Show that n = O(2n).b. Use a. to show that log2 n = O(n).

Solution.

Page 127: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

4.6. LOGARITHMIC AND EXPONENTIAL COMPLEXITIES 127

Class Activity 4.17

a. Show that 12 + 1

3 + · · ·+ 1n ≤ ln n, n ≥ 2.

b. Use part a. to show that for n ≥ 3

1 +12

+ · · ·+ 1n≤ ln n.

c. Use b. to show that n + n2 + n

3 + · · ·+ nn ∈ O(n ln n).

Solution.

Page 128: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

128 CHAPTER 4. MODELS IN COMPUTER SCIENCES

Class Activity 4.18

Show that 2n ∈ O(n!).

Solution.

Page 129: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

4.6. LOGARITHMIC AND EXPONENTIAL COMPLEXITIES 129

Class Activity 4.18

a. Show that log2 n! = O(n log2 n).b. Show that n log2 n = O(log2 n!).

Solution.

Page 130: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

130 CHAPTER 4. MODELS IN COMPUTER SCIENCES

4.7 Θ- and Ω-Notations

The O-notation asymptotically bounds a function from above. When we havebounds from above and below, we use Θ notation. For a given function g(n), wedenote by Θ(g(n)) to be the set of all functions f such that there exist positiveconstants C1, C2, and n0 such that C1|g(n)| ≤ |f(n)| ≤ C2|g(n)| for all n ≥ n0.If f ∈ Θ(g(n)) we write f(n) = Θ(g(n)).

Class Activity 4.19Show that 1

2n2 − 3n = Θ(n2).

Solution.

Page 131: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

4.7. Θ- AND Ω-NOTATIONS 131

Class Activity 4.20

Show that 6n3 6= Θ(n2).

Solution.

Page 132: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

132 CHAPTER 4. MODELS IN COMPUTER SCIENCES

Theorem 5For given two functions f(n) and g(n), f(n) = Θ(g(n)) if and only if f(n) =O(g(n)) and g(n) = O(f(n)).

Proof.Suppose that f(n) = Θ(g(n)). Then there exist positive constants C1, C2, andn0 such that C1|g(n)| ≤ |f(n)| ≤ C2|g(n)| for all n ≥ n0. The left-hand sideinequality implies that g(n) = O(f(n)) whereas the right-hand side inequalityimplies that f(n) = O(g(n)). Now go backward for the converse.

Just as O provides an asymptotic upper bound on a function, Ω−notationprovides an asymptotic lower bound. For a given function g(n), let Ω(g(n))denote the set of all funtions f(n) such that there exist positive constants Cand n0 such that C|g(n)| ≤ |f(n)| for all n ≥ n0. For f(n) ∈ Ω(g(n)) we writef(n) = Ω(g(n)).

Class Activity 4.21

Show that log2 n! = Ω(n log2 n).

Solution.

Page 133: A Calculus Approach to Mathematical Modelings3.amazonaws.com/cramster-resource/6940_n_19750.pdfat a simple rate of interest of 8:5% per year? † What principal will earn $75 in interest

4.7. Θ- AND Ω-NOTATIONS 133

Theorem 6For given two functions f(n) and g(n), f(n) = Θ(g(n)) if and only if f(n) =O(g(n)) and f(n) = Ω(g(n)).

Proof.Suppose first that f(n) = Θ(g(n)). Then there exist positive constants C1, C2

and n0 such that C1|g(n)| ≤ |f(n)| ≤ C2|g(n)| for n ≥ n0. The right-hand sideinequality implies that f(n) = O(g(n)) whereas the left-hand side inequalityimplies that f(n) = Ω(g(n)).Conversely, suppose that f(n) = O(g(n)) and f(n) = Ω(g(n)). Then there ex-ist constants C1, C2, n1 and n2 such that |f(n)| ≤ C2|g(n)| for n ≥ n2 andC1|g(n)| ≤ |f(n)| for n ≥ n1. Let n0 = maxn1, n2. Then for n ≥ n0 we haveC1|g(n)| ≤ |f(n)| ≤ C2|g(n)|. That is, f(n) = Θ(g(n)).

Class Activity 4.22Let f(n) and g(n) be two given functions. We say that f(n) = o(g(n)) if andonly if limn→∞

f(n)g(n) = 0.

a. Show that if f(n) = o(g(n)) then f(n) = O(g(n)).b. Find two functions f(n) and g(n) such that f(n) = O(g(n) but f(n) 6=o(g(n)).

Solution.


Recommended