Sunteți pe pagina 1din 47

Problem Solving

Problem - a discrepancy
current state-desired state
Decisions- Choices
Two or more alternatives
Decision Making
process of choice making

What is a problem?
A state of difficulty that needs to be resolved
PROBLEMS EXIST WHERE GOALS NEED TO BE
ATTAINED AND THERE IS UNCERTAINTY ABOUT
SOLUTION.

Types of Decisions
Programmed
Simple,

routine; preestablished routines and


procedures; lower level workers (usually
alone)

Non

programmed

Complex,

creative; no prescriptions
available, upper level supervisors (usually in
groups)

Strategic
high

level, non programmed, directions for


organization

Types of Decisions
Certain

vs. uncertain

knowledge

of decision outcomes
probability of decision outcomes
information available
Uncertainty

Reduction

Problem Faced in Everyday in Life

People make decisions everyday


Examples:
Should I wear casual or formal today?..
Should I study physics or mathematics?
Should I watch TV or go out to cinema?..
what career?
what course?
What shoes?
...
Everything needs a DECISION AS A SOLUTION TO THE
PROBLEM

What happens when bad decisions are made?

WASTAGE OF TIME AND RESOURCES


COST

Approaches to solve a problem:


Algorithmic
Heuristic

Important definitions
Solutions that can be solved with a series
of known actions are called
Algorithmic Solutions
Employing a self-learning approach to the
solution of a problems is known as
Heuristic Solutions

Types of Problems
Algorithmic

solutions

Problems that can be solved with a series of actions.


Solutions can be reached through a direct set of steps.
Balancing checkbook, baking a cake,
cross-checking, Balance sheet,
profit-loss statement.
Alphabetizing 10,000 names

Heuristic

solutions

Problem solution requiring reasoning based on


knowledge and experience, and a process of trial and
error.
Solutions cannot be reached through a direct set of
steps.
How to buy the best stock or expand the company
Difficult to evaluate the solution

Examples

Algorithmic solution:

To make a cup of coffee

To find largest of three numbers

Heuristic solutions:

how to buy the best stock?

How to play chess?

Types of Problems
People

are better at solving heuristic


problems
Artificial

intelligence is the field of computer


science that deals with heuristic problems

Computers

are better at solving


complicated calculus problems or
alphabetizing 10,000 names
This

class deals with algorithmic solutions

Problem solving with computers


Computers use algorithmic solutions

Program set of instructions that make up solution to a problem

Results outcome of running the program

Testing Are the outcomes what you expected and correct

Documentation two types

manual documentation instructions telling users how to use the


program

Problem solving with computers involves several steps

Clearly define the problem.

Analyze the problem and formulate a method to solve it (see


also .validation.).

Describe the solution in the form of an algorithm.

Draw a flowchart of the algorithm.

Write the computer program.


Compile and run the program (debugging).

Test the program (debugging) (see also verification.).

Interpretation of results.

Problem solving concepts for computers

Constants

Variables

Operators

Hierarchy of operations

Data types

Equations

Functions

Expressions

Constant:

A variable whose value is determined when a program


description is written and doesnt change from that value
during program execution.

A constant is a value in a program, that stays the same


throughout the program's execution-numeric, alphabetical,
special symbols. Ex:PI=3.142857

Rules:
Constant cannot be changed after it is initially given a value

Variable: a named location in memory for


storing data.

Variables are values that can change as


much as needed during the execution of
a program. Ex:city=chennai

Data vs. Information


O
U
T
P
U
T

I
N
P
U
T

Data
Unorganized facts

P
R
O
C
E
S
S

Information
Processed
meaningful
report

DATATYPE

A type is the kind of data that variable is allowed to


hold

Problem Solving Steps


Identify

the problem
Understand the problem
Identify alternative ways to solve the
problem
Select the best way to solve the problem
from the list of alternative solutions
List instructions that enable you to solve
the problem using selected solution
Evaluate the solution

Problem Solving Techniques


Divide

and conquer: break down a large,


complex problem into smaller, solvable
problems.
Hill-climbing: attempting at every step to
move closer to the goal situation.
Means-end analysis: requires the setting
of sub-goals based on the process of
getting from the initial state to the goal
state when solving the problem.

Divide and conquer

Hill Climbing

Means-end analysis

Problem Solving Techniques


Trial-and-error:

select a possible answer,


apply it to the problem and, if it is not
successful, select another possibility.
Ends when a possibility yields a solution.
Brainstorming: a group technique
designed to generate a large number of
ideas for the solution of a problem.

Trial and Error method

Brainstorming

Communicating with computer


What is a program?

A set of step-by-step instructions that directs the computer to


perform tasks and produce results.

What is a Programming Language?

A programming language is a set of rules that instructs a computer


what operations to perform.

Syntax: Rules governing the computer oerating system, the


language and the application

BUG: It is an error

Debugging: The process of locating and correcting an error.

Organising Problems
Certain organisational tools can help us to solve problems :

Problem Analysis Charts a beginning analysis of the problem

Structure/Interactivity Charts shows the overall layout or


structure of the solution

IPO Chart shows the input, the processing and the output

Algorithm show the sequence of instructions comprising the


solution

Flowcharts graphic representations of the algorithms

George Plya's 1945, How to Solve It


Name

Informal Description

Analogy

Can you find a problem analogous to your problem


and solve that?

Generalization

Can you find a problem more general than your


problem?

Induction

Can you solve your problem by deriving a


generalization from some examples?

Variation of the
Problem

Can you vary or change your problem to create a new


problem (or set of problems) whose solution(s) will
help you solve your original problem?

Auxiliary Problem

Can you find a sub-problem or side problem whose


solution will help you solve your problem?

Here is a problem
related to yours
and solved before

Can you find a problem related to yours that has


already been solved and use that to solve your
problem?

George Plya's 1945, How to Solve It


Name

Informal Description

Specialization

Can you find a problem more specialized?

Decomposing and
Recombining

Can you decompose the problem and "recombine its


elements in some new manner"?

Working
backward

Can you start with the goal and work backwards to


something you already know?

Draw a Figure

Can you draw a picture of the problem?

Auxiliary
Elements

Can you add some new element to your problem to


get closer to a solution?

Dennis Ritchie

Ken Thompson (left) with Dennis Ritchie (right,


the inventor of the C programming language)

An algorithm is a procedure or formula for solving a problem.


It is a self-contained step-by-step set of operations to be performed.
Algorithms exist that perform calculation, data processing, and
automated reasoning.

FLOWCHART

A flowchart is a type of diagram that represents an algorithm, workflow or


process, showing the steps as boxes of various kinds, and their order by
connecting them with arrows. This diagrammatic representation illustrates a
solution model to a given problem

S-ar putea să vă placă și