Quantitative Exercise 1 and 2
Quantitative Exercise 1 and 2
A company makes two products (X and Y) using two machines (A and B).
Each unit of X that is produced requires 50 minutes of processing time on machine A and 30
Minutes of processing time on machine B. Each unit of Y that is produced requires 24 minutes of
processing time on machine A and 33 minutes of processing time on machine B. Available processing
time on machine A is forecasted to be 35 hours. The company expects a profit of birr 75 per unit from X
and birr 95 from Y.
Exercise 2
Graphical method for L.P minimization problem
The agricultural institute suggested to a farmer to spread out at least 480kg of phosphate fertilizer and
not less than 720kg of nitrogen fertilizer to raise productivity of crops in his field. There are two sources
for obtaining these mixtures A and B. Both of these are available in bags weighing 100kg each and they
cost birr 40 and 24 respectively. Mixture A contains phosphate and nitrogen equivalent of 20kg and 80kg
respectively, while mixture B contains these ingredient equivalent of 40kg each.
Answer 1
# Define constraints
prob += 50 * x + 24 * y <= 60 * 35, "Machine A processing time"
prob += 30 * x + 33 * y <= 60 * 24, "Machine B processing time"
The output will show the optimal solution, which is 358.333 units of X and 397.917 units of Y for
a total profit of 67,916.67 birr.
Answer 2
a) The problem can be modeled as a linear programming problem with the following
variables:
Let x be the number of bags of mixture A to buy Let y be the number of bags of mixture
B to buy
The objective function to minimize cost can be written as: Minimize Z = 40x + 24y
Subject to the following constraints: 20x + 40y ≥ 480 (phosphate fertilizer requirement)
80x + 40y ≥ 720 (nitrogen fertilizer requirement) x, y ≥ 0 (non-negative quantities of
bags)
The objective function to minimize cost can be written as: Minimize Z = 40x + 24y
Subject to the following constraints: 20x + 40y ≥ 480 (phosphate fertilizer requirement)
80x + 40y ≥ 720 (nitrogen fertilizer requirement) x, y ≥ 0 (non-negative quantities of
bags)
b) Here is the Python code to solve the problem using PuLP library:
from pulp import *
# Define constraints
prob += 20 * x + 40 * y >= 480, "Phosphate fertilizer
requirement"
prob += 80 * x + 40 * y >= 720, "Nitrogen fertilizer requirement"