D1: Matchings (older papers) – Edexcel IAL Decision Mathematics (WDM1)
Question text
2.
(a) (i) Describe how to carry out the first pass of a bubble sort when it is used to sort a list of n
numbers into ascending order.
(ii) Write down the circumstances under which the bubble sort stops.
(4)
A bubble sort, starting at the left-hand end of the list, is used to sort a list of ten numbers into
ascending order. After a number of passes the list reads
0.9 1.2 1.5 0.5 1.4 1.1 0.7 1.7 2.2 3.2
(b) Determine the maximum number of passes that could have taken place on this list. You must
give a reason for your answer.
(2)
(c) Complete the bubble sort to produce a list of the numbers in ascending order. You only need to
give the state of the list after each complete pass.
(4)
(d) Use the first-fit decreasing bin packing algorithm to determine how the ten numbers listed
above can be packed into bins of size 4
(3)
(Total 13 marks)
3.
1
A
A
1
2
B
B
2
3
C
C
3
4
D
D
4
5
E
E
5
6
F
F
6
Figure 1
Figure 2
Figure 1 shows the possible allocations of six workers, A, B, C, D, E and F, to six .tasks, 1, 2, 3, 4,
5 and 6.
Figure 2 shows an initial matching.
(a) Starting from this initial matching, use the maximum matching algorithm to find an improved
matching. You should state the alternating path you use and list your improved matching.
(3)
(b) Explain why it is not possible to find a complete matching.
(1)
After training, task 1 is added to worker A’s possible allocations.
(c) Taking the improved matching found in (a) as the new initial matching, use the maximum
matching algorithm to find a complete matching. You should state the alternating path you use
and list your complete matching.
(3)
(Total 7 marks)
4.
(a) Draw the activity network described by the precedence table below, using activity on arc.
Use dummies only where necessary.
(5)
Activity
Immediately preceding activities
A
–
B
–
C
A
D
A, B
E
C, D
F
D
G
C
H
G
I
G
J
E, F, I
K
F
Given that K is a critical activity,
(b) state which other activities must also be critical.
(1)
Given instead that all activities shown in the precedence table have the same duration and K is not
necessarily critical,
(c) state the critical path for the network.
(1)
(Total 7 marks)
Question text
1.
(a) Define the term ‘bipartite graph’.
(2)
Six workers, A, B, C, D, E and F, are to be matched to six tasks, 1, 2, 3, 4, 5 and 6
The table below shows the tasks that each worker is able to do.
Worker
Tasks
A
2, 4
B
5
C
3, 4
D
2
E
4, 5, 6
F
1, 6
(b) Using Diagram 1 in the answer book, draw a bipartite graph to show the possible allocation of
workers to tasks.
(1)
Initially, workers A, C, E and F are allocated to tasks 2, 4, 5 and 6 respectively.
(c) Starting from the given initial matching, apply the maximum matching algorithm to obtain a
complete matching. You must state the alternating paths that you use, and state your improved
matching after each iteration.
(6)
(Total 9 marks)
2.
B
4
C
10
F
A
5
11
21
2
34
E
G
5
7
D
23
8
10
16
10
L
10
K
4
6
J
H
Figure 1
Figure 1 represents a network of roads. The number on each arc is the length, in km, of the
corresponding road.
(a) Use Dijkstra’s algorithm to find the shortest route from A to L. State the shortest route and its
length.
(6)
(b) Explain how you determined the shortest route from your labelled diagram.
(2)
(c) Find the length of the shortest route from J to F via A, and state your route.
(2)
(Total 10 marks)
3.
I(17)
C(7)
D(5)
J(15)
E(8)
A(6)
F(9)
K(16)
G(3)
L(11)
M(4)
B(2)
H(14)
Figure 2
A project is modelled by the activity network shown in Figure 2. The activities are represented by
the arcs. The number in brackets on each arc gives the time, in days, to complete the corresponding
activity. Each activity requires one worker. The project is to be completed in the shortest possible
time.
(a) Complete Diagram 1 in the answer book to show the early event times and the late event times.
(4)
(b) State the critical activities.
(1)
(c) Draw a cascade (Gantt) chart for this project on Grid 1 in the answer book.
(4)
(d) Use your cascade chart to determine the minimum number of workers needed to complete the
project in the shortest possible time. You must make specific reference to time and activities.
(You do not need to provide a schedule of the activities.)
(2)
(Total 11 marks)
Question text
1.
Use the binary search algorithm to try to locate the name Hilbert in the following alphabetical list.
Clearly indicate how you chose your pivots and which part of the list is being rejected at each stage.
Descartes
Euler
Gauss
Hamilton
Lagrange
Noether
Poisson
Ramanujan
Stokes
Turing
(Total 4 marks)
2.
A
B
C
D
E
F
G
H
A
–
27
51
32
29
23
47
40
B
27
–
24
35
20
42
33
28
C
51
24
–
37
43
31
26
34
D
32
35
37
–
39
45
44
30
E
29
20
43
39
–
38
45
55
F
23
42
31
45
38
–
53
45
G
47
33
26
44
45
53
–
39
H
40
28
34
30
55
45
39
–
The table represents a network that shows the average journey time, in minutes, between eight
towns, A, B, C, D, E, F, G and H.
(a) Use Prim’s algorithm, starting at A, to find the minimum spanning tree for this network. You
must clearly state the order in which you select the edges of your tree.
(3)
(b) Draw the minimum spanning tree using the vertices given in Diagram 1 in the answer book.
(1)
(c) State the weight of the minimum spanning tree.
(1)
(Total 5 marks)
3.
A
1
A
1
B
2
B
2
C
3
C
3
4
4
D
D
E
E
5
5
F
6
F
6
Figure 1
Figure 2
Figure 1 shows the possible allocations of six workers, A, B, C, D, E and F, to six tasks, 1, 2, 3,
4, 5 and 6. Each task must be assigned to only one worker and each worker must be assigned to
exactly one task.
Figure 2 shows an initial matching.
(a) Starting from the given initial matching, use the maximum matching algorithm to find an
alternating path from A to 4. Hence find an improved matching. You should list the alternating
path you use, and state your improved matching.
(3)
(b) Explain why it is not possible to find a complete matching.
(1)
After training, task 1 is added to worker A’s possible allocations.
(c) Starting from the improved matching found in (a), use the maximum matching algorithm to
find a complete matching. You should list the alternating path you use, and state your complete
matching.
(3)
(Total 7 marks)
4.
23
18
27
9
25
10
12
30
24
The numbers in the list represent the weights, in kilograms, of nine suitcases. The suitcases are to
be transported in containers that will each hold a maximum weight of 45 kilograms.
(a) Calculate a lower bound for the number of containers that will be needed to transport the
suitcases.
(2)
(b) Use the first-fit bin packing algorithm to allocate the suitcases to the containers.
(2)
(c) Using the list provided, carry out a bubble sort to produce a list of the weights in descending
order. You need only give the state of the list after each complete pass.
(4)
(d) Use the first-fit decreasing bin packing algorithm to allocate the suitcases to the containers.
(2)
(e) Explain why it is not possible to transport the suitcases using fewer containers than the number
used in (d).
(1)
(Total 11 marks)
5.
B
C
13.2
8.9
2.4
A
D
11.5
5.3
6.5
5.5
F
2.7
E
G
4.9
10.2
1.2
12.5
J
3.1
1.9
I
H
6.4
10.5
K
Figure 3
[The total weight of the network is 106.7]
Figure 3 models a network of cycle tracks that have to be inspected. The number on each arc
represents the length, in km, of the corresponding track. Angela needs to travel along each cycle
track at least once and wishes to minimise the length of her inspection route. She must start and
finish at A.
(a) Use an appropriate algorithm to find the tracks that will need to be traversed twice. You should
make your method and working clear.
(5)
(b) Find a route of minimum length, starting and finishing at A. State the length of your route.
(2)
A new cycle track, AC, is under construction. It will be 15 km long. Angela will have to include
this new track in her inspection route.
(c) State the effect this new track will have on the total length of her route. Justify your answer.
(2)
(Total 9 marks)
6.
A
14
D
8
4
21
8
25
B
10
5
E
C
2x
4
H
17
12
F
4
9
x
6
G
Figure 4
Figure 4 represents a network of roads. The number on each arc represents the time taken, in
minutes, to drive along the corresponding road.
Stieg wishes to minimise the time spent driving from his home at A, to his office at H. The amount
of traffic