Which sorting algorithm is fastest?: a maths EPQ idea
A title to start from
Which sorting algorithm is fastest in practice, and does Big O notation tell the whole story?
Why it works as an EPQ
You can prove complexity results and then test them by timing your own code, so theory meets evidence.
Scope and difficulty
Solid. Solid. Three or four algorithms, lists of several sizes and shapes.
The maths
Builds on these A Level topics: Sequences and series · Exponentials and logarithms · Proof.
You would learn:
- Big O notation
- Recurrences such as T(n) = 2T(n/2) + n
- Best, worst and average cases
One possible plan
- Analyse each algorithm's comparisons in the best, worst and average case.
- Solve the merge sort recurrence.
- Time your own implementations on random, sorted and nearly sorted lists.
- Judge when Big O predicts real performance and when it does not.
Pitfalls
- Timing code without repeats or with other programs running.
- Using library sort functions you have not analysed.
Where to start reading
- Introduction to Algorithms (Cormen, Leiserson, Rivest and Stein), sorting chapters
- Search for: master theorem recurrences
Making something? Read the artefact guide first: an artefact still needs a research-based written report.
Similar ideas
- How search engines rank pagesHow can matrices and probability rank web pages, and how could the ranking be manipulated?
- How QR codes survive damageHow can a damaged QR code still be read? The mathematics of error-correcting codes
- How compression makes files smallerHow can a file be made smaller without losing anything, and what is the limit?
- How a neural network learnsHow does a neural network learn, and how much of it is calculus you already know?
All maths and computer science ideas · all 93 ideas
Your EPQ must be your own work. These pages coach: ideas, structure, checklists and planning. Submitting text, proofs, code or analysis written by someone else or by an AI tool as your own is malpractice. How to use help and AI honestly.