Problems

The below problems are taken from the text book:

A First Course in Mathematical Modeling, 5th Edition. Frank R. Giordano, William P. Fox, Steven B. Horton. ISBN-13: 9781285050904.

Exercise #10 Page Page 8.

Your grandparents have an annuity. The value of the annuity increases each month by an automatic deposit of 1% interest on the previous month’s balance. Your grandparents withdraw $1000 at the beginning of each month for living expenses. Currently, they have $50,000 in the annuity. Model the annuity with a dynamical system. Will the annuity run out of money? When? Hint: What value will \(a_n\) have when the annuity is depleted?

Solution

Basically, the change in the amount increases by the amount paid in the form of interest and decreases by the amount withdraw each month.

Change = \(\Delta a_n = a_{n+1} - a_n = 0.01 \cdot a_n - 1000\)

The dynamical system will be:

\(a_0 = 50000\)

\(a_{n+1} = a_n + 0.01 \cdot a_n - 1000\)

The below table represent the values for the upcoming months.

Let’s see a few records and the graphical representation.

First records in the succession with no decimals
Month Balance
0 50000
1 49500
2 48995
3 48485
4 47970
5 47450
Last records in the succession with no decimals
Month Balance
65 4532
66 3577
67 2613
68 1639
69 655
70 -338

Answers

Will the annuity run out of money?

Yes, the annuity will run out of money.

When?

The annuity will run out of money in about 70 months from now on.

What value will \(a_n\) have when the annuity is depleted?

\(a_n\) will have a value of - $338.09. That means that on their final withdrawal they will take home $1000 - $338.09 = $ 661.91 since they gained some interest in the last month.

Exercise #9 Page Page 17.

The data in the accompanying table show the speed n (in increments of 5 mph) of an automobile and the associated distance \(a_n\) in feet required to stop it once the brakes are applied. For instance, \(n=6\) (representing \(6 \times 5 = 30\) mph) requires a stopping distance of \(a_6 = 47\) ft.

n vs stopping distance
n Distance
1 3
2 6
3 11
4 21
5 32
6 47
7 65
8 87
9 112
10 140
11 171
12 204
13 241
14 282
15 325
16 376

a.

Calculate and plot the change \(\Delta a_n\) versus n. Does the graph reasonably approximate a linear relationship?

Solution

Now, the next table shows \(\Delta a_n = a_{n+1} - a_n\).

Speed, stopping distance and delta
n Distance Delta
1 3 3
2 6 5
3 11 10
4 21 11
5 32 15
6 47 18
7 65 22
8 87 25
9 112 28
10 140 31
11 171 33
12 204 37
13 241 41
14 282 43
15 325 51
16 376

Let’s plot our Delta vs our n values.

Does the graph reasonably approximate a linear relationship?

Yes, the graph reasonably approximate a linear relationship.

b.

Based on your conclusions in part (a), find a difference equation model for the stopping distance data. Test your model by plotting the errors in the predicted values against n. Discuss the appropriateness of the model.

Solution

In order to solve this, we can basically calculate our stopping distance as follows:

\(Distance_{n+1} = Distance_{n} + Delta_{n}\)

Since we already know the values for the \(Distance_n\); we could find a formula for Delta in terms of n since we concluded that is somehow linear.

That is:

\(Delta = k \cdot n + b\)

We could calculate k by finding the slope that passes in between the points \((n = 5, Delta = 15)\) and \((n = 6, Delta = 18)\).

\(k \approx \frac{18-15}{6-5} \approx 3\)

Now, if we want to substitute to find b, we could use as follows:

let’s use the point \((n = 1, Delta = 3)\) and by replacing in the following formula:

\(Delta = k \cdot n + b\)

\(3 = 3 \cdot 1 + b\)

\(0 = b\)

Hence our final model formula for the Delta will be as follows:

\(Delta_{n} = 3n\)

Now that we have our \(Delta_n\) in terms of n; we can proceed as follows:

\(Predicted \: Distance_{n+1} = Predicted \: Distance_{n} + Delta_{n}\)

Based on the above result; in order to obtain our final model formula, we could write as follows:

\(Predicted \: Distance_{n+1} = Predicted \: Distance_{n} + 3n\)

with \(Predicted \: Distance_0 = 3\).

Speed, stopping distance, delta and predicted values
n Distance Delta Predicted Error
1 3 3 3 0
2 6 5 6 0
3 11 10 12 1
4 21 11 21 0
5 32 15 33 1
6 47 18 48 1
7 65 22 66 1
8 87 25 87 0
9 112 28 111 -1
10 140 31 138 -2
11 171 33 168 -3
12 204 37 201 -3
13 241 41 237 -4
14 282 43 276 -6
15 325 51 318 -7
16 376 363 -13

The above plot, represents the real value in blue color and the predicted value in red.

The above graph represent the difference in between the actual reading and the predicted value employing the difference equation model for the stopping distance data.

In regards of the appropriateness of the model; it seems to be some how accurate with what seems to be a few outliers when the speed is high; this could be understandable and seems to predict the stopping distance fairly good; perhaps, this process could be improved using other methods.

Exercise #13 Page 34.

Consider the spreading of a rumor through a company of 1000 employees, all working in the same building. We assume that the spreading of a rumor is similar to the spreading of a contagious disease (see Example 3, Section 1.2) in that the number of people hearing the rumor each day is proportional to the product of the number who have heard the rumor previously and the number who have not heard the rumor. This is given by

\(r_{n+1} = r_n + k r_n(1000 - n)\)

where k is a parameter that depends on how fast the rumor spreads and n is the number of days. Assume k = 0.001 and further assume that four people initially have heard the rumor. How soon will all 1000 employees have heard the rumor?

Solution

From the above text we can collect the following information:

\(r_0 = 4\)

\(k = 0.001\)

By replacing in the above formula we obtain as follows:

\(r_{n+1} = r_n + 0.001 r_n(1000 - n)\)

\(r_0 = 4\)

Let’s create a table of values based on the above dynamic system

##     n         rn
## 1   0    4.00000
## 2   1    7.98400
## 3   2   15.90426
## 4   3   31.55557
## 5   4   62.11538
## 6   5  120.37244
## 7   6  226.25535
## 8   7  401.31922
## 9   8  641.58132
## 10  9  871.53605
## 11 10  983.49701
## 12 11  999.72765
## 13 12  999.99993
## 14 13 1000.00000
## 15 14 1000.00000

Let’s plot our results:

Answer

How soon will all 1000 employees have heard the rumor?

If we take the decimals off from the results and we round down due to being person as a whole, our given function will never reach 1000 but 999 as the top value after 12 days.

If we round to the nearest decimals, then it will be reached after 11 days.

If we do not round any decimals, then it will take about 13 days.

So basically; it will be safe to say that the spread of the rumor will take from 11 to 13 days to spread to 1000 employees.

Exercise #6 Page Page 55.

An economist is interested in the variation of the price of a single product. It is observed that a high price for the product in the market attracts more suppliers. However, increasing the quantity of the product supplied tends to drive the price down. Over time, there is an interaction between price and supply. The economist has proposed the following model, where \(P_n\) represents the price of the product at year n, and \(Q_n\) the quantity. Find the equilibrium values for this system.

\(P_{n+1}=P_n-0.1(Q_n-500)\)

\(Q_{n+1}=Q_n+0.2(P_n-100)\)

Equilibrium values

If we call the equilibrium values (P, Q) then we must have \(P=P_{n+1}=P_n\) and \(Q=Q_{n+1}=Q_n\) simultaneously. Substituting into the above dynamical system yields:

\(P=P-0.1(Q-500)\)

\(Q=Q+0.2(P-100)\)

and by solving the above equations, we obtain

\(Q=500\) and \(P=100\)

a.

Does the model make sense intuitively? What is the significance of the constants 100 and 500? Explain the significance of the sign of the constants -0.1 and 0.2.

  • Does the model make sense intuitively? YES.

  • What is the significance of the constants 100 and 500?

The constants 500 and 100 work as thresholds.

  • Explain the significance of the sign of the constants -0.1 and 0.2.

Basically the constants -0.1 and 0.2 indicate as follows: The 0.2 indicate that the price has a positive change in the quantity if the price is over 100, while the -0.1 indicate that the quantity has a negative effect in the price if the quantity increases over 500.

b.

Test the initial condition in the following table and predict the long-term behaviour.

Price Quantity
Case A 100 500
Case B 200 500
Case C 100 600
Case D 100 400

Please note that I have written a small script that will calculate our cases given our cases.

  • Case A

With 10 iterations

runCase("Case A",P = 100, Q = 500, 10)

##    n Price Quantity
## 1  0   100      500
## 2  1   100      500
## 3  2   100      500
## 4  3   100      500
## 5  4   100      500
## 6  5   100      500
## 7  6   100      500
## 8  7   100      500
## 9  8   100      500
## 10 9   100      500

With 100 iterations

runCase("Case A",P = 100, Q = 500, 100)

##      n Price Quantity
## 91  90   100      500
## 92  91   100      500
## 93  92   100      500
## 94  93   100      500
## 95  94   100      500
## 96  95   100      500
## 97  96   100      500
## 98  97   100      500
## 99  98   100      500
## 100 99   100      500

With 1000 iterations

runCase("Case A",P = 100, Q = 500, 1000)

##        n Price Quantity
## 991  990   100      500
## 992  991   100      500
## 993  992   100      500
## 994  993   100      500
## 995  994   100      500
## 996  995   100      500
## 997  996   100      500
## 998  997   100      500
## 999  998   100      500
## 1000 999   100      500
  • Case B

With 10 iterations

runCase("Case B",P = 200, Q = 500, 10)

##    n    Price Quantity
## 1  0 200.0000 500.0000
## 2  1 200.0000 520.0000
## 3  2 198.0000 540.0000
## 4  3 194.0000 559.6000
## 5  4 188.0400 578.4000
## 6  5 180.2000 596.0080
## 7  6 170.5992 612.0480
## 8  7 159.3944 626.1678
## 9  8 146.7776 638.0467
## 10 9 132.9729 647.4022

With 100 iterations

runCase("Case B",P = 200, Q = 500, 100)

##      n    Price Quantity
## 91  90 343.0498 526.7621
## 92  91 340.3736 575.3721
## 93  92 332.8364 623.4468
## 94  93 320.4917 670.0141
## 95  94 303.4903 714.1125
## 96  95 282.0791 754.8105
## 97  96 256.5980 791.2263
## 98  97 227.4754 822.5459
## 99  98 195.2208 848.0410
## 100 99 160.4167 867.0852

With 500 iterations

runCase("Case B",P = 200, Q = 500, 500)

##       n     Price   Quantity
## 491 490 12413.987 -4415.0967
## 492 491 12905.497 -1952.2992
## 493 492 13150.727   608.8003
## 494 493 13139.847  3218.9457
## 495 494 12867.952  5826.9151
## 496 495 12335.261  8380.5056
## 497 496 11547.210 10827.5578
## 498 497 10514.455 13116.9999
## 499 498  9252.755 15199.8908
## 500 499  7782.766 17030.4417
  • Case C

With 10 iterations

runCase("Case C",P = 100, Q = 600, 10)

##    n     Price Quantity
## 1  0 100.00000 600.0000
## 2  1  90.00000 600.0000
## 3  2  80.00000 598.0000
## 4  3  70.20000 594.0000
## 5  4  60.80000 588.0400
## 6  5  51.99600 580.2000
## 7  6  43.97600 570.5992
## 8  7  36.91608 559.3944
## 9  8  30.97664 546.7776
## 10 9  26.29888 532.9729

With 100 iterations

runCase("Case C",P = 100, Q = 600, 100)

##      n      Price Quantity
## 91  90  86.618930 743.0498
## 92  91  62.313945 740.3736
## 93  92  38.276583 732.8364
## 94  93  14.992941 720.4917
## 95  94  -7.056232 703.4903
## 96  95 -27.405264 682.0791
## 97  96 -45.613172 656.5980
## 98  97 -61.272974 627.4754
## 99  98 -74.020512 595.2208
## 100 99 -83.542592 560.4167

With 500 iterations

runCase("Case C",P = 100, Q = 600, 500)

##       n       Price  Quantity
## 491 490  2557.54833 12813.987
## 492 491  1326.14958 13305.497
## 493 492    45.59986 13550.727
## 494 493 -1259.47284 13539.847
## 495 494 -2563.45755 13267.952
## 496 495 -3840.25280 12735.261
## 497 496 -5063.77889 11947.210
## 498 497 -6208.49994 10914.455
## 499 498 -7249.94540  9652.755
## 500 499 -8165.22086  8182.766
  • Case D

With 10 iterations

runCase("Case D",P = 100, Q = 400, 10)

##    n    Price Quantity
## 1  0 100.0000 400.0000
## 2  1 110.0000 400.0000
## 3  2 120.0000 402.0000
## 4  3 129.8000 406.0000
## 5  4 139.2000 411.9600
## 6  5 148.0040 419.8000
## 7  6 156.0240 429.4008
## 8  7 163.0839 440.6056
## 9  8 169.0234 453.2224
## 10 9 173.7011 467.0271

With 100 iterations

runCase("Case D",P = 100, Q = 400, 100)

##      n    Price Quantity
## 91  90 113.3811 256.9502
## 92  91 137.6861 259.6264
## 93  92 161.7234 267.1636
## 94  93 185.0071 279.5083
## 95  94 207.0562 296.5097
## 96  95 227.4053 317.9209
## 97  96 245.6132 343.4020
## 98  97 261.2730 372.5246
## 99  98 274.0205 404.7792
## 100 99 283.5426 439.5833

With 500 iterations

runCase("Case D",P = 100, Q = 400, 500)

##       n      Price   Quantity
## 491 490 -2357.5483 -11813.987
## 492 491 -1126.1496 -12305.497
## 493 492   154.4001 -12550.727
## 494 493  1459.4728 -12539.847
## 495 494  2763.4575 -12267.952
## 496 495  4040.2528 -11735.261
## 497 496  5263.7789 -10947.210
## 498 497  6408.4999  -9914.455
## 499 498  7449.9454  -8652.755
## 500 499  8365.2209  -7182.766

In conclusion, we can state that in this model, the equilibrium point is not stable.

END.