D1 Past Paper Booklet - The Grange School Blogs

Transcription

D1 Past Paper Booklet - The Grange School Blogs
The Grange School
Maths Department
Decision 1
OCR Past Papers
Jan 2007
1
2
An airline allows each passenger to carry a maximum of 25 kg in luggage. The four members of the
Adams family have bags of the following weights (to the nearest kg):
Mr Adams:
10
4
2
Mrs Adams:
13
3
7
5
5
8
2
5
10
5
3
5
Sarah Adams:
Tim Adams:
2
4
3
The bags need to be grouped into bundles of 25 kg maximum so that each member of the family can
carry a bundle of bags.
(i) Use the first-fit method to group the bags into bundles of 25 kg maximum. Start with the bags
belonging to Mr Adams, then those of Mrs Adams, followed by Sarah and finally Tim.
[3]
(ii) Use the first-fit decreasing method to group the same bags into bundles of 25 kg maximum. [3]
(iii) Suggest a reason why the grouping of the bags in part (i) might be easier for the family to carry.
[1]
2
A baker can make apple cakes, banana cakes and cherry cakes.
The baker has exactly enough flour to make either 30 apple cakes or 20 banana cakes or 40 cherry
cakes.
The baker has exactly enough sugar to make either 30 apple cakes or 40 banana cakes or 30 cherry
cakes.
The baker has enough apples for 20 apple cakes, enough bananas for 25 banana cakes and enough
cherries for 10 cherry cakes.
The baker has an order for 30 cakes.
The profit on each apple cake is 4p, on each banana cake is 3p and on each cherry cake is 2p. The
baker wants to maximise the profit on the order.
(i) The availability of flour leads to the constraint 4a + 6b + 3c ≤ 120. Give the meaning of each of
the variables a, b and c in this constraint.
[2]
(ii) Use the availability of sugar to give a second constraint of the form Xa + Yb + Zc ≤ 120, where
X , Y and Z are numbers to be found.
[2]
(iii) Write down a constraint from the total order size. Write down constraints from the availability
of apples, bananas and cherries.
[3]
(iv) Write down the objective function to be maximised.
[You are not required to solve the resulting LP problem.]
© OCR 2007
4736/01 Jan07
[1]
Jan 2007
3
3
A simple graph is one in which any two vertices are directly connected by at most one arc and no
vertex is directly connected to itself.
A connected graph is one in which every vertex is connected, directly or indirectly, to every other
vertex.
A simply connected graph is one that is both simple and connected.
(i) A simply connected graph is drawn with 6 vertices and 9 arcs.
(a) What is the sum of the orders of the vertices?
[1]
(b) Explain why if the graph has two vertices of order 5 it cannot have any vertices of order 1.
[2]
(c) Explain why the graph cannot have three vertices of order 5.
[2]
(ii) Draw an example of a simply connected graph with 6 vertices and 9 arcs in which one of the
vertices has order 5 and all the orders of the vertices are odd numbers.
[2]
(iii) Draw an example of a simply connected graph with 6 vertices and 9 arcs that is also Eulerian.
[2]
© OCR 2007
4736/01 Jan07
[Turn over
4
Jan 2007
4
Answer this question on the insert provided.
The table shows the distances, in units of 100 m, between seven houses, A to G.
A
B
C
D
E
F
G
A
0
4
5
3
2
5
6
B
4
0
1
2
4
7
6
C
5
1
0
3
4
6
7
D
3
2
3
0
2
6
4
E
2
4
4
2
0
6
6
F
5
7
6
6
6
0
10
G
6
6
7
4
6
10
0
(i) Use Prim’s algorithm on the table in the insert to find a minimum spanning tree. Start by crossing
out row A. Show which entries in the table are chosen and indicate the order in which the rows
are deleted. Draw your minimum spanning tree and state its total weight.
[6]
Harry is an estate agent. He must visit each of the houses A to G to photograph them. The distances,
in units of 100 m, from Harry’s office (H ) to each of the houses are listed below.
House
A
B
C
D
E
F
G
Distance from H
12
14
15
15
13
16
16
Harry wants to find the shortest route that starts at his office and visits each of the houses before
returning to his office.
(ii) Which standard network problem does Harry need to solve?
[1]
(iii) Use your answer from part (i) to calculate a lower bound for the length of Harry’s route, showing
all your working.
[3]
(iv) Use the nearest neighbour method, starting from Harry’s office, to find a tour that visits each of
the houses. Hence find an upper bound for the length of Harry’s route.
[4]
© OCR 2007
4736/01 Jan07
Jan 2007
5
5
Answer part (i) of this question on the insert provided.
Rhoda Raygh enjoys driving but gets extremely irritated by speed cameras.
The network represents a simplified map on which the arcs represent roads and the weights on the
arcs represent the numbers of speed cameras on the roads.
The sum of the weights on the arcs is 72.
(i) Rhoda lives at Ayton (A) and works at Kayton (K ). Use Dijkstra’s algorithm on the diagram in
the insert to find the route from A to K that involves the least number of speed cameras and state
the number of speed cameras on this route.
[7]
(ii) In her job Rhoda has to drive along each of the roads represented on the network to check for
overhanging trees. This requires finding a route that covers every arc at least once, starting and
ending at Kayton (K ). Showing all your working, find a suitable route for Rhoda that involves
the least number of speed cameras and state the number of speed cameras on this route.
[6]
(iii) If Rhoda checks the roads for overhanging trees on her way home, she will instead need a route
that covers every arc at least once, starting at Kayton and ending at Ayton. Calculate the least
number of speed cameras on such a route, explaining your reasoning.
[3]
© OCR 2007
4736/01 Jan07
[Turn over
6
Jan 2007
6
Consider the linear programming problem:
maximise
P = 3x − 5y + 4,
subject to
x + 2y − 3 ≤ 12,
2x + 5y − 8 ≤ 40,
x ≥ 0, y ≥ 0, ≥ 0.
and
(i) Represent the problem as an initial Simplex tableau.
[3]
(ii) Explain why it is not possible to pivot on the column of this tableau. Identify the entry on which
to pivot for the first iteration of the Simplex algorithm. Explain how you made your choice of
column and row.
[3]
(iii) Perform one iteration of the Simplex algorithm. Write down the values of x, y and after this
iteration.
[3]
(iv) Explain why P has no finite maximum.
[1]
The coefficient of in the objective is changed from +4 to −40.
(v) Describe the changes that this will cause to the initial Simplex tableau and the tableau that results
after one iteration. What is the maximum value of P in this case?
[4]
Now consider this linear programming problem:
maximise
Q = 3x − 5y + 7,
subject to
x + 2y − 3 ≤ 12,
2x − 7y + 10 ≤ 40,
x ≥ 0, y ≥ 0, ≥ 0.
and
Do not use the Simplex algorithm for these parts.
(vi) By adding the two constraints, show that Q has a finite maximum.
[1]
(vii) There is an optimal point with y = 0. By substituting y = 0 in the two constraints, calculate the
values of x and that maximise Q when y = 0.
[3]
© OCR 2007
4736/01 Jan07
2
Jan 2007 Insert
4
(i)
↓
A
B
C
D
E
F
G
A
0
4
5
3
2
5
6
B
4
0
1
2
4
7
6
C
5
1
0
3
4
6
7
D
3
2
3
0
2
6
4
E
2
4
4
2
0
6
6
F
5
7
6
6
6
0
10
G
6
6
7
4
6
10
0
A
Order in which rows were deleted: ................................................................................................
Minimum spanning tree:
Total weight: ................................................................................................
(ii) ........................................................................................................................................................
(iii) ........................................................................................................................................................
Lower bound: ................................................................................................................................
(iv) Tour: ..............................................................................................................................................
Upper bound: ................................................................................................................................
© OCR 2007
4736/01/Ins Jan07
Jan 2007 Insert
5
3
(i)
Route: ............................................................................................................................................
Number of speed cameras on route: .............................................................................................
© OCR 2007
4736/01/Ins Jan07
June 2007
1
2
Two graphs A and B are shown below.
(i) Write down an example of a cycle on graph A.
[1]
(ii) Why is U –Y –V –Z –Y –X not a path on graph B?
[1]
(iii) How many arcs would there be in a spanning tree for graph A?
[1]
(iv) For each graph state whether it is Eulerian, semi-Eulerian or neither.
[2]
(v) The graphs show designs to be etched on metal plates. The etching tool is positioned at a starting
point and follows a route without repeating any arcs. It may be lifted off and positioned at a new
starting point. What is the smallest number of times that the etching tool must be positioned,
including the initial position, to draw each graph?
[2]
An arc is drawn connecting Q to U , so that the two graphs become one. The resulting graph is not
Eulerian.
(vi) Extra arcs are then added to make an Eulerian graph. What is the smallest number of extra arcs
that need to be added?
[2]
© OCR 2007
4736/01 Jun07
3
June 2007
2
A landscape gardener is designing a garden. Part of the garden will be decking, part will be flowers
and the rest will be grass. Let d be the area of decking, f be the area of flowers and g be the area of
grass, all measured in m2 .
The total area of the garden is 120 m2 of which at least 40 m2 must be grass. The area of decking must
not be greater than the area of flowers. Also, the area of grass must not be more than four times the
area of decking.
Each square metre of grass will cost £5, each square metre of decking will cost £10 and each square
metre of flowers will cost £20. These costs include labour. The landscape gardener has been instructed
to come up with the design that will cost the least.
(i) Write down a constraint in d, f and g from the total area of the garden.
[1]
(ii) Explain why the constraint g ≤ 4d is required.
[1]
(iii) Write down a constraint from the requirement that the area of decking must not be greater than
the area of flowers.
[1]
(iv) Write down a constraint from the requirement that at least 40 m2 of the garden must be grass and
[3]
write down the minimum feasible values for each of d and f .
(v) Write down the objective function to be minimised.
[1]
(vi) Write down the resulting LP problem, using slack variables to express the constraints from
[3]
parts (ii) and (iii) as equations.
(You are not required to solve the resulting LP problem.)
3
(i) Use shuttle sort to sort the five numbers 8, 6, 9, 7, 5 into increasing order. Write down the list
that results at the end of each pass. Calculate and record the number of comparisons and the
number of swaps that are made in each pass.
[6]
(ii) The algorithm below is part of another method for sorting a list into increasing order. Apply it
to the list 8, 6, 9, 7, 5. Show the result of each step.
[5]
© OCR 2007
Step 1:
Input the original list and call it list A.
Step 2:
Remove the first item in list A and call this item X .
Step 3:
If the first item remaining in list A is less than X move it to list B,
otherwise move it to list C.
Step 4:
If the next item remaining in list A is less than X move it to become
the next item in list B, otherwise move it to become the next item
in list C.
Step 5:
If there are still items in list A, repeat Step 4.
Step 6:
Count the number of items in list B and call this N .
Step 7:
Put the items in list B at positions 1 to N of list A, item X at position
N + 1 of list A and the items in list C at positions N + 2 onwards of
list A.
Step 8:
Display list A.
4736/01 Jun07
[Turn over
4
June 2007
Consider the linear programming problem:
maximise
subject to
and
4
P = 3x − 5y,
x + 5y ≤ 12,
x − 5y ≤ 10,
3x + 10y ≤ 45,
x ≥ 0, y ≥ 0.
(i) Represent the problem as an initial Simplex tableau.
[3]
(ii) Identify the entry on which to pivot for the first iteration of the Simplex algorithm. Explain how
you made your choice of column and row.
[2]
(iii) Perform one iteration of the Simplex algorithm. Write down the values of x, y and P after this
iteration.
[6]
(iv) Show that x = 11, y = 0.2 is a feasible solution and that it gives a bigger value of P than that in
[2]
part (iii).
© OCR 2007
4736/01 Jun07
5
June 2007
5
Answer this question on the insert provided.
The network below represents a simplified map of a building. The arcs represent corridors and the
weights on the arcs represent the lengths of the corridors, in metres.
The sum of the weights on the arcs is 765 metres.
(i) Janice is the cleaning supervisor in the building. She is at the position marked as J when she is
called to attend a cleaning emergency at B. On the network in the insert, use Dijkstra’s algorithm,
starting from vertex J and continuing until B is given a permanent label, to find the shortest path
[7]
from J to B and the length of this path.
(ii) In her job Janice has to walk along each of the corridors represented on the network. This requires
finding a route that covers every arc at least once, starting and ending at J . Showing all your
working, find the shortest distance that Janice must walk to check all the corridors.
[5]
The labelled vertices represent ‘cleaning stations’. Janice wants to visit every cleaning station using
the shortest possible route. She produces a simplified network with no repeated arcs and no arc that
joins a vertex to itself.
(iii) On the insert, complete Janice’s simplified network. Which standard network problem does
Janice need to solve to find the shortest distance that she must travel?
[4]
© OCR 2007
4736/01 Jun07
[Turn over
6
June 2007
6
Answer this question on the insert provided.
The table shows the distances, in miles, along the direct roads between six villages, A to F . A dash
(−) indicates that there is no direct road linking the villages.
A
A
B
C
D
E
F
−
6
3
−
−
−
B
C
6
3
−
5
6
−
14
5
−
8
4
10
D
E
F
6
−
14
4
10
3
8
−
8
−
3
8
−
−
−
−
−
−
(i) On the table in the insert, use Prim’s algorithm to find a minimum spanning tree. Start by crossing
out row A. Show which entries in the table are chosen and indicate the order in which the rows
are deleted. Draw your minimum spanning tree and state its total weight.
[6]
(ii) By deleting vertex B and the arcs joined to vertex B, calculate a lower bound for the length of the
shortest cycle through all the vertices.
[3]
(iii) Apply the nearest neighbour method to the table above, starting from F , to find a cycle that passes
through every vertex and use this to write down an upper bound for the length of the shortest
cycle through all the vertices.
[4]
© OCR 2007
4736/01 Jun07
June 2007 Insert
5
2
(i)
Shortest path from J to B: .............................................................................................................
Length of path: ............................ metres
(ii) ........................................................................................................................................................
........................................................................................................................................................
........................................................................................................................................................
Length of shortest route that starts and ends at J and covers every arc = .......................... metres
© OCR 2007
4736/01/Ins Jun07
June 2007 Insert
3
(iii)
........................................................................................................................................................
© OCR 2007
4736/01/Ins Jun07
[Turn over
4
June 2007 Insert
6
(i)
⏐
⏐
A
B
C
D
E
F
A
−
6
3
−
−
−
B
6
−
5
6
−
14
C
3
5
−
8
4
10
D
−
6
8
−
3
8
E
−
−
4
3
−
−
F
−
14
10
8
−
−
A
Order in which rows were deleted: ...............................................................................................
Minimum spanning tree:
Total weight: ............................ miles
(ii) ........................................................................................................................................................
........................................................................................................................................................
Lower bound: ............................ miles
(iii) Cycle: ............................................................................................................................................
........................................................................................................................................................
Upper bound: ............................ miles
© OCR 2007
4736/01/Ins Jun07
Jan 2008
1
2
Five boxes weigh 5 kg, 2 kg, 4 kg, 3 kg and 8 kg. They are stacked, in the order given, with the first
box at the top of the stack. The boxes are to be packed into bins that can each hold up to 10 kg.
(i) Use the first-fit method to put the boxes into bins. Show clearly which boxes are packed in which
bins.
[2]
(ii) Use the first-fit decreasing method to put the boxes into bins. You do not need to use an algorithm
for sorting. Show clearly which boxes are packed in which bins.
[2]
(iii) Why might the first-fit decreasing method not be practical?
[1]
(iv) Show that if the bins can only hold up to 8 kg each it is still possible to pack the boxes into three
bins.
[1]
2
A puzzle involves a 3 by 3 grid of squares, numbered 1 to 9, as shown in Fig. 1a below. Eight of the
squares are covered by blank tiles. Fig. 1b shows the puzzle with all of the squares covered except for
square 4. This arrangement of tiles will be called position 4.
A move consists of sliding a tile into the empty space. From position 4, the next move will result in
position 1, position 5 or position 7.
(i) Draw a graph with nine vertices to represent the nine positions and arcs that show which positions
can be reached from one another in one move. What is the least number of moves needed to get
from position 1 to position 9?
[3]
(ii) State whether the graph from part (i) is Eulerian, semi-Eulerian or neither. Explain how you
know which it is.
[2]
© OCR 2008
4736/01 Jan08
3
Jan 2008
3
Answer this question on the insert provided.
(i) This diagram shows a network. The insert has a copy of this network together with a list of
the arcs, sorted into increasing order of weight. Use Kruskal’s algorithm on the insert to find a
minimum spanning tree for this network. Draw your tree and give its total weight.
[5]
(ii) Use your answer to part (i) to find the weight of a minimum spanning tree for the network with
vertex G, and all the arcs joined to G, removed. Hence find a lower bound for the travelling
salesperson problem on the original network.
[3]
(iii) Apply the nearest neighbour method, starting from vertex A, to find an upper bound for the
travelling salesperson problem on the original network.
[3]
© OCR 2008
4736/01 Jan08
[Turn over
4
Jan 2008
4
Answer this question on the insert provided.
Jenny needs to travel to London to arrive in time for a morning meeting. The graph below represents
the various travel options that are available to her.
It takes Jenny 120 minutes to drive from her home to the local airport and check in (arc JA). The
journey from the local airport to Gatwick takes 80 minutes. From Gatwick to the underground station
takes 60 minutes, and walking from the underground station to the meeting venue takes 15 minutes.
Alternatively, Jenny could get a taxi from Gatwick to the meeting venue; this takes 80 minutes.
It takes Jenny 15 minutes to drive from her house to the train station. Alternatively, she can walk to
the bus stop, which takes 5 minutes, and then get a bus to the train station, taking another 20 minutes.
From the train station to Paddington takes 300 minutes, and from Paddington to the underground
station takes a further 20 minutes. Alternatively, Jenny could walk from Paddington to the meeting
venue, taking 30 minutes.
Jenny can catch a coach from her local bus stop to Victoria, taking 400 minutes. From Victoria she
can either travel to the underground station, which takes 10 minutes, or she can walk to the meeting
venue, which takes 15 minutes.
The final option available to Jenny is to drive to a friend’s house, taking 240 minutes, and then
continue the journey into London by train. The journey from her friend’s house to Waterloo takes
Jenny 30 minutes. From here she can either go to the underground station, which takes 20 minutes,
or walk to the meeting venue, which takes 40 minutes.
(i) Weight the arcs on the graph in the insert to show these times. Apply Dijkstra’s algorithm,
starting from J , to give a permanent label and order of becoming permanent at each vertex. Stop
when you have assigned a permanent label to vertex M . Write down the route of the shortest
[9]
path from J to M .
(ii) What does the value of the permanent label at M represent?
[1]
(iii) Give two reasons why Jenny might choose to use a different route from J to M .
[2]
© OCR 2008
4736/01 Jan08
5
Jan 2008
5
Mark wants to decorate the walls of his study. The total wall area is 24 m2 . Mark can cover the walls
using any combination of three materials: panelling, paint and pinboard. He wants at least 2 m2 of
pinboard and at least 10 m2 of panelling.
Panelling costs £8 per m2 and it will take Mark 15 minutes to put up 1 m2 of panelling. Paint costs
£4 per m2 and it will take Mark 30 minutes to paint 1 m2 . Pinboard costs £10 per m2 and it will
take Mark 20 minutes to put up 1 m2 of pinboard. He has all the equipment that he will need for the
decorating jobs.
Mark is able to spend up to £150 on the materials for the decorating. He wants to know what area
should be covered with each material to enable him to complete the whole job in the shortest time
possible.
Mark models the problem as an LP with five constraints. His constraints are:
x + y + = 24,
4x + 2y + 5 ≤ 75,
x ≥ 10,
y ≥ 0,
≥ 2.
(i) Identify the meaning of each of the variables x, y and .
[2]
(ii) Show how the constraint 4x + 2y + 5 ≤ 75 was formed.
[2]
(iii) Write down an objective function, to be minimised.
[1]
Mark rewrites the first constraint as = 24 − x − y and uses this to eliminate from the problem.
(iv) Rewrite and simplify the objective and the remaining four constraints as functions of x and y
only.
[3]
(v) Represent your constraints from part (iv) graphically and identify the feasible region. Your graph
[4]
should show x and y values from 9 to 15 only.
6
(i) Represent the linear programming problem below by an initial Simplex tableau.
Maximise
P = 25x + 14y − 32,
subject to
6x − 4y + 3 ≤ 24,
5x − 3y + 10 ≤ 15,
x ≥ 0, y ≥ 0, ≥ 0.
and
[2]
(ii) Explain how you know that the first iteration will use a pivot from the x column. Show the
calculations used to find the pivot element.
[3]
(iii) Perform one iteration of the Simplex algorithm. Show how each row was calculated and write
[7]
down the values of x, y, and P that result from this iteration.
(iv) Explain why the Simplex algorithm cannot be used to find the optimal value of P for this problem.
[1]
© OCR 2008
4736/01 Jan08
[Turn over
6
Jan 2008
7
In this question, the function INT(X ) is the largest integer less than or equal to X . For example,
INT(3.6) = 3,
INT(3) = 3,
INT(−3.6) = −4.
Consider the following algorithm.
Step 1
Step 2
Step 3
Step 4
Step 5
Step 6
Step 7
Step 8
Step 9
Input B
Input N
Calculate F = N ÷ B
Let G = INT(F )
Calculate H = B × G
Calculate C = N − H
Output C
Replace N by the value of G
If N = 0 then stop, otherwise go back to Step 3
(i) Apply the algorithm with the inputs B = 2 and N = 5. Record the values of F , G, H , C and N
each time Step 9 is reached.
[5]
(ii) Explain what happens when the algorithm is applied with the inputs B = 2 and N = −5.
[4]
(iii) Apply the algorithm with the inputs B = 10 and N = 37. Record the values of F , G, H , C and
N each time Step 9 is reached. What are the output values when B = 10 and N is any positive
integer?
[4]
© OCR 2008
4736/01 Jan08
Jan 2008 Insert
3
2
(i)
Total weight of arcs in minimum spanning tree = ............................
© OCR 2008
4736/01 Ins Jan08
Jan 2008 Insert
3
(ii) ........................................................................................................................................................
........................................................................................................................................................
Weight of spanning tree for the network with vertex G removed = ..............................................
........................................................................................................................................................
Lower bound for travelling salesperson problem on original network = ......................................
(iii) ........................................................................................................................................................
Upper bound for travelling salesperson problem on original network = .......................................
© OCR 2008
4736/01 Ins Jan08
[Turn over
Jan 2008 Insert
4
4
(i)
Route of shortest path from J to M : .............................................................................................
(ii) ........................................................................................................................................................
........................................................................................................................................................
(iii) ........................................................................................................................................................
........................................................................................................................................................
........................................................................................................................................................
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every reasonable
effort has been made by the publisher (OCR) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the publisher will be
pleased to make amends at the earliest possible opportunity.
OCR is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of University of Cambridge Local Examinations Syndicate (UCLES),
which is itself a department of the University of Cambridge.
© OCR 2008
4736/01 Ins Jan08
June 2008
1
2
This question is about using bubble sort to sort a list of numbers into increasing order.
(i) Which numbers, if any, can be guaranteed to be in their correct final position after the first pass?
[1]
Suppose now that the original, unsorted list was 3, 2, 1, 5, 4.
(ii) Write down the list that results after one pass through bubble sort. How many comparisons and
how many swaps were used in this pass?
[2]
(iii) Write down the list that results after a second pass through bubble sort. How many more passes
will be required until the algorithm terminates?
[2]
Bubble sort is a quadratic order algorithm.
(iv) A computer takes 0.2 seconds to sort a list of 500 numbers using bubble sort. Approximately
how long will it take to sort a list of 3000 numbers?
[2]
2
A simple graph is one in which any two vertices are directly connected by at most one arc and no
vertex is directly connected to itself.
A connected graph is one in which every vertex is joined, directly or indirectly, to every other vertex.
A simply connected graph is one that is both simple and connected.
(i) Draw an Eulerian graph with four vertices, of orders 2, 2, 4 and 4, and no others. Explain why
your graph is not simply connected.
[3]
(ii) Draw a non-Eulerian graph with four vertices, of orders 2, 2, 4 and 4, and no others. Explain
why your graph is non-Eulerian even though its vertices are all of even order.
[3]
© OCR 2008
4736/01 Jun08
June 2008
3
3
The constraints of a linear programming problem are represented by the graph below. The feasible
region is the unshaded region, including its boundaries.
(i) Write down the inequalities that define the feasible region.
[4]
(ii) Calculate the coordinates of the three vertices of the feasible region.
[4]
The objective is to maximise 5x + 3y.
(iii) Find the values of x and y at the optimal point, and the corresponding maximum value of 5x + 3y.
[3]
The objective is changed to maximise 5x + ky, where k is positive.
(iv) Find the range of values of k for which the optimal point is the same as in part (iii).
© OCR 2008
4736/01 Jun08
[3]
[Turn over
4
June 2008
4
Answer this question on the insert provided.
The vertices in the network below represent the rooms in a house. The arcs represent routes between
rooms, and the weights on the arcs represent distances in metres.
(i) On the diagram in the insert, use Dijkstra’s algorithm to find the shortest path from A to K . You
must show your working, including temporary labels, permanent labels and the order in which
permanent labels are assigned. Write down the route of the shortest path from A to K and give
its length in metres.
[7]
A locked door blocks the route CJ , so this arc cannot be used.
(ii) Use your answer to part (i) to find the route of the shortest path from A to J and its length in
metres.
[2]
(iii) Alterations mean that the length of route FJ changes from its current value of 5 metres. By how
much would it have to change if the route of the shortest path from A to J , not using CJ , changes
[2]
from that found in part (ii)?
© OCR 2008
4736/01 Jun08
5
5
June 2008
Laura is booking buses to transport students home from a college party. She wants to book four buses
to travel to Easton and five buses to travel to Weston. She contacts the local bus companies to ask
about availability and cost. This information is summarised in the table below.
Company
Number of buses
available
Cost per bus
to Easton
Cost per bus
to Weston
Anywhere Autos (A)
3
£250
£250
Busy Buses (B)
3
£200
£140
County Coaches (C)
3
£300
£280
Suppose that Laura books x buses to travel to Easton from company A and y buses to travel to Easton
from company B.
(i) Copy and complete the following table to show, in terms of x and y, how many buses Laura
books from each company to each town and show that the total cost is £(2090 − 20x + 40y). [5]
E
A
x
B
y
W
x+y−1
C
(ii) Laura wants to spend no more than £2150 on the buses.
Show that this leads to the constraint −x + 2y ≤ 3.
[1]
When Laura looks at the times that the companies could run the buses, she realises that she will need
at least one bus from C to E. This leads to the constraint x + y ≤ 3.
Each bus from A can carry 50 students, each bus from B can carry 40 students and each bus from C
can carry 60 students. Laura wants to maximise the number of students who can travel to W .
(iii) Show that this leads to needing to maximise the objective function x + 2y.
[2]
Laura’s problem gives the linear programming problem:
Maximise
P = x + 2y,
subject to
−x + 2y ≤ 3,
x + y ≤ 3,
x ≥ 0, y ≥ 0,
and
(iv) Represent this problem as an initial Simplex tableau.
with x and y both integers.
[2]
(v) Use the Simplex algorithm, pivoting first on a value chosen from the y column, to find the values
[6]
of x and y at the optimum point.
© OCR 2008
4736/01 Jun08
[Turn over
June 2008
6
6
The network below represents a simplified map of a forest. The nodes represent locations in the forest
and the arcs represent footpaths. The weights on the arcs represent distances, in metres.
(a) Woody the forest ranger wants to start from rangers’ hut (H ) and walk along every footpath at
least once using the shortest possible total distance.
(i) Which standard network problem does Woody need to solve to find the shortest route that
covers every arc?
[1]
The total length of all the footpaths shown is 3000 metres.
(ii) Use an appropriate algorithm to find the length of the shortest route that Woody can use.
Show all your working. (You may find the lengths of shortest paths between nodes by
inspection.)
[4]
Suppose that, instead, Woody wants to start from the car park (C) and walk along every footpath
at least once using the shortest possible total distance.
(iii) What is the length of the shortest route that Woody can use if he starts from the car park?
At which node does this route end?
[3]
(b) There is a nesting box at each node of the network.
Cyril the squirrel lives in the forest. He wants to start from his drey (D) and check each nesting
box, to see whether he has stored any nuts there, before returning to his drey. Cyril is a vain
squirrel, so he wants to use the footpaths so that people can see him. However he is also a very
lazy squirrel, so he would like to check the boxes in the shortest distance possible.
(i) Apply the nearest neighbour method starting at node D to find a tour through all the nodes
that starts and ends at D. Calculate the total weight of this tour. Explain why the nearest
[3]
neighbour method fails if you start at node A.
(ii) Construct a minimum spanning tree by using Prim’s algorithm on the reduced network
formed by deleting node A and all the arcs that are directly joined to node A. Start building
your tree at node B. (You do not need to represent the network as a matrix.) Give the order
in which nodes are added to your tree and draw a diagram to show the arcs in your tree.
Calculate the total weight of your tree.
[5]
(iii) From your previous answers, what can you say about the shortest possible distance that
Cyril must travel to visit each nesting box and return home to his drey?
[2]
© OCR 2008
4736/01 Jun08
June 2008 Insert
4
2
(i)
Route of shortest path from A to K = ............................................................................................
Length of shortest path from A to K = ............................ metres
(ii) ........................................................................................................................................................
Route of shortest path from A to J , without using CJ = ...............................................................
Length of path = ............................ metres
(iii) ........................................................................................................................................................
........................................................................................................................................................
Length of FJ must change by ............................ metres
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every reasonable
effort has been made by the publisher (OCR) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the publisher will be
pleased to make amends at the earliest possible opportunity.
OCR is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of University of Cambridge Local Examinations Syndicate (UCLES),
which is itself a department of the University of Cambridge.
© OCR 2008
4736/01 Ins Jun08
2
1
Jan 2009
The flow chart shows an algorithm for which the input is a three-digit positive integer.
START
Input an integer A for which 100 ? A ? 999
Let C = 1
Reverse the order of the digits of A to form the number B
Add 1 to C
Subtract the smaller of A and B from the larger,
taking A to be the smaller when A = B
Let the result be D
Replace A by
the value of D
Does C
equal 3?
NO
YES
Output D
STOP
(i) Trace through the algorithm using the input A = 614 to show that the output is 297. Write down
the values of A, B, C and D in each pass through the algorithm.
[4]
2
(ii) What is the output when A = 616?
[1]
(iii) Explain why the counter C is needed.
[1]
(i) Draw a graph with five vertices of orders 1, 2, 2, 3 and 4.
[2]
(ii) State whether the graph from part (i) is Eulerian, semi-Eulerian or neither. Explain how you
know which it is.
[2]
(iii) Explain why a graph with five vertices of orders 1, 2, 2, 3 and 4 cannot be a tree.
© OCR 2009
4736 Jan09
[2]
3
Jan 2009
3
Answer this question on the insert provided.
B
E
37
26
9
A
16
28
D
29
23
18
27
20
14
C
22
G
31
F
(i) This diagram shows a network. The insert has a copy of this network together with a list of
the arcs, sorted into increasing order of weight. Use Kruskal’s algorithm on the insert to find a
minimum spanning tree for this network. Draw your tree and give its total weight.
[5]
(ii) Use your answer to part (i) to find the weight of a minimum spanning tree for the network with
vertex E , and all the arcs joined to E, removed. Hence find a lower bound for the travelling
salesperson problem on the original network.
[3]
(iii) Show that the nearest neighbour method, starting from vertex A, fails on the original network.
[2]
(iv) Apply the nearest neighbour method, starting from vertex B, to find an upper bound for the
travelling salesperson problem on the original network.
[3]
(v) Apply Dijkstra’s algorithm to the copy of the network in the insert to find the least weight path
from A to G. State the weight of the path and give its route.
[6]
(vi) The sum of the weights of all the arcs is 300.
Apply the route inspection algorithm, showing all your working, to find the weight of the least
weight closed route that uses every arc at least once. The weights of least weight paths from
vertex A should be found using your answer to part (v); the weights of other such paths should
be determined by inspection.
[4]
© OCR 2009
4736 Jan09
Turn over
4
Jan 2009
4
Answer this question on the insert provided.
The list of numbers below is to be sorted into decreasing order using shuttle sort.
21
76
65
13
88
62
67
28
34
(i) How many passes through shuttle sort will be required to sort the list?
[1]
After the first pass the list is as follows.
76
21
65
13
88
62
67
28
34
(ii) State the number of comparisons and the number of swaps that were made in the first pass. [1]
(iii) Write down the list after the second pass. State the number of comparisons and the number of
swaps that were used in making the second pass.
[2]
(iv) Complete the table in the insert to show the results of the remaining passes, recording the number
of comparisons and the number of swaps made in each pass. You may not need all the rows of
boxes printed.
[6]
When the original list is sorted into decreasing order using bubble sort there are 30 comparisons and
17 swaps.
(v) Use your results from part (iv) to compare the efficiency of these two methods in this case.
© OCR 2009
4736 Jan09
[2]
5
Jan 2009
Katie makes and sells cookies.
5
Each batch of plain cookies takes 8 minutes to prepare and then 12 minutes to bake.
Each batch of chocolate chip cookies takes 12 minutes to prepare and then 12 minutes to bake.
Each batch of fruit cookies takes 10 minutes to prepare and then 12 minutes to bake.
Katie can only bake one batch at a time. She has the use of the kitchen, including the oven, for at most
1 hour.
(i) Each batch of cookies must be prepared before it is baked. By considering the maximum time
available for baking the cookies, explain why Katie can make at most 4 batches of cookies. [2]
Katie models the constraints as
x + y + ß ≤ 4,
4x + 6y + 5ß ≤ 24,
x ≥ 0, y ≥ 0, ß ≥ 0,
where x is the number of batches of plain cookies, y is the number of batches of chocolate chip cookies
and ß is the number of batches of fruit cookies that Katie makes.
(ii) Each batch of cookies that Katie prepares must be baked within the hour available. By considering
the maximum time available for preparing the cookies, show how the constraint 4x + 6y + 5ß ≤ 24
was formed.
[2]
(iii) In addition to the constraints, what other restriction is there on the values of x, y and ß?
[1]
Katie will make £5 profit on each batch of plain cookies, £4 on each batch of chocolate chip cookies
and £3 on each batch of fruit cookies that she sells. Katie wants to maximise her profit.
(iv) Write down an expression for the objective function to be maximised. State any assumption that
you have made.
[2]
(v) Represent Katie’s problem as an initial Simplex tableau. Perform one iteration of the Simplex
algorithm, choosing to pivot on an element from the x-column. Show how each row was obtained.
Write down the number of batches of cookies of each type and the profit at this stage.
[10]
After carrying out market research, Katie decides that she will not make fruit cookies. She also decides
that she will make at least twice as many batches of chocolate chip cookies as plain cookies.
(vi) Represent the constraints for Katie’s new problem graphically and calculate the coordinates of
the vertices of the feasible region. By testing suitable integer-valued coordinates, find how many
batches of plain cookies and how many batches of chocolate chip cookies Katie should make to
maximise her profit. Show your working.
[8]
© OCR 2009
4736 Jan09
2
Jan 2009 Insert
3
(i)
B
E
37
26
9
A
16
28
D
29
23
G
31
18
27
C
AB = 9
DF = 14
BD = 16
CD = 18
FG = 20
CF = 22
EG = 23
EF = 26
AC = 27
DE = 28
AD = 29
DG = 31
BE = 37
20
14
22
F
B
E
G
D
A
C
F
Total weight of arcs in minimum spanning tree = ............................
(ii) Weight of spanning tree for vertices A, B, C, D, F and G only = .................................................
........................................................................................................................................................
Lower bound for travelling salesperson problem on original network = ......................................
(iii) ........................................................................................................................................................
........................................................................................................................................................
(iv) Nearest neighbour gives B – ..........................................................................................................
Upper bound for travelling salesperson problem on original network = .......................................
© OCR 2009
4736 Ins Jan09
3
Jan 2009 Insert
(v)
Permanent
label
Order of becoming
permanent
Key:
Temporary
labels
Do not cross out your working
values (temporary labels)
B
E
37
26
9
A
16
28
D
29
23
18
27
20
14
C
22
G
31
F
Weight = ............................
Route = ..........................................................................................................................................
(vi) ........................................................................................................................................................
........................................................................................................................................................
........................................................................................................................................................
........................................................................................................................................................
........................................................................................................................................................
........................................................................................................................................................
© OCR 2009
4736 Ins Jan09
Turn over
Jan 2009 Insert
4
4
(i) ............................ passes
(ii) ............................ comparisons and ............................ swaps
(iii)
............................ comparisons and ............................ swaps
Comp
(iv)
Swap
(v) ........................................................................................ is the more efficient method in this case
because ..........................................................................................................................................
........................................................................................................................................................
........................................................................................................................................................
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every reasonable
effort has been made by the publisher (OCR) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the publisher will be
pleased to make amends at the earliest possible opportunity.
OCR is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of University of Cambridge Local Examinations Syndicate (UCLES),
which is itself a department of the University of Cambridge.
© OCR 2009
4736 Ins Jan09
2
June 2009
1
The memory requirements, in KB, for eight computer files are given below.
43
172
536
17
314
462
220
231
The files are to be grouped into folders. No folder is to contain more than 1000 KB, so that the folders
are small enough to transfer easily between machines.
(i) Use the first-fit method to group the files into folders.
[3]
(ii) Use the first-fit decreasing method to group the files into folders.
[3]
First-fit decreasing is a quadratic order algorithm.
(iii) A computer takes 1.3 seconds to apply first-fit decreasing to a list of 500 numbers. Approximately
how long will it take to apply first-fit decreasing to a list of 5000 numbers?
[2]
2
(i) Explain why it is impossible to draw a graph with four vertices in which the vertex orders are 1,
2, 3 and 3.
[1]
A simple graph is one in which any two vertices are directly joined by at most one arc and no vertex
is directly joined to itself.
A connected graph is one in which every vertex is joined, directly or indirectly, to every other vertex.
A simply connected graph is one that is both simple and connected.
(ii) (a) Draw a graph with five vertices of orders 1, 1, 2, 2 and 4 that is neither simple nor connected.
[2]
(b) Explain why your graph from part (a) is not semi-Eulerian.
[1]
(c) Draw a semi-Eulerian graph with five vertices of orders 1, 1, 2, 2 and 4.
[1]
Six people (Ann, Bob, Caz, Del, Eric and Fran) are represented by the vertices of a graph. Each pair
of vertices is joined by an arc, forming a complete graph. If an arc joins two vertices representing
people who have met it is coloured blue, but if it joins two vertices representing people who have not
met it is coloured red.
(iii) (a) Explain why the vertex corresponding to Ann must be joined to at least three of the others
by arcs that are the same colour.
[2]
(b) Now assume that Ann has met Bob, Caz and Del. Bob, Caz and Del may or may not have
met one another. Explain why the graph must contain at least one triangle of arcs that are
all the same colour.
[2]
© OCR 2009
4736 Jun09
June 2009
3
3
The constraints of a linear programming problem are represented by the graph below. The feasible
region is the unshaded region, including its boundaries.
y
8
6
4
2
0
2
4
6
8
x
(i) Write down the inequalities that define the feasible region.
[4]
(ii) Write down the coordinates of the three vertices of the feasible region.
[2]
The objective is to maximise 2x + 3y.
(iii) Find the values of x and y at the optimal point, and the corresponding maximum value of 2x + 3y.
[3]
The objective is changed to maximise 2x + ky, where k is positive.
(iv) Find the range of values of k for which the optimal point is the same as in part (iii).
© OCR 2009
4736 Jun09
[2]
Turn over
4
June 2009
4
Answer this question on the insert provided.
The vertices in the network below represent the junctions between main roads near Ayton (A). The
arcs represent the roads and the weights on the arcs represent distances in miles.
A
E
8
6
2
7
2
D
3
F
1.5
3
B
2.5
C
12
4
9
H
7.5
G
(i) On the diagram in the insert, use Dijkstra’s algorithm to find the shortest path from A to H . You
must show your working, including temporary labels, permanent labels and the order in which
permanent labels are assigned. Write down the route of the shortest path from A to H and give
its length in miles.
[7]
Simon is a highways surveyor. He needs to check that there are no potholes in any of the roads. He
will start and end at Ayton.
(ii) Which standard network problem does Simon need to solve to find the shortest route that uses
every arc?
[1]
The total weight of all the arcs is 67.5 miles.
(iii) Use an appropriate algorithm to find the length of the shortest route that Simon can use. Show all
your working. (You may find the lengths of shortest paths between nodes by using your answer
to part (i) or by inspection.)
[5]
Suppose that, instead, Simon wants to find the shortest route that uses every arc, starting from A and
ending at H .
(iv) Which arcs does Simon need to travel twice? What is the length of the shortest route that he can
use?
[2]
[This question continues on the next page.]
© OCR 2009
4736 Jun09
5
June 2009
There is a set of traffic lights at each junction. Simon’s colleague Amber needs to check that all the
traffic lights are working correctly. She will start and end at the same junction.
(v) Show that the nearest neighbour method fails on this network if it is started from A.
[1]
(vi) Apply the nearest neighbour method starting from C to find an upper bound for the distance that
Amber must travel.
[3]
(vii) Construct a minimum spanning tree by using Prim’s algorithm on the reduced network formed
by deleting node A and all the arcs that are directly joined to node A. Start building your tree
at node B. (You do not need to represent the network as a matrix.) Mark the arcs in your tree on
the diagram in the insert.
Give the order in which nodes are added to your tree and calculate the total weight of your tree.
Hence find a lower bound for the distance that Amber must travel.
[6]
5
Badgers is a small company that makes badges to customers’ designs. Each badge must pass through
four stages in its production: printing, stamping out, fixing pin and checking. The badges can be
laminated, metallic or plastic.
The times taken for 100 badges of each type to pass through each of the stages and the profits that
Badgers makes on every 100 badges are shown in the table below. The table also shows the total time
available for each of the production stages.
Printing
(seconds)
Stamping out
(seconds)
Fixing pin
(seconds)
Checking
(seconds)
Profit
(£)
Laminated
15
5
50
100
4
Metallic
15
8
50
50
3
Plastic
30
10
50
20
1
9000
3600
25 000
10 000
Total time
available
Suppose that the company makes x hundred laminated badges, y hundred metallic badges and ß hundred
plastic badges.
(i) Show that the printing time leads to the constraint x + y + 2ß ≤ 600. Write down and simplify
constraints for the time spent on each of the other production stages.
[4]
(ii) What other constraint is there on the values of x, y and ß?
[1]
The company wants to maximise the profit from the sale of badges.
(iii) Write down an appropriate objective function, to be maximised.
[1]
(iv) Represent Badgers’ problem as an initial Simplex tableau.
[4]
(v) Use the Simplex algorithm, pivoting first on a value chosen from the x-column and then on a
value chosen from the y-column. Interpret your solution and the values of the slack variables in
the context of the original problem.
[9]
© OCR 2009
4736 Jun09
2
June 2009 Insert
4
Permanent
label
Order of becoming
permanent
(i)
Key:
Temporary
labels
Do not cross out your working
values (temporary labels)
1
0
A
E
8
6
2
7
2
D
3
F
1.5
3
B
2.5
C
12
4
9
H
7.5
G
Route of shortest path from A to H = ............................................................................................
Length of shortest path from A to H = ............................ miles
(ii) ........................................................................................................................................................
(iii) ........................................................................................................................................................
........................................................................................................................................................
........................................................................................................................................................
........................................................................................................................................................
........................................................................................................................................................
Length of shortest route = ............................ miles
© OCR 2009
4736 Ins Jun09
3
June 2009 Insert
(iv) Repeat arcs ....................................................................................................................................
Length of shortest route = ............................ miles
(v) ........................................................................................................................................................
........................................................................................................................................................
(vi) ........................................................................................................................................................
........................................................................................................................................................
Upper bound = ............................ miles
(vii)
E
7
2
D
3
F
1.5
3
B
2.5
C
4
12
9
H
7.5
G
Order of adding nodes to tree: ......................................................................................................
Total weight = ............................ miles
........................................................................................................................................................
........................................................................................................................................................
Lower bound = ............................ miles
© OCR 2009
4736 Ins Jun09
Jan 2010
1
2
Answer this question on the insert provided.
3
B
3
D
A
5
1
1
1
5
F
3
C
E
3
(i) Apply Dijkstra’s algorithm to the copy of this network in the insert to find the least weight path
[5]
from A to F . State the route of the path and give its weight.
(ii) Apply the route inspection algorithm, showing all your working, to find the weight of the least
weight closed route that uses every arc at least once. Write down a closed route that has this
least weight.
[4]
An extra arc is added, joining B to E, with weight 2.
(iii) Write down the new least weight path from A to F. Explain why the new least weight closed
route, that uses every arc at least once, has no repeated arcs.
[2]
© OCR 2010
4736 Jan10
3
Jan 2010
2
A simple graph is one in which any two vertices are directly connected by at most one arc and no
vertex is directly connected to itself.
A connected graph is one in which every vertex is joined, directly or indirectly, to every other vertex.
A simply connected graph is one that is both simple and connected.
(i) Explain why there is no simply connected graph with exactly five vertices each of which is
connected to exactly three others.
[1]
(ii) A simply connected graph has five vertices A, B, C, D and E, in which A has order 4, B has
order 2, C has order 3, D has order 3 and E has order 2. Explain how you know that the graph
is semi-Eulerian and write down a semi-Eulerian trail on this graph.
[2]
A network is formed from the graph in part (ii) by weighting the arcs as given in the table below.
A
B
C
D
E
A
−
5
3
8
2
B
5
−
6
−
−
C
3
6
−
7
−
D
8
−
7
−
9
E
2
−
−
9
−
(iii) Apply Prim’s algorithm to the network, showing all your working, starting at vertex A. Draw
the resulting tree and state its total weight.
[3]
A sixth vertex, F , is added to the network using arcs CF and DF , each of which has weight 6.
(iv) Use your answer to part (iii) to write down a lower bound for the length of the minimum tour
that visits every vertex of the extended network, finishing where it starts. Apply the nearest
neighbour method, starting from vertex A, to find an upper bound for the length of this tour.
[4]
Explain why the nearest neighbour method fails if it is started from vertex F .
© OCR 2010
4736 Jan10
Turn over
4
Jan 2010
3
Maggie is a personal trainer. She has twelve clients who want to lose weight. She decides to put some
of her clients on weight loss programme X , some on programme Y and the rest on programme Z .
Each programme involves a strict diet; in addition programmes X and Y involve regular exercise at
Maggie’s home gym. The programmes each last for one month.
In addition to the diet, clients on programme X spend 30 minutes each day on the spin cycle, 10 minutes
each day on the rower and 20 minutes each day on free weights. At the end of one month they can
each expect to have lost 9 kg more than a client on just the diet.
In addition to the diet, clients on programme Y spend 10 minutes each day on the spin cycle and
30 minutes each day on free weights; they do not use the rower. At the end of one month they can
each expect to have lost 6 kg more than a client on just the diet.
Because of other clients who use Maggie’s home gym, the spin cycle is available for the weight
loss clients for 180 minutes each day, the rower for 40 minutes each day and the free weights for
300 minutes each day. Only one client can use each piece of apparatus at any one time.
Maggie wants to decide how many clients to put on each programme to maximise the total expected
weight loss at the end of the month. She models the objective as follows.
Maximise P = 9x + 6y
(i) What do the variables x and y represent?
[1]
(ii) Write down and simplify the constraints on the values of x and y from the availability of each of
the pieces of apparatus.
[3]
(iii) What other constraints and restrictions apply to the values of x and y?
[1]
(iv) Use a graphical method to represent the feasible region for Maggie’s problem. You should use
graph paper and choose scales so that the feasible region can be clearly seen. Hence determine
how many clients should be put on each programme.
[6]
© OCR 2010
4736 Jan10
5
Jan 2010
4
Jack and Jill are packing food parcels. The boxes for the food parcels can each carry up to 5000 g in
weight and can each hold up to 30 000 cm3 in volume.
The number of each item to be packed, their dimensions and weights are given in the table below.
Item type
A
B
C
D
Number to be packed
15
8
3
4
Length (cm)
10
40
20
10
Width (cm)
10
30
50
40
10
20
10
10
Volume (cm )
1000
24 000
10 000
4000
Weight (g)
1000
250
300
400
Height (cm)
3
Jill tries to pack the items by weight using the first-fit decreasing method.
(i) List the 30 items in order of decreasing weight and hence show Jill’s packing. Explain why Jill’s
packing is not possible.
[5]
Jack tries to pack the items by volume using the first-fit decreasing method.
(ii) List the 30 items in order of decreasing volume and hence show Jack’s packing. Explain why
Jack’s packing is not possible.
[5]
(iii) Give another reason why a packing may not be possible.
5
[1]
Consider the following LP problem.
Minimise
2a − 3b + c + 18,
subject to
a + b − c ≥ 14,
−2a + 3c ≤ 50,
10 + 4a ≥ 5b,
and
a ≤ 20, b ≤ 10, c ≤ 8.
(i) By replacing a by 20 − x, b by 10 − y and c by 8 − ß, show that the problem can be expressed as
follows.
Maximise
2x − 3y + ß,
subject to
and
x + y − ß ≤ 8,
2x
− 3ß ≤ 66,
≤ 40,
4x − 5y
x ≥ 0, y ≥ 0, ß ≥ 0.
[3]
(ii) Represent the problem as an initial Simplex tableau. Perform one iteration of the Simplex
algorithm. Explain how the choice of pivot was made and show how each row was obtained.
Write down the values of x, y and ß at this stage. Hence write down the corresponding values of
a, b and c.
[11]
(iii) If, additionally, the variables a, b and c are non-negative, what additional constraints are there
on the values of x, y and ß?
[2]
© OCR 2010
4736 Jan10
Turn over
6
Jan 2010
6
Answer this question on the insert provided.
In this question you will need the result: 1 + 2 + . . . + k = 12 k(k + 1).
Dominic is writing a computer program to carry out Kruskal’s algorithm. He starts by writing a
procedure that enables him to input arcs and their weights, for example A 8 B would represent
an arc joining A to B of weight 8.
(i) If Dominic uses a network with five vertices, what is the greatest number of arcs that he needs
to input? What is the greatest number of arcs for a network with n vertices?
[2]
He then uses shuttle sort to sort the inputs into order of increasing weight.
(ii) (a) For a network with five vertices, write down
• the maximum number of passes
• the maximum number of comparisons in the first, second and third passes
• the maximum total number of comparisons.
[3]
(b) Show that the maximum total number of comparisons for a network with n vertices is
1
1
[2]
4 n(n − 1) 2 n(n − 1) − 1.
Dominic then sets up four memory areas. M1 is for the vertices that are in the tree, M2 is for the arcs
that are in the tree and M3 is for the vertices that are not in the tree. Initially, M1and M2 are empty
and M3 contains a list of all the vertices. Dominic stores the sorted list of arcs and their weights in
M4.
The first arc on the sorted list is added to the tree, the vertices at its ends are transferred from M3 to
M1 and the arc is transferred from M4 to M2.
The arc that is now first in M4 is considered. Each of the two vertices that define the arc is compared
with every entry in M3. If either of the vertices appears in M3, the arc is added to the tree by
transferring the vertices at its ends from M3 to M1 and transferring the arc from M4 to M2. If neither
of the vertices appears in M3, the arc is just deleted from M4.
This is continued until M4 is empty.
(iii) The insert shows the start of Dominic’s program for the network shown below.
D
5
2
E
C
9
6
4
3
7
A
8
Complete the working on the table in the insert.
B
[4]
(iv) Dominic’s program has quartic order (order n4 ). Dominic’s program takes 30 seconds to process
an input from a network with 100 vertices. Approximately how long would it take to process an
input from a network with 500 vertices?
[2]
© OCR 2010
4736 Jan10
Jan 2010 Insert
1
2
(i)
0
1
3
B
3
D
A
5
1
1
1
5
F
3
C
Key:
Order of assigning
Permanent label
E
3
Permanent label
Temporary labels (working values)
— do not cross out
........................................................................................................................................................
........................................................................................................................................................
Path ................................................................................................
Weight ............................
(ii) ........................................................................................................................................................
........................................................................................................................................................
Weight ............................
Route .............................................................................................................................................
(iii) ........................................................................................................................................................
........................................................................................................................................................
........................................................................................................................................................
© OCR 2010
4736 Ins Jan10
Jan 2010 Insert
6
3
(i) Greatest number of arcs
for a network with five vertices = .............................................................
for a network with n vertices = .................................................................
(ii) (a) For a network with five vertices
maximum number of passes = ................................................
maximum number of comparisons
in the first pass = .............................................................
in the second pass = ........................................................
in the third pass = ...........................................................
maximum total number of comparisons = .....................................................................
(b) For a network with n vertices
maximum total number of comparisons = .....................................................................
........................................................................................................................................
........................................................................................................................................
(iii)
M1
Vertices in tree
M2
Arcs in tree
M3
Vertices not in tree
M4
Sorted list
ABCDE
DE
D 2 E
ABC
D 2 E
D 2 E
A 3 E
A 4 C
D 2 E
C 5 D
B 6 E
B 7 C
D 2 E
A 8 B
C 9 E
(iv) ........................................................................................................................................................
........................................................................................................................................................
© OCR 2010
4736 Ins Jan10
June 2010
1
2
Owen and Hari each want to sort the following list of marks into decreasing order.
31
28
75
87
42
43
70
56
61
95
(i) Owen uses bubble sort, starting from the left-hand end of the list.
(a) Show the result of the first pass through the list. Record the number of comparisons and the
number of swaps used in this first pass. Which marks, if any, are guaranteed to be in their
correct final positions after the first pass?
[4]
(b) Write down the list at the end of the second pass of bubble sort.
[1]
(c) How many more passes are needed to get the value 95 to the start of the list?
[1]
(ii) Hari uses shuttle sort, starting from the left-hand end of the list.
Show the results of the first and the second pass through the list. Record the number of
comparisons and the number of swaps used in each of these passes.
[4]
(iii) Explain why, for this particular list, the total number of comparisons will be greater using bubble
sort than using shuttle sort.
[2]
Shuttle sort is a quadratic order algorithm.
(iv) If it takes Hari 20 seconds to sort a list of ten marks using shuttle sort, approximately how long
will it take Hari to sort a list of fifty marks?
[2]
2
A simple graph is one in which any two vertices are directly connected by at most one arc and no
vertex is directly connected to itself.
A connected graph is one in which every vertex is joined, directly or indirectly, to every other vertex.
A simply connected graph is one that is both simple and connected.
(i) Explain why it is impossible to draw a graph with exactly three vertices in which the vertex
orders are 2, 3 and 4.
[1]
(ii) Draw a graph with exactly four vertices of orders 1, 2, 3 and 4 that is neither simple nor connected.
[2]
(iii) Explain why there is no simply connected graph with exactly four vertices of orders 1, 2, 3 and 4.
State which of the properties ‘simple’ and ‘connected’ cannot be achieved.
[2]
(iv) A simply connected Eulerian graph has exactly five vertices.
(a) Explain why there cannot be exactly three vertices of order 4.
[1]
(b) By considering the vertex orders, explain why there are only four such graphs. Draw an
example of each.
[3]
© OCR 2010
4736 Jun10
3
June 2010
3
The constraints of a linear programming problem are represented by the graph below. The feasible
region is the unshaded region, including its boundaries.
y
6
4
2
x
0
2
4
6
(i) Write down the inequalities that define the feasible region.
[3]
The objective is to maximise P1 = x + 6y.
(ii) Find the values of x and y at the optimal point, and the corresponding value of P1 .
[3]
The objective is changed to maximise Pk = kx + 6y, where k is positive.
(iii) Calculate the coordinates of the optimal point, and the corresponding value of Pk when the
optimal point is not the same as in part (ii).
[2]
(iv) Find the range of values of k for which the point identified in part (ii) is still optimal.
© OCR 2010
4736 Jun10
[2]
Turn over
4
June 2010
4
The network below represents a small village. The arcs represent the streets and the weights on the
arcs represent distances in km.
E
0.3
A
0.5
B
D
0.1
F
0.2
0.6
0.2
0.35
C
0.45
G
1.0
(i) Use Dijkstra’s algorithm to find the shortest path from A to G. You must show your working,
including temporary labels, permanent labels and the order in which permanent labels are
assigned. Write down the route of the shortest path from A to G.
[5]
Hannah wants to deliver newsletters along every street; she will start and end at A.
(ii) Which standard network problem does Hannah need to solve to find the shortest route that uses
every arc?
[1]
The total weight of all the arcs is 3.7 km.
(iii) Hannah knows that she will need to travel AB and EF twice, once in each direction. With this
information, use an appropriate algorithm to find the length of the shortest route that Hannah can
use. Show all your working. (You may find the lengths of shortest paths between vertices by
inspection.)
[5]
There are street name signs at each vertex except for A and E. Hannah’s friend Peter wants to check
that the signs have not been vandalised. He will start and end at B.
The table below shows the complete set of shortest distances between vertices B, C, D, F and G.
B
C
D
F
G
B
−
0.2
0.1
0.3
0.75
C
0.2
−
0.3
0.5
0.95
D
0.1
0.3
−
0.2
0.65
F
0.3
0.5
0.2
−
0.45
G
0.75
0.95
0.65
0.45
−
(iv) Apply the nearest neighbour method to this table, starting from B, to find an upper bound for the
distance that Peter must travel.
[2]
(v) Apply Prim’s algorithm to the matrix formed by deleting the row and column for vertex G from
the table. Start building your tree at vertex B.
Draw your tree. Give the order in which vertices are built into your tree and calculate the total
weight of your tree. Hence find a lower bound for the distance that Peter must travel.
[4]
© OCR 2010
4736 Jun10
5
June 2010
5
Jenny is making three speciality smoothies for a party: fruit salad, ginger ßinger and high C.
Each litre of fruit salad contains 600 calories and has 120 mg of sugar and 100 mg of vitamin C.
Each litre of ginger ßinger contains 800 calories and has 80 mg of sugar and 40 mg of vitamin C.
Each litre of high C contains 500 calories and has 120 mg of sugar and 120 mg of vitamin C.
Jenny has enough milk to make 5 litres of fruit salad or 3 litres of ginger ßinger or 4 litres of high
C. This leads to the constraint
12x + 20y + 15ß ≤ 60
in which x represents the number of litres of fruit salad, y represents the number of litres of ginger
ßinger and ß represents the number of litres of high C.
Jenny wants there to be no more than 5000 calories and no more than 800 mg of sugar in total in the
smoothies that she makes.
(i) Use this information to write down and simplify two more constraints on the values of x, y and ß,
other than that they are non-negative.
[4]
Jenny wants to maximise the total amount of vitamin C in the smoothies. This gives the following
objective.
Maximise P = 100x + 40y + 120ß
(ii) Represent Jenny’s problem as an initial Simplex tableau. Use the Simplex algorithm, choosing
the first pivot from the ß column and showing all your working, to find the optimum. How much
of each type of smoothie should Jenny make?
[13]
(iii) Show that if the first pivot had been chosen from the x column then the optimum would have
been achieved in one iteration instead of two.
[5]
© OCR 2010
4736 Jun10
2
Jan 2011
1
In the network below, the arcs represent the roads in Ayton, the vertices represent roundabouts, and
the arc weights show the number of traffic lights on each road. Sam is an evening class student at
Ayton Academy (A). She wants to drive from the academy to her home (H ). Sam hates waiting at
traffic lights so she wants to find the route for which the number of traffic lights is a minimum.
B
1
E
3
2
7
8
A
H
5
C
10
F
3
4
D
1
12
9
G
(i) Apply Dijkstra’s algorithm to find the route that Sam should use to travel from A to H . At each
vertex, show the temporary labels, the permanent label and the order of permanent labelling.
[5]
In the daytime, Sam works for the highways department. After an electrical storm, the highways
department wants to check that all the traffic lights are working. Sam is sent from the depot (D) to
drive along every road and return to the depot. Sam needs to pass every traffic light, but wants to
repeat as few as possible.
(ii) Find the minimum number of traffic lights that must be repeated. Show your working.
[4]
Suppose, instead, that Sam wants to start at the depot, drive along every road and end at her home,
passing every traffic light but repeating as few as possible.
(iii) Find a route on which the minimum number of traffic lights must be repeated. Explain your
reasoning.
[3]
© OCR 2011
4736 Jan11
3
Jan 2011
2
Five rooms, A, B, C, D, E, in a building need to be connected to a computer network using expensive
cabling. Rob wants to find the cheapest way to connect the rooms by finding a minimum spanning
tree for the cable lengths. The length of cable, in metres, needed to connect each pair of rooms is
given in the table below.
Room
Room
A
B
C
D
E
A
−
12
30
15
22
B
12
−
24
16
30
C
30
24
−
20
25
D
15
16
20
−
10
E
22
30
25
10
−
(i) Apply Prim’s algorithm in matrix (table) form, starting at vertex A and showing all your working.
Write down the order in which arcs were added to the tree. Draw the resulting tree and state the
length of cable needed.
[4]
A sixth room, F , is added to the computer network. The distances from F to each of the other rooms
are AF = 32, BF = 29, CF = 31, DF = 35, EF = 30.
(ii) Use your answer to part (i) to write down a lower bound for the length of the minimum tour
that visits every vertex of the extended network, finishing where it starts. Apply the nearest
neighbour method, starting from vertex A, to find an upper bound for the length of this tour. [4]
3
(i) Explain why it is impossible to draw a graph with exactly four vertices of orders 1, 2, 3 and 3.
[1]
A simple graph is one in which any two vertices are directly connected by at most one arc and no
vertex is directly connected to itself.
A connected graph is one in which every vertex is joined, directly or indirectly, to every other vertex.
A simply connected graph is one that is both simple and connected.
(ii) Explain why there is no simply connected graph with exactly four vertices of orders 1, 1, 2 and
4.
[1]
(iii) A connected graph has four vertices A, B, C and D, in which A, B and C have order 2 and D has
order 4. Explain how you know that the graph is Eulerian. Draw an example of such a graph
and write down an Eulerian trail for your graph.
[3]
A graph has three vertices, A, B and C of orders a, b and c, respectively.
(iv) What restrictions on the values of a, b and c follow from the graph being
(a) simple,
(b) connected,
(c) semi-Eulerian?
© OCR 2011
[3]
4736 Jan11
Turn over
Jan 2011
4
4
(i) Describe carefully how to carry out the first pass through bubble sort when we are using it to sort
a list of n numbers into increasing order. State which value is guaranteed to be in its correct final
position after the first pass and hence explain how to carry out the second pass on a reduced list.
Write down the stopping condition for bubble sort.
[5]
(ii) Show the list of six values that results at the end of each pass when we use bubble sort to sort
this list into increasing order.
3
10
8
2
6
11
You do not need to count the number of comparisons and the number of swaps that are used.
[3]
Zack wants to cut lengths of wood from planks that are 20 feet long. The following lengths, in feet,
are required.
3
10
8
2
6
(iii) Use the first-fit method to find a way to cut the pieces.
11
[2]
(iv) Use the first-fit decreasing method to find a way to cut the pieces. Give a reason why this might
be a more useful cutting plan than that from part (iii).
[2]
(v) Find a more efficient way to cut the pieces. How many planks will Zack need with this cutting
plan and how many cuts will he need to make?
[2]
© OCR 2011
4736 Jan11
5
Jan 2011
5
An online shopping company selects some of its parcels to be checked before posting them. Each
selected parcel must pass through three checks, which may be carried out in any order. One person
must check the contents, another must check the postage and a third person must check the address.
The parcels are classified according to the type of customer as ‘new’, ‘occasional’ or ‘regular’. The
table shows the time taken, in minutes, for each check on each type of parcel.
Check contents
Check postage
Check address
New
3
4
3
Occasional
5
3
4
Regular
2
3
3
The manager in charge of checking at the company has allocated each type of parcel a ‘value’ to
represent how useful it is for generating additional income. In suitable units, these values are as
follows.
new = 8 points
occasional = 7 points
regular = 4 points
The manager wants to find out how many parcels of each type her department should check each hour,
on average, to maximise the total value. She models this objective as
Maximise P = 8x + 7y + 4ß.
(i) What do the variables x, y and ß represent?
[1]
(ii) Write down the constraints on the values of x, y and ß.
[4]
The manager changes the value of parcels for regular customers to 0 points.
(iii) Explain what effect this has on the objective and simplify the constraints.
[2]
(iv) Use a graphical method to represent the feasible region for the manager’s new problem. You
should choose scales so that the feasible region can be clearly seen. Hence determine the optimal
strategy.
[6]
Now suppose that there is exactly one hour available for checking and the manager wants to find out
how many parcels of each type her department should check in that hour to maximise the total value.
The value of parcels for regular customers is still 0 points.
(v) Find the optimal strategy in this situation.
[3]
(vi) Give a reason why, even if all the timings and values are correct, the total value may be less than
this maximum.
[1]
Question 6 is printed overleaf.
© OCR 2011
4736 Jan11
6
Jan 2011
6
Consider the following LP problem.
Minimise
subject to
and
2a − 4b + 5c − 30,
3a + 2b − c ≥ 10,
−2a + 4c ≤ 35,
4a − b ≤ 20,
a ≤ 6, b ≤ 8, c ≤ 10.
(i) Since a ≤ 6 it follows that 6 − a ≥ 0, and similarly for b and c. Let 6 − a = x (so that a is replaced by
6 − x), 8 − b = y and 10 − c = ß to show that the problem can be expressed as
Maximise
subject to
and
2x − 4y + 5ß,
3x + 2y − ß ≤ 14,
2x − 4ß ≤ 7,
−4x + y ≤ 4,
x ≥ 0, y ≥ 0, ß ≥ 0.
[3]
(ii) Represent the problem as an initial Simplex tableau. Perform two iterations of the Simplex
algorithm, showing how each row was obtained. Hence write down the values of a, b and c after
two iterations. Find the value of the objective for the original problem at this stage.
[10]
© OCR 2011
4736 Jan11
2
June 2011
1
The constraints of a linear programming problem are represented by the graph below. The feasible
region is the unshaded region, including its boundaries.
y
6
A
B
4
2
0
2
4
6
x
(i) Write down the inequalities that define the feasible region.
[2]
The objective is to maximise Pm = x + my, where m is a positive, real-valued constant.
(ii) In the case when m = 2, calculate the values of x and y at the optimal point, and the corresponding
[2]
value of P2 .
(iii) (a) Write down the values of m for which point A is optimal.
(b) Write down the values of m for which point B is optimal.
© OCR 2011
4736 Jun11
[2]
3
June 2011
2
Consider the following algorithm.
STEP 1
Input a number N
STEP 2
Calculate R = N ÷ 2
STEP 3
Calculate S = (N ÷ R) + R ÷ 2
STEP 4
If R and S are the same when rounded to 2 decimal places, go to STEP 7
STEP 5
Replace R with the value of S
STEP 6
Go to STEP 3
STEP 7
Output the value of R correct to 2 decimal places
(i) Work through the algorithm starting with N = 16. Record the values of R and S each time they
change and show the value of the output.
[2]
(ii) Work through the algorithm starting with N = 2. Record the values of R and S each time they
change and show the value of the output.
[2]
(iii) What does the algorithm achieve for positive inputs?
[1]
(iv) Show that the algorithm fails when it is applied to N = −4.
[1]
(v) Describe what happens when the algorithm is applied to N = −2. Suggest how the algorithm
could be improved to avoid this problem, without imposing a restriction on the allowable input
values.
[2]
© OCR 2011
4736 Jun11
Turn over
4
June 2011
3
A simple graph is one in which any two vertices are directly connected by at most one arc and no
vertex is directly connected to itself.
A connected graph is one in which every vertex is joined, directly or indirectly, to every other vertex.
A simply connected graph is one that is both simple and connected.
(i) Explain why it is impossible to draw a graph with exactly five vertices of orders 1, 2, 3, 4 and 5.
[1]
(ii) Explain why there is no simply connected graph with exactly five vertices of orders 2, 2, 3, 4
and 5. State which of the properties ‘simple’ and ‘connected’ cannot be achieved.
[2]
(iii) Calculate the number of arcs in a simply connected graph with exactly five vertices of orders 1,
1, 2, 2 and 4. Hence explain why such a graph cannot be a tree.
[2]
(iv) Draw a simply connected semi-Eulerian graph with exactly five vertices that is also a tree. By
considering the orders of the vertices, explain why it is impossible to draw a simply connected
Eulerian graph with exactly five vertices that is also a tree.
[2]
In the graph below the vertices represent buildings and the arcs represent pathways between those
buildings.
A
D
C
B
F
E
(v) By considering the orders of the vertices, explain why it is impossible to walk along these
pathways in a continuous route that uses every arc once and only once. Write down the
minimum number of arcs that would need to be travelled twice to walk in a continuous route that
uses every arc at least once.
[2]
© OCR 2011
4736 Jun11
June 2011
4
Consider the following LP problem.
5
Maximise
P = −3w + 5x − 7y + 2ß,
subject to
w + 2x − 2y − ß ≤ 10,
2w + 3y − 4ß ≤ 12,
4w + 5x + y ≤ 30,
w ≥ 0, x ≥ 0, y ≥ 0, ß ≥ 0.
and
(i) Represent the problem as an initial Simplex tableau. Explain why the pivot can only be chosen
from the x column.
[4]
(ii) Perform one iteration of the Simplex algorithm. Show how each row was obtained and write
down the values of w, x, y, ß and P at this stage.
[4]
(iii) Perform a second iteration of the Simplex algorithm. Write down the values of w, x, y, ß and P
at this stage and explain how you can tell from this tableau that P can be increased without limit.
How could you have known from the LP formulation above that P could be increased without
limit?
[5]
© OCR 2011
4736 Jun11
Turn over
6
June 2011
5
The arcs in the network below represent the tracks in a forest and the weights on the arcs represent
distances in km.
C
3.2
4.6
1.4
A
0.9
B
D
5.0
F
2.5
1.0
G
1.8
6.0
5.3
E
Dijkstra’s algorithm is to be used to find the shortest path from A to G.
(i) Apply Dijkstra’s algorithm to find the shortest path from A to G. Show your working, including
temporary labels, permanent labels and the order in which permanent labels are assigned. Do
not cross out your working values. Write down the route of the shortest path from A to G and
give its length.
[6]
The track joining B and D is washed away in a flood. It is replaced by a new track of unknown length,
x km.
C
3.2
4.6
1.4
A
0.9
B
D
x
F
2.5
1.0
G
1.8
6.0
5.3
E
(ii) What is the smallest value that x can take so that the route found in part (i) is still a shortest path?
[2]
If the value of x is smaller than this, what is the weight of the shortest path from A to G?
(iii) (a) For what values of x will vertex E have two temporary labels? Write down the values of
these temporary labels.
[2]
(b) For what values of x will vertex C have two temporary labels? Write down the values of
these temporary labels.
[2]
Dijkstra’s algorithm has quadratic order.
(iv) If a computer takes 20 seconds to apply Dijkstra’s algorithm to a complete network with 50
vertices, approximately how long will it take for a complete network with 100 vertices?
[2]
© OCR 2011
4736 Jun11
7
June 2011
6
The arcs in the network represent the tracks in a forest. The weights on the arcs represent distances
in km.
C
3.2
4.6
1.4
A
0.9
B
D
x
F
2.5
1.0
G
1.8
6.0
5.3
E
Richard wants to walk along every track in the forest. The total weight of the arcs is 26.7 + x.
(i) Find, in terms of x, the length of the shortest route that Richard could use to walk along every
[3]
track, starting at A and ending at G. Show all of your working.
(ii) Now suppose that Richard wants to find the length of the shortest route that he could use to
walk along every track, starting and ending at A. Show that for x ≤ 1.8 this route has length
(32.4 + 2x) km, and for x ≥ 1.8 it has length (34.2 + x) km.
[8]
Whenever two tracks join there is an information board for visitors to the forest. Shauna wants to
check that the information boards have not been vandalised. She wants to find the length of the
shortest possible route that starts and ends at A, passing through every vertex at least once.
Consider first the case when x is less than 3.2.
(iii) (a) Apply Prim’s algorithm to the network, starting from vertex A, to find a minimum spanning
tree. Draw the minimum spanning tree and state its total weight. Explain why the solution
to Shauna’s problem must be longer than this.
[3]
(b) Use the nearest neighbour strategy, starting from vertex A, and show that it stalls before it
has visited every vertex.
[2]
Now consider the case when x is greater than 3.2 but less than 4.6.
(iv) (a) Draw the minimum spanning tree and state its total weight.
[2]
(b) Use the nearest neighbour strategy, starting from vertex A, to find a route from A to G
passing through each vertex once. Write down the route obtained and its total weight.
Show how a shortcut can give a shorter route from A to G passing through each vertex.
Hence, explaining your method, find an upper bound for Shauna’s problem.
[4]
© OCR 2011
4736 Jun11
Jan 2012
2
1
Tom has some packages that he needs to sort into order of decreasing weight. The weights, in kg, given on
the packages are as follows.
3
6
2
6
5
7
1
4
9
Use shuttle sort to put the weights into decreasing order (from largest to smallest). Show the result at the
end of each pass through the algorithm and write down the number of comparisons and the number of swaps
used in each pass. Write down the total number of passes, the total number of comparisons and the total
number of swaps used.
[6]
2
A simple graph is one in which any two vertices are directly connected by at most one arc and no vertex is
directly connected to itself. A connected graph is one in which every vertex is joined, directly or indirectly,
to every other vertex. A simply connected graph is one that is both simple and connected.
(i) What is the minimum number of arcs that a simply connected graph with six vertices can have? Draw
an example of such a graph.
[2]
(ii) What is the maximum number of arcs that a simply connected graph with six vertices can have? Draw
an example of such a graph.
[2]
(iii) What is the maximum number of arcs that a simply connected Eulerian graph with six vertices can
have? Explain your reasoning.
[2]
(iv) State how you know that the graph below is semi-Eulerian and write down a semi-Eulerian trail for the
graph.
[2]
A
B
C
F
D
E
© OCR 2012
4736 Jan12
Jan 2012
3
3
A
6
B
4
2
3
C
5
5
4
D
3
F
6
E
(i) Apply Dijkstra’s algorithm to the copy of this network in the answer booklet to find the least weight
path from A to F. State the route of the path and give its weight.
[6]
In the remainder of this question, any least weight paths required may be found without using a formal
algorithm.
(ii) Apply the route inspection algorithm, showing all your working, to find the weight of the least weight
closed route that uses every arc at least once.
[3]
(iii) Find the weight of the least weight route that uses every arc at least once, starting at A and ending at F.
Explain how you reached your answer.
[4]
© OCR 2012
4736 Jan12
Turn over
Jan 2012
4
4
Lucy is making party bags which she will sell to raise money for charity. She has three colours of party bag:
red, yellow and blue. The bags contain balloons, sweets and toys. Lucy has a stock of 40 balloons, 80 sweets
and 30 toys. The table shows how many balloons, sweets and toys are needed for one party bag of each
colour.
Colour of party bag
Balloons
Sweets
Toys
Red
5
3
5
Yellow
4
7
2
Blue
6
6
3
Lucy will raise £1 for each bag that she sells, irrespective of its colour. She wants to calculate how many
bags of each colour she should make to maximise the total amount raised for charity.
Lucy has started to model the problem as an LP formulation.
Maximise
P = x + y + z,
subject to
3x + 7y + 6z
80.
(i) What does the variable x represent in Lucy’s formulation?
(ii) Explain why the constraint 3x + 7y + 6z
[1]
80 must hold and write down another two similar constraints.
[3]
(iii) What other constraints and restrictions apply to the values of x, y and z?
[1]
(iv) What assumption is needed for the objective to be valid?
[1]
(v) Represent the problem as an initial Simplex tableau. Do not carry out any iterations yet.
[3]
(vi) Perform one iteration of the Simplex algorithm, choosing a pivot from the x column. Explain how the
choice of pivot row was made and show how each row was calculated.
[6]
(vii) Write down the values of x, y and z from the first iteration of the Simplex algorithm and hence find the
number of bags of each colour that Lucy should make according to this non-optimal tableau.
[2]
In the optimal solution Lucy makes 10 bags.
(viii) Without carrying out further iterations of the Simplex algorithm, find a solution in which Lucy should
make 10 bags.
[1]
© OCR 2012
4736 Jan12
Jan 2012
5
5
The table shows the road distances in miles between five places in Great Britain. For example, the distance
between Birmingham and Cardiff is 103 miles.
Ayr
250
Birmingham
350
103
Cardiff
235
104
209
Doncaster
446
157
121
261
Exeter
(i) Complete the network in the answer booklet to show this information. The vertices are labelled by
using the initial letter of each place.
[2]
(ii) List the ten arcs by increasing order of weight. Apply Kruskal’s algorithm to the list. Any entries that
are crossed out should still be legible. Draw the resulting minimum spanning tree and give its total
weight.
[4]
A sixth vertex, F, is added to the network. The distances, in miles, between F and each of the other places
are shown in the table below.
Distance from F
A
B
C
D
E
200
50
150
59
250
(iii) Use the weight of the minimum spanning tree from part (ii) to find a lower bound for the length of the
minimum tour (cycle) that visits every vertex of the extended network with six vertices.
[2]
(iv) Apply the nearest neighbour method, starting from vertex A, to find an upper bound for the length of
the minimum tour (cycle) through the six vertices.
[2]
(v) Use the two least weight arcs through A to form a least weight path of the form SAT, where S and T are
two of {B, C, D, E, F}, and give the weight of this path. Similarly write down a least weight path of the
form UEV, where U and V are two of {A, B, C, D, F}, and give the weight of this path. You should find
that the two paths that you have written down use all six vertices.
Now find the least weight way in which the two paths can be joined together to form a cycle through
all six vertices. Hence write down a tour through the six vertices that has total weight less than the
upper bound. Write down the total weight of this tour.
[8]
Question 6 is printed overleaf.
© OCR 2012
4736 Jan12
Turn over
Jan 2012
6
6
The function INT(C) gives the largest integer that is less than or equal to C.
For example: INT(4.8) = 4, INT(7) = 7, INT(0.8) = 0, INT(−0.8) = −1, INT(−2.4) = −3.
Consider the following algorithm.
Line 10
Line 20
Line 30
Line 40
Line 50
Line 60
Line 70
Line 80
Input A and B
Calculate C = B ÷ A
Let D = INT(C)
Calculate E = A × D
Calculate F = B − E
Output the value of F
Replace B by the value of D
If B = 0 then stop, otherwise go back to line 20
(i) Apply the algorithm using the inputs A = 10 and B = 128. Record the values of A, B, C, D, E, and F
every time they change. Record the output each time line 60 is reached.
[4]
(ii) Show what happens when the input values are A = 10 and B = −13.
© OCR 2012
4736 Jan12
[5]
2
June 2012
1
Satellite navigation systems (sat navs) use a version of Dijkstra’s algorithm to find the shortest route between
two places. A simplified map is shown below. The values marked represent road distances, in km, for that
section of road (from a place to a road junction, or between two places).
Ayton (A)
Beetown (B)
12
60
10
8
5
Deeham (D)
Ceeville (C)
(E) Eborne
3
6
25
Fort Effleigh (F)
(i) Use the map to construct a network with exactly 10 arcs to show the direct distances between these
places, with no road junctions shown. For example, there will need to be an arc connecting A to B of
weight 22, and also arcs connecting A to C, D, and E. There is no arc connecting A to F (because there is
no route from A to F that does not pass through another place).
[2]
(ii) Apply Dijkstra’s algorithm, starting at A, to find the shortest route from A to F.
[5]
Dijkstra’s algorithm has quadratic order (order n2).
(iii) If it takes 3 seconds for a certain sat nav to find the shortest route between two places when it has
to process 200 places, calculate approximately how many minutes it will take when it has to process
4000 places.
[2]
© OCR 2012
4736 Jun12
3
June 2012
2
A simple graph is one in which any two vertices are directly connected by at most one arc and no vertex is
directly connected to itself. A connected graph is one in which every vertex is joined, directly or indirectly,
to every other vertex. A simply connected graph is one that is both simple and connected.
(i) (a) Draw a simply connected Eulerian graph with exactly five vertices and five arcs.
[1]
(b) Draw a simply connected semi-Eulerian graph with exactly five vertices and five arcs, in which
one of the vertices has order 4.
[1]
(c) Draw a simply connected semi-Eulerian graph with exactly five vertices and five arcs, in which
none of the vertices have order 4.
[1]
A teacher is organising revision classes for her students. There will be ten revision classes scheduled into a
number of sessions. Each class will run in one session only. Each student has chosen two classes to attend.
The table shows which classes each student has chosen.
Revision classes
Student number
C1
C2
1
✓
✓
C3
2
C4
M1
M2
S1
D1
✓
3
✓
4
✓
✓
✓
✓
6
D2
✓
5
✓
✓
✓
7
8
S2
✓
✓
✓
✓
9
✓
10
✓
✓
✓
(ii) (a) Draw a graph to show this information. Each vertex represents a class. Each arc links the two
classes chosen by a student.
[2]
(b) Show how the teacher can arrange the classes in just two sessions, which satisfy all student
choices. For example, C1 and C2 cannot be in the same session.
[2]
An extra student joins the group. This student chooses to attend the revision classes in M1 and D1.
(c) Explain why the teacher cannot now arrange the classes in just two sessions. Do not amend your
graph from part (ii)(a).
[2]
© OCR 2012
4736 Jun12
Turn over
4
June 2012
3
The constraints of a linear programming problem are represented by the graph below. The feasible region is
the unshaded region, including its boundaries.
y
3
2
1
0
1
2
3
x
(i) Obtain the four inequalities that define the feasible region.
[4]
(ii) Calculate the coordinates of the vertices of the feasible region, giving your values as fractions.
[4]
The objective is to maximise P = x + 4y.
(iii) Calculate the value of P at each vertex of the feasible region. Hence write down the coordinates of the
optimal point, and the corresponding value of P.
[3]
Suppose that the solution must have integer values for both x and y.
(iv) Find the coordinates of the optimal point with integer-valued x and y, and the corresponding value
of P. Explain how you know that this is the optimal solution.
[2]
© OCR 2012
4736 Jun12
5
June 2012
4
Consider the following linear programming problem.
Maximise
P = −5x − 6y + 4z,
subject to
3x − 4y + z
6x
+ 2z
−10x − 5y + 5z
x 0, y 0, z
12,
20,
30,
0.
(i) Use slack variables s, t and u to rewrite the first three constraints as equations. What restrictions are
there on the values of s, t and u?
[2]
(ii) Represent the problem as an initial Simplex tableau.
[2]
(iii) Show why the pivot for the first iteration of the Simplex algorithm must be the coefficient of z in the
third constraint.
[2]
(iv) Perform one iteration of the Simplex algorithm, showing how the elements of the pivot row were
calculated and how this was used to calculate the other rows.
[3]
(v) Perform a second iteration of the Simplex algorithm and record the values of x, y, z and P at the end of
this iteration.
[3]
(vi) Write down the values of s, t and u from your final tableau and explain what they mean in terms of the
original constraints.
[2]
© OCR 2012
4736 Jun12
Turn over
6
June 2012
5
Jess and Henry are out shopping. The network represents the main routes between shops in a shopping
arcade. The arcs represent pathways and escalators, the vertices represent some of the shops and the weights
on the arcs represent distances in metres.
N
70
M
60
40
80
P
100
80
190
R
170
S
40
50
80
T
30
210
V
W
The total weight of all the arcs is 1200 metres.
The table below shows the shortest distances between vertices; some of these are indirect distances.
M
N
P
R
S
T
V
W
M
–
70
110
190
60
190
140
90
N
70
–
40
130
120
170
80
150
P
110
40
–
100
80
140
120
110
R
190
130
100
–
130
40
50
160
S
60
120
80
130
–
170
80
30
T
190
170
140
40
170
–
90
200
V
140
80
120
50
80
90
–
110
W
90
150
110
160
30
200
110
–
(i) Use a standard algorithm to find the shortest distance that Jess must travel to cover every arc in the
original network, starting and ending at M.
[3]
(ii) Find the shortest distance that Jess must travel if she just wants to cover every arc, but does not mind
where she starts and where she finishes. Which two points are her start and finish?
[2]
© OCR 2012
4736 Jun12
June 2012
7
Henry suggests that Jess only needs to visit each shop.
(iii) Apply the nearest neighbour method to the network, starting at M, to write down a closed tour through
all the vertices. Calculate the weight of this tour. What does this value tell you about the length of the
shortest closed route that passes through every vertex?
[4]
Henry thinks that Jess does not need to visit shop W. He uses the table of shortest distances to list all the
possible connections between M, N, P, R, S, T and V by increasing order of weight. Henry’s list is given in
your answer book.
(iv) Use Kruskal’s algorithm on Henry’s list to find a minimum spanning tree for M, N, P, R, S, T and V.
Draw the tree and calculate its total weight.
[2]
Jess insists that they must include shop W.
(v) Use the weight of the minimum spanning tree for M, N, P, R, S, T and V, and the table of shortest
distances, to find a lower bound for the length of the shortest closed route that passes through all eight
vertices.
[2]
[Question 6 is printed overleaf.]
© OCR 2012
4736 Jun12
Turn over
June 2012
6
8
The following flow chart has been written to find a root of the cubic equation x3 + Ax2 + Bx + C = 0, given a
starting value X that is thought to be near the root.
Input the values of A, B and C
Input X
Calculate Y = X3 + AX2 + BX + C
Calculate Z = 3X2 + 2AX + B
NO
YES
Does Z = 0?
Let X = W
Let W = X – (Y ÷ Z)
NO
Is W – X between
í 0.05 and 0.05?
Reduce X by 1
YES
Output X
(i) Work through the algorithm, recording the values of X, Y, Z and W each time they change, for the
equation x3 − 4x2 + 5x + 1 = 0, with a starting value of X = 0.
[6]
(ii) Show what happens when the algorithm is used for the equation x3 − 4x2 + 5x + 1 = 0, with a starting
value of X = 1.
[2]
(iii) Show what happens when the algorithm is used for the equation x3 − 4x2 + 5x + 1 = 0, with a starting
value of X = −1.
[5]
(iv) Identify a possible problem with using this algorithm.
[1]
Copyright Information
OCR is committed to seeking permission to reproduce all third-party content that it uses in its assessment materials. OCR has attempted to identify and contact all copyright holders
whose work is used in this paper. To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced in the OCR Copyright
Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download from our public website (www.ocr.org.uk) after the live examination series.
If OCR has unwittingly failed to correctly acknowledge or clear any third-party content in this assessment material, OCR will be happy to correct its mistake at the earliest possible
opportunity.
For queries or further information please contact the Copyright Team, First Floor, 9 Hills Road, Cambridge CB2 1GE.
OCR is part of the Cambridge Assessment Group; Cambridge Assessment is the brand name of University of Cambridge Local Examinations Syndicate (UCLES), which is itself a
department of the University of Cambridge.
© OCR 2012
4736 Jun12
2
Jan 2013
1
(i) Use shuttle sort to put this list of values into decreasing order (from largest to smallest).
18
7
9
20
15
21
6
10
22
Show the result at the end of each pass through the algorithm and write down the number of comparisons
and the number of swaps used in each pass.
[5]
(ii) The values give the weights, in kg, of sacks of grain. The sacks are to be loaded into boxes, each of
which can hold at most 30 kg. Use the first-fit decreasing method to show which sacks should be put
into which box.
[2]
(iii) Suppose that some stronger boxes are available, each of which can hold at most W kg. Find the least
value of W for which only four boxes are needed. Show a packing using four of these stronger boxes.
[2]
2
A tetromino is a two-dimensional shape made by joining four squares edge-to-edge. Joins are along complete
edges.
(i) Represent each of the tetrominoes below by a graph in which the nodes represent the squares and two
nodes are joined by an arc if the squares share a common edge.
[2]
(A)
(B)
(C)
(D)
(ii) Six simply connected graphs with four nodes are shown below. For each graph, either draw a tetromino
that can be represented by the graph, as in part (i), or explain why this is not possible.
[3]
(1)
(2)
(3)
(4)
(5)
(6)
Two tetrominoes are regarded as being the same if one can be rotated or reflected to form the other. Derek
claims that each tetromino corresponds to a unique tree with four nodes, and each tree with four nodes
corresponds to a unique tetromino. Derek’s claim is wrong.
(iii) From the diagrams above, find:
(a) a tetromino whose graph does not correspond to a tree;
[1]
(b) two different tetrominoes whose graphs correspond to the same tree.
[1]
A pentomino is a two-dimensional shape made by joining five squares edge-to-edge. Joins are along
complete edges. Two pentominoes are regarded as being the same if one can be rotated or reflected to form
the other. There are twelve distinct pentominoes.
(iv) When the pentominoes are represented by graphs, as in part (i), there are only four distinct graphs.
Draw these four graphs.
[3]
© OCR 2013
4736/01 Jan13
3
Jan 2013
3
The total weight of the arcs in the network below is 230.
13
A
14
C
14
E
G
31
18
11
19
15
13
16
13
12
B
14
D
15
F
12
H
(i) Apply Dijkstra’s algorithm to the copy of the network in the answer book to find the least weight path
from A to H. Give the path and its weight.
[6]
In the remainder of this question, any least weight paths required may be found without using a formal
algorithm.
(ii) The arc AD is removed. Apply the route inspection algorithm, showing your working, to find the
weight of the least weight closed route that uses every arc (except AD) at least once.
[4]
(iii) Suppose, instead, that the arc AD is available, but arcs AC and CD are both removed. Apply the route
inspection algorithm, showing your working, to find the weight of the least weight closed route that
uses every arc (except AC and CD) at least once.
[4]
© OCR 2013
4736/01 Jan13
Turnover
4
Jan 2013
4
Pam has seven employees. When it snows they all need to be contacted by telephone.
The table shows the expected time, in minutes, that it will take Pam and her employees to contact each
other.
Pam
Alan
Bob
Caz
Dan
Ella
Fred
Gita
Pam
–
10
4
8
18
12
12
9
Alan
10
–
6
10
18
12
11
9
Bob
4
6
–
9
17
10
11
10
Caz
8
10
9
–
15
13
10
7
Dan
18
18
17
15
–
16
19
20
Ella
12
12
10
13
16
–
13
14
Fred
12
11
11
10
19
13
–
18
Gita
9
9
10
7
20
14
18
–
(i) Use the nearest neighbour method, starting from Pam, to find a cycle through all the employees and
Pam. If there is a choice of names choose the one that occurs first alphabetically. Calculate the total
weight of this cycle.
[5]
(ii) Apply Prim’s algorithm to the copy of the table in the answer book, starting by crossing out the row for
Pam and looking down the column for Pam. List the arcs in the order in which they were chosen. Draw
the resulting minimum spanning tree and calculate its total weight.
[6]
(iii) Find a lower bound for the minimum weight cycle through Pam and her seven employees by initially
removing Gita from the minimum spanning tree.
[3]
Pam realises that it takes less time if she splits the employees into teams.
(iv) Use the minimum spanning tree to suggest how to split the employees into two teams, so that Pam
contacts the two team leaders and they each contact the members of their team. Using this solution,
find the minimum elapsed time by which all the employees can be contacted.
[3]
© OCR 2013
4736/01 Jan13
June
2013
Jan 2013
1
2
The list below is to be sorted into increasing order using bubble sort, starting at the left-hand end of the list.
24
57
9
31
16
4
(i) Show which values are compared and which are swapped in the first pass. Write down the list that
results at the end of the first pass.
[2]
(ii) Without showing the individual comparisons and swaps, write down the lists that result after the second
pass and after the third pass.
[2]
(iii) In total there will be five passes made in carrying out bubble sort on the list. Write down how many
swaps are made in each pass.
[2]
2
A simple graph is one in which any two vertices are directly connected by at most one arc and no vertex is
directly connected to itself. A connected graph is one in which every vertex is joined, directly or indirectly,
to every other vertex. A simply connected graph is one that is both simple and connected.
(i) (a) Draw a connected Eulerian graph that has exactly four vertices and five arcs but is not simple.
[1]
(b) Explain why it is not possible to have a simply connected Eulerian graph with exactly four
vertices and five arcs.
[2]
A simply connected Eulerian graph is drawn that has exactly eight vertices and ten arcs.
(ii) (a) Explain how you know that the sum of the vertex orders must be 20.
[1]
(b) Write down the minimum and maximum possible vertex order and draw a diagram that includes
both the minimum and the maximum cases.
[3]
(c) Draw a diagram to show a simply connected Eulerian graph with exactly eight vertices and ten
arcs in which the number of vertices of order 4 is as large as possible.
[1]
© OCR 2013
4736/01 Jun13
June 2013
3
3
Holly has written an algorithm.
Step 1
Step 2
Step 3
Step 4
Step 5
Step 6
Step 7
Step 8
Step 9
Step 10
Step 11
Step 12
Step 13
Input two positive integers A and B
Let C = A – B
If C < 0, let D = B then let E = B + C
If C = 0, jump to Step 10
If C > 0, let D = A and let E = B
Let F = D – E
If F < 0, let D = E then let E = F + D and go back to Step 6
If F = 0, let F = D then jump to Step 11
If F > 0, let D = F then go back to Step 6
Let F = A
Let G = A ÷ F
Let M = G × B
Print the values F and M
(i) Work through Holly’s algorithm using the input values A = 30 and B = 18. Set out your working using
the table in the answer book. Use one row for each step where any values change and only write down
values when they change. Write down the values that are printed.
[6]
(ii) Describe what happens when A = 18 and B = 30. You need only record enough rows of the table to be
able to show what happens.
[2]
(iii) Without doing further working, state the output values of F and M when A = 12 and B = 8.
© OCR 2013
4736/01 Jun13
[2]
Turn over
4
June 2013
4
A simplified map of an area of moorland is shown below. The vertices represent farmhouses and the arcs
represent the paths between the farmhouses. The weights on the arcs show distances in km.
B
24
10
8
A
F
14
23
20
11
24
8
C
5
9
12
15
E
G
7
16
D
18
Ted wants to visit each farmhouse and then return to his starting point.
(i) In your answer book the arcs have been sorted into increasing order of weight. Use Kruskal’s algorithm
to find a minimum spanning tree for the network, and give its total weight. Hence find a route visiting
each farmhouse, and returning to the starting point, which has length 82 km.
[4]
(ii) Give the weight of the minimum spanning tree for the six vertices A, B, C, E, F, G. Hence find a route
visiting each of the seven farmhouses once, and returning to the starting point, which has length 81 km.
[2]
(iii) Show that the nearest neighbour method fails to produce a cycle through every vertex when started
from A but that it succeeds when started from B. Adapt this cycle to find a complete cycle of total
weight less than 70, and find the total length of the shorter cycle.
[6]
© OCR 2013
4736/01 Jun13
5
June 2013
5
This question uses the same network as question 4. The total weight of the arcs in the network is 224.
B
24
10
8
A
F
14
23
20
11
24
8
C
5
9
12
15
E
G
7
16
D
18
(i) Apply Dijkstra’s algorithm to the network, starting at A, to find the shortest route from A to G.
[5]
(ii) Dijkstra’s algorithm has quadratic order (order n2). It takes 2.25 seconds for a certain computer to
apply Dijkstra’s algorithm to a network with 7 vertices. Calculate approximately how many hours it
will take to apply Dijkstra’s algorithm to a network with 1400 vertices.
[2]
(iii) How much shorter would the path CE need to be for it to become part of a shortest path from A to G?
[2]
Following a landslip, the paths AC and CE become blocked and cannot be used. A warden needs to travel
along all the remaining paths to check that there are no more landslips.
(iv) Find the shortest distance that the warden must travel, assuming that she starts and ends at vertex C.
Show your working.
[6]
© OCR 2013
4736/01 Jun13
Turn over
6
June 2013
6
Consider the following linear programming problem.
Maximise
P = 5x + 8y,
subject to
3x – 2y G 12,
3x + 4y G 30,
3x – 8y H –24,
x H 0, y H 0.
(i) Represent the constraints graphically. Shade the regions where the inequalities are not satisfied and
hence identify the feasible region.
[4]
(ii) Calculate the coordinates of the vertices of the feasible region, apart from the origin, and calculate the
value of P at each vertex. Hence find the optimal values of x and y, and state the maximum value of the
objective.
[4]
(iii) Suppose that, additionally, x and y must both be integers. Find the maximum feasible value of y for
every feasible integer value of x. Calculate the value of P at each of these points and hence find the
optimal values of x and y with this additional restriction.
[4]
Tom wants to use the Simplex algorithm to solve the original (non-integer) problem. He reformulates it
as follows.
Maximise
P = 5x + 8y,
subject to
3x – 2y G 12,
3x + 4y G 30,
–3x + 8y G 24,
x H 0, y H 0.
(iv) Explain why Tom needed to change the third constraint.
[1]
(v) Represent the problem by an initial Simplex tableau.
[2]
(vi) Perform one iteration of the Simplex algorithm, choosing your pivot from the y column. Show how
the pivot row was used to calculate the other rows. Write down the values of x, y and P that result from
this iteration.
Perform a second iteration of the Simplex algorithm to achieve the optimum point.
© OCR 2013
4736/01 Jun13
[6]
2
June 2014
1
Sangita needs to move some heavy boxes to her new house. She has borrowed a van that can carry at most
600 kg. She will have to make several deliveries to her new house.
The masses of the boxes have been recorded in kg as:
120
120
120
100
150
200
250
150
200
250
120
(i) Use the first-fit method to show how Sangita could pack the boxes into the van. How many deliveries
does this solution require?
[3]
(ii) Use the first-fit decreasing method to show how Sangita could pack the boxes into the van. There is no
need to use a sorting algorithm, but you should write down the sorted list before showing the packing.
How many deliveries does this solution require?
[4]
Sangita then realises that she cannot fit more than four boxes in the van at a time.
(iii) Find a way to pack the boxes into the van so that she makes as few deliveries as possible.
2
A simple graph is one in which any two vertices are directly connected by at most one arc and no vertex is
directly connected to itself. A connected graph is one in which every vertex is joined, directly or indirectly,
to every other vertex. A simply connected graph is one that is both simple and connected.
[2]
(i) (a) Draw a simply connected graph that has exactly four vertices and exactly five arcs. Is your graph
Eulerian, semi-Eulerian or neither? Explain how you know.
[3]
(b) By considering the sum of the vertex orders, show that there is only one possible simply connected
graph with exactly four vertices and exactly five arcs.
[5]
(ii) Draw five distinct simply connected graphs each with exactly five vertices and exactly five arcs.
© OCR 2014
4736/01 Jun14
[3]
3
June 2014
3
The following algorithm finds two positive integers for which the sum of their squares equals a given input,
when this is possible.
The function INT(X ) gives the largest integer that is less than or equal to X. For example: INT ^6.9h = 6 ,
INT ^7h = 7 , INT ^7.1h = 7 .
Line 10
Line 20
Line 30
Line 40
Line 50
Line 60
Line 70
Line 80
Line 90
Line 100
Line 110
Input a positive integer, N
Let C = 1
If C 2 H N jump to line 110
[you may record your answer as a surd or a decimal]
Let X = ^N - C 2h
Let Y = INT (X)
If X = Y jump to line 100
If C 2 Y jump to line 110
Add 1 to C
Go back to line 30
Print C, X and stop
Print ‘FAIL’ and stop
(i) Apply the algorithm to the input N = 500 . You only need to write down values when they change and
there is no need to record the use of lines 30, 60, 70 or 90.
[4]
(ii) Apply the algorithm to the input N = 7 .
[2]
(iii) Explain why lines 70 and 110 are needed.
[1]
The algorithm has order
(iv) If it takes 0.7 seconds to run the algorithm when N = 3000 , roughly how long will it take when
[2]
N = 12 000 ?
© OCR 2014
N.
4736/01 Jun14
Turnover
4
June 2014
4
The network below represents a treasure trail. The arcs represent paths and the weights show distances in
units of 100 metres.
The total length of the paths shown is 4200 metres.
B
3
1
1
A
C
5
8
1
E
3
1
4
F
2
4
D
5
3
H
1
G
(i) Apply Dijkstra’s algorithm to the network, starting at A, to find the shortest distance (in metres) from A
to each of the other vertices.
[5]
Alex wants to hunt for the treasure. His current location is marked on the network as A. The clues to the
location of the treasure are located on the paths. Every path has at least one clue and some paths have more
than one. This means that Alex will need to search along the full length of every path to find all the clues.
(ii) Showing your working, find the length of the shortest route that Alex can take, starting and ending at
A, to find every clue.
[3]
The clues tell Alex that the treasure is located at the point marked as H on the network.
(iii) Write down the shortest route from A to H.
Zac also starts at A and searches along every path to find the clues. He also uses a shortest route to do this,
but without returning to A. Instead he proceeds directly to the treasure at H.
(iv) Calculate the length of the shortest route that Zac can take to search for all the clues and reach the
treasure.
[2]
© OCR 2014
4736/01 Jun14
[1]
5
June 2014
5
This question uses the same network as question 4.
The network below represents a treasure trail. The arcs represent paths and the weights show distances in
units of 100 metres.
B
3
1
1
A
C
5
8
D
1
E
3
1
4
F
2
5
4
3
H
1
G
Gus wants to hunt for the treasure. He assumes that the treasure is located at a vertex, but he does not know
which one.
(i) (a) Use the nearest neighbour method starting at G to find an upper bound for the length of the
shortest closed route through every vertex.
[3]
(b) Gus follows this route, but starting at A. Write down his route, starting and ending at A.
[1]
(ii) Use Prim’s algorithm on the network, starting at A, to find a minimum spanning tree. You should
write down the arcs in the order they are included, draw the tree and give its total weight (in units of
100 metres).
[3]
(iii) (a) Vertex H and all arcs joined to H are removed from the original network. Write down the weight
of the minimum spanning tree for vertices A, B, C, D, E, F and G in the resulting reduced network.
[1]
(b) Use this minimum spanning tree for the reduced network to find a lower bound for the length of
the shortest closed route through every vertex in the original network.
[1]
(iv) Find a route that passes through every vertex, starting and ending at A, that is longer than the lower
bound from part (iii)(b) but shorter than the upper bound from part (i)(a). Give the length of your
route, in metres.
[2]
Assume that Gus travels along paths at a rate of x minutes for every 100 metres and that he spends y minutes
at each vertex hunting for the treasure. Gus starts by hunting for the treasure at A. He then follows the route
from part (iv), starting and finishing at A and hunting for the treasure at each vertex.
Unknown to Gus, the treasure is found before he gets to it, so he has to search at every vertex. Gus can take
at most 2 hours from when he starts searching at A to when he arrives back at A.
(v) Use this information to write down a constraint on x and y.
[2]
The treasure was at H and was found 40 minutes after Gus started. This means that Gus takes more than
40 minutes to get to H.
(vi) Use this information to write down a second constraint on x and y.
© OCR 2014
4736/01 Jun14
[2]
Turnover
6
June 2014
6
Sandie makes tanning lotions which she sells to beauty salons. She makes three different lotions using the
same basic ingredients but in different proportions. These lotions are called amber, bronze and copper.
To make one litre of tanning lotion she needs one litre of fluid. This can either be water or water mixed
with hempseed oil. One litre of amber lotion uses one litre of water, one litre of bronze lotion uses 0.8 litres
of water and one litre of copper lotion uses 0.5 litres of water. Any remainder is made up of hempseed oil.
Sandie has 40 litres of water and 7 litres of hempseed oil available.
(i) By defining appropriate variables a, b and c, show that the constraint on the amount of water available
can be written as 10a + 8b + 5c G 400 .
[2]
(ii) Find a similar constraint on the amount of hempseed oil available.
[1]
The tanning lotions also use two colourants which give two further availability constraints. Sandie wants to
maximise her profit, £P. The problem can be represented as a linear programming problem with the initial
Simplex tableau below. In this tableau s, t, u and v are slack variables.
P
a
b
c
s
t
u
v
RHS
1
−8
−7
−4
0
0
0
0
0
0
10
8
5
1
0
0
0
400
0
0
2
5
0
1
0
0
70
0
2
4
1
0
0
1
0
176
0
5
1
3
0
0
0
1
80
(iii) Use the initial Simplex tableau to write down two inequalities to represent the availability constraints
for the colourants.
[2]
(iv) Write down the profit that Sandie makes on each litre of amber lotion that she sells.
(v) Carry out one iteration of the Simplex algorithm, choosing a pivot from the a column. Show the
operations used to calculate each row.
[5]
[1]
After a second iteration of the Simplex algorithm the tableau is as given below.
P
a
b
c
s
t
u
v
RHS
1
0
0
14.3
0
2.7
0
1.6
317
0
0
0
0
0
1
2.5
0
0
0
0
−9.2
0
1
0
0.1
−16
1
−3
0
−2
30
0.5
0
0
35
0
−1.8
1
−0.4
18
0
−0.1
0
0.2
9
(vi) Explain how you know that the optimal solution has been achieved.
(vii) How much of each lotion should Sandie make and what is her maximum profit? Why might the profit
be less than this?
[4]
(viii) If none of the other availabilities change, what is the least amount of water that Sandie needs to make
the amounts of lotion found in part (vii)?
[1]
© OCR 2014
4736/01 Jun14
[1]