problem solving module 1
problem solving module 1
Examples of problems
Addition: Add any two numbers
Increment: Add 1 to any number
Ternary addition: Add any three numbers
Sorting: Sort any list of names
Decision problems: Problems where the answer is either yes or no
Factoring: Find the prime factors of a positive integer
SOLVING A PROBLEM
Problem-solving techniques are methods for identifying and addressing
problems. They often involve a series of steps, such as defining the problem,
generating solutions, and evaluating the outcome.
A set of sequential steps usually written in Ordinary Language to solve a given problem is called
Algorithm
3. Write an algorithm to find the largest of three numbers X, Y,Z.
Flowchart
A flow chart is a step by step diagrammatic representation of the logic paths to
solve a given problem. Or A flowchart is visual or graphical representation of an
algorithm.
For solving any problem, there is no universal method, to solve the problem,we
must try the exact problem statement.
If the problem has some similarities, then other problem also be solved,by discover
the new problem.
Ex . sorting( bubble sort,insertion sort,quick sort,selection sort)
(Bubble sort)
(Selction sort)
PROBLEM INSTANCE
A problem instance refers to the input,constraintand
expected output of a problem that needs to be solved. It
includes all the necessary information and data required to
find a solution.
Ascending : [1,2,3,6,7]
Desc:[7,6,3,2,1]
Concept of generalization
Generalization draws conclusion from observed patterns
in specific cases.