UNIHIVE

Study Hub UNIPORT COS 102

COS 102 · Problem Solving

The general problem-solving process

The stages from understanding a problem to checking the solution.

Our notes

2 min read

Four stages (after the mathematician George Pólya)

  1. Understand the problem. What is given (inputs)? What is wanted (outputs)? What are the conditions? Restate it in your own words; draw a picture; try a small example.
  2. Devise a plan. Choose a technique (next topics): look for a similar problem you have solved, break it into parts, work backwards, make a table.
  3. Carry out the plan. Follow the steps carefully, checking each one.
  4. Look back. Is the answer reasonable? Does it meet every condition? Can the method be reused or made simpler?

The same stages in software

StageWhat you produce
Problem definition and analysisa statement of inputs, outputs, processing and limits
Designan algorithm as a flowchart or pseudocode
Implementation (coding)a program in a language such as Python or C
Testing and debuggingtest cases with expected results; errors fixed
Evaluation and refinementimprovements for speed, clarity, new needs
Documentation and maintenanceuser guide, comments, later updates

IPO analysis

A quick way to analyse a problem is the Input-Process-Output chart.

Example: "Find a student's GPA from course units and grades."

InputProcessOutput
units and grade of each courseconvert grades to points (A = 5, B = 4, C = 3, D = 2, E = 1, F = 0); multiply each by its units; add; divide by total unitsGPA to 2 decimal places

Worked example

Units and grades: 3 units A, 2 units B, 3 units C, 1 unit F.

  • Quality points = 3 × 5 + 2 × 4 + 3 × 3 + 1 × 0 = 15 + 8 + 9 + 0 = 32.
  • Total units = 9.
  • GPA = 32 ÷ 9 = 3.56.

Looking back: the grades lie between A and F, and 3.56 lies between 0 and 5. Check that the failed course's units are still counted in the total (UNIPORT, like most Nigerian universities, counts them).

Exams usually ask

  • List and explain the stages of problem solving.
  • Prepare an IPO chart for a given problem.

Common mistake

Skipping "look back". A quick sense check (is the GPA between 0 and 5?) catches many errors.

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 COS 102 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.