0% found this document useful (0 votes)
24 views

Introduction to Problem-Solving I.pptx

This document provides an introduction to problem-solving in computer science, outlining key concepts and steps involved in the process. It discusses various types of computational problems, including decision, search, optimization, and counting problems, and emphasizes the importance of understanding the problem before creating a solution plan. Additionally, it introduces algorithms, pseudocode, and flowcharts as tools for developing and representing solutions.

Uploaded by

klopienclaudia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Introduction to Problem-Solving I.pptx

This document provides an introduction to problem-solving in computer science, outlining key concepts and steps involved in the process. It discusses various types of computational problems, including decision, search, optimization, and counting problems, and emphasizes the importance of understanding the problem before creating a solution plan. Additionally, it introduces algorithms, pseudocode, and flowcharts as tools for developing and representing solutions.

Uploaded by

klopienclaudia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

DEPARTMENT OF

COMPUTER SCIENCE

Introduction to
problem solving i

DR JEREMIAH O. BANDELE
PhD Electrical/Electronic Engineering
University of Noingham
DEPARTMENT OF
COMPUTER SCIENCE

Learning objectives

At the end of this lesson, you should be able to:


● Describe the concept of problem-solving in computer science.
● Discuss various computational problem types.

● Outline the four steps to problem-solving.

● Develop a solution plan by applying computer programming concepts.


Problem-solving in computer science

● The essence of computer science is problem-solving. Problems can be real world


problems or abstract problems.
● To solve these problems with a computer, a systematic approach is required.
● We need a systematic approach because the computer also processes information in a
systematic manner.
How do computers solve problems ?

Before a computer can be used to solve problems, the


problems must be programmed (by a programmer) into a
form that the computer understands.
Before a programmer can carry out this task, the
programmer must first understand how the problem can be
solved by a human.
So why do we need the computer since a human can solve
the problem? The computer is able to handle larger problem
volumes faster and more efficiently.
How do computers solve problems ?

After the problem to be solved is programmed as inputs, the inputs are passed to the computer
using input devices such as keyboard, mouse, joystick and an external memory device.
How do computers solve problems ?

The computer processes the input in its central processing unit (CPU).
How do computers solve problems ?

The computer provides the result with output devices such printer, monitor, loudspeaker
and sound card.
Computational problem

Problems with step-by-step solutions are computational problem. With computational


problems, the inputs, problem limitations and output conditions are well defined.
We will now discuss four types of computational problems:
● Decision problems: These are problems where
the solution can either be YES or NO
● Search problems: These are problems where the
solution is a value or values with a particular
property.
Computational problem types

We will now discuss four types of computational problems:


● Decision problems
● Search problems
● Optimization problems
● Counting problems
Computational problem TYPES

● Decision problems: These are problems where the solution can either be YES
or NO
● Search problems: These are problems where the solution is a value or values
with a particular property.
Computational problem types

● Optimization problems: These are problems where the best possible solution is
accepted as the solution.
● Counting problems: These are problems where the solution is determining the
number of values with a particular property.
Four steps to problem-solving

Understand the
problem

Create a solution
step-by-step plan

Carry out the


solution plan

Evaluate and
refactor the
solution
understanding the problem

Before trying to solve any computational problem, a thorough understanding of the


problem is essential
Answers must also be provided to questions such as:

● What are the inputs?

● What are the processes involved?

● What is the output?


What can the computer accept as input?

With the help of input devices, computers will accept anything that can be converted to a
digital form as inputs. These can include the following;

● Numbers
● Letters
● Pictures
● Music
● Videos
● Sound waves
● Retinal scans
● Wi-fi signals
What can the computer accept as input?

After the CPU processes the inputs, the computer uses output devices to create various
outputs. These can include the following;
● Printed documents
● On-screen data
● Visuals
● Audio
● Digital music files
● Digitized speech
● Charts and graphs
● Images
Creating a step-by-step solution plan

After the problem is well understood, the next step is to create a step-by-step solution plan.
A step-by-step plan usually involves a process of breaking down the main problem into smaller
problems until the problems are small enough to be solved.
Solving all the small problems automatically solves the main problem
Creating a step-by-step solution plan

Creating a solution plan


to problems involves
preparing algorithms and
representing them with
pseudocodes and
flowcharts.
Algorithm

An algorithm is a procedure of steps used to solve a given problem.


The steps must be ordered, unambiguous and complete so that it can easily be converted
into a computer program.
Algorithm

Example 1: Write an algorithm that calculates the final


grade of a student. The algorithm should also show
whether the student has passed or failed.

Note that the average of five grades is used as the final


grade and the pass mark is 45.
Pseudocode

A pseudocode is the textual representation of


an algorithm.

Pseudocodes are written in a form that makes


them easily convertible into programming
statements.

Even though that look like the actual program,


they cannot be compiled or executed by the
computer.
Pseudocode

Example 2: Write a pseudocode for the


algorithm written in example 1.
Flowchart

A flowchart is the graphical


representation of an algorithm.
The flowchart is a graphical
representation of the sequence of
operations in a computer program.

Flowcharts use symbols to describe


actions such as start, stop, input,
process, merge and decision.
Flowchart

Example 3: Create a flowchart for the algorithm written in example 1.

START

Input
G1,G2,G3,G4,G5

Grade = (G1+G2+G3+G4+G5)/5

Is Grade
> 44

Print Print
“FAIL” “PASS”

STOP
FURTHER READING RESOURCES

● Bransford, J. D., & Stein, B. S. (1993). The IDEAL problem solver.


● Treffinger, D. J., Isaksen, S. G., & Stead-Dorval, K. B. (2006). Creative problem
solving: An introduction. Prufrock Press Inc.
● Goodrich, M. T., & Tamassia, R. (2015). Algorithm design and applications (Vol. 363).
Hoboken: Wiley.
FURTHER READING RESOURCES

● Shaffer, C. A. (1997). A practical introduction to data structures and algorithm analysis.


Upper Saddle River, NJ: Prentice Hall.
● Chaudhuri, A. B. (2020). Flowchart and algorithm basics: The art of programming.
Mercury Learning and Information.
● Chaudhuri, A. B. (2005). The Art of Programming Through Flowcharts & Algorithms.
Firewall Media.
REFERENCES

● "Flying Magazine". Flying: 36–June 1963. ISSN 0015-4806.


● "Human Powered Flight Group Webpage". Royal Aeronautical Society. 2011. Retrieved 18 January 2021.
● Bransford, J. D., & Stein, B. S. (1993). The IDEAL problem solver.
● Treffinger, D. J., Isaksen, S. G., & Stead-Dorval, K. B. (2006). Creative problem solving: An introduction.
Prufrock Press Inc..
Thank
You

You might also like