SlideShare a Scribd company logo
1 of 23
Download to read offline
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

Similar to problem solving skills and its related all information

Computational thinking
Computational thinkingComputational thinking
Computational thinking
r123457
 
C programming .pptx
C programming .pptxC programming .pptx
C programming .pptx
SuhaibKhan62
 
classVII_Coding_Teacher_Presentation.pptx
classVII_Coding_Teacher_Presentation.pptxclassVII_Coding_Teacher_Presentation.pptx
classVII_Coding_Teacher_Presentation.pptx
ssusere336f4
 
01 Introduction to analysis of Algorithms.pptx
01 Introduction to analysis of Algorithms.pptx01 Introduction to analysis of Algorithms.pptx
01 Introduction to analysis of Algorithms.pptx
ssuser586772
 

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

Algorithms 1
Algorithms 1Algorithms 1
Algorithms 1
 
PROBLEM SOLVING.pptx
PROBLEM SOLVING.pptxPROBLEM SOLVING.pptx
PROBLEM SOLVING.pptx
 
Algorithm week2(technovation)
Algorithm week2(technovation)Algorithm week2(technovation)
Algorithm week2(technovation)
 
Algorithm.pdf
Algorithm.pdfAlgorithm.pdf
Algorithm.pdf
 
Computational thinking
Computational thinkingComputational thinking
Computational thinking
 
Lecture 24
Lecture 24Lecture 24
Lecture 24
 
C programming .pptx
C programming .pptxC programming .pptx
C programming .pptx
 
classVII_Coding_Teacher_Presentation.pptx
classVII_Coding_Teacher_Presentation.pptxclassVII_Coding_Teacher_Presentation.pptx
classVII_Coding_Teacher_Presentation.pptx
 
CS8461 - Design and Analysis of Algorithms
CS8461 - Design and Analysis of AlgorithmsCS8461 - Design and Analysis of Algorithms
CS8461 - Design and Analysis of Algorithms
 
Algorithmic problem sloving
Algorithmic problem slovingAlgorithmic problem sloving
Algorithmic problem sloving
 
part_1 (1).ppt
part_1 (1).pptpart_1 (1).ppt
part_1 (1).ppt
 
Lec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdf
Lec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdfLec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdf
Lec07-Greedy Algorithms.pdf Lec07-Greedy Algorithms.pdf
 
DAA Unit 1.pdf
DAA Unit 1.pdfDAA Unit 1.pdf
DAA Unit 1.pdf
 
Object Oriented Paradigm
Object Oriented ParadigmObject Oriented Paradigm
Object Oriented Paradigm
 
02 Algorithms and flowcharts - computers.pptx
02 Algorithms and flowcharts - computers.pptx02 Algorithms and flowcharts - computers.pptx
02 Algorithms and flowcharts - computers.pptx
 
Programs_Problem_Solving_Algorithms.ppt
Programs_Problem_Solving_Algorithms.pptPrograms_Problem_Solving_Algorithms.ppt
Programs_Problem_Solving_Algorithms.ppt
 
CPP03 - Repetition
CPP03 - RepetitionCPP03 - Repetition
CPP03 - Repetition
 
Introduction to C ++.pptx
Introduction to C ++.pptxIntroduction to C ++.pptx
Introduction to C ++.pptx
 
01 Introduction to analysis of Algorithms.pptx
01 Introduction to analysis of Algorithms.pptx01 Introduction to analysis of Algorithms.pptx
01 Introduction to analysis of Algorithms.pptx
 
Algorithm Introduction
Algorithm IntroductionAlgorithm Introduction
Algorithm Introduction
 

More from ssuserf86fba

detail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdfdetail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdf
ssuserf86fba
 
Introduction To C++ programming and its basic concepts
Introduction To C++ programming and its basic conceptsIntroduction To C++ programming and its basic concepts
Introduction To C++ programming and its basic concepts
ssuserf86fba
 
Lecture-2-Relational-Algebra-and-SQL-Advanced-DataBase-Theory-MS.pdf
Lecture-2-Relational-Algebra-and-SQL-Advanced-DataBase-Theory-MS.pdfLecture-2-Relational-Algebra-and-SQL-Advanced-DataBase-Theory-MS.pdf
Lecture-2-Relational-Algebra-and-SQL-Advanced-DataBase-Theory-MS.pdf
ssuserf86fba
 

More from ssuserf86fba (14)

Lecture of using iict concept in c++ basic
Lecture of using iict concept in c++ basicLecture of using iict concept in c++ basic
Lecture of using iict concept in c++ basic
 
Input and output basic of c++ programming and escape sequences
Input and output basic of c++ programming and escape sequencesInput and output basic of c++ programming and escape sequences
Input and output basic of c++ programming and escape sequences
 
detail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdfdetail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdf
 
Introduction To C++ programming and its basic concepts
Introduction To C++ programming and its basic conceptsIntroduction To C++ programming and its basic concepts
Introduction To C++ programming and its basic concepts
 
system and application software are used in computer.
system and application software are used in computer.system and application software are used in computer.
system and application software are used in computer.
 
its about computer storage and its managements how to manage the memory, in a...
its about computer storage and its managements how to manage the memory, in a...its about computer storage and its managements how to manage the memory, in a...
its about computer storage and its managements how to manage the memory, in a...
 
computerarchitecturecachememory-170927134432.pdf
computerarchitecturecachememory-170927134432.pdfcomputerarchitecturecachememory-170927134432.pdf
computerarchitecturecachememory-170927134432.pdf
 
number system in introduction to computer language
number system in introduction to computer languagenumber system in introduction to computer language
number system in introduction to computer language
 
introduction to computer and technology-Lecture-1.pdf
introduction to computer and technology-Lecture-1.pdfintroduction to computer and technology-Lecture-1.pdf
introduction to computer and technology-Lecture-1.pdf
 
cache memory and cloud computing technology
cache memory and cloud computing technologycache memory and cloud computing technology
cache memory and cloud computing technology
 
its about information process cycle and its components
its about information process cycle and its componentsits about information process cycle and its components
its about information process cycle and its components
 
cental processing unit and all its components
cental processing unit and all its componentscental processing unit and all its components
cental processing unit and all its components
 
Ipc (how we transfer the information end to end
Ipc (how we transfer the information end to endIpc (how we transfer the information end to end
Ipc (how we transfer the information end to end
 
Lecture-2-Relational-Algebra-and-SQL-Advanced-DataBase-Theory-MS.pdf
Lecture-2-Relational-Algebra-and-SQL-Advanced-DataBase-Theory-MS.pdfLecture-2-Relational-Algebra-and-SQL-Advanced-DataBase-Theory-MS.pdf
Lecture-2-Relational-Algebra-and-SQL-Advanced-DataBase-Theory-MS.pdf
 

Recently uploaded

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 

Recently uploaded (20)

2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic Marks
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 

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.