Linear Programming
Linear Programming
Linear Inequalities
inequality represents the mathematical expression in which both sides are not equal.
In this case, the equal sign “=” in the expression is replaced by any of the inequality
symbols such as greater than symbol (>), less than symbol (<), greater than or equal to
symbol (≥), less than or equal to symbol (≤) or not equal to symbol (≠).
Examples: x > 2, y – 2x < 0 and y > x
Example
y < 10 – 2x
y < -2x + 10
Graph the line y = x – 2 and y = -2x + 10
draw a solid line for y≤ or y≥ and a dashed line for y< or y>. Shade the line as per
inequalities, such as above the line for a “greater than” and below the line for a “less
than”.
Linear Programming
Linear programming is a mathematical concept that is used to find the optimal solution
of the linear function. This method uses simple assumptions for optimizing the given
function. Linear Programming has a huge real-world application and it is used to solve
various types of problems.
In simple terms, it is the method to find out how to do something in the best possible way.
With limited resources, you need to do the optimum utilization of resources and achieve
the best possible result in a particular objective such as least cost, highest margin, or least
time.
Components
• Decision Variables: Variables you want to determine to achieve the optimal solution.
• Objective Function: Mathematical equation that represents the goal you want to achieve
• Constraints: Limitations or restrictions that your decision variables must follow.
• Non-Negativity Restrictions: In some real-world scenarios, decision variables cannot be
negative
General Formula
Two friends start their own business, where they knit and sell scarves and sweaters out of
high-quality wool. They can make a profit of $8 per scarf and $10 per sweater. To make a
scarf, 3 bags of knitting wool are needed; to make a sweater, 4 bags of knitting wool are
needed. The friends can only make 8 items per day, and can use not more than 27 bags of
knitting wool per day. Write the inequalities that represent the constraints. Then
summarize what has been described thus far by writing the objective function for profit
and the two constraints.
Let 𝑥 represent the number of scarves sold, and let 𝑦 represent the number of sweaters
sold. There are two constraints: the number of items the business can make in a day (a
maximum of 8) and the number of bags of knitting wool they can use per day (a
maximum of 27). The first constraint (total number of items in a day) is written as:
x+y<8
Since each scarf takes 3 bags of knitting wool and each sweater takes 4 bags of knitting
wool, the second constraint, total bags of knitting wool per day, is written as:
3𝑥+4𝑦≤27
This is the profit equation: The business makes $8 per scarf and $10 per sweater.
P = 8x + 10y
Example#2
A factory produces two products, widgets and wadgets. It takes 24 minutes for the factory
to make 1 widget, and 32 minutes for the factory to make 1 wadget. Research indicates
that long-term demand for products from the factory will result in average sales of 12
widgets per day and 10 wadgets per day. Because of limitations on storage at the factory,
no more than 20 widgets or 17 wadgets can be made each day. Write the inequalities that
represent the constraints. Then summarize what has been described thus far by writing the
objective function for time and the two constraints.
Let 𝑥 equal the number of widgets made; let 𝑦 equal the number of wadgets made. Based
on the long-term demand, we know the factory must produce a minimum of 12 widgets
and 10 wadgets per day. We also know because of storage limitations, the factory cannot
produce more than 20 widgets per day or 17 wadgets per day. Writing those as
inequalities, we have:
𝑥 ≥ 12
𝑦 ≥ 10
𝑥 ≤ 20
𝑦≤17
The number of widgets made per day must be between 12 and 20, and the number of wadgets
made per day must be between 10 and 17. Therefore, we have:
12 ≤ 𝑥 ≤ 20
10 ≤ 𝑦 ≤ 17
The system is:
𝑇 = 24𝑥 + 32𝑦
12 ≤ 𝑥 ≤ 20
10 ≤ 𝑦 ≤ 17
𝑇 is the variable for time; it takes 24 minutes to make a widget and 32 minutes to make a wadget.
Graphical Method
The graphical method is used to optimize the two-variable linear programming. If the
problem has two decision variables, a graphical method is the best method to find the
optimal solution. In this method, the set of inequalities are subjected to constraints. Then
the inequalities are plotted in the XY plane. Once, all the inequalities are plotted in the
XY graph, the intersecting region will help to decide the feasible region. The feasible
region will provide the optimal solution as well as explains what all values our model can
take.
Example#1
Find the maximal and minimal value of z = 6x + 9y when the constraint conditions
are,
• 2x + 3y ≤ 12
• x and y ≥ 0
• x+y≤5
First convert the inequations into normal equations
2x+3y = 12, x = 0, y = 0 and x + y = 5
Find the points at which 2x + 3y = 12 and x + y = 5 cut the x-axis and y-axis.
X - axis intersection(y = 0)
2x + 3(0) = 12
(6,0) and (5,0)
x=6
(6,0) can’t be used be
used for the second
x+0=5 inequality
x=5
Y - axis intersection(x = 0)
(0,4) and (0,5)
2(0) + 3y = 12 (0,5) can’t be used be
y=4 used for the second
inequality
Point of intersection of the two lines:
0+y=5
x+y=5 2x + 3y = 12
y=5 x=5–y 2(5 – y) + 3y = 12
10 – 2y + 3y =
12
y = 12 – 10 = 2
x=5–y=5-2=3
(3,2)
Find Z for each point and maxima and minima.
Coordinates Z = 6x + 9y
(0,4) Z = 36
(5,0) Z = 30
(3,2) Z = 36
Hence, we find that Z = 6x + 9y is maximum at (0,4) and (3,2) and minimum at (5,0).
Example #2
Two friends start their own business, where they knit and sell scarves and sweaters out of
high-quality wool. They can make a profit of $8 per scarf and $10 per sweater. To make a
scarf, 3 bags of knitting wool are needed; to make a sweater, 4 bags of knitting wool are
needed. The friends can only make 8 items per day, and can use not more than 27 bags of
knitting wool per day. Use linear programming to determine the most optimal solution for
maximum profit.
Objective Function: P = 8x + 10y
X - axis intersection(y = 0)
Constraints: 3x + 4(0) = 27
x+y<8 x=9
3𝑥 + 4𝑦 ≤ 27 x+0=8
x ≥ 0, y ≥ 0 x=8
It aims to find the optimal solution by iteratively improving the objective function value.
This method is considered one of the greatest inventions of modern times due to its broad
applicability in solving business-related problems.
Steps
Step 1: Formulate the linear programming problems based on the given constraints.
Step 2: Convert all the given inequalities to equations or equalities of the linear programming problems by adding the slack
variable to each inequality where ever required.
Step 3: Construct the initial simplex table. By representing each constraint equation in a row and writing the objective
function at the bottom row. The table so obtained is called the Simplex table.
Step 4: Identify the greatest negative entry in the bottom row the column of the element with the highest negative entry is
called the pivot column
Step 5: Divide the entries of the right-most column with the entries of the respective pivot column, excluding the entries of the
bottommost row. Now the row containing the least entry is called the pivot row. The pivot element is obtained by the
intersection of the pivot row and the pivot column.
Step 6: Using matrix operation and with the help of the pivot element make all the entries in the pivot column to be zero.
Step 7: Check for the non-negative entries in the bottommost row if there are no negative entries in the bottom row, end the
process else start the process again from step 4.
Step 8: The final simplex table so obtained gives the solution to our problem.
Websites:
https://byjus.com/maths/linear-inequalities/
https://www.geeksforgeeks.org/linear-programming/
https://openstax.org/books/contemporary-mathematics/pages/5-11-linear-programming
The Mathematics of Finance
Simple Interest
When money is borrowed, the person borrowing the money (borrower) typically has to
pay the person or entity that lent the money (the lender) more than the amount of money
that was borrowed. This extra money is the interest that is to be paid. Interest is
sometimes referred to as the cost to borrow, the cost of the loan, or the finance cost.
This idea also applies when someone deposits money in a bank account or some other
form of investment. That person is essentially lending the money to the bank or company.
The money earned by the depositor is also called interest. The interest is typically based
on the amount borrowed, or the principal.
Formula
The simple interest, 𝐼, to be paid on a loan with annual interest rate 𝑟 for a number of
years (term of the loan) 𝑡,
This total is often referred to as the loan payoff amount, or more simply just the payoff.
Example #1
Calculate the simple interest to be paid on a loan with the given principal, annual
percentage rate, and number of years. Then, calculate the loan payoff amount.
Riley runs an auto repair shop, and needs to purchase a new brake lathe, which costs
$11,995. She takes out a two-year, simple interest loan at an annual interest rate of 14.9%.
How much interest will she pay and how much total will she repay on the loan?
P = 11,995
r = 14.9% or 0.149
t = 2 yrs
𝐼 = 𝑃×𝑟×𝑡 = 11995 × 0.149 × 2 = 3,574.51
𝑇 = 𝑃+𝐼 = 11,995 + 3,574.51 = 15,569.51
Example #3
In the following, determine how much interest was earned on the investment and the
future value of the investment, if the investment yields simple interest.
1. Principal is $1,000, annual interest rate is 2.01%, and time is 5 years
2. Principal is $5,000, annual interest rate is 1.85%, and time is 30 years
3. Principal is $10,000, annual interest rate is 1.25%, and time is 18 months
4. Principal is $7,000, annual interest rate is 3.26%, and time is 100 days
1. The principal is 𝑃 = $1,000, the annual interest rate is 0.0201, and the term is 5 years,
or 𝑡 = 5. The interest earned on the investment is 𝐼=𝑃×𝑟×𝑡=1,000×0.0201×5=100.5, or the
interest earned was $100.50.
T = 𝑃+𝐼 = 1,000 + 100.5 = 1100.5. The future value of the investment at the end of 5
years is $1,100.50.
2. The principal is 𝑃 = $5,000, the annual interest rate is 0.0185, and the term is 30 years,
or 𝑡 = 30. The interest earned on the investment is 𝐼=𝑃×𝑟×𝑡=5,000×0.0185×30=2,775, or
the interest earned was $2,775.00.
T = 𝑃+𝐼 = 5,000 + 2,775 = 7,775. The future value of the investment at the end of 30
years is $7,775.00.
3. The principal is 𝑃 = $10,000, the annual interest rate is 0.0125, and the term is 18 months.
For 18 months, we use 18/12 as 𝑡. The interest earned on the investment is 𝐼 = 𝑃×𝑟×𝑡 =
10,000×0.0125×(18/12) = 187.5, or the interest earned was $187.50.
T = 𝑃+𝐼 = 10,000 + 187.5 = 10,187.5. The future value of the investment at the end of 18
months is $10,187.50.
4. Principal is $7,000, annual interest rate is 3.26%, and time is 100 days. The principal
is 𝑃 = $7,000, the annual interest rate, in decimal form, is 0.0326, and the term is 100
days. For 𝑡 = 100/365. The interest earned on the investment is 𝐼 = 𝑃×𝑟×𝑡 =
7,000×0.0326×(100/365)=62.52, or the interest earned was $62.52.
T = 𝑃+𝐼 = 7,000+62.52 = 7,062.52. The future value of the investment at the end of 100
days is $7,062.52.
Compound Interest
An account that pays simple interest only pays based on the original principal and the
term of the loan. Accounts offering compound interest pay interest at regular intervals.
After each interval, the interest is added to the original principal. Later, interest is
calculated on the original principal plus the interest that has been added previously.
After each period, the interest on the account is computed, then added to the account.
Then, after the next period, when interest is computed, it is computed based on the
original principal AND the interest that was added in the previous periods.
Formula
The future value of an investment, 𝐴, the principal 𝑃 is invested at an annual interest rate
of 𝑟, compounded 𝑛 times per year, for 𝑡 years,
Compounded annually n = 1
Compounded monthly n = 12
Compounded quarterly n = 4
Compounded daily n = 365
Compounded semiannually n = 2
Example #1: Future value
Principal is $5,000, annual interest rate is 3.8%, compounded monthly, for 5 years.
Principal is $18,500, annual interest rate is 6.25%, compounded quarterly, for 17 years.
Example #2: Present value
How can you buy expensive stuffs without the cash sufficient for the purchase? You
borrow the money and the lender will receive back the money with interest.
Loans are taken out to pay for goods or services when a person does not have the cash to
pay for the goods or services. Loans can come from a bank, or from the company selling
the goods or providing the service. The borrower agrees to pay back more than the
amount borrowed. So there is a cost to borrowing that should be considered when
deciding on a purchase bought with credit or a borrowed money. Even using credit cards
are loan.
Terms
I is the interest to be paid with the remaining principal P with the rate of interest r paid in
n times a year,
Find the interest to be paid for the period on loans with the following remaining principal
and given annual interest rate. Each period is a month. Remaining principal is $13,450,
interest rate is 6.75%
Example #2
In the following, calculate the payment necessary to pay off the loan with the given
details. The payments are monthly. A car loan taken out for $28,500 at an annual interest
rate of 3.99% for 5 years.
Credit Cards
Credit cards are used to borrow money, usually from the bank, to pay a purchase. The
payment is a type of loan so the borrower will pay the lender back with interest. The
credit card charges the lender with an annual fee, which is the fee charged for the
privilege of using the card. The card also grants reward programs which are benefits
granted from the usage of the card. There is also a credit limit which is the maximum
amount the card can grant. The card can’t be used if the limit is exceeded until the debt is
paid.
Types: Bank-issued credit cards, store-issued credit cards and travel/entertainment cards
or charge cards
Credit Score
The credit score is a number that will show the ability of the borrower in paying off loans
based on the credit report.
Included in the calculation of credit score:
Credit Payment History: is the borrower paying on time and enough
The amount owed or credit utilization ratio: how much of the credit limit is reached
Length of credit history: age of the loan or credit card and time of being used
Types of credit used
New Credit: how often new accounts are opening
Credit Card Statements
The cardholders will receive monthly statements and they should pay the amount for at
most 21 day for the minimum amount. The billing period is one month from the
registration of the card. The statement will include the current balance, interest rate, the
minimum payment due, and the due date. Missing the due date will result in paying late
fee and a negative report to credit bureau and negatively affects the credit score.
Balance of the Credit Card
The balance, or sometimes balance due, on a credit card is the previous balance, plus all
expenses, minus all payments and credits, plus the interest on the card.
Average Daily Balance
Example:
Compute the average daily balance:
Date Activity Amount
1-May Billing Date Balance $450.21
10-May Payment $120.00
15-May Groceries $83.43
26-May Auto Parts $45.12
26-May Restaurant $85.34
30-May Shoes $98.23
Add the amount on the same day. The payment will be treated as a negative value
Date Amount
1-May $450.21
10-May $330.21
15-May $413.64
26-May $544.10
30-May $642.33
Add a column with the days before the balance changes(the last will be 2 because May
has 31 days) and another column for balance times days:
I is the interest
ADB is the average daily balance
r is the rate of interest
d is the billing cycle days
Example
Compute the interest charged for the credit card based on the given:
ADB = $2,765.00, annual interest rate 13.99%, billing cycle of 30 days
Minimum Payment
The minimum payment due is the smallest required amount to be paid on a credit card to
avoid late fees and penalties, such as an increased interest rate. The calculations for this
may differ from card to card. They also depend in the balance of the credit card. General
guidelines for minimum payment due are:
• For larger balances (usually over $1,000), the minimum payment will be some percentage
of the balance due.
• For moderate balances (between $25 and $1,000), the minimum would be a specified
dollar amount. $25 seems to be a common value.
• If the balance is small (under $25 for instance), then the minimum payment is the balance.
Example
The FYA credit card company has the following minimum payment policy. For balances
over $1,000, the minimum payment is 2.5% of the balance due plus fees, but not interest.
For balances between $500.00 and $999.99, the minimum payment is $50.00. For
balances $499.99 and under, the minimum payment is $25.00 or the balance due,
whichever is smaller.
In the following, calculate the minimum payment due given the credit card minimum
payment policy, the balance due and fees charged.
1. Balance due is $1,309.00, no fees
2. Balance due is $265.50, $35 in fees
3. Balance due is $784.90, no fees
1. The amount is greater than 1000 so the minimum is 2.5% of the balance:
You can save your money in a safe or a vault (or worse, under the mattress!), but that
money does not grow. It would be hard to save enough for retirement that way. What can
be done to increase the value of the money you already have?
Bonds
Bonds are issued from big companies and from governments. Selling bonds is an
alternative to an institution taking a loan from a bank. The funds from the selling of bonds
are often used for large projects, like funding the building of a new highway or hospital.
They are bought for what is known as the issue price. The interest is fixed (does not
change) at the time of purchase and is based on the issue price of the bond. The interest
rate is often referred to as the coupon rate; the interest paid is often called the coupon
yield. The interest paid is often higher than savings accounts and the risk is exceptionally
low. The bond is for a fixed length of time. The end of this time is the maturity date of the
bond.
Example: Muriel purchases a $3,000 bond with a maturity of 4 years at a fixed
coupon rate of 5.5% paid annually. How much is Muriel paid each year, and how
much does she receive on the maturity date?
The coupon rate is 5.5% of her bond value is 0.055×$3,000=$165. After year 1, Muriel
receives $165. She receives $165 after years 2 and 3 also. In year 4, when the bond
matures, Muriel receives $3,165, or the interest and the initial investment, or principal.
Stock
Stocks are part ownership in a company. They come in units called shares. The
performance and earnings of stocks is not guaranteed, which makes them riskier than any
other investment discussed earlier. However, they can offer higher return on investment
than the other investments. Their value grows in two ways. They offer dividends, which
is a portion of the profit made by the company. And the price per share can increase based
on how others see that value of the company changing. If the value of the company drops,
or the company folds, the money invested in the stock also drops.
Example: Haniah buys stock in the ABC company, investing a total of $13,000. She expects
the stock to grow, through stock price increase and reinvestment of dividends, by 12.3% per
year and compounded annually. If she leaves that money invested, how much will the stocks
be worth in 20 years?
The principal is $13,000, the rate is 0.123, the number of compounding periods per year is
1, and the time is 20 years.
A mutual fund is a collection of investments that are all bundled together. When you buy
shares of a mutual fund, your money is pooled with the assets of other investors. This
pooled money is invested in stocks, bonds, money market instruments, and other assets.
Mutual funds are typically operated by professional money managers who allocate the
fund's assets and attempt to produce capital gains or income for the fund's investors.
Example:
Kaitlyn has analyzed her $12,862.50 quarterly budget using the 50-30-20 budget
philosophy, and sees she should be saving or paying down debt with $2,572.50 per
quarter. She decides to invest $1,300 quarterly a mutual fund that reports an average
return of 11.62% over the 18-year life of the mutual fund. Assuming that this interest rate
continues, and is compounded quarterly, how much will her mutual fund account be worth
after 5 years?
The equation for future value:
Return on Investments
It is a measure on how profitable an investment is. The higher the return the better the
investments.
Example: Muriel purchased a $3,000 bond with a maturity of 4 years at a fixed
coupon rate of 5.5% paid annually. What was Muriel’s return on investment?
Each year, Muriel received $165. She received this money four times, so earned a total of
$660. So the future value is $3,660.
Mortgage
A mortgage is a long-term loan and the property itself is the security. The bank decides
the minimum down payment (with your input), the payment schedule, the duration of the
loan, whether the loan can be assumed by another party, and the penalty for late
payments. The title of the home belongs to the bank.
Example: Cassandra buys a house. Her 30-year mortgage comes to $99,596 with
5.35% interest. If Cassandra pays off the mortgage over those 30 years, how much
will she have paid in total?
https://openstax.org/books/contemporary-mathematics/pages/6-3-simple-interest
https://openstax.org/books/contemporary-mathematics/pages/6-4-compound-interest
https://openstax.org/books/contemporary-mathematics/pages/6-8-the-basics-of-loans
https://openstax.org/books/contemporary-mathematics/pages/6-10-credit-cards
https://openstax.org/books/contemporary-mathematics/pages/6-7-investments
https://openstax.org/books/contemporary-mathematics/pages/6-12-renting-and-homeown
ership
https://www.moneymax.ph/personal-finance/articles/credit-score-philippines