Computer Science · Ch 4 — Introduction to Problem Solving
Introduction
Introduction
Computers surround us today because they let us finish routine tasks faster and with fewer errors. A familiar illustration is booking a train ticket online. India runs one of the world's largest railway networks, which makes reservation an inherently complicated job: the system must track details of every train (its type, the kinds of berths and compartments it offers, its running schedule and so on), cope with many users trying to book seats at the same instant, and handle a host of other interlinked factors. Only because computers manage all of this can a passenger now reserve a seat from anywhere, at any time, with a few taps — something that once demanded a trip to the booking counter.
Computerisation
When a computer is put to work on a routine human task by developing software that automates it efficiently, we call that computerisation. Ticket booking is one example; countless everyday activities have been computerised in the same spirit.
Why problem solving matters in computer science
Because computers are the tool we reach for when tackling day-to-day problems, problem solving is a core skill every computer science student must develop. There is, however, an important caveat: a computer cannot solve a problem on its own. It only carries out the precise, step-by-step instructions that a human supplies. Whether the computer succeeds therefore depends entirely on how well we do three things:
- define the problem correctly and precisely,
- design a solution to it — this designed solution is called an algorithm,
- implement the solution as a program, written in a programming language.
Problem solving, defined
Putting these pieces together gives the working definition the chapter is built around:
Problem solving is the process of (1) identifying a problem, (2) developing an algorithm for the identified problem, and (3) implementing that algorithm to produce a computer program.
Everything that follows in this chapter — the steps of problem solving, algorithms and their representation as flowcharts and pseudocode, flow of control, verification, comparison of algorithms, coding and decomposition — elaborates on the stages of this single process.