Skip to content

Commit

Permalink
[lp_intro]Update lp (#531)
Browse files Browse the repository at this point in the history
* explain iso-revenue lines

* add comma in the numbers

* Update lectures/lp_intro.md

Co-authored-by: Matt McKay <[email protected]>

---------

Co-authored-by: Matt McKay <[email protected]>
  • Loading branch information
longye-tian and mmcky committed Jul 26, 2024
1 parent 0c60b16 commit c814e4e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lectures/lp_intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ $$

The following graph illustrates the firm's constraints and iso-revenue lines.

Iso-revenue lines show all the combinations of materials and labor that produce the same revenue.

```{code-cell} ipython3
---
tags: [hide-input]
Expand Down Expand Up @@ -335,7 +337,7 @@ OR-Tools tells us that the best investment strategy is:

3. At the beginning of the third year, the bank balance should be $ \$75,072.245 $.

4. At the end of the third year, the mutual fund will get payouts from the annuity and corporate bond and repay its loan from the bank. At the end it will own $ \$141018.24 $, so that it's total net rate of return over the three periods is $ 41.02\%$.
4. At the end of the third year, the mutual fund will get payouts from the annuity and corporate bond and repay its loan from the bank. At the end it will own $ \$141,018.24 $, so that it's total net rate of return over the three periods is $ 41.02\%$.



Expand Down Expand Up @@ -542,14 +544,14 @@ c_ex2 = np.array([1.30*3, 0, 0, 1.06, 1.30])
A_ex2 = np.array([[1, 1, 0, 0, 0],
[1, -rate, 1, 0, 1],
[1, 0, -rate, 1, 0]])
b_ex2 = np.array([100000, 0, 0])
b_ex2 = np.array([100_000, 0, 0])
# Bounds on decision variables
bounds_ex2 = [( 0, None),
(-20000, None),
(-20000, None),
(-20000, None),
( 0, 50000)]
(-20_000, None),
(-20_000, None),
(-20_000, None),
( 0, 50_000)]
```
Let's solve the problem and check the status using `success` attribute.
Expand Down Expand Up @@ -581,7 +583,7 @@ SciPy tells us that the best investment strategy is:
3. At the beginning of the third year, the mutual fund should borrow $ \$20,000$ from the bank and invest in the annuity.
4. At the end of the third year, the mutual fund will get payouts from the annuity and corporate bond and repay its loan from the bank. At the end it will own $ \$141018.24 $, so that it's total net rate of return over the three periods is $ 41.02\% $.
4. At the end of the third year, the mutual fund will get payouts from the annuity and corporate bond and repay its loan from the bank. At the end it will own $ \$141,018.24 $, so that it's total net rate of return over the three periods is $ 41.02\% $.
Expand Down

0 comments on commit c814e4e

Please sign in to comment.