unit 2: mathematical applications module 1: discrete ... · 5. identify the objective function and...

17
1 UNIT 2: MATHEMATICAL APPLICATIONS MODULE 1: DISCRETE MATHEMATICS (a) Linear Programming Students should be able to: 1. derive and graph linear inequalities in two variables; 2. determine whether a selected trail point satisfies a given inequality; 3. determine the solution set that satisfies a set of linear inequalities in two variables; 4. determine the feasible region of a linear programming problem; 5. identify the objective function and constraints of a linear programming problem; 6. determine a unique optimal solution (where it exists) of a linear programming problem; 7. formulate linear programming models in two variables from real-world data. Introduction Linear Programming: a mathematical method used to find the ‘best’ solution to problems which can be expressed in terms of linear equations or inequalities. Solutions are usually found by drawing graphs of inequalities and looking for optimum values that satisfy the required conditions. This method is widely used in business and industrial contexts and the problems often relate to obtaining maximum profits for given costs and production levels. Variables: items whose quantities are controlled. Variables can take various values within a problem. For graphical solutions we can only have two variables (one on each axis). Constraints: equations or inequalities, involving one or more of the variables, which limit or control the values the variable(s) can take. In linear programming most (if not all) of the constraints are inequalities. The non-negativity constraints are > 0, > 0. Feasible region: the set of points on the graph which satisfy all the constraints. The feasible region is usually left unshaded in linear programming graphs. Exercise For each of the following questions (i) choose and define the variables; (ii) write down the constraints; (iii) draw the graphs of the inequalities and identify the feasible region. 1. A school librarian is ordering new books. He has a total budget of $1000. He must order at least three books on discrete mathematics and at least three books in pure mathematics. Discrete books cost $120 each and pure books cost $150. 2. A gardener grows carrots and lettuce on a plot 2 m wide. A 10 cm strip is needed for a row of carrots and a 50 cm strip is needed for a row of lettuce. He uses a seed dispenser that has to be filled twice in order to sow a row of carrot seeds and once for a row of lettuce and he only has time to fill the dispenser at most 22 times.

Upload: others

Post on 27-Mar-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

1

UNIT 2: MATHEMATICAL APPLICATIONS

MODULE 1: DISCRETE MATHEMATICS

(a) Linear Programming Students should be able to: 1. derive and graph linear inequalities in two variables; 2. determine whether a selected trail point satisfies a given inequality; 3. determine the solution set that satisfies a set of linear inequalities in two variables; 4. determine the feasible region of a linear programming problem; 5. identify the objective function and constraints of a linear programming problem; 6. determine a unique optimal solution (where it exists) of a linear programming problem; 7. formulate linear programming models in two variables from real-world data.

Introduction

Linear Programming: a mathematical method used to find the ‘best’ solution to problems which can be expressed in terms of linear equations or inequalities. Solutions are usually found by drawing graphs of inequalities and looking for optimum values that satisfy the required conditions. This method is widely used in business and industrial contexts and the problems often relate to obtaining maximum profits for given costs and production levels.

Variables: items whose quantities are controlled. Variables can take various values within a problem. For graphical solutions we can only have two variables (one on each axis).

Constraints: equations or inequalities, involving one or more of the variables, which limit or control the values the variable(s) can take. In linear programming most (if not all) of the constraints are inequalities.

The non-negativity constraints are 𝒙 > 0, 𝑦 > 0.

Feasible region: the set of points on the graph which satisfy all the constraints. The feasible region is usually left unshaded in linear programming graphs.

Exercise

For each of the following questions (i) choose and define the variables; (ii) write down the constraints; (iii) draw the graphs of the inequalities and identify the feasible region.

1. A school librarian is ordering new books. He has a total budget of $1000. He must order at least

three books on discrete mathematics and at least three books in pure mathematics. Discrete books cost $120 each and pure books cost $150.

2. A gardener grows carrots and lettuce on a plot 2 m wide. A 10 cm strip is needed for a row of

carrots and a 50 cm strip is needed for a row of lettuce. He uses a seed dispenser that has to be filled twice in order to sow a row of carrot seeds and once for a row of lettuce and he only has time to fill the dispenser at most 22 times.

2

Optimisation Objective: the purpose of the linear programming problem – e.g. costs, profits. Objective function: an expression, involving the variables, which is to be maximised or minimised. This is sometimes called the profit function. Optimum solution or optimal solution: the combination of the variables that gives the ‘best’ solution to the problem. Every point in the feasible region is a solution to the problem. In linear programming there are two methods used to find the optimal solution - i.e. the solution which minimises costs or maximises profits. Any set of constraints will always generate a convex shape, the feasible region. A set of parallel lines with gradient equal to the objective function and with the first one passing through the point of least profit, will pass through the other vertices, in order, round each side, giving increased profit, until the maximum profit is reached. Method 1: Tour of vertices PROCEDURE

Select a start vertex – usually the origin, if it is the feasible region – and evaluate the profit.

Calculate the profit at an adjacent vertex. If it is greater, make it the current vertex until no adjacent vertex has a greater profit.

Method 2: Profit line PROCEDURE

Draw a line, with gradient equal to the gradient of the objective function, through the origin.

Move this line up the y-axis until it is just leaving the feasible region. The point of exit is the optimum solution.

Efficiency and choice of method Method 1 requires that the coordinates of each vertex are known. These may be read from an accurately draw graph or calculated using simultaneous equations (especially when the solution does not have integer values). Method 2 can often be approximated by a sketch but it will still be necessary to calculate and verify likely solution points. A consideration of gradients will also help since the optimum point will lie at the intersection of constraints whose gradients are the closest above and below the gradient of the profit (objective) line. Exercise

(a) Draw the graph represented by the constraints 2𝑥 + 𝑦 ≤ 16, 2𝑥 + 3𝑦 ≤ 24, 𝑦 ≤ 6, 𝑥 ≥ 0, 𝑦 ≥ 0

(b) If the objective function is 𝑃 = 𝑥 + 𝑦, use Method 1 to find the optimal solution. (c) If the objective function is 𝑃 = 𝑥 + 2𝑦, use Method 2 to find the optimal solution.

3

Integer Solutions When integer solutions are required the integer points within the feasible region must be considered to find the one with the best profit or cost. In this case we consider the integer points closest to the boundary of the feasible region. Exercise Maximise 5𝑥 + 6𝑦 subject to 𝑥 + 𝑦 ≤ 6, 2𝑥 + 3𝑦 ≤ 14, given that 𝑥 and 𝑦 are integers.

Multiple Solutions There are two cases when multiple solutions occur.

The profit line is parallel to one of the constraints. All points on that line (in the feasible region) have an equal profit and are, therefore, optimum solutions.

If an integer solution is required and the maximum profit occurs at a point with non-integer values, more than one point in the feasible region have the same ‘maximum’ profit and are therefore all optimum solutions.

Exercise Given that 𝑥 and 𝑦 are integers

1. Maximise 8𝑥 + 6𝑦 subject to 3𝑥 + 5𝑦 ≤ 30, 4𝑥 + 3𝑦 ≤ 24. 2. Maximise 𝑥 + 𝑦 subject to 3𝑥 + 2𝑦 ≤ 17, 4𝑥 + 𝑦 ≤ 15.

Minimisation Problems Problems which are about minimising costs are solved using the same procedure as problems about maximising profits. However, there are differences.

The feasible region is infinite.

The origin is NOT feasible, therefore, a vertex on one of the axes is usually taken as a starting point for a tour of vertices.

The cost line starts towards the top right of the graph and moves towards the origin to find the lowest cost.

Exercise

1. Minimise 𝑥 + 2𝑦 subject to 4𝑥 + 5𝑦 ≥ 40, 8𝑥 + 3𝑦 ≥ 48 2. Minimise 𝑥 + 𝑦 subject to 3𝑥 + 5𝑦 ≥ 30, 3𝑥 + 2𝑦 ≥ 24

(a) when 𝑥 and 𝑦 can take any values (b) when 𝑥 and 𝑦 must be integers.

4

3. A diamond company has two mines. The first costs $15 000 a day to operate and will produce in

one day 1 kg of jewel grade diamonds, 2 kg of medium grade and 5 kg of industrial grade. The second mine costs $22 000 a day, and produces in one day 4 kg of jewel grade diamonds, 1 kg of medium grade and 6 kg of industrial grade. The company must produce at least 8 kg of jewel grade, 8 kg of medium grade and 30 kg of industrial grade diamonds each month. How many days should it operate each mine to meet this quota as cheaply as possible is (a) It can use a mine for only part of a day (b) It must use each mine for a whole number of days.

3 or More Variables In real-world situations many linear programming problems will have more than two variables. Problems involving 3 variables can be solved graphically using 3-dimensional axes. The feasible region becomes a convex polyhedron, with each constraint becoming the equation of a plane – the face of the polyhedron. For problems in (three or) more than three variables the constraints are modelled by equations and are solved using

matrices

simultaneous equations. [Problems involving three or more variables will NOT be tested.] Exercise A recycling company makes three grades of recycled paper. Let 𝑎 be the number of boxes of grade 1 paper, 𝑏 be the number of boxes of grade 2 paper and 𝑐 be the number of boxes of grade 3 paper that the company can make during the day. The table below shows how much recycled newspaper and how much non-recycled newspaper it takes to make one box of each grade of paper.

Recycled newspaper Non-recycled newspaper

One box of grade 1 paper 10 kg 90 kg

One box of grade 2 paper 25 kg 60 kg

One box of grade 3 paper 80 kg 0 kg

The company has 785 kg of recycled newspaper and 540 kg of non-recycled newspaper. (a) Write down two inequalities that must be satisfied by the variables, other than that they must

be non-negative. (b) What other restriction applies to 𝑎, 𝑏 and 𝑐.

Each box of grade 1 paper sold gives a profit of $70, each box of grade 2 paper sold gives a profit of $120 and each box of grade 3 paper sold gives a profit of $180. The company wants to maximise the daily profit from the sale of the paper.

(c) Write down the objective function for this problem assuming that the company can sell all the boxes of paper that they make. (OCR)

Bibliography Discrete & Decision Ian Bloomfield and John Stevens Discrete Mathematics 1 Stan Dolan Finite Mathematics Seymour Lipschutz

5

UNIT 2: MATHEMATICAL APPLICATIONS

MODULE 1: DISCRETE MATHEMATICS

(b) Graph Theory and Critical Path Analysis Students should be able to: 8. Identify the vertices and sequence of edges that make up a path; 9. Determine the degree of a vertex; 10. Use networks as models of real-world situations; 11. Use the activity network algorithm in drawing a network diagram to model a real-world

problem (activities will be represented by vertices and the duration of the activities by edges);

12. Calculate the earliest start time, latest start time and float time; 13. Identify the critical path in an activity network; 14. Use the critical path in decision making.

Graph Theory

Introduction

The graphs discussed in Graph Theory are not like the graphs used in Algebra or Statistics. They are collections of dots, called vertices (or nodes), that may or may not be connected to each other by lines, called edges (or arcs).

Graph – a simple way to model connectedness. We use the graph to show the connectedness of the original real-world situation.

A vertex may be connected to itself by a loop.

A vertex may be connected to another vertex by a single edge

or by multiple edges.

Different graphs may be drawn to represent the same information.

The two graphs above show the same connectivity. Therefore they may be used to represent the same data.

A

B

C

D E

F G H

A

B

C

D H

F

E G

6

Different graphs which have the same connectedness are isomorphic. Isomorphic graphs must have the same number of vertices and the vertices must be connected together in the same manner.

An adjacency matrix is also used to represent the information. The elements represent the number of direct routes between the vertices. [Note: A vertex which has a loop has 2 routes to itself – one in each direction].

A B C D E F G H

A - 0 1 0 0 0 0 0

B 0 - 1 0 0 0 0 0

C 1 1 - 1 0 0 0 1

D 0 0 1 - 1 0 0 1

E 0 0 0 1 - 0 1 0

F 0 0 0 0 0 - 1 0

G 0 0 0 0 1 1 - 1

H 0 0 1 1 0 0 1 -

A trail (or route) is a sequence of edges such that the end vertex of one edge is the start vertex of the next.

A closed trail is one where the initial and final vertices are the same.

A path is a trail with the restriction that no vertex is passed more than once.

A cycle is a closed trail where only the initial and final vertices are the same. Although one vertex is allowed to be used twice – at the beginning and the end – no edge is allowed to be used twice.

A Hamiltonian cycle is a one which visits every vertex once only.

7

Exercise

1. From the eight graphs below, pick out the four pairs which are isomorphic to each other.

8

Types of Graphs

A simple graph is a graph without loops or multiple edges.

The table below shows ALL the simple graphs with 1, 2 or 3 edges.

No. of Nodes Graphs No. of graphs

1 1

2 2

3

8

Each of the graphs above is a subgraph of

The degree or order or valency of a vertex is the number of edges at the vertex. Each of the vertices of the graph above is of order 2. If the number of edges is even, the vertex has even order; if odd, the vertex has odd order.

A Loop (i.e an edge that starts and finishes at the same vertex) is counted twice .

A complete graph: a simple graph in which each of the vertices is connected by precisely one edge to every other vertex.

The first four complete graphs

Each simple graph is a subgraph of Kn for any sufficiently large n.

The number of edges in a complete graph, Kn is

E = 1

2𝑛(𝑛 − 1),

where E is the number of edges and n is the number

of vertices in the complete graph.

K1 K2 K3 K4

9

Proof: Each vertex is connected to the other n – 1 vertices

it is at the end of n – 1 edges.

There are n vertices

there are 𝑛 × (𝑛 − 1) ends of edges.

Since every edge has 2 ends, there are

1

2𝑛(𝑛 − 1) edges in total. Q.E.D.

A connected graph: If it is possible to find a route from any vertex to another vertex the graph is said to be connected.

A bipartite (two part) graph has two sets of vertices. The edges only connect the vertices from one set to the other set (and do not connect vertices within sets).

Every vertex in one set does not have to be connected to all the vertices in the other set.

If every vertex in one set is connected to every vertex in the other set, the graph is called a complete bipartite graph. If there are m vertices in the first set and n vertices in the second set, the complete bipartite graph is denoted by Km,n.

Bipartite graphs can be used to represent matching, allocation and transportation problems.

A Eulerian graph is a connected graph which has a closed trail with every edge traversed once only.

A connected graph is Eulerian if and only if every vertex has even order.

If the start vertex and the finish vertex are not the same, the graph is called semi-Eulerian. That is the trail is not closed. A connected graph is semi-Eulerian if and only if two of its vertices are of odd order and all the other vertices are of even order.

K3,2

10

Exercise

1. State whether the following graphs are Eulerian, semi-Eulerian or neither.

11

A planar graph is a graph with no crossing edges. K4 K4 in planar form.

Planarity is important in applications such as the design of electronic circuits.

Exercise

A digraph (or directed) graph is a graph with directed edges.

A network is a graph carrying information such as lengths, costs or times as weights on the edges. Networks are used to model real-world problems. A network may also be modeled by an adjacency matrix. The elements of the matrix are the weights on the edges. The matrix is called a weight (or distance) matrix.

12

Exercise

Exercise

13

Critical Path Analysis

Introduction

Real-world problems can often be analysed using mathematical models. Problems involving multiple activities may be modeled by networks. Critical Path Analysis (CPA) or Critical Path Method (CPM) is then used to determine the ‘best’ course of action in order to complete the task most efficiently.

There are two notations used in CPA:

i. activity on edge (used commercially) ii. activity on vertex (used in examinations)

Procedure

STEP 1: Make a table which list the following 1. all the activities 2. the time (duration) that each activity will take to complete 3. the dependencies between the activities 4. logical end points such as milestones or deliverable it

STEP 2: Draw a network (using activity on vertex) to model the schedule of events. The (vertices) events are represented by squares which are divided into four sections as shown in the diagram below. Section 1 contains the event name (the activity coming in to the event).

Section 2 contains the duration of the event (i.e. the duration of the activity coming in to the event).

Section 3 contains the earliest start time. Section 4 contains the latest start time. Algorithm for drawing a network 1. Create an event ‘START’ and put all activities which have no precedents coming out from it.

Complete sections 1 and 2 of the event squares for each activity. 2. Choose an activity for which all preceding activities are already in the network and add it. If

there are more activities to add, repeat 2. 3. Terminate all ‘loose’ activities in a single ‘FINISH’ event. (You may need to re-draw the

network to make it look tidy.)

1 2

3 4

14

STEP 3: Analyse the problem. Each activity has an earliest start time and a latest start time associated with it. These are the earliest and latest times an activity can commence without affecting the completion date of the project We perform a forward pass through the network to determine the earliest start times. Then we perform a backward pass through the network to determine the latest start times. These times are written in the appropriate sections of the event squares. Algorithm for the Forward Pass (work from start to finish) 1. Put 0 in section 3 of the START event. 2. For each subsequent event:

a. consider each activity coming in to the event, add together the earliest start time and the duration of the activity(ies) coming in to the event;

b. label the event’s earliest time with the largest of these. 3. Put the latest completion time in section 3 of the FINISH event.

Algorithm for the Backward Pass (work from finish to start)

1. Complete section 4 of the FINISH event with the same time as that in its section 3. That is, for the FINISH event

earliest start time = latest start time = completion time for the project 2. For each previous event:

a. consider each activity leaving from it (i.e. going towards the start), subtract the duration of the activity from the latest finish time(s) of the event(s) coming in to it;

b. label the event’s latest start time with the smallest of these. 3. The latest start time of the START event is 0.

Critical activities are the activities for which the earliest start time and the latest start times are the same. A change in the duration of a critical activity results in a corresponding change in the completion time for the project. These activities make up the critical path.

A critical path is a path from the START event to the FINISH event consists of critical activities only. It is the longest path contained in a network. A network may have more than one critical path but in each case the completion time is the same.

15

Float

Float (or slack) is a measure of the facility to alter the timings (start or duration) of an activity without affecting the overall completion time of the project. There are three types of float.

1. Total float for an activity is a measure of the facility for an activity to change if it is the only one being changed. It is the difference between the latest and earliest start times of the activity.

i.e. total float = latest start time – earliest start time

2. Independent float for an activity is a measure of the facility for this activity to change without affecting the float times of other activities.

i.e. independent float = (𝑚𝑖𝑛𝑖𝑚𝑢𝑚 𝑒𝑎𝑟𝑙𝑖𝑒𝑠𝑡

𝑠𝑡𝑎𝑟𝑡 𝑡𝑖𝑚𝑒 𝑜𝑓 𝑙𝑒𝑎𝑣𝑖𝑛𝑔𝑒𝑣𝑒𝑛𝑡𝑠

) − (

𝑚𝑎𝑥𝑖𝑚𝑢𝑚 𝑙𝑎𝑡𝑒𝑠𝑡𝑓𝑖𝑛𝑖𝑠ℎ 𝑡𝑖𝑚𝑒 𝑜𝑓

𝑝𝑟𝑒𝑐𝑒𝑑𝑖𝑛𝑔 𝑒𝑣𝑒𝑛𝑡𝑠 ) − 𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛

Note: latest finish time of an activity is the sum of its latest start time and its duration

3. Interfering float for an activity is the part of the float which is not independent, but interferes with the float of the other activities.

i.e. interfering float = total float – independent float

Crashing a network

If the duration of one (or more) event is changed sufficiently to change the overall project time or the activities forming the critical path or both, it is said to be crashing the network.

16

EXAMPLE:

The table below shows the activities involved in completing a project, together with their durations and immediate predecessors.

Activity Duration (days) Immediate predecessors

A 3 -

B 5 -

C 2 A, B

D 6 B

E 5 C, D

F 2 D

G 7 C

(a) Draw an activity network for the project given in the table above (b) Find the critical path and the duration of the project. (c) If the duration of each activity is increased by a day, by how much will the project

completion be delayed? (d) Calculate the float times for activity C, activity E and activity F.

SOLUTION:

(a)

A 3 C 2 G 7 0 4 5 7 7 9 E 5 FINISH 11 11 16 16 0 B 5 D 6 F 2 0 0 5 5 11 14

(b) Activities B, D and E are critical activities. Therefore the critical path is B D E. The completion time is 16. Therefore the project duration is 16 days.

(c) It will be delayed by 3 days (since 1 day added to each critical event will increase the project duration by an additional day.

(d) For activity C Total float = 7 – 5 = 2 Independent float = min(7,11) – max ((4+3),(0+5)) – 2 = 7 – 7 – 2 = -2 Interfering float = 2 – (-2) = 4

For activity E Total float = 11 – 11 = 0

Independent float = 16 – max ((7+2), (5+6) – 5 = 16 – 11 – 5 = 0

START

0

17

Interfering float = 0 – 0 = 0

For activity F Total float = 14 – 11 = 3 Independent float = 16 – 11 – 2 = 3 Interfering float = 3 – 3 = 0

Bibliography

Discrete Mathematics 1 Stan Dolan

Discrete & Decision Ian Bloomfield and John Stevens

Decision Mathematics 1 Susie G Jameson

Decision D1 Brian Jefferson