0% found this document useful (0 votes)
24 views38 pages

COMP102-Introduction-to-Problem-Solving_160514

The document provides an overview of problem-solving, defining a problem as a challenge that hinders achieving goals and outlining the structured process of problem-solving, which includes defining the problem, analyzing it, designing algorithms, coding, testing, and final documentation. It discusses different types of problems (well-defined and ill-defined) and various problem-solving techniques such as divide and conquer, root cause analysis, flowcharting, and reasoning methods. The content emphasizes the importance of clearly defining problems and employing systematic approaches to find effective solutions.

Uploaded by

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

COMP102-Introduction-to-Problem-Solving_160514

The document provides an overview of problem-solving, defining a problem as a challenge that hinders achieving goals and outlining the structured process of problem-solving, which includes defining the problem, analyzing it, designing algorithms, coding, testing, and final documentation. It discusses different types of problems (well-defined and ill-defined) and various problem-solving techniques such as divide and conquer, root cause analysis, flowcharting, and reasoning methods. The content emphasizes the importance of clearly defining problems and employing systematic approaches to find effective solutions.

Uploaded by

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

INTRODUCTION

TO PROBLEM
SOLVING
Lecture 2
Dr. ifra AFZAL
Contents:
◦What is problem?
◦What is problem solving?
◦Problem/ Program Development Process
◦Problem Solving Techniques
https://www.youtube.com/watch?v=Sd9MZdB1ItU
What is problem?
◦A problem is a situation or challenge prevents achieving the
desired outcomes or goal.
For Example
◦ 1. Sorting a list of integers in ascending order.

◦ 2. Finding the shortest path between two nodes.

◦ 3. Determining whether a string is a palindrome.(civic, radar, level)

◦ 4. Searching for an element in a large database.


What is problem solving?
◦ Problem solving is the process of identifying, analysing, and resolving
problems effectively. It involves critical thinking, creativity, and decision-
making to overcome obstacles and achieve goals.
Program/Problem Solving
Process
◦ A structured approach to identifying, analysing, and resolving problems.
Program Development Process

3. Designing the
1. Defining Problem 2. Analysis
Algorithm

6. Final 5. Testing and 4. Coding and


Documentation Debugging Documentation
1. Defining Problem

◦ Without knowing the problem you


can not move further. So have a clear
understanding of the problem for
which you are going to find the
solution.
Types of Problem
1. Well defined problem
◦ A well-defined problem is a problem with clear goals, a known starting
point, and a limited number of solutions.
Example
Finding the shortest path:
◦The starting point (Lahore)
◦Destination (Islamabad) are
known
◦possible paths are limited to
roads (Motorway, GT Road)
The Power Of Defining The
Problem

◦ Albert Einstein
"If I only had an hour to save
the world, I would spend 55
minutes defining the problem
and only 5 minutes solving it".
Types of Problem

2. ILL defined problem


◦An ill-defined problem is a problem that
doesn't have clear goals, solution paths,
or expected solutions.
Example
Problem Statement:
Our software is slow, and we need to make it faster.

◦ Unclear problem statement: "Slow" is relative.


◦ Lack of specific goals: No clear performance metrics.
◦ Unclear outcome: No measurable success criteria.
2. Analyse the problem
◦ Problem analysis is a systematic process of breaking down a complex
problem into manageable parts to understand the nature & find solution.

◦ Solving Rubick’s cube without any knowledge is a complex problem.


◦ Solve 1st Layer
◦ Solve 2nd Layer
◦ Solve Final Layer
Cont.…
◦Analysis helps in deciding
◦The facts and figures which are necessary for developing the
program
◦The language in which the program will be most suitable
◦Web development(HTML,CSS,PHP), Desktop
Development(Java)
◦Machine Learning(Python)
◦What is the desired output and in which form it is needed,
etc.
3. Designing the Algorithm
◦ An algorithm is a sequence of steps that must be carried out before a
programmer starts preparing his program
◦ Select data structures Arrays, Trees, Graphs etc
4. Coding or Writing the
Program
◦ In this step, an algorithm is converted into program.
◦ The program consists of different steps given in the
algorithm
◦ A large number of programming languages are
available to write programs
5. Testing Program
◦ A program must be tested in the process of program development
◦ This process verifies the accuracy of a program
◦ The program is tested by executing it again and again
◦ Different values are given as input and output is checked
◦ The program may not give required results if it contains any error
◦ The errors must be deleted and corrected if the output is not correct
◦ All bugs in the program are detected and removed during program testing
◦ It ensures that the program gives desired results and the problem is solved
correctly
6. Final Documentation
◦ When the program is finalized, its documentation is prepared
◦ Final documentation is provided to the user
◦ It guides the user how to use the program in the most efficient way
◦ Another purpose of documentation is to allow some other programmer to
modify the code if necessary
◦ Documentation should be done in each step during the development of a
program
Problem Solving Techniques
1. Divide and Conquer
2. Root Cause Analysis (RCA)
3. Flowcharting
4. Decision Trees
5. Deductive Reasoning
6. Inductive Reasoning
7. Trial and Error
8. Others
1. Divide and Conquer
1. Divide: Break down the problem into
smaller, manageable sub-problems.
2. Conquer: Solve each sub-problem
independently.
3. Combine: Combine the solutions to the
sub-problems to solve the original
problem.
Example
◦ Problem: Host a 3-day conference for 500 attendees.

1. Venue Selection
2. Speaker Management
3. Registration
4. Marketing and Promotion
5. Budgeting and Sponsorship
2. Root Cause Analysis (RCA)
Root Cause Analysis (RCA) is a method used to identify the underlying
causes of a problem.
Example 1
Problem: John is consistently late to work.
Identify possible causes:
- Oversleeping - Traffic - Public transportation issues

Analyse and prioritize causes:


◦ Oversleeping (80%)
◦ Traffic (15%)
◦ Public transportation issues (5%)
Example 2
Problem: Office internet is slow.
Identify possible causes:
- Outdated router - Insufficient bandwidth - Malware infection

Analyse and prioritize causes:


◦ Insufficient bandwidth (20%)
◦ Malware infection (10%)
◦ Outdated router (70%)
3. Flowcharting
◦ Flowcharts are visual representations of a process or system, using
symbols and arrows to illustrate the flow of steps.
Benefits:
◦ 1. Simplifies complex processes
◦ 2. Improves communication
◦ 3. Enhances understanding
◦ 4. Identifies inefficiencies
◦ 5. Facilitates problem-solving
Example
◦ Problem:
To find temperature freezing
or not. (Celsius: 0o Fahrenheit:
32)
4. Decision Trees
A decision tree is a flowchart-like structure used to make decisions or
predictions. It consists of
Nodes: representing decisions or tests on attributes
Branches: representing the outcome of these decisions
Leaf Nodes: representing final outcomes or predictions.
Exampl
e
5. Deductive Reasoning
◦ Also called Abstraction or Top Down Approach
◦ Deductive reasoning involves drawing a specific conclusion from a general
statement or premises.
Example:
◦ All fruits grow on trees: General statement
◦ Apples are a type of fruit: Specific statement
◦ Therefore, apples grow on trees: Conclusion
6. Inductive Reasoning
Also called Generalization or Bottom Up Approach
◦ Inductive reasoning involves making generalizations or drawing
conclusions based on specific observations or experiences.
Example 1
◦ You observe that every swan you've ever seen is white. (specific)
Based on this observation, you might inductively conclude that all swans are
white.
(General)
Example 2
Predicting Weather
◦ Observations:-
◦ Today: Sunny and hot (specific)
◦ Yesterday: Sunny and hot (specific)
◦ Last week: Sunny and hot (specific)
Conclusion: It's likely to be sunny and hot tomorrow. (General)
7. Trial and Error
The Trial and Error method involves testing different solutions or approaches
to solve a problem, learning from failures, and refining the approach until a
satisfactory solution is found.
Example 1
◦ Substituting different values of the variable and checking the equality of
LHS and RHS
Example 2
Troubleshooting a Computer Issue
Problem: Computer won't turn on
Trail and Error
1. Check power cord (not the issue)
2. Check battery (not the issue)
3. Check motherboard (issue found)
Other Problem solving
techniques
◦ Optimization
◦ Brainstorming
◦ Mind mapping
◦ Analogical reasoning
◦ Simulation
◦ SCAMPER etc.

You might also like