SlideShare a Scribd company logo
1 of 60
4.1 Unit 1:
Programming and Computational Thinking (PCT-1)
XI
Computer Science (083)
Board : CBSE
Courtesy CBSE
4.1 Unit I
Programming and Computational
Thinking (PCT-1)
(80 Theory + 70 Practical)
Praveen M Jigajinni
Prepared by
Courtesy CBSE
DCSc & Engg, PGDCA,ADCA,MCA.MSc(IT),Mtech(IT),MPhil (Comp. Sci)
Department of Computer Science, Sainik School Amaravathinagar
Cell No: 9431453730 Email – praveenkumarjigajinni@gmail.com
PROBLEM SOLVING TECHNIQUES
 able to define problem;
 able to define algorithm;
 write algorithms for simple problems;
 explain properties of an algorithm;
 the meaning of flowchart;
 explain the need of flow chart;
 explain different symbols used in flow chart;
 draw flow chart for simple problems; and
convert a flow chart into an algorithm and
vice versa.
ALGORITHM AND FLOW CHART
OBJECTIVES
ALGORITHM AND FLOW CHART
Intelligence is one of the key
characteristics which differentiate a human
being from other living creatures on the
earth. Basic intelligence covers day to day
problem solving and making strategies to
handle different situations which keep
arising in day to day life.
INTRODUCTION
ALGORITHM AND FLOW CHART
One person goes Bank to withdraw money.
After knowing the balance in his account,
he/she decides to withdraw the entire
amount from his account but he/she has to
leave minimum balance in his account.
INTRODUCTION
ALGORITHM AND FLOW CHART
Here deciding about how much amount
he/she may withdraw from the account is
one of the example of the basic
intelligence. During the process of solving
any problem, one tries to find the
necessary steps to be taken in a sequence.
INTRODUCTION
ALGORITHM AND FLOW CHART
What is Algorithm?
Algorithm can be defined as: “A sequ
ence of activities to be processed for getti
ng desired output from a given input.”
ALGORITHM AND FLOW CHART
What is Algorithm?
Webopedia defines an algorithm as:
“A formula or set of steps for solving a
particularproblem. To be an algorithm, a set
of rules must be unambiguous and have a cl
ear stopping point”.
MUHAMMAD IBN MUSA AL-KHWARIZMI
Muḥammad ibn Mūsā al-
Khwārizmī (Persian: ‫محمد‬‫بن‬‫موسى‬
‫;خوارزمی‬ c. 780 – c. 850),
Formerly Latinized as Algoritmi, was
a Persian scholar who produced
works in mathematics, astronomy,
& geography under the patronage
of the Caliph Al-Ma'mun of
the Abbasid Caliphate.
Around 820 AD he was appointed as the astronomer
and head of the library of the House of
Wisdom in Baghdad.
PROPERTIES OF ALGORITHM
Donald Ervin Knuth has given a list of five
properties for an algorithm, these
properties are:
1) FINITENESS
2) DEFINITENESS
3) INPUT
4) OUTPUT
5) EFFECTIVENESS
PROPERTIES OF ALGORITHM
1) FINITENESS:
An algorithm must always terminate
after a finite number of steps. It
means after every step one reach
closer to solution of the problem and
after a finite number of steps
algorithm reaches to an end point.
PROPERTIES OF ALGORITHM
2) DEFINITENESS
Each step of an algorithm must be
precisely defined. It is done by well
thought actions to be performed at
each step of the algorithm. Also the
actions are defined unambiguously for
each activity in the algorithm.
PROPERTIES OF ALGORITHM
3) INPUT
Any operation you perform need
some beginning value/quantities
associated with different activities in
the operation. So the value/quantities
are given to the algorithm before it
begins.
PROPERTIES OF ALGORITHM
4) OUTPUT:
One always expects output/result
(expected value/quantities) in terms of output
from an algorithm. The result may be obtained
at different stages of the algorithm. If some
result is from the intermediate stage of the
operation then it is known as intermediate
result and result obtained at the end of
algorithm is known as end result. The output
is expected value/quantities always have a
specified relation to the inputs.
PROPERTIES OF ALGORITHM
5) EFFECTIVENESS:
Algorithms to be developed/written
using basic operations. Actually operations
should be basic, so that even they can in
principle be done exactly and in a finite
amount of time by a person, by using paper
and pencil only.
PROPERTIES OF ALGORITHM
Any algorithm should have all these five
properties otherwise it will not fulfil the
basic objective of solving a problem in finite
time. As you have seen in previous
examples, every step of an algorithm puts
you closer to the solution
ADVANTAGES OF ALGORITHM
The use of algorithms provides a number of
advantages. One of these advantages is in
the development of the procedure itself,
which involves identification of the
processes, major decision points, and
variables necessary to solve the problem.
Developing an algorithm allows and even
forces examination of the solution process
in a rational manner.
ADVANTAGES OF ALGORITHM
Identification of the processes and decision
points reduces the task into a series of
smaller steps of more manageable size.
Problems that would be difficult or
impossible to solve wholesale can be
approached as a series of small, solvable
sub problems. The required specification
aids in the identification and reduction of
subconscious biases. By using an algorithm,
decision-making becomes a more rational
process.
ADVANTAGES OF ALGORITHM
In additional to making the process more
rational, use of an algorithm will make the
process more efficient and more consistent.
Efficiency is an inherent result of the
analysis and specification process.
Consistency comes from both the use of the
same specified process and increased skill in
applying the process. An algorithm serves
as a mnemonic device and helps ensure
that variables or parts of the problem are
not ignored.
ADVANTAGES OF ALGORITHM
Presenting the solution process as an
algorithm allows more precise
communication. Finally, separation of the
procedure steps facilitates division of labor
and development of expertise.
A final benefit of the use of an algorithm
comes from the improvement it makes
possible. If the problem solver does not
know what was done, he or she will not
know what was done wrong.
ADVANTAGES OF ALGORITHM
As time goes by and results are compared
with goals, the existence of a specified
solution process allows identification of
weaknesses and errors in the process.
Reduction of a task to a specified set of
steps or algorithm is an important part of
analysis, control, and evaluation.
DISADVANTAGES OF ALGORITHM
One disadvantage of algorithms is that they
always terminate, which means there are
some computational procedures—occasionally
even useful ones—which are not algorithms.
Furthermore, all computational procedures,
whether they terminate or not, can only give
computable results, so you cannot, for
example, design a program which determines a
busy beaver number more quickly than could
be done by actually running the associated
types of Turing machines.
ALGORITHM EXAMPLES
Let us take one simple day-to-day example
by writing algorithm for making, “Maggi
Noodles‟ as a food.
Step 1: Start
Step 2: Take pan with water
Step 3: Put pan on the burner
Step 4: Switch on the gas/burner
Step 5: Put magi and masala
Step 6: Give two minutes to boil
Step 7: Take off the pan
Step 8: Take out the magi with the help of
fork/spoon
Step 9: Put the maggi on the plate and serve it
Step 10: Stop.
ALGORITHM EXAMPLES
Write an algorithm to print “Good Morning‟
Step 1: Start
Step 2: Print “Good Morning‟
Step 3: Stop
ALGORITHM EXAMPLES
Write an algorithm to find area of a rectangle.
Step 1: Start
Step 2: Take length and breadth and
store them as L and B?
Step 3: Multiply by L and B and store it
in area
Step 4: Print area
Step 5: Stop
ALGORITHM EXAMPLES
Write an algorithm to check whether he is
eligible to vote? (more than or equal to 18
years old).
Step 1: Start
Step 2: Take age and store it in age
Step 3: Check age value, if age >= 18 then go
to step 4 else step 5
Step 4: Print “Eligible to vote” and go to
step 6
Step 5: Print “Not eligible to vote”
Step 6: Stop
ALGORITHM EXAMPLES
Write an algorithm to check whether given
number is +ve, -ve or zero.
Step 1: Start
Step 2: Take any number and store it in n.
Step 3: Check n value, if n > 0 then go to
step 5 else go to step 4
Step 4: Check n value, if n < 0 then go to
step 6 else go to step 7
ALGORITHM EXAMPLES
Write an algorithm to check whether given
number is +ve, -ve or zero.
Step 5: Print “Given number is +ve”and go
to step 8
Step 6: Print “Given number is -ve” and go
to step 8
Step 7: Print “Given number is zero”
Step 8: Stop
FLOWCHART
The flowchart is a diagram which visually pre
sents the flow of data through processing
systems. This means by seeing a flow chart o
ne can know the operations performed and
the sequence of these operations in a syste
m. Algorithms are nothing but sequence of
steps for solving problems. So a flow chart ca
n be used for representing an algorithm. A
flowchart, will describe the operations
(and in what sequence) are required
to solve a given problem.
FLOWCHART
A flowchart is a type of diagram that
represents an algorithm, workflow or
process. The flowchart shows the steps as
boxes of various kinds, and their order by
connecting the boxes with arrows. This
diagrammatic representation illustrates a
solution model to a given problem.
Flowcharts are used in analyzing, designing,
documenting or managing a process or
program in various fields.
FLOWCHART
BUILDING BLOCKS
OF
FLOW CHART
OR
COMMON SYMBOLS
OF
FLOW CHART
The American National Standards
Institute (ANSI) set standards for flowcharts
and their symbols in the
1960s. The International Organization for
Standardization(ISO) adopted the ANSI
symbols in 1970. The current standard was
revised in 1985. Generally, flowcharts flow
from top to bottom and left to right.
BUILDING BLOCKS OF FLOW CHART
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
Flowline
(Arrowhead)
Shows the process's order of
operation. A line coming from
one symbol and pointing at
another. Arrowheads are
added if the flow is not the
standard top-to-bottom, left-
to right.
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
Terminal
Indicates the beginning and ending
of a program or sub-process.
Represented as a stadium, oval or
rounded (fillet) rectangle. They
usually contain the word "Start" or
"End", or another phrase signaling
the start or end of a process, such as
"submit inquiry" or "receive
product".
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
Process
Represents a set of operations that
changes value, form, or location of
data. Represented as a rectangle
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
Decision
Shows a conditional operation that
determines which one of the two
paths the program will take. The
operation is commonly a yes/no
question or true/false test.
Represented as a diamond
(rhombus).
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
Input /
Output
Indicates the process of inputting
and outputting data, as in entering
data or displaying results.
Represented as a parallelogram
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
Annotation
(Comment)
Indicating additional
information about a step the
program. Represented as an
open rectangle with a dashed
or solid line connecting it to
the corresponding symbol in
the flowchart.
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
Predefined
Process
Functions
Shows named process
/Function which is defined
elsewhere. Represented as
a rectangle with double-
struck vertical edges.
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
On-page
Connector
Pairs of labelled connectors
replace long or confusing
lines on a flowchart page.
Represented by a small
circle with a letter inside.
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
Off-page
Connector
A labelled connector for
use when the target is on
another page. Represented
as a home plate-
shaped pentagon.
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
Storage/
Backup
Magnetic Tape used for sec
ondary storage/Backup
BUILDING BLOCKS OF FLOW CHART
ANSI/ISO
Shape
Name Description
Storage/
Backup
Magnetic Disk used for sec
ondary storage/Backup
ADVANTAGES OF USING FLOWCHARTS
As we discussed flow chart is used for
representing algorithm in pictorial form.
This pictorial representation of a
solution/system is having many
advantages. These advantages are as
follows:
1. COMMUNICATION.
2. EFFECTIVE ANALYSIS.
3. DOCUMENTATION OF PROGRAM/SYSTEM.
4. EFFICIENT PROGRAM MAINTENANCE.
5. CODING OF THE PROGRAM.
ADVANTAGES OF USING FLOWCHARTS
1. COMMUNICATION:
A Flowchart can be used as a better way of
communication of the logic of a system and
steps involve in the solution, to all concerned
particularly to the client of system.
ADVANTAGES OF USING FLOWCHARTS
2. EFFECTIVE ANALYSIS:
A flowchart of a problem can be used for
effective analysis of the problem.
ADVANTAGES OF USING FLOWCHARTS
3.DOCUMENTATION OF PROGRAM/
SYSTEM:
Program flowcharts are a vital part of a good
program documentation. Program document is
used for various purposes like knowing the
components in the program, complexity of the
program etc.
ADVANTAGES OF USING FLOWCHARTS
4. EFFICIENT PROGRAM
MAINTENANCE:
Once a program is developed and becomes
operational it needs time to time maintenance.
With help of flowchart maintenance become
easier.
ADVANTAGES OF USING FLOWCHARTS
5. CODING OF THE PROGRAM:
Any design of solution of a problem is finally
converted into computer program. Writing code
referring the flowchart of the solution become
easy.
LIMITATIONS OF USING FLOWCHARTS
1) COMPLEXITY OF LOGIC: If program logic is
complex then flowchart of the program
becomes complicated.
2) ALTERATIONS AND MODIFICATIONS IN LOGIC:
any alterations in the program logic may require
redrawing of flowchart completely.
3) REUSE IS NOT POSSIBLE: As the flowchart
symbols cannot be typed, always reproduction
of flowchart symbols are required.
FLOWCHART EXAMPLES
Draw a flowchart to find the simple interest.
(Sequence)
FLOWCHART EXAMPLES
Draw a flowchart to find bigger number
among two numbers (selective)
FLOWCHART EXAMPLES
Draw a flow chart to find factorial of any
number.
FLOWCHART EXAMPLES
FLOWCHART - SOLVE IT
Draw a flow chart to print the number from 1
to N.
Draw a flow chart to find biggest number
among N numbers.
FLOWCHART - SOLVE IT
FLOWCHART EXAMPLES
THANK YOU

More Related Content

What's hot

What's hot (20)

Data handling CBSE PYTHON CLASS 11
Data handling CBSE PYTHON CLASS 11Data handling CBSE PYTHON CLASS 11
Data handling CBSE PYTHON CLASS 11
 
Chapter 14 strings
Chapter 14 stringsChapter 14 strings
Chapter 14 strings
 
Datatypes in python
Datatypes in pythonDatatypes in python
Datatypes in python
 
Array Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional arrayArray Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional array
 
Looping statement in python
Looping statement in pythonLooping statement in python
Looping statement in python
 
11 Unit1 Chapter 1 Getting Started With Python
11   Unit1 Chapter 1 Getting Started With Python11   Unit1 Chapter 1 Getting Started With Python
11 Unit1 Chapter 1 Getting Started With Python
 
Programming in c Arrays
Programming in c ArraysProgramming in c Arrays
Programming in c Arrays
 
Chapter 5 boolean algebra
Chapter 5 boolean algebraChapter 5 boolean algebra
Chapter 5 boolean algebra
 
Lesson 02 python keywords and identifiers
Lesson 02   python keywords and identifiersLesson 02   python keywords and identifiers
Lesson 02 python keywords and identifiers
 
C language ppt
C language pptC language ppt
C language ppt
 
Basics of c++ Programming Language
Basics of c++ Programming LanguageBasics of c++ Programming Language
Basics of c++ Programming Language
 
Loops in Python.pptx
Loops in Python.pptxLoops in Python.pptx
Loops in Python.pptx
 
Tree - Data Structure
Tree - Data StructureTree - Data Structure
Tree - Data Structure
 
Python for loop
Python for loopPython for loop
Python for loop
 
Two dimensional arrays
Two dimensional arraysTwo dimensional arrays
Two dimensional arrays
 
Python list
Python listPython list
Python list
 
Array in c
Array in cArray in c
Array in c
 
Data types in python lecture (2)
Data types in python lecture (2)Data types in python lecture (2)
Data types in python lecture (2)
 
stack & queue
stack & queuestack & queue
stack & queue
 
Data types in python
Data types in pythonData types in python
Data types in python
 

Similar to 11 Unit 1 Problem Solving Techniques

Chapter 6 algorithms and flow charts
Chapter 6  algorithms and flow chartsChapter 6  algorithms and flow charts
Chapter 6 algorithms and flow chartsPraveen M Jigajinni
 
Flow Chajhbhvhhhhhhhhhhhhhrts FOR BPE.pptx
Flow Chajhbhvhhhhhhhhhhhhhrts  FOR BPE.pptxFlow Chajhbhvhhhhhhhhhhhhhrts  FOR BPE.pptx
Flow Chajhbhvhhhhhhhhhhhhhrts FOR BPE.pptxdevelvin404
 
Algorithm for computational problematic sit
Algorithm for computational problematic sitAlgorithm for computational problematic sit
Algorithm for computational problematic sitSaurabh846965
 
Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithmrajkumar1631010038
 
Design and Analysis Algorithms.pdf
Design and Analysis Algorithms.pdfDesign and Analysis Algorithms.pdf
Design and Analysis Algorithms.pdfHarshNagda5
 
AOA Week 01.ppt
AOA Week 01.pptAOA Week 01.ppt
AOA Week 01.pptINAM352782
 
1.1 the introduction of design and analysis of algorithm
1.1 the introduction of design and analysis of algorithm1.1 the introduction of design and analysis of algorithm
1.1 the introduction of design and analysis of algorithmMohammed khaja Jamaluddin
 
Algorithm Analysis.pdf
Algorithm Analysis.pdfAlgorithm Analysis.pdf
Algorithm Analysis.pdfNayanChandak1
 
Unit 1 python (2021 r)
Unit 1 python (2021 r)Unit 1 python (2021 r)
Unit 1 python (2021 r)praveena p
 
Basics of Algorithm Unit 1 part 1 algorithm
Basics of Algorithm Unit 1 part 1  algorithmBasics of Algorithm Unit 1 part 1  algorithm
Basics of Algorithm Unit 1 part 1 algorithmJIMS LAJPAT NAGAR
 
Logic Development and Algorithm.
Logic Development and Algorithm.Logic Development and Algorithm.
Logic Development and Algorithm.NandiniSidana
 
Problem-solving and design 1.pptx
Problem-solving and design 1.pptxProblem-solving and design 1.pptx
Problem-solving and design 1.pptxTadiwaMawere
 
Software develop....
Software develop.... Software develop....
Software develop.... GCWUS
 
UNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.pptUNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.pptracha49
 

Similar to 11 Unit 1 Problem Solving Techniques (20)

Chapter 6 algorithms and flow charts
Chapter 6  algorithms and flow chartsChapter 6  algorithms and flow charts
Chapter 6 algorithms and flow charts
 
Algo and flowchart
Algo and flowchartAlgo and flowchart
Algo and flowchart
 
Flow Chajhbhvhhhhhhhhhhhhhrts FOR BPE.pptx
Flow Chajhbhvhhhhhhhhhhhhhrts  FOR BPE.pptxFlow Chajhbhvhhhhhhhhhhhhhrts  FOR BPE.pptx
Flow Chajhbhvhhhhhhhhhhhhhrts FOR BPE.pptx
 
Algorithm for computational problematic sit
Algorithm for computational problematic sitAlgorithm for computational problematic sit
Algorithm for computational problematic sit
 
Lect 3-4 Zaheer Abbas
Lect 3-4 Zaheer AbbasLect 3-4 Zaheer Abbas
Lect 3-4 Zaheer Abbas
 
Chap6
Chap6Chap6
Chap6
 
Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithm
 
Design and Analysis Algorithms.pdf
Design and Analysis Algorithms.pdfDesign and Analysis Algorithms.pdf
Design and Analysis Algorithms.pdf
 
AOA Week 01.ppt
AOA Week 01.pptAOA Week 01.ppt
AOA Week 01.ppt
 
1.1 the introduction of design and analysis of algorithm
1.1 the introduction of design and analysis of algorithm1.1 the introduction of design and analysis of algorithm
1.1 the introduction of design and analysis of algorithm
 
Algorithm Analysis.pdf
Algorithm Analysis.pdfAlgorithm Analysis.pdf
Algorithm Analysis.pdf
 
Unit 1 python (2021 r)
Unit 1 python (2021 r)Unit 1 python (2021 r)
Unit 1 python (2021 r)
 
UNIT 1.pptx
UNIT 1.pptxUNIT 1.pptx
UNIT 1.pptx
 
Basics of Algorithm Unit 1 part 1 algorithm
Basics of Algorithm Unit 1 part 1  algorithmBasics of Algorithm Unit 1 part 1  algorithm
Basics of Algorithm Unit 1 part 1 algorithm
 
Logic Development and Algorithm.
Logic Development and Algorithm.Logic Development and Algorithm.
Logic Development and Algorithm.
 
Problem-solving and design 1.pptx
Problem-solving and design 1.pptxProblem-solving and design 1.pptx
Problem-solving and design 1.pptx
 
Software develop....
Software develop.... Software develop....
Software develop....
 
chapter 1
chapter 1chapter 1
chapter 1
 
Module 1 python.pptx
Module 1 python.pptxModule 1 python.pptx
Module 1 python.pptx
 
UNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.pptUNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.ppt
 

More from Praveen M Jigajinni

Chapter 09 design and analysis of algorithms
Chapter 09  design and analysis of algorithmsChapter 09  design and analysis of algorithms
Chapter 09 design and analysis of algorithmsPraveen M Jigajinni
 
Chapter 06 constructors and destructors
Chapter 06 constructors and destructorsChapter 06 constructors and destructors
Chapter 06 constructors and destructorsPraveen M Jigajinni
 
Chapter 04 object oriented programming
Chapter 04 object oriented programmingChapter 04 object oriented programming
Chapter 04 object oriented programmingPraveen M Jigajinni
 
Chapter 8 getting started with python
Chapter 8 getting started with pythonChapter 8 getting started with python
Chapter 8 getting started with pythonPraveen M Jigajinni
 
Chapter 7 basics of computational thinking
Chapter 7 basics of computational thinkingChapter 7 basics of computational thinking
Chapter 7 basics of computational thinkingPraveen M Jigajinni
 
Chapter 3 cloud computing and intro parrallel computing
Chapter 3 cloud computing and intro parrallel computingChapter 3 cloud computing and intro parrallel computing
Chapter 3 cloud computing and intro parrallel computingPraveen M Jigajinni
 

More from Praveen M Jigajinni (20)

Chapter 09 design and analysis of algorithms
Chapter 09  design and analysis of algorithmsChapter 09  design and analysis of algorithms
Chapter 09 design and analysis of algorithms
 
Chapter 07 inheritance
Chapter 07 inheritanceChapter 07 inheritance
Chapter 07 inheritance
 
Chapter 06 constructors and destructors
Chapter 06 constructors and destructorsChapter 06 constructors and destructors
Chapter 06 constructors and destructors
 
Chapter 05 classes and objects
Chapter 05 classes and objectsChapter 05 classes and objects
Chapter 05 classes and objects
 
Chapter 04 object oriented programming
Chapter 04 object oriented programmingChapter 04 object oriented programming
Chapter 04 object oriented programming
 
Chapter 03 python libraries
Chapter 03 python librariesChapter 03 python libraries
Chapter 03 python libraries
 
Chapter 02 functions -class xii
Chapter 02   functions -class xiiChapter 02   functions -class xii
Chapter 02 functions -class xii
 
Unit 3 MongDB
Unit 3 MongDBUnit 3 MongDB
Unit 3 MongDB
 
Chapter 15 Lists
Chapter 15 ListsChapter 15 Lists
Chapter 15 Lists
 
Chapter 13 exceptional handling
Chapter 13 exceptional handlingChapter 13 exceptional handling
Chapter 13 exceptional handling
 
Chapter 10 data handling
Chapter 10 data handlingChapter 10 data handling
Chapter 10 data handling
 
Chapter 9 python fundamentals
Chapter 9 python fundamentalsChapter 9 python fundamentals
Chapter 9 python fundamentals
 
Chapter 8 getting started with python
Chapter 8 getting started with pythonChapter 8 getting started with python
Chapter 8 getting started with python
 
Chapter 7 basics of computational thinking
Chapter 7 basics of computational thinkingChapter 7 basics of computational thinking
Chapter 7 basics of computational thinking
 
Chapter 4 number system
Chapter 4 number systemChapter 4 number system
Chapter 4 number system
 
Chapter 3 cloud computing and intro parrallel computing
Chapter 3 cloud computing and intro parrallel computingChapter 3 cloud computing and intro parrallel computing
Chapter 3 cloud computing and intro parrallel computing
 
Chapter 2 operating systems
Chapter 2 operating systemsChapter 2 operating systems
Chapter 2 operating systems
 
Chapter 1 computer fundamentals
Chapter 1 computer  fundamentalsChapter 1 computer  fundamentals
Chapter 1 computer fundamentals
 
Chapter 0 syllabus 2019 20
Chapter 0  syllabus 2019 20Chapter 0  syllabus 2019 20
Chapter 0 syllabus 2019 20
 
Chapter 16 Dictionaries
Chapter 16 DictionariesChapter 16 Dictionaries
Chapter 16 Dictionaries
 

Recently uploaded

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 

Recently uploaded (20)

Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 

11 Unit 1 Problem Solving Techniques

  • 1. 4.1 Unit 1: Programming and Computational Thinking (PCT-1) XI Computer Science (083) Board : CBSE Courtesy CBSE
  • 2. 4.1 Unit I Programming and Computational Thinking (PCT-1) (80 Theory + 70 Practical) Praveen M Jigajinni Prepared by Courtesy CBSE DCSc & Engg, PGDCA,ADCA,MCA.MSc(IT),Mtech(IT),MPhil (Comp. Sci) Department of Computer Science, Sainik School Amaravathinagar Cell No: 9431453730 Email – praveenkumarjigajinni@gmail.com
  • 4.  able to define problem;  able to define algorithm;  write algorithms for simple problems;  explain properties of an algorithm;  the meaning of flowchart;  explain the need of flow chart;  explain different symbols used in flow chart;  draw flow chart for simple problems; and convert a flow chart into an algorithm and vice versa. ALGORITHM AND FLOW CHART OBJECTIVES
  • 5. ALGORITHM AND FLOW CHART Intelligence is one of the key characteristics which differentiate a human being from other living creatures on the earth. Basic intelligence covers day to day problem solving and making strategies to handle different situations which keep arising in day to day life. INTRODUCTION
  • 6. ALGORITHM AND FLOW CHART One person goes Bank to withdraw money. After knowing the balance in his account, he/she decides to withdraw the entire amount from his account but he/she has to leave minimum balance in his account. INTRODUCTION
  • 7. ALGORITHM AND FLOW CHART Here deciding about how much amount he/she may withdraw from the account is one of the example of the basic intelligence. During the process of solving any problem, one tries to find the necessary steps to be taken in a sequence. INTRODUCTION
  • 8. ALGORITHM AND FLOW CHART What is Algorithm? Algorithm can be defined as: “A sequ ence of activities to be processed for getti ng desired output from a given input.”
  • 9. ALGORITHM AND FLOW CHART What is Algorithm? Webopedia defines an algorithm as: “A formula or set of steps for solving a particularproblem. To be an algorithm, a set of rules must be unambiguous and have a cl ear stopping point”.
  • 10. MUHAMMAD IBN MUSA AL-KHWARIZMI Muḥammad ibn Mūsā al- Khwārizmī (Persian: ‫محمد‬‫بن‬‫موسى‬ ‫;خوارزمی‬ c. 780 – c. 850), Formerly Latinized as Algoritmi, was a Persian scholar who produced works in mathematics, astronomy, & geography under the patronage of the Caliph Al-Ma'mun of the Abbasid Caliphate. Around 820 AD he was appointed as the astronomer and head of the library of the House of Wisdom in Baghdad.
  • 11. PROPERTIES OF ALGORITHM Donald Ervin Knuth has given a list of five properties for an algorithm, these properties are: 1) FINITENESS 2) DEFINITENESS 3) INPUT 4) OUTPUT 5) EFFECTIVENESS
  • 12. PROPERTIES OF ALGORITHM 1) FINITENESS: An algorithm must always terminate after a finite number of steps. It means after every step one reach closer to solution of the problem and after a finite number of steps algorithm reaches to an end point.
  • 13. PROPERTIES OF ALGORITHM 2) DEFINITENESS Each step of an algorithm must be precisely defined. It is done by well thought actions to be performed at each step of the algorithm. Also the actions are defined unambiguously for each activity in the algorithm.
  • 14. PROPERTIES OF ALGORITHM 3) INPUT Any operation you perform need some beginning value/quantities associated with different activities in the operation. So the value/quantities are given to the algorithm before it begins.
  • 15. PROPERTIES OF ALGORITHM 4) OUTPUT: One always expects output/result (expected value/quantities) in terms of output from an algorithm. The result may be obtained at different stages of the algorithm. If some result is from the intermediate stage of the operation then it is known as intermediate result and result obtained at the end of algorithm is known as end result. The output is expected value/quantities always have a specified relation to the inputs.
  • 16. PROPERTIES OF ALGORITHM 5) EFFECTIVENESS: Algorithms to be developed/written using basic operations. Actually operations should be basic, so that even they can in principle be done exactly and in a finite amount of time by a person, by using paper and pencil only.
  • 17. PROPERTIES OF ALGORITHM Any algorithm should have all these five properties otherwise it will not fulfil the basic objective of solving a problem in finite time. As you have seen in previous examples, every step of an algorithm puts you closer to the solution
  • 18. ADVANTAGES OF ALGORITHM The use of algorithms provides a number of advantages. One of these advantages is in the development of the procedure itself, which involves identification of the processes, major decision points, and variables necessary to solve the problem. Developing an algorithm allows and even forces examination of the solution process in a rational manner.
  • 19. ADVANTAGES OF ALGORITHM Identification of the processes and decision points reduces the task into a series of smaller steps of more manageable size. Problems that would be difficult or impossible to solve wholesale can be approached as a series of small, solvable sub problems. The required specification aids in the identification and reduction of subconscious biases. By using an algorithm, decision-making becomes a more rational process.
  • 20. ADVANTAGES OF ALGORITHM In additional to making the process more rational, use of an algorithm will make the process more efficient and more consistent. Efficiency is an inherent result of the analysis and specification process. Consistency comes from both the use of the same specified process and increased skill in applying the process. An algorithm serves as a mnemonic device and helps ensure that variables or parts of the problem are not ignored.
  • 21. ADVANTAGES OF ALGORITHM Presenting the solution process as an algorithm allows more precise communication. Finally, separation of the procedure steps facilitates division of labor and development of expertise. A final benefit of the use of an algorithm comes from the improvement it makes possible. If the problem solver does not know what was done, he or she will not know what was done wrong.
  • 22. ADVANTAGES OF ALGORITHM As time goes by and results are compared with goals, the existence of a specified solution process allows identification of weaknesses and errors in the process. Reduction of a task to a specified set of steps or algorithm is an important part of analysis, control, and evaluation.
  • 23. DISADVANTAGES OF ALGORITHM One disadvantage of algorithms is that they always terminate, which means there are some computational procedures—occasionally even useful ones—which are not algorithms. Furthermore, all computational procedures, whether they terminate or not, can only give computable results, so you cannot, for example, design a program which determines a busy beaver number more quickly than could be done by actually running the associated types of Turing machines.
  • 24. ALGORITHM EXAMPLES Let us take one simple day-to-day example by writing algorithm for making, “Maggi Noodles‟ as a food. Step 1: Start Step 2: Take pan with water Step 3: Put pan on the burner Step 4: Switch on the gas/burner Step 5: Put magi and masala Step 6: Give two minutes to boil Step 7: Take off the pan Step 8: Take out the magi with the help of fork/spoon Step 9: Put the maggi on the plate and serve it Step 10: Stop.
  • 25. ALGORITHM EXAMPLES Write an algorithm to print “Good Morning‟ Step 1: Start Step 2: Print “Good Morning‟ Step 3: Stop
  • 26. ALGORITHM EXAMPLES Write an algorithm to find area of a rectangle. Step 1: Start Step 2: Take length and breadth and store them as L and B? Step 3: Multiply by L and B and store it in area Step 4: Print area Step 5: Stop
  • 27. ALGORITHM EXAMPLES Write an algorithm to check whether he is eligible to vote? (more than or equal to 18 years old). Step 1: Start Step 2: Take age and store it in age Step 3: Check age value, if age >= 18 then go to step 4 else step 5 Step 4: Print “Eligible to vote” and go to step 6 Step 5: Print “Not eligible to vote” Step 6: Stop
  • 28. ALGORITHM EXAMPLES Write an algorithm to check whether given number is +ve, -ve or zero. Step 1: Start Step 2: Take any number and store it in n. Step 3: Check n value, if n > 0 then go to step 5 else go to step 4 Step 4: Check n value, if n < 0 then go to step 6 else go to step 7
  • 29. ALGORITHM EXAMPLES Write an algorithm to check whether given number is +ve, -ve or zero. Step 5: Print “Given number is +ve”and go to step 8 Step 6: Print “Given number is -ve” and go to step 8 Step 7: Print “Given number is zero” Step 8: Stop
  • 31. The flowchart is a diagram which visually pre sents the flow of data through processing systems. This means by seeing a flow chart o ne can know the operations performed and the sequence of these operations in a syste m. Algorithms are nothing but sequence of steps for solving problems. So a flow chart ca n be used for representing an algorithm. A flowchart, will describe the operations (and in what sequence) are required to solve a given problem. FLOWCHART
  • 32. A flowchart is a type of diagram that represents an algorithm, workflow or process. The flowchart shows the steps as boxes of various kinds, and their order by connecting the boxes with arrows. This diagrammatic representation illustrates a solution model to a given problem. Flowcharts are used in analyzing, designing, documenting or managing a process or program in various fields. FLOWCHART
  • 34. The American National Standards Institute (ANSI) set standards for flowcharts and their symbols in the 1960s. The International Organization for Standardization(ISO) adopted the ANSI symbols in 1970. The current standard was revised in 1985. Generally, flowcharts flow from top to bottom and left to right. BUILDING BLOCKS OF FLOW CHART
  • 35. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description Flowline (Arrowhead) Shows the process's order of operation. A line coming from one symbol and pointing at another. Arrowheads are added if the flow is not the standard top-to-bottom, left- to right.
  • 36. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description Terminal Indicates the beginning and ending of a program or sub-process. Represented as a stadium, oval or rounded (fillet) rectangle. They usually contain the word "Start" or "End", or another phrase signaling the start or end of a process, such as "submit inquiry" or "receive product".
  • 37. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description Process Represents a set of operations that changes value, form, or location of data. Represented as a rectangle
  • 38. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description Decision Shows a conditional operation that determines which one of the two paths the program will take. The operation is commonly a yes/no question or true/false test. Represented as a diamond (rhombus).
  • 39. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description Input / Output Indicates the process of inputting and outputting data, as in entering data or displaying results. Represented as a parallelogram
  • 40. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description Annotation (Comment) Indicating additional information about a step the program. Represented as an open rectangle with a dashed or solid line connecting it to the corresponding symbol in the flowchart.
  • 41. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description Predefined Process Functions Shows named process /Function which is defined elsewhere. Represented as a rectangle with double- struck vertical edges.
  • 42. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description On-page Connector Pairs of labelled connectors replace long or confusing lines on a flowchart page. Represented by a small circle with a letter inside.
  • 43. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description Off-page Connector A labelled connector for use when the target is on another page. Represented as a home plate- shaped pentagon.
  • 44. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description Storage/ Backup Magnetic Tape used for sec ondary storage/Backup
  • 45. BUILDING BLOCKS OF FLOW CHART ANSI/ISO Shape Name Description Storage/ Backup Magnetic Disk used for sec ondary storage/Backup
  • 46. ADVANTAGES OF USING FLOWCHARTS As we discussed flow chart is used for representing algorithm in pictorial form. This pictorial representation of a solution/system is having many advantages. These advantages are as follows: 1. COMMUNICATION. 2. EFFECTIVE ANALYSIS. 3. DOCUMENTATION OF PROGRAM/SYSTEM. 4. EFFICIENT PROGRAM MAINTENANCE. 5. CODING OF THE PROGRAM.
  • 47. ADVANTAGES OF USING FLOWCHARTS 1. COMMUNICATION: A Flowchart can be used as a better way of communication of the logic of a system and steps involve in the solution, to all concerned particularly to the client of system.
  • 48. ADVANTAGES OF USING FLOWCHARTS 2. EFFECTIVE ANALYSIS: A flowchart of a problem can be used for effective analysis of the problem.
  • 49. ADVANTAGES OF USING FLOWCHARTS 3.DOCUMENTATION OF PROGRAM/ SYSTEM: Program flowcharts are a vital part of a good program documentation. Program document is used for various purposes like knowing the components in the program, complexity of the program etc.
  • 50. ADVANTAGES OF USING FLOWCHARTS 4. EFFICIENT PROGRAM MAINTENANCE: Once a program is developed and becomes operational it needs time to time maintenance. With help of flowchart maintenance become easier.
  • 51. ADVANTAGES OF USING FLOWCHARTS 5. CODING OF THE PROGRAM: Any design of solution of a problem is finally converted into computer program. Writing code referring the flowchart of the solution become easy.
  • 52. LIMITATIONS OF USING FLOWCHARTS 1) COMPLEXITY OF LOGIC: If program logic is complex then flowchart of the program becomes complicated. 2) ALTERATIONS AND MODIFICATIONS IN LOGIC: any alterations in the program logic may require redrawing of flowchart completely. 3) REUSE IS NOT POSSIBLE: As the flowchart symbols cannot be typed, always reproduction of flowchart symbols are required.
  • 53. FLOWCHART EXAMPLES Draw a flowchart to find the simple interest. (Sequence)
  • 54. FLOWCHART EXAMPLES Draw a flowchart to find bigger number among two numbers (selective)
  • 55. FLOWCHART EXAMPLES Draw a flow chart to find factorial of any number.
  • 57. FLOWCHART - SOLVE IT Draw a flow chart to print the number from 1 to N.
  • 58. Draw a flow chart to find biggest number among N numbers. FLOWCHART - SOLVE IT