UNIHIVE

Study Hub UNIPORT CSC 183

CSC 183 · Introduction to Problem Solving

Solution techniques I: abstraction, analogy and idea generation

Abstraction, analogy, brainstorming, trial and error and hypothesis testing.

Our notes

2 min read

Abstraction

Abstraction means keeping only the details that matter and ignoring the rest. A map of Port Harcourt shows roads and landmarks, not every tree. To plan the shortest route to campus, a road map is enough: the colour of the buildings does not matter.

In computing, abstraction lets us treat a complicated thing as a simple one: a "student record" holds a name, matric number and courses, not everything about the person.

Analogy

Solve a new problem by noticing it is like one you have already solved. Scheduling exams so no student has two at once is like colouring a map so neighbouring countries have different colours: the same method works for both.

Brainstorming

A group (or one person) lists as many ideas as possible, quickly, without criticising any of them at first. Then the ideas are grouped, judged and the best chosen. Rules: quantity first, no judging during the listing, build on others' ideas, welcome odd ideas.

Trial and error

Try a possible solution, see if it works, and if not try another, learning from each failure. It works when there are few possibilities or each try is cheap (finding which key opens a padlock from a bunch of five). It is slow when the possibilities are many.

Hypothesis testing

Make a guess about the cause or the answer (a hypothesis), predict what you should see if it is true, and test the prediction.

Example: "My program gives the wrong average." Hypothesis: it divides by the wrong count. Prediction: with three numbers 2, 4 and 6 it should print 4; if it prints 3, it is dividing by 4. Test it. If the prediction fails, form a new hypothesis.

Worked example: trial and error made smarter

Find a whole number whose square is 2,209.

  • Pure trial from 1 upwards would take 47 tries.
  • Smarter: 40² = 1,600 and 50² = 2,500, so the number is between 40 and 50. The last digit 9 means it ends in 3 or 7. Try 43² = 1,849 (too small), 47² = 2,209 ✓. Two tries.

Using what each trial tells you turns blind guessing into a method.

Exams usually ask

  • Explain abstraction and analogy with examples.
  • State the rules of brainstorming.

Common mistake

Judging ideas while brainstorming. It stops people suggesting the unusual idea that might be best.

Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.

Read

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.

All CSC 183 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.