SlideShare a Scribd company logo
1 of 20
Download to read offline
Algorithms
Chapter 10
What's The Pla
Algorithmic Thin
Problem Solving
Your roommate, who is taking Information
Technology II class, is in a panic. He is
worried that he might lose his financial aid if
his average goes under 6.0
How can he figure out what his current Average
is?
How can you build a process that any student
can use to tell them what average they have
based on grades provided thus far?
Algorithm Development Objectives
 At the end of this unit the student will:
 define the term algorithm
 state 5 properties of a good algorithm
 from a given problem and stated audience, create
an appropriate algorithm using the properties
stated above.
 use the concept of abstraction and top-down
design in creating an algorithm.
 begin to think about the kinds of problems that
have a computing solution.
Problem Solving
1. Understand the problem (and the audience)
1. Are you making a pie?
2. Needing directions?
3. Putting together a piece of equipment?
4. Trying to solve a mathematical puzzle?
2. Devise a plan
1. Is this similar to something else?
2. Who is the audience for the solution?
3. What are the required steps?
Problem Solving ( Cont’d )
3. Carry out the plan (implement)
1. Does it work?
2. Is each step correct? Necessary?
3. Is the solution accurate? (Correct)
1. Will it always lead to a solution
Algorithm Definition
 A logical sequence of steps for solving a
problem, …

From http://Dictionary.msn.com
 Dale and Lewis:

a plan of solution for a problem

Algorithm – An unambiguous (and precise) set of steps
for solving a problem (or sub-problem) in a finite
amount of time using a finite amount of data.
Algorithm Definition, cont
 Shackelford, Russell L. in Introduction to
Computing and Algorithms –
 “An algorithm is a specification of a behavioral
process. It consists of a finite set of instructions
that govern behavior step-by-step.”
Notice
 Notice the term finite. Algorithms should
lead to an eventual solution.
 Step by step process. Each step should do
one logical action.
Algorithms
 Algorithms are addressed to some audience.
Consider:
 A set of instructions for building a child’s bicycle.
 A diagnostic checklist for a failure of some system on the
space shuttle.
 The algorithm for what to do when a nuclear reactor
begins to overheat.
 An algorithm that will run on a computer system to
calculate student GPA’s.
Audience
 Each audience will have its own “rules” that
govern how we will address them, the
language that they speak.
 Each audience will have certain assumptions
about what they know and don’t know.
 An audience might include people or a
computer.
Good vs. Bad Algorithms
 All algorithms will have input, perform a
process, and produce output.
 A good algorithm should be:
 Simple - relative
 Complete – account for all inputs & cases
 Correct (Right)
 should have appropriate levels of Abstraction. –
grouping steps into a single module
 Precise
 Mnemonic - SCRAP
Precision
 Precision means that there is only one way to
interpret the instruction. Unambiguous
 Words like “maybe”, “sometimes” and
“occasionally” have no business in a well developed
algorithm.
 Instead of “maybe”, we can specify the exact
circumstances in which an action will be carried out.
Simplicity
 Simple can be defined as having no
unnecessary steps and no unnecessary
complexity. (You may lose points if your
algorithm contains unnecessary steps)
 Each step of a well developed algorithm
should carry out one logical step of the
process.
 Avoid something like: “Take 2nd
right after you
exit at King Street”
It has Levels of Abstraction.
 From the Oxford English Dictionary,
abstraction is defined as:
 “The act or process of separating in thought, of
considering a thing independently of its
associations; or a substance independently of its
attributes; or an attribute or quality independently
of the substance to which it belongs.”
 Example: Add all the scores then divide the sum
by the number of students to get the average.
Or in other words
 The abstraction property lets us view an
algorithm as a series of high level aggregate
steps, with the detail hidden in a lower level.
Abstraction, cont.
 Instead of approaching a problem and worrying
about each and every thing you must do to solve the
problem, you can begin to look at the major steps.
(Top down design)
 After the major steps, you can begin to fill in how
you would accomplish the major step.
 That fill in may lead to the need for additional levels
to fill in those details, etc.
 Top down design.
DiagrammaticallyDrivethecarto
school
Get directions
Start the car
Follow the directions
Get parking pass
Drive to the
destination
Turn left out of your
driveway
At the next light, turn right.
At the intersection with I-
66, take the on-ramp for
I-66 West
…
Level 1
Level 2
Level 3Find a place to park
Stop the car
Other algorithm attributes
 A good algorithm should be correct.
 A good algorithm should be complete.
 Shackelford again, “To be correct, an
algorithm must produce results that are
correct and complete given any and all sets
of appropriate data.”
 And to be correct, an algorithm must proceed
through to a conclusion.
Steps from Schaum’s
 Analyze the problem and develop the specification.
 Design the solution
 Test the solution as part of the design steps.
 Implement the program (code the program)
 Test the program
 Validate the program (further extensive testing) to
insure it works under all circumstances.
For example:
 For example, a student is taking 4 classes:
 Spanish – 4 credits – 6
 English – 1 credit – 9
 Computer Science – 3 credits – 86
 P.E. – 3 credits – 5
 What is the student’s semester average?
 How did you figure it out?
 How can you describe that process for others in the
class?

More Related Content

What's hot

Pragmatic Programmer
Pragmatic ProgrammerPragmatic Programmer
Pragmatic ProgrammerBert Añasco
 
Preparing for IEEEXtreme 12.0 & mora xtreme
Preparing for IEEEXtreme 12.0 & mora xtremePreparing for IEEEXtreme 12.0 & mora xtreme
Preparing for IEEEXtreme 12.0 & mora xtremeSupun Abeysinghe
 
An introduction to Competitive Programming
An introduction to Competitive ProgrammingAn introduction to Competitive Programming
An introduction to Competitive ProgrammingGaurav Agarwal
 
The pragmatic programmer
The pragmatic programmerThe pragmatic programmer
The pragmatic programmerNilesh Sharma
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving TechniquesAshesh R
 
The pragmatic programmer
The pragmatic programmerThe pragmatic programmer
The pragmatic programmerJoel Corrêa
 
Problem solving using Computer
Problem solving using ComputerProblem solving using Computer
Problem solving using ComputerDavid Livingston J
 
Programming fundamentals lecture 1 0f c
Programming fundamentals lecture 1 0f cProgramming fundamentals lecture 1 0f c
Programming fundamentals lecture 1 0f cRaja Hamid
 
Data structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 pptData structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 pptaviban
 
RecSys 2016 Talk: Feature Selection For Human Recommenders
RecSys 2016 Talk: Feature Selection For Human RecommendersRecSys 2016 Talk: Feature Selection For Human Recommenders
RecSys 2016 Talk: Feature Selection For Human RecommendersKatherine Livins
 
Computational thinking
Computational thinkingComputational thinking
Computational thinkingr123457
 
Program design and problem solving techniques
Program design and problem solving techniquesProgram design and problem solving techniques
Program design and problem solving techniquesDokka Srinivasu
 
Fundamental Programming Lect 4
Fundamental Programming Lect 4Fundamental Programming Lect 4
Fundamental Programming Lect 4Namrah Erum
 
Proving Lower Bounds to answer the P versus NP Question
Proving Lower Bounds to answer the P versus NP QuestionProving Lower Bounds to answer the P versus NP Question
Proving Lower Bounds to answer the P versus NP Questionguest383ed6
 

What's hot (20)

Pragmatic Programmer
Pragmatic ProgrammerPragmatic Programmer
Pragmatic Programmer
 
Preparing for IEEEXtreme 12.0 & mora xtreme
Preparing for IEEEXtreme 12.0 & mora xtremePreparing for IEEEXtreme 12.0 & mora xtreme
Preparing for IEEEXtreme 12.0 & mora xtreme
 
An introduction to Competitive Programming
An introduction to Competitive ProgrammingAn introduction to Competitive Programming
An introduction to Competitive Programming
 
The pragmatic programmer
The pragmatic programmerThe pragmatic programmer
The pragmatic programmer
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniques
 
The pragmatic programmer
The pragmatic programmerThe pragmatic programmer
The pragmatic programmer
 
Problem solving using Computer
Problem solving using ComputerProblem solving using Computer
Problem solving using Computer
 
Algorithms
AlgorithmsAlgorithms
Algorithms
 
Algorithms
AlgorithmsAlgorithms
Algorithms
 
Programming fundamentals lecture 1 0f c
Programming fundamentals lecture 1 0f cProgramming fundamentals lecture 1 0f c
Programming fundamentals lecture 1 0f c
 
Introduction to problem solving in C
Introduction to problem solving in CIntroduction to problem solving in C
Introduction to problem solving in C
 
Data structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 pptData structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 ppt
 
Maze Path Finding
Maze Path FindingMaze Path Finding
Maze Path Finding
 
Class 7 lecture notes
Class 7 lecture notesClass 7 lecture notes
Class 7 lecture notes
 
RecSys 2016 Talk: Feature Selection For Human Recommenders
RecSys 2016 Talk: Feature Selection For Human RecommendersRecSys 2016 Talk: Feature Selection For Human Recommenders
RecSys 2016 Talk: Feature Selection For Human Recommenders
 
Computational thinking
Computational thinkingComputational thinking
Computational thinking
 
Program design and problem solving techniques
Program design and problem solving techniquesProgram design and problem solving techniques
Program design and problem solving techniques
 
ACCU May 2020
ACCU May 2020ACCU May 2020
ACCU May 2020
 
Fundamental Programming Lect 4
Fundamental Programming Lect 4Fundamental Programming Lect 4
Fundamental Programming Lect 4
 
Proving Lower Bounds to answer the P versus NP Question
Proving Lower Bounds to answer the P versus NP QuestionProving Lower Bounds to answer the P versus NP Question
Proving Lower Bounds to answer the P versus NP Question
 

Similar to QULITIES OF A GOOD ALGORITHM

03 algorithm properties
03 algorithm properties03 algorithm properties
03 algorithm propertiesLincoln School
 
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
 
UNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.pptUNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.pptracha49
 
Introduction to Design Algorithm And Analysis.ppt
Introduction to Design Algorithm And Analysis.pptIntroduction to Design Algorithm And Analysis.ppt
Introduction to Design Algorithm And Analysis.pptBhargaviDalal4
 
Algorithms notes 2 tutorials duniya
Algorithms notes 2   tutorials duniyaAlgorithms notes 2   tutorials duniya
Algorithms notes 2 tutorials duniyaTutorialsDuniya.com
 
Design and Analysis Algorithms.pdf
Design and Analysis Algorithms.pdfDesign and Analysis Algorithms.pdf
Design and Analysis Algorithms.pdfHarshNagda5
 
Algorithm for computational problematic sit
Algorithm for computational problematic sitAlgorithm for computational problematic sit
Algorithm for computational problematic sitSaurabh846965
 
CH-1.1 Introduction (1).pptx
CH-1.1 Introduction (1).pptxCH-1.1 Introduction (1).pptx
CH-1.1 Introduction (1).pptxsatvikkushwaha1
 
algorithm design.pptx
algorithm design.pptxalgorithm design.pptx
algorithm design.pptxssuserd11e4a
 
Types of Algorithms.ppt
Types of Algorithms.pptTypes of Algorithms.ppt
Types of Algorithms.pptALIZAIB KHAN
 
Design and analysis of computer algorithms
Design and analysis of computer algorithmsDesign and analysis of computer algorithms
Design and analysis of computer algorithms Krishna Chaytaniah
 
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
 
Design and Analysis of Algorithm ppt for unit one
Design and Analysis of Algorithm ppt for unit oneDesign and Analysis of Algorithm ppt for unit one
Design and Analysis of Algorithm ppt for unit onessuserb7c8b8
 
138755986 problem-solving-methods-ppt
138755986 problem-solving-methods-ppt138755986 problem-solving-methods-ppt
138755986 problem-solving-methods-pptANn Villanueva
 

Similar to QULITIES OF A GOOD ALGORITHM (20)

03 algorithm properties
03 algorithm properties03 algorithm properties
03 algorithm properties
 
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
 
UNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.pptUNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.ppt
 
UNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.pptUNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.ppt
 
Introduction to Design Algorithm And Analysis.ppt
Introduction to Design Algorithm And Analysis.pptIntroduction to Design Algorithm And Analysis.ppt
Introduction to Design Algorithm And Analysis.ppt
 
Algorithms notes 2 tutorials duniya
Algorithms notes 2   tutorials duniyaAlgorithms notes 2   tutorials duniya
Algorithms notes 2 tutorials duniya
 
Design and Analysis Algorithms.pdf
Design and Analysis Algorithms.pdfDesign and Analysis Algorithms.pdf
Design and Analysis Algorithms.pdf
 
Lesson 11 1
Lesson 11  1Lesson 11  1
Lesson 11 1
 
Algorithm for computational problematic sit
Algorithm for computational problematic sitAlgorithm for computational problematic sit
Algorithm for computational problematic sit
 
Unit 1 dsa
Unit 1 dsaUnit 1 dsa
Unit 1 dsa
 
CH-1.1 Introduction (1).pptx
CH-1.1 Introduction (1).pptxCH-1.1 Introduction (1).pptx
CH-1.1 Introduction (1).pptx
 
algorithm design.pptx
algorithm design.pptxalgorithm design.pptx
algorithm design.pptx
 
Types of Algorithms.ppt
Types of Algorithms.pptTypes of Algorithms.ppt
Types of Algorithms.ppt
 
Design and analysis of computer algorithms
Design and analysis of computer algorithmsDesign and analysis of computer algorithms
Design and analysis of computer algorithms
 
GE8151 notes pdf.pdf
GE8151 notes pdf.pdfGE8151 notes pdf.pdf
GE8151 notes pdf.pdf
 
Lesson 3
Lesson 3Lesson 3
Lesson 3
 
Chapter 6 algorithms and flow charts
Chapter 6  algorithms and flow chartsChapter 6  algorithms and flow charts
Chapter 6 algorithms and flow charts
 
Design and Analysis of Algorithm ppt for unit one
Design and Analysis of Algorithm ppt for unit oneDesign and Analysis of Algorithm ppt for unit one
Design and Analysis of Algorithm ppt for unit one
 
138755986 problem-solving-methods-ppt
138755986 problem-solving-methods-ppt138755986 problem-solving-methods-ppt
138755986 problem-solving-methods-ppt
 
Algorithm itabq
Algorithm itabqAlgorithm itabq
Algorithm itabq
 

Recently uploaded

Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样vhwb25kk
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfJohn Sterrett
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts ServiceSapana Sha
 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Jack DiGiovanna
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Callshivangimorya083
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubaihf8803863
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...Suhani Kapoor
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...Suhani Kapoor
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsappssapnasaifi408
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改atducpo
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDRafezzaman
 
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)jennyeacort
 
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAmazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAbdelrhman abooda
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfSocial Samosa
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 

Recently uploaded (20)

Decoding Loan Approval: Predictive Modeling in Action
Decoding Loan Approval: Predictive Modeling in ActionDecoding Loan Approval: Predictive Modeling in Action
Decoding Loan Approval: Predictive Modeling in Action
 
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdf
 
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts Service
 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
 
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
 
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
 
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
VIP High Profile Call Girls Amravati Aarushi 8250192130 Independent Escort Se...
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
 
Call Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort ServiceCall Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort Service
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
 
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
Call Us ➥97111√47426🤳Call Girls in Aerocity (Delhi NCR)
 
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAmazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 

QULITIES OF A GOOD ALGORITHM

  • 1. Algorithms Chapter 10 What's The Pla Algorithmic Thin
  • 2. Problem Solving Your roommate, who is taking Information Technology II class, is in a panic. He is worried that he might lose his financial aid if his average goes under 6.0 How can he figure out what his current Average is? How can you build a process that any student can use to tell them what average they have based on grades provided thus far?
  • 3. Algorithm Development Objectives  At the end of this unit the student will:  define the term algorithm  state 5 properties of a good algorithm  from a given problem and stated audience, create an appropriate algorithm using the properties stated above.  use the concept of abstraction and top-down design in creating an algorithm.  begin to think about the kinds of problems that have a computing solution.
  • 4. Problem Solving 1. Understand the problem (and the audience) 1. Are you making a pie? 2. Needing directions? 3. Putting together a piece of equipment? 4. Trying to solve a mathematical puzzle? 2. Devise a plan 1. Is this similar to something else? 2. Who is the audience for the solution? 3. What are the required steps?
  • 5. Problem Solving ( Cont’d ) 3. Carry out the plan (implement) 1. Does it work? 2. Is each step correct? Necessary? 3. Is the solution accurate? (Correct) 1. Will it always lead to a solution
  • 6. Algorithm Definition  A logical sequence of steps for solving a problem, …  From http://Dictionary.msn.com  Dale and Lewis:  a plan of solution for a problem  Algorithm – An unambiguous (and precise) set of steps for solving a problem (or sub-problem) in a finite amount of time using a finite amount of data.
  • 7. Algorithm Definition, cont  Shackelford, Russell L. in Introduction to Computing and Algorithms –  “An algorithm is a specification of a behavioral process. It consists of a finite set of instructions that govern behavior step-by-step.”
  • 8. Notice  Notice the term finite. Algorithms should lead to an eventual solution.  Step by step process. Each step should do one logical action.
  • 9. Algorithms  Algorithms are addressed to some audience. Consider:  A set of instructions for building a child’s bicycle.  A diagnostic checklist for a failure of some system on the space shuttle.  The algorithm for what to do when a nuclear reactor begins to overheat.  An algorithm that will run on a computer system to calculate student GPA’s.
  • 10. Audience  Each audience will have its own “rules” that govern how we will address them, the language that they speak.  Each audience will have certain assumptions about what they know and don’t know.  An audience might include people or a computer.
  • 11. Good vs. Bad Algorithms  All algorithms will have input, perform a process, and produce output.  A good algorithm should be:  Simple - relative  Complete – account for all inputs & cases  Correct (Right)  should have appropriate levels of Abstraction. – grouping steps into a single module  Precise  Mnemonic - SCRAP
  • 12. Precision  Precision means that there is only one way to interpret the instruction. Unambiguous  Words like “maybe”, “sometimes” and “occasionally” have no business in a well developed algorithm.  Instead of “maybe”, we can specify the exact circumstances in which an action will be carried out.
  • 13. Simplicity  Simple can be defined as having no unnecessary steps and no unnecessary complexity. (You may lose points if your algorithm contains unnecessary steps)  Each step of a well developed algorithm should carry out one logical step of the process.  Avoid something like: “Take 2nd right after you exit at King Street”
  • 14. It has Levels of Abstraction.  From the Oxford English Dictionary, abstraction is defined as:  “The act or process of separating in thought, of considering a thing independently of its associations; or a substance independently of its attributes; or an attribute or quality independently of the substance to which it belongs.”  Example: Add all the scores then divide the sum by the number of students to get the average.
  • 15. Or in other words  The abstraction property lets us view an algorithm as a series of high level aggregate steps, with the detail hidden in a lower level.
  • 16. Abstraction, cont.  Instead of approaching a problem and worrying about each and every thing you must do to solve the problem, you can begin to look at the major steps. (Top down design)  After the major steps, you can begin to fill in how you would accomplish the major step.  That fill in may lead to the need for additional levels to fill in those details, etc.  Top down design.
  • 17. DiagrammaticallyDrivethecarto school Get directions Start the car Follow the directions Get parking pass Drive to the destination Turn left out of your driveway At the next light, turn right. At the intersection with I- 66, take the on-ramp for I-66 West … Level 1 Level 2 Level 3Find a place to park Stop the car
  • 18. Other algorithm attributes  A good algorithm should be correct.  A good algorithm should be complete.  Shackelford again, “To be correct, an algorithm must produce results that are correct and complete given any and all sets of appropriate data.”  And to be correct, an algorithm must proceed through to a conclusion.
  • 19. Steps from Schaum’s  Analyze the problem and develop the specification.  Design the solution  Test the solution as part of the design steps.  Implement the program (code the program)  Test the program  Validate the program (further extensive testing) to insure it works under all circumstances.
  • 20. For example:  For example, a student is taking 4 classes:  Spanish – 4 credits – 6  English – 1 credit – 9  Computer Science – 3 credits – 86  P.E. – 3 credits – 5  What is the student’s semester average?  How did you figure it out?  How can you describe that process for others in the class?