SlideShare a Scribd company logo
Problem Solving
Skills
Lecture 11
Problem
A well-defined problem has five components:
• A clearly defined initial situation given
• A clearly defined goal
• A clearly defined set of resources
• A clearly defined constraints
• Ownership
Case Study
You are at a river that you want to cross with
all your goods. Your goods consist of a chicken, a
bag of grain and your cat. You have to cross the
river in your boat but can only take one
passenger with you at a time – the chicken, the
cat or the bag of grain. You can’t leave the
chicken alone with the grain as the chicken will
eat the grain. You can’t leave your cat alone
with the chicken as cat will eat the chicken.
However, you know that cat does not eat grain.
How do you get everything across the river
intact?
Problem
• Initial Situation: You, the Chicken, the Bag of Grain and the
Cat are on one bank of a river with access to a boat.
• Resources: The boat and your knowledge and problem-solving
skills.
• Constraints: You can take only one passenger, you must not
leave Cat with the Chicken, you must not leave the Chicken
with the Grain.
• Goal: You, the Chicken, the Bag of Grain and the Cat on the
opposite bank of river.
• Ownership: You will be involved in planning the solution and
carrying it out
Solution
• Take the chicken across the river and leave it on the
other side. Return to where you have left Cat and the
Grain.
• Take Cat across the river and leave him on the other
side. Take back the chicken.
• Leave the chicken where you started. Take the bag of
grain across the river and leave it with the Rover.
• Go back and fetch the chicken and take it across the
river with you.
Problem Solving
• Problem solving is a process of identifying a
problem and finding the best solution for it.
• Problem solving is a skill that can be
developed by following a well organized
approach.
• Different strategies, techniques and tools
are used to solve a problem.
Problem Solving (Cont.)
When faced with a problem:
1. We first clearly define the problem
2. Think of possible solutions
3. Select the one that we think is the best
under the prevailing circumstances
4. And then apply that solution
5. If the solution woks as desired, fine; else we
go back to step 2
Problem Solving (Cont.)
• Computers are used as a tool to solve a complex
problems by developing computer programs.
• Computer programs contain different instructions
for computer.
• A programmer writes instructions and computer
executes these instructions to solve a problem.
• Different problem solving techniques are as follows:
 Algorithm
 Flowchart
 Program
Algorithm
• From programming point of view, an
algorithm is a step-by-step procedure to
resolve any problem.
• An algorithm is an effective method
expressed as a finite set of well-defined
instructions.
Three Requirements
1. Sequence is:
 Precise
 Consists of limited number of steps
2. Each step is:
 Unambiguous
 Executable
3. The sequence of steps terminates in the form of a
solution
Properties of Algorithm
• Following are some properties of an algorithm:
 The given problem should be broken down into simple
and meaningful steps.
 The steps should be numbered sequentially
 The steps should be descriptive and written in simple
English.
Sample Algorithm
Write an algorithm to find area of a rectangle
Step 1: Start
Step 2: get l,b values
Step 3: Calculate A=l*b
Step 4: Display A
Step 5: Stop
Sample Algorithm - 2
Write an algorithm to add two numbers
1. Start
2. Read the value of num1
3. Read the value of num2
4. Add num1 and num2
5. Store the result in a variable sum
6. Display sum
7. End
Analysis of Algorithm
• Analysis in the context of algorithms is concerned with
predicting the resources that are required:
 Computational Time
 Memory
 Bandwidth
 Logic functions
• However, Time – generally measured in terms of number
of steps required to execute an algorithm is the resource of
most interest
• By analyzing several algorithms, the most efficient one
can be identified
Algorithm Techniques
Different kind of algorithm strategies are there
which people follow to write an algorithm:
• Greedy Algorithm
• Deterministic Algorithm
• Randomized Algorithm
• Brute Force Strategy
Traveling Salesman Problem
• A salesman needs to visit each of the n cities.
• Is there is a route that takes the salesman
through every city and back to starting city A at a
cost of $520?
Few Questions
• Is that the best possible sequence?
• How do you know?
• How do I determine the best sequence? (How
do I determine the sequence that I draw is the best
one, shortened one and optimist one.)
Solution: you have to list down all possible
combinations, compute all possible distances.
Have to find minimum distance
SYNTAX & SEMANTICS
• An algo. is correct if its:
Syntax is correct
Semantics are correct
• Semantics: The concept embedded in an
algorithm(the soul!)
• Syntax: The actual representation of an
algorithm(the body!)
Pseudo code
• Algorithms are written in a language that
is similar to simple English called pseudo
code.
• There is no standard to write pseudo code.
• It is used to specify program logic in an
English like manner that is independent of
any particular programming language.
Pseudo Code (Cont.)
• Pseudo code simplifies program development by
separating it into two main parts:
Logic Design
Coding
• Logic Design: In this part, the logic of the program
is designed. We specify different steps required to
solve the problem and the sequence of these steps.
• Coding: In this part, the algorithm is converted into
a program. The steps of algorithm are translated into
instructions of any programing language.
Sample Pseudocode
Write pseudocode to find area of a rectangle
BEGIN
READ l,b
CALCULATE A=l*b
DISPLAY A
END
Sample Pseudocode
Write pseudocode to add two numbers
BEGIN
NUMBER num1, num2, sum
OUTPUT ("Input number1:")
INPUT num1
OUTPUT ("Input number2:")
INPUT num2
sum= num1 + num2
OUTPUT sum
Difference Between Algorithm and
Pseudocode
Parameters Algorithm Pseudocode
Meaning and Definition An algorithm is a systematic,
logical approach that provides a
step-by-step procedure for
computers to solve a specific
problem.
Pseudocode is a simplified
version of programming codes,
written in plain English
language and used to outline a
program before its
implementation.
Expression and Use Algorithms can be expressed
using flowcharts, natural
language, and other methods.
Pseudocode includes various
control structures such as
repeat-until, if-then-else, while,
for, and case.

More Related Content

PPTX
Chp-1 DAA (2).pptx design analysis and algoritham presentation
PPTX
Programming in C - Problem Solving using C
PPT
Problem solving
PPTX
Data Structures_Introduction to algorithms.pptx
PPTX
1. Problem Solving Techniques and Data Structures.pptx
PPTX
Concept of Algorithm.pptx
PPTX
Algorithm and C code related to data structure
PPT
C programming for Computing Techniques
Chp-1 DAA (2).pptx design analysis and algoritham presentation
Programming in C - Problem Solving using C
Problem solving
Data Structures_Introduction to algorithms.pptx
1. Problem Solving Techniques and Data Structures.pptx
Concept of Algorithm.pptx
Algorithm and C code related to data structure
C programming for Computing Techniques

Similar to problem solving skills and its related all information (20)

PPTX
Algo_Lecture01.pptx
PDF
PROGRAMMING IN C UNIT I.pdffffffffffffffffffffffffd
PPT
2.2 Demonstrate the understanding of Programming Life Cycle
PPTX
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
PPTX
File 2013 09-27-07 56 18_catur_supriyanto,_m.cs__presentation1
PPT
Problem Solving Techniques notes for Unit 1
PPT
PPTX
problem solving and algorithm development
PPTX
MODULE1-INTRODUCTION.pptx-COMPUTER PROGRAMING
PPTX
PROBLEM SOLVING.pptx
PDF
Introduction to analysis algorithm in computer Science
PDF
introduction to analysis of algorithm in computer science
PPTX
Modile-1-PPT-1-BCAC0207-AlgorithmDesign.pptx
PPTX
Algorithm week2(technovation)
PPTX
asic computer is an electronic device that can receive, store, process, and o...
PPT
computer programming introduction ppt.ppt
PPTX
ANALYSIS AND DESIGN OF ALGORITHMS -M1-PPT
PDF
Algorithm.pdf
PPTX
Computational thinking
PPTX
Binary to hexadecimal algorithmic old.pptx
Algo_Lecture01.pptx
PROGRAMMING IN C UNIT I.pdffffffffffffffffffffffffd
2.2 Demonstrate the understanding of Programming Life Cycle
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
File 2013 09-27-07 56 18_catur_supriyanto,_m.cs__presentation1
Problem Solving Techniques notes for Unit 1
problem solving and algorithm development
MODULE1-INTRODUCTION.pptx-COMPUTER PROGRAMING
PROBLEM SOLVING.pptx
Introduction to analysis algorithm in computer Science
introduction to analysis of algorithm in computer science
Modile-1-PPT-1-BCAC0207-AlgorithmDesign.pptx
Algorithm week2(technovation)
asic computer is an electronic device that can receive, store, process, and o...
computer programming introduction ppt.ppt
ANALYSIS AND DESIGN OF ALGORITHMS -M1-PPT
Algorithm.pdf
Computational thinking
Binary to hexadecimal algorithmic old.pptx
Ad

More from ssuserf86fba (16)

PDF
Lecture 1(i). ifs about information process cyle using ict concept
PDF
Lecture 1.pdf its about introduction of information and .
PPTX
Lecture of using iict concept in c++ basic
PDF
Input and output basic of c++ programming and escape sequences
PDF
detail of flowchart and algorithm that are used in programmingpdf
PDF
Introduction To C++ programming and its basic concepts
PDF
system and application software are used in computer.
PDF
its about computer storage and its managements how to manage the memory, in a...
PDF
computerarchitecturecachememory-170927134432.pdf
PDF
number system in introduction to computer language
PDF
introduction to computer and technology-Lecture-1.pdf
PPTX
cache memory and cloud computing technology
PDF
its about information process cycle and its components
PDF
cental processing unit and all its components
PPTX
Ipc (how we transfer the information end to end
PDF
Lecture-2-Relational-Algebra-and-SQL-Advanced-DataBase-Theory-MS.pdf
Lecture 1(i). ifs about information process cyle using ict concept
Lecture 1.pdf its about introduction of information and .
Lecture of using iict concept in c++ basic
Input and output basic of c++ programming and escape sequences
detail of flowchart and algorithm that are used in programmingpdf
Introduction To C++ programming and its basic concepts
system and application software are used in computer.
its about computer storage and its managements how to manage the memory, in a...
computerarchitecturecachememory-170927134432.pdf
number system in introduction to computer language
introduction to computer and technology-Lecture-1.pdf
cache memory and cloud computing technology
its about information process cycle and its components
cental processing unit and all its components
Ipc (how we transfer the information end to end
Lecture-2-Relational-Algebra-and-SQL-Advanced-DataBase-Theory-MS.pdf
Ad

Recently uploaded (20)

PPTX
Internet of Things (IOT) - A guide to understanding
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PDF
composite construction of structures.pdf
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
Construction Project Organization Group 2.pptx
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
Sustainable Sites - Green Building Construction
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
web development for engineering and engineering
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
Digital Logic Computer Design lecture notes
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
additive manufacturing of ss316l using mig welding
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Internet of Things (IOT) - A guide to understanding
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
composite construction of structures.pdf
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Construction Project Organization Group 2.pptx
Automation-in-Manufacturing-Chapter-Introduction.pdf
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Sustainable Sites - Green Building Construction
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
web development for engineering and engineering
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Digital Logic Computer Design lecture notes
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
bas. eng. economics group 4 presentation 1.pptx
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
additive manufacturing of ss316l using mig welding
CYBER-CRIMES AND SECURITY A guide to understanding
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx

problem solving skills and its related all information

  • 2. Problem A well-defined problem has five components: • A clearly defined initial situation given • A clearly defined goal • A clearly defined set of resources • A clearly defined constraints • Ownership
  • 3. Case Study You are at a river that you want to cross with all your goods. Your goods consist of a chicken, a bag of grain and your cat. You have to cross the river in your boat but can only take one passenger with you at a time – the chicken, the cat or the bag of grain. You can’t leave the chicken alone with the grain as the chicken will eat the grain. You can’t leave your cat alone with the chicken as cat will eat the chicken. However, you know that cat does not eat grain. How do you get everything across the river intact?
  • 4. Problem • Initial Situation: You, the Chicken, the Bag of Grain and the Cat are on one bank of a river with access to a boat. • Resources: The boat and your knowledge and problem-solving skills. • Constraints: You can take only one passenger, you must not leave Cat with the Chicken, you must not leave the Chicken with the Grain. • Goal: You, the Chicken, the Bag of Grain and the Cat on the opposite bank of river. • Ownership: You will be involved in planning the solution and carrying it out
  • 5. Solution • Take the chicken across the river and leave it on the other side. Return to where you have left Cat and the Grain. • Take Cat across the river and leave him on the other side. Take back the chicken. • Leave the chicken where you started. Take the bag of grain across the river and leave it with the Rover. • Go back and fetch the chicken and take it across the river with you.
  • 6. Problem Solving • Problem solving is a process of identifying a problem and finding the best solution for it. • Problem solving is a skill that can be developed by following a well organized approach. • Different strategies, techniques and tools are used to solve a problem.
  • 7. Problem Solving (Cont.) When faced with a problem: 1. We first clearly define the problem 2. Think of possible solutions 3. Select the one that we think is the best under the prevailing circumstances 4. And then apply that solution 5. If the solution woks as desired, fine; else we go back to step 2
  • 8. Problem Solving (Cont.) • Computers are used as a tool to solve a complex problems by developing computer programs. • Computer programs contain different instructions for computer. • A programmer writes instructions and computer executes these instructions to solve a problem. • Different problem solving techniques are as follows:  Algorithm  Flowchart  Program
  • 9. Algorithm • From programming point of view, an algorithm is a step-by-step procedure to resolve any problem. • An algorithm is an effective method expressed as a finite set of well-defined instructions.
  • 10. Three Requirements 1. Sequence is:  Precise  Consists of limited number of steps 2. Each step is:  Unambiguous  Executable 3. The sequence of steps terminates in the form of a solution
  • 11. Properties of Algorithm • Following are some properties of an algorithm:  The given problem should be broken down into simple and meaningful steps.  The steps should be numbered sequentially  The steps should be descriptive and written in simple English.
  • 12. Sample Algorithm Write an algorithm to find area of a rectangle Step 1: Start Step 2: get l,b values Step 3: Calculate A=l*b Step 4: Display A Step 5: Stop
  • 13. Sample Algorithm - 2 Write an algorithm to add two numbers 1. Start 2. Read the value of num1 3. Read the value of num2 4. Add num1 and num2 5. Store the result in a variable sum 6. Display sum 7. End
  • 14. Analysis of Algorithm • Analysis in the context of algorithms is concerned with predicting the resources that are required:  Computational Time  Memory  Bandwidth  Logic functions • However, Time – generally measured in terms of number of steps required to execute an algorithm is the resource of most interest • By analyzing several algorithms, the most efficient one can be identified
  • 15. Algorithm Techniques Different kind of algorithm strategies are there which people follow to write an algorithm: • Greedy Algorithm • Deterministic Algorithm • Randomized Algorithm • Brute Force Strategy
  • 16. Traveling Salesman Problem • A salesman needs to visit each of the n cities. • Is there is a route that takes the salesman through every city and back to starting city A at a cost of $520?
  • 17. Few Questions • Is that the best possible sequence? • How do you know? • How do I determine the best sequence? (How do I determine the sequence that I draw is the best one, shortened one and optimist one.) Solution: you have to list down all possible combinations, compute all possible distances. Have to find minimum distance
  • 18. SYNTAX & SEMANTICS • An algo. is correct if its: Syntax is correct Semantics are correct • Semantics: The concept embedded in an algorithm(the soul!) • Syntax: The actual representation of an algorithm(the body!)
  • 19. Pseudo code • Algorithms are written in a language that is similar to simple English called pseudo code. • There is no standard to write pseudo code. • It is used to specify program logic in an English like manner that is independent of any particular programming language.
  • 20. Pseudo Code (Cont.) • Pseudo code simplifies program development by separating it into two main parts: Logic Design Coding • Logic Design: In this part, the logic of the program is designed. We specify different steps required to solve the problem and the sequence of these steps. • Coding: In this part, the algorithm is converted into a program. The steps of algorithm are translated into instructions of any programing language.
  • 21. Sample Pseudocode Write pseudocode to find area of a rectangle BEGIN READ l,b CALCULATE A=l*b DISPLAY A END
  • 22. Sample Pseudocode Write pseudocode to add two numbers BEGIN NUMBER num1, num2, sum OUTPUT ("Input number1:") INPUT num1 OUTPUT ("Input number2:") INPUT num2 sum= num1 + num2 OUTPUT sum
  • 23. Difference Between Algorithm and Pseudocode Parameters Algorithm Pseudocode Meaning and Definition An algorithm is a systematic, logical approach that provides a step-by-step procedure for computers to solve a specific problem. Pseudocode is a simplified version of programming codes, written in plain English language and used to outline a program before its implementation. Expression and Use Algorithms can be expressed using flowcharts, natural language, and other methods. Pseudocode includes various control structures such as repeat-until, if-then-else, while, for, and case.