COS 102 · Problem Solving
Our notes
2 min readReduction
Turn a new problem into one you already know how to solve. Finding the largest number in a list can be reduced to sorting the list and taking the last item (not the fastest way, but correct).
Divide and conquer (decomposition)
Break a big problem into smaller parts, solve each, then combine. Organising a departmental dinner: venue, food, invitations, budget, programme. Each part can be given to a different person. In programs, each part becomes a function.
Means-end analysis
Compare the current state with the goal, find the biggest difference, and choose an action that reduces it. Repeat until no difference remains. To get from Choba to Lagos: the biggest difference is distance (take a bus or flight), then smaller ones (get to the park, get from the arrival point to the house).
Working backwards
Start from the goal and ask what step must come just before it. Useful when the goal is clear and the start has many choices: "I must submit at 9 a.m., so I must print by 8, so I must finish typing by 7".
Root cause analysis
Find the real cause instead of treating symptoms. The five whys: ask "why?" repeatedly.
Results were published late. Why? Scores came in late. Why? One lecturer submitted late. Why? Scripts were marked late. Why? Too many scripts for one marker. Root cause: workload, not laziness.
Lateral thinking
Look at the problem from an unexpected angle instead of following the obvious line (Edward de Bono). Long queues at the cafeteria might be solved not by faster cooks but by a pre-order system.
The focal object method
Combine features of unrelated random objects with the object you want to improve, to produce new ideas: a "bag" combined with features of a "lamp" gives a school bag with a reading light.
Morphological analysis
List the main features of a solution and the options for each, then consider combinations.
| Feature | Options |
|---|---|
| Payment | cash, transfer, card |
| Delivery | pick-up, hostel delivery |
| Ordering | in person, WhatsApp, app |
3 × 2 × 3 = 18 possible designs for a campus food service, to be judged one by one.
Research and proof
Find what others have already learned (books, documentation, people) before reinventing it. A proof shows that a method always works, not only on the examples tried: the strongest form of checking.
Exams usually ask
- Explain divide and conquer and means-end analysis with examples.
- Apply the five whys or morphological analysis to a given problem.
Common mistake
Treating these as competing methods. Real problems are solved by combining several of them.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
Best pick Introduction to Computer Science, 3.4 Algorithmic Paradigms
(opens openstax.org in a new tab)
OpenStax, Introduction to Computer Science, 3.4 Algorithmic Paradigms, CC BY-NC-SA 4.0 · licence
-
Divide-and-conquer algorithm
(opens en.wikipedia.org in a new tab)
Wikipedia, Divide-and-conquer algorithm, CC BY-SA 4.0 · licence
-
Means–ends analysis
(opens en.wikipedia.org in a new tab)
Wikipedia, Means–ends analysis, CC BY-SA 4.0 · licence
-
OpenStax, Introduction to Computer Science (whole free textbook)
The whole book, free to read online or download as a PDF (the PDF is large: Wi-Fi).
(opens openstax.org in a new tab)
OpenStax, OpenStax, Introduction to Computer Science (whole free textbook), CC BY-NC-SA 4.0 · licence
Watch
We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.