Difference between revisions of "Linear programming"

From Karnataka Open Educational Resources
Jump to navigation Jump to search
(Made Linear Programming page)
 
Line 1: Line 1:
== Foundations of Linear Programming ==
+
== Concept 1 : Mathematical modelling ==
Linear Programming is a way to find optimal solutions for a mathematical model defined by the linear constraints.
+
One of the most important applications of mathematics in life is to find a optimal solution for problems. For example, what goods should a shopkeeper buy to get the most amount of profit or what is the optimal combination of food you should eat to get maximum amount of nutrients? 
  
== Concept 1 : Linear inequalities ==
+
To solve these questions, we need to mathematize them i.e. make equations out of those which can be solved. For example we need to write down how much profit does the shopkeeper get on each good, how much budget does he have, which goods sell more, which goods might go bad etc and then using this data, devise equations which will help us in finding the optimal combination of goods the shopkeeper should buy. 
 +
 
 +
This process of converting a real life problem in a mathematical fashion is called '''mathematical modelling.''' 
 +
 
 +
== Concept 2 : Linear Programming ==
 +
As the name suggests, '''Linear Programming''' is a method of optimizing a mathematical model which is represent by linear constraints only i.e. it does not contain any second order terms. Only equations of form <math>a_1 x_1+a_2x_2+a_3 x_3......=a_0</math>are allowed where <math>a_n</math>are constants and <math>x_n</math>are variables.
  
 
== Concept 2 : Finding optimal solutions ==
 
== Concept 2 : Finding optimal solutions ==
 +
Now we will solve a real life optimization problem using linear programming.
 +
 +
=== '''Question''' ===
 +
One kind of cake (Cake A) requires 200g of flour and 25g of fat, and another kind of cake (Cake B) requires 100g of flour and 50g of fat. Find the maximum number of cakes which can be made from 5kg of flour and 1 kg of fat assuming that there is no shortage of the other ingredients used in making the cakes. (From NCERT)
 +
 +
Let <math>x </math>be the number of cake A and <math>y</math>be the number of cake B.
 +
 +
According to the question we have to maximize <math>x+y</math>in limited number of ingredients (5 kg flour and 1 kg fat)
 +
 +
Before moving ahead we should set a baseline. We know that <math>x
 +
</math>and <math>y</math>cant be less than 0.
 +
 +
Hence <math>x , y \geq 0 </math>
 +
 +
For flour :
 +
 +
<math>200 x + 100 y \leq 5000</math>
 +
 +
What this basically means is that if we make <math>x</math>cake A , we will use <math>200x
 +
</math>grams of flour. Similarly for <math>y
 +
</math> cake B, we will use <math>100y
 +
</math> grams of flour. The total flour used in all the cakes should be less than 5000g. 
 +
 +
Similarly for fat :
 +
 +
<math>25x + 50y \leq 1000</math>
 +
 +
Now we have four linear inequalities. There are multiple ways to solve these inequalities. The first method we will look at is the graphical method which is easier to visualize and understand.
 +
 +
==== Activity ====
 +
Plot the following inequalities on geogebra.
 +
 +
<math>x \geq 0 </math>
 +
 +
<math>y \geq 0 </math>
 +
 +
<math>200 x + 100 y \leq 5000</math>
 +
 +
<math>25x + 50y \leq 1000</math>
 +
 +
Geogebra file : https://www.geogebra.org/calculator/qvjg3ntd
 +
[[File:Linear programming question 1.png|thumb|Geogebra plot]]

Revision as of 07:20, 17 June 2022

Concept 1 : Mathematical modelling

One of the most important applications of mathematics in life is to find a optimal solution for problems. For example, what goods should a shopkeeper buy to get the most amount of profit or what is the optimal combination of food you should eat to get maximum amount of nutrients?

To solve these questions, we need to mathematize them i.e. make equations out of those which can be solved. For example we need to write down how much profit does the shopkeeper get on each good, how much budget does he have, which goods sell more, which goods might go bad etc and then using this data, devise equations which will help us in finding the optimal combination of goods the shopkeeper should buy.

This process of converting a real life problem in a mathematical fashion is called mathematical modelling.

Concept 2 : Linear Programming

As the name suggests, Linear Programming is a method of optimizing a mathematical model which is represent by linear constraints only i.e. it does not contain any second order terms. Only equations of form are allowed where are constants and are variables.

Concept 2 : Finding optimal solutions

Now we will solve a real life optimization problem using linear programming.

Question

One kind of cake (Cake A) requires 200g of flour and 25g of fat, and another kind of cake (Cake B) requires 100g of flour and 50g of fat. Find the maximum number of cakes which can be made from 5kg of flour and 1 kg of fat assuming that there is no shortage of the other ingredients used in making the cakes. (From NCERT)

Let be the number of cake A and be the number of cake B.

According to the question we have to maximize in limited number of ingredients (5 kg flour and 1 kg fat)

Before moving ahead we should set a baseline. We know that and cant be less than 0.

Hence

For flour :

What this basically means is that if we make cake A , we will use grams of flour. Similarly for cake B, we will use grams of flour. The total flour used in all the cakes should be less than 5000g.

Similarly for fat :

Now we have four linear inequalities. There are multiple ways to solve these inequalities. The first method we will look at is the graphical method which is easier to visualize and understand.

Activity

Plot the following inequalities on geogebra.

Geogebra file : https://www.geogebra.org/calculator/qvjg3ntd

Geogebra plot