BREAKING
Imaginary number feels seen, refuses to be real★Matrices multiplied in wrong order, student loses faith★Proof by induction ends, nobody knows why it worked★
  1. Home
  2. A Level
  3. Further Mathematics
  4. OCR
  5. Algorithms

OCR A Level Further Maths

Topic questions Decision mathematics Algorithms

Algorithms

6 questions · 78 marks · about 1.5 hours

Algorithms questions

OCR H245 Algorithms 6 questions

Discrete Mathematics June 2025, Question 3 8 marks

Hiro uses a sorting algorithm to sort the heights in cm of 8 people into ascending order.

At the end of the first pass through the algorithm, Hiro ends up with the list below:

142 165 152 135 171 154 172 182

(a)

If Hiro used the shuttle sort algorithm, write down the possibilities for the original list.

[1]
Reveal mark scheme Mark scheme for question 3(a)
(b)

Hiro actually used the bubble sort algorithm starting at the left-hand side.

Complete the second and third passes using the bubble sort algorithm.

You should show the list that results at the end of each pass.

[2]
Reveal mark scheme Mark scheme for question 3(b)
(c)

In total, Hiro needed 5 passes to complete the bubble sort algorithm.

In total, the shuttle sort algorithm would take 12 comparisons to sort the original list into ascending order.

Using the total number of comparisons for each algorithm, compare the efficiency of

bubble sort and shuttle sort for sorting the heights of the 8 people.

[3]
Reveal mark scheme Mark scheme for question 3(c)
(d)

It takes a computer 2.4 × 10-3 seconds to sort a list of 300 numbers into ascending order using the bubble sort algorithm.

Find the approximate length of a list the computer could sort in 1 minute. Give your answer

to 1 significant figure.

[2]
Reveal mark scheme Mark scheme for question 3(d)

Discrete Mathematics June 2024, Question 5 18 marks

(a)

Write down a way in which the nearest neighbour method can fail to solve the problem of

finding a least weight cycle through all the vertices of a network.

[1]
Reveal mark scheme Mark scheme for question 5(a)
(b)

Explain why, when trying to find a least weight cycle through all the vertices of a network, an

ad hoc method may be preferable to an algorithmic approach.

[1]
Reveal mark scheme Mark scheme for question 5(b)
(c)

The distance matrix below represents a network connecting six viewpoints A, B, C, D, E and F. The distance matrix shows the direct distances between each pair of viewpoints where a direct route exists. The distances are measured in km. A blank shows that there is no direct route between the two viewpoints.

Figure for question 5

Draw the network on the vertices given in the Printed Answer Booklet.

[2]
Reveal mark scheme Mark scheme for question 5(c)
(d)

Apply the nearest neighbour method, starting from A.

[2]
Reveal mark scheme Mark scheme for question 5(d)
(e)

A hiker wants to travel between the six viewpoints, starting and finishing at A. The hiker must visit every viewpoint at least once, but may visit a viewpoint more than once.

Show that the hiker does not need to travel as far as 50 km.

[2]
Reveal mark scheme Mark scheme for question 5(e)
(f)

Use an appropriate algorithm to find the shortest distance from F to each of the other

viewpoints.

[5]
Reveal mark scheme Mark scheme for question 5(f)
(g)

Complete the table in the Printed Answer Book to show the shortest distance between each

pair of viewpoints.

[2]
Reveal mark scheme Mark scheme for question 5(g)
(h)

Use your answer to part (g) to find a lower bound for the distance the hiker must travel by

initially deleting vertex A.

[3]
Reveal mark scheme Mark scheme for question 5(h)

Discrete Mathematics June 2023, Question 5 12 marks

A list of 8 values is given below.

3 24 8 1 4 20 30 18

The list is to be sorted into increasing order using quick sort, as given in the Formulae Booklet.

(a)

Carry out the first two passes of the sort.

[4]
Reveal mark scheme Mark scheme for question 5(a)
(b)(i)

A different list of 8 values is to be sorted into increasing order using quick sort, as given in the Formulae Booklet.

State the maximum number of passes that could be required.

[1]
Reveal mark scheme Mark scheme for question 5(b)(i)
(b)(ii)

Find the minimum number of passes that could be required.

[2]
Reveal mark scheme Mark scheme for question 5(b)(ii)
(c)

The run-time for quick sort could be measured by counting the number of comparisons used.

In the worst case, the run time for quick sort is O(n2).

A computer takes at most 0.03 seconds to sort a list of 100 values into increasing order using quick sort.

Calculate an estimate for the time taken, in the worst case, to sort a list of 500 values using

quick sort.

[2]
Reveal mark scheme Mark scheme for question 5(c)
(d)

A list of n values (where n > 10) is to be sorted into increasing order using quick sort, as given in the Formulae Booklet.

Explain why, in the best case, n - 3 comparisons are used in the second pass.

[3]
Reveal mark scheme Mark scheme for question 5(d)

Discrete Mathematics June 2022, Question 7 12 marks

A building has 7 CCTV cameras, A to G, at the junctions of some of the corridors.

The cameras at the junctions and the lengths of the 11 corridors between them, in metres, are shown in the table below.

Figure for question 7
(a)

Model this information as a network.

[1]
Reveal mark scheme Mark scheme for question 7(a)
(b)

Use an appropriate algorithm to calculate the minimum distance from A to each of the other

vertices.

[3]
Reveal mark scheme Mark scheme for question 7(b)
(c)

The run‑time of an algorithm for finding this minimum distance is proportional to the total number of comparisons used. For a network with n vertices, the worst case is when the algorithm is applied to a network based on the complete graph Kn.

In each pass

• A vertex is made permanent and the temporary label at all adjacent vertices that are not yet permanent are updated. This uses 1 comparison for every such vertex (adjacent to the permanent label) that previously already had a temporary label.

• The best temporary labels at all vertices that do not yet have permanent labels are then compared to determine the next vertex to become permanent. If there are k such vertices this involves k - 1 comparisons.

By considering the number of comparisons of each type in each iteration, show that the algorithm uses a total of 6 comparisons when it is applied to a network based on the complete

graph K4.

[2]
Reveal mark scheme Mark scheme for question 7(c)
(d)

You are given that the total number of comparisons used when the algorithm is applied to a network based on Kn is (n - 1)(n - 2).

A computer takes 0.03 seconds to apply this algorithm on a network based on K7.

Calculate, to 1 decimal place, how many seconds it will take the computer to apply the

algorithm to a network based on K70.

[2]
Reveal mark scheme Mark scheme for question 7(d)
(e)(i)

The manager wants to construct a tour (a closed route) that passes each camera.

Find a lower bound for the length of this tour by initially deleting D.

[2]
Reveal mark scheme Mark scheme for question 7(e)(i)
(e)(ii)

Find an upper bound for the length of this tour by using the nearest neighbour algorithm

starting from D.

[1]
Reveal mark scheme Mark scheme for question 7(e)(ii)
(e)(iii)

Deduce the length of the shortest possible tour. Briefly explain your reasoning.

[1]
Reveal mark scheme Mark scheme for question 7(e)(iii)

Discrete Mathematics November 2021, Question 4 13 marks

Figure for question 4
(a)
Figure for question 4
[2]
Reveal mark scheme Mark scheme for question 4(a)
(b)
Figure for question 4
[1]
Reveal mark scheme Mark scheme for question 4(b)
(c)

Explain carefully how you know that the graph K5 has thickness 2.

[3]
Reveal mark scheme Mark scheme for question 4(c)
(d)

The following colouring algorithm can be used to determine whether a connected graph is bipartite or not. The algorithm colours each vertex of a graph in one of two colours, α and β.

STEP 1 Choose a vertex and assign it colour α.

STEP 2 If any vertex is adjacent to another vertex of the same colour, jump to STEP 5. Otherwise assign colour β to each vertex that is adjacent to a vertex with colour α.

STEP 3 If any vertex is adjacent to another vertex of the same colour, jump to STEP 5. Otherwise assign colour α to each vertex that is adjacent to a vertex with colour β.

STEP 4 Repeat STEP 2 and STEP 3 until all vertices are coloured.

STEP 5 If there are no adjacent vertices of the same colour then the graph is bipartite. Otherwise the graph is not bipartite.

STEP 6 Stop.

Apply this algorithm to graph A, starting with the vertex in the top left corner, to determine

whether graph A is bipartite or not.

[3]
Reveal mark scheme Mark scheme for question 4(d)
(e)
Figure for question 4
[1]
Reveal mark scheme Mark scheme for question 4(e)
(f)

The worst case is when the graph is a path that starts at one vertex and ends at another, having passed through each of the other vertices once.

What can you deduce about the efficiency of the colouring algorithm in this worst case?

[1]
Reveal mark scheme Mark scheme for question 4(f)
(g)

The colouring algorithm is used on two graphs, X and Y. It takes 10 seconds to run for graph X and 60 seconds to run for graph Y. Graph X has 1000 vertices.

Estimate the number of vertices in graph Y.

[1]
Reveal mark scheme Mark scheme for question 4(g)
(h)

A different algorithm has efficiency O(2n). This algorithm takes 10 seconds to run for graph X.

Explain why you would expect this algorithm to take longer than 60 seconds to run for graph Y.

[1]
Reveal mark scheme Mark scheme for question 4(h)

Discrete Mathematics November 2021, Question 7 15 marks

A network is formed by weighting the graph below using the listed arc weights.

Figure for question 7
(a)(i)

Show the result after the first pass and after the second pass, when the list of weights is

sorted into increasing order using bubble sort.

[2]
Reveal mark scheme Mark scheme for question 7(a)(i)
(a)(ii)

Show the result after the first pass and after the second pass, when the list of weights is

sorted into increasing order using shuttle sort.

[2]
Reveal mark scheme Mark scheme for question 7(a)(ii)
(b)

In the remaining passes of bubble sort another 14 comparisons are made. In the remaining passes of shuttle sort another 11 comparisons are made. The total number of swaps needed is the same for both sorting methods.

Use the total number of comparisons and the total number of swaps to compare the efficiency

of bubble sort and shuttle sort for sorting this list of weights.

[3]
Reveal mark scheme Mark scheme for question 7(b)
(c)(i)

The sorted list of arc weights for the network is as follows.

0.9 1.5 2.3 2.9 3.5 4.2 4.7 5.3

These weights can be given to the arcs of the graph in several ways to form different networks.

What is the smallest weight that does not have to appear in a minimum spanning tree for

any of these networks? You must explain your reasoning.

[2]
Reveal mark scheme Mark scheme for question 7(c)(i)
(c)(ii)

Show a way of weighting the arcs, using the weights in the list, that results in the largest possible total for a minimum spanning tree. You should state the total weight of your

minimum spanning tree.

[3]
Reveal mark scheme Mark scheme for question 7(c)(ii)
(c)(iii)

Determine the total weight of an optimal solution of the route inspection problem for the

network found in part (c)(ii).

[3]
Reveal mark scheme Mark scheme for question 7(c)(iii)

Report a problem with a question on this page
What is wrong?

Goes to whoever maintains the question split. No account needed and nothing is published on this page.

Memes

Certified Further Maths memes. Peer-reviewed by nobody.

Laugh now. Cry in the exam hall later. Then come back and do a past paper.

Prove it by induction
Write ‘clearly’ and move on
Me on the final ‘show that’
Using the formula booklet
Proving it by induction
Writing ‘by symmetry’ to skip half the work
Writing ‘trivially’ and daring the examiner
Further enlightenment, ranked

Mum 💖

how's further maths going?? 🥰

my answers are all complex rn

keep it simple love 💖

📱 Screen time this week · Spotify4h 59m

The answer was i. Nobody knows why

Further Maths starter pack

Calculator that does matricesProof that’s 3 pages longArgand diagram doodlesThis website
Collect all four. Prove it.