ALGORITHM DESIGN
ACTIVITY
Choose 5 random numbers
from 1-9.
The numbers should not be
arranged consecutively.
1.What are the classifications of design approaches?
2.What are the classifications of other classifications?
3.Where does this bubble sorting fall into?
4.Why do you think it is sorting algorithm?
5.How does this bubble sorting helps you in solving?
6.Why is it important to know bubble sorting method?
What is computational thinking?
What are the elements of
computational thinking?
What is algorithm?
CLASSROOM NORMS
Treat everyone with respect.
Listen to others.
Do your best to be successful.
123, ARRANGE ME!
Arrange the procedures
properly. Use numbers
(1,2,3,4,5, …) only.
123, ARRANGE ME!
 Group 1: Washing clothes
 Group 2: Fixing a broken table
 Group 3: Going to school
 Group 4: Brushing your teeth
 Group 5: Washing dishes
123, ARRANGE ME!
 What are the procedures you arranged?
 Does following procedures necessary?
 What does following procedures do in our daily
life?
 What do you think is our topic for today?
CHECKING OF ACTIVITY
LEARNING OBJECTIVES
At the end of the lesson the students are able to:
1.Determine and explain the classifications of algorithm
design;
2.Illustrate the categories of implementation method and
design method through venn diagram, fishbone, diagram,
table, and example algorithms; and
3. Appreciate the importance of solving problems in our
daily activities.
ACTIVITY TIME!
1. The class will be divided into 5 (five) groups.
2.You will identify the classifications of Implementation Method and
Design Method.
3.Group 1: make a Venn Diagram of Design Method
4.Group 2: fill in the Table of description in Implementation Method
5.Group 3: make a fishbone diagram of Design Method
6.Group 4: give example algorithms of Implementation Method
7.Group 5: explain the importance of Implementation Method and
Design Method.
8.The classifications will be shown via PowerPoint Presentation.
9.10 minutes to do the activity.
10.Presentation of the output will follow.
RUBRIC FOR THE ACTIVITY
GREEDY METHOD
At each step, decision is made to
choose the local optimum, without
thinking about the future consequences
Example: Fractional Knapsack and
Activity Selection
BRANCH AND BOUND
 This technique is very useful in solving combinatorial
optimization problem that have multiple solutions and
we are interested in find the most optimum solution. In
this approach, the entire solution space is represented
in the form of a state space tree.
 Example: Job sequencing and Travelling salesman
problem.
RECURSION OR ITERATION
Recursive algorithm is an algorithm which calls
itself again and again until a base condition is
achieved.
Iterative algorithm use loops and/or data
structures like stacks, qeues to solv e any
problem.
Every recursive solution can be implemented as
an iterative solution and vice versa.
SERIAL OR PARALLEL OR DISTRIBUTED
ALGORITHMS
Serial algorithms, one instruction is executed at
a time.
Parallel algorithms are those in which we divide
the problem into subproblems and execute
them on different processors.
Distributed algorithms are parallel algorithms
that are distributed on different machines.
DYNAMIC PROGRAMMING
 This strategy is similar to divide and conquer, the
difference is that whenever we have recursive
function calls with the same result, instead of calling
them again we try to store the result in a data
structure in the form of a table and retrieve the
results from the table.
 Example: 0-1Knapsack and subset-sum problem
LINEAR PROGRAMMING
there are inequalities in terms of inputs
and maximizing or minimizing some linear
functions of inputs.
Example: Maximum flow or Directed
Graph
REDUCTION (TRANSFORM ANG CONQUER)
In this method, we solve a difficult problem
by transforming it into a known problem for
which we have an optimal solution.
Basically, the goal is to find a reducing
algorithm whose complexity is not
dominated by the resulting reduced
algorithms.
DIVIDE AND CONQUER
This strategy involves dividing the
problem into sub-problem, recursively
solving them, ang then recombining
them for the final answer.
Example: Merge sort and Quicksort
BACKTRACKING
 This technique is very useful in solving
combinatorial problems that have a single
unique solution. Where we have to find the
correct combination of steps that lead to
fulfilment of the task.
 Example: N-queens problem
EXACT OR APPROXIMATE
Exact algorithm are algorithms that are capable
of finding an optimal solution for any problem
are known.
Approximate algorithms are the type of
algorithms that find the result as an average
outcome of sub outcomes to a problem.
CHECKING OF OUTPUT
ANALYSIS
BASED ON THE ACTIVITY…
How did you find the activity?
What did you feel while doing the activity?
How did you come up with the result of your activity?
What is the importance of teamwork/cooperation in
group activity?
What are the topics shown on your activity?
What is algorithm?
What do you think are the classifications for Implementation
Method?
What are the classifications for Design method?
Which of the following classifications greatly impacts you as
a student?
Which of these classifications can you apply in your daily
life?
How can we apply algorithm in our daily life?
Why is it important to follow procedures?
ABSTRACTION
WHAT IS ALGORITHM?
 a procedure to solve a
particular problem in a finite
number of steps for a finite-
sized input.
CLASSIFICATIONS OF ALGORITHMS:
1.Implementation Method
2.Design Method
3.Design Approaches
4.Other Classifications
IMPORTANCE OF ALGORITHMS:
 Organization
 Problem solving
 Performance comparison
 Reusability
 Research
ORGANIZATION
Algorithms can be very complex and by
classifying them, it becomes easier to
organize, understand, and compare different
algorithms.
PROBLEM SOLVING
Different problems require different
algorithms, and by having a classification, it
can help identify the best algorithm for a
particular problem.
PERFORMANCE COMPARISON
By classifying algorithms, it is possible to
compare their performance in terms of time
and space complexity, making it easier to
choose the best algorithm for a particular
use case.
REUSABILITY
By classifying algorithms, it becomes
easier to re-use existing algorithms for
similar problems, thereby reducing
development time and improving efficiency.
RESEARCH
Classifying algorithms is essential for
research and development in computer
science, as it helps to identify new
algorithms and improve existing ones.
IMPLEMENTATION METHOD:
1. Recursion or Iteration
2. Exact or Approximate
3. Serial or Parallel or
Distributed Algorithms
RECURSION OR ITERATION
 Recursive algorithm is an algorithm which
calls itself again and again until a base
condition is achieved.
 Iterative algorithm use loops and/or data
structures like stacks, qeues to solv e any
problem.
 Every recursive solution can be implemented
as an iterative solution and vice versa.
EXACT OR APPROXIMATE
 Exact algorithm are algorithms that are
capable of finding an optimal solution for any
problem are known.
 Approximate algorithms are the type of
algorithms that find the result as an average
outcome of sub outcomes to a problem.
SERIAL OR PARALLEL OR DISTRIBUTED
ALGORITHMS
Serial algorithms, one instruction is executed at
a time.
Parallel algorithms are those in which we divide
the problem into subproblems and execute
them on different processors.
Distributed algorithms are parallel algorithms
that are distributed on different machines.
DESIGN METHOD
1. Greedy Method
2. Divide and Conquer
3. Dynamic Programming
4. Linear Programming
5. Reduction (Transform and Conquer)
6. Backtracking
7. Branch and Bound
GREEDY METHOD
At each step, decision is made to choose
the local optimum, without thinking
about the future consequences
Example: Fractional Knapsack and
Activity Selection
DIVIDE AND CONQUER
This strategy involves dividing the
problem into sub-problem, recursively
solving them, ang then recombining
them for the final answer.
Example: Merge sort and Quicksort
DYNAMIC PROGRAMMING
 This strategy is similar to divide and conquer, the difference
is that whenever we have recursive function calls with the
same result, instead of calling them again we try to store
the result in a data structure in the form of a table and
retrieve the results from the table.
 Thus, the overall time complexity is reduced. “Dynamic”
means we dynamically decide, whether to call a function or
retrieve values from the table.
 Example: 0-1Knapsack and subset-sum problem
LINEAR PROGRAMMING
there are inequalities in terms of inputs
and maximizing or minimizing some
linear functions of inputs.
Example: Maximum flow or Directed
Graph
REDUCTION (TRANSFORM ANG CONQUER)
 In this method, we solve a difficult problem by transforming
it into a known problem for which we have an optimal
solution. Basically, the goal is to find a reducing algorithm
whose complexity is not dominated by the resulting
reduced algorithms.
 Example: Selection algorithm for finding the median in a
list involves first sorting the list and then finding out the
middle element in the sorted list. These techniques are
also called transform and conquer.
BACKTRACKING
 This technique is very useful in solving combinatorial problems that
have a single unique solution. Where we have to find the correct
combination of steps that lead to fulfillment of the task. Such problems
have multiple stages and there are multiple options at each stage.
 This approach is based on exploring each available option at every
stage one-by-one. While exploring an option if a point is reached that
doesn’t seem to lead to the solution, the program control backtracks one
step, and starts exploring the next option. In this way, the program
explores all possible course of actions and finds the route that leads to
the solution.
 Example: N-queens problem
BRANCH AND BOUND
 This technique is very useful in solving combinatorial
optimization problem that have multiple solutions and we are
interested in find the most optimum solution. In this
approach, the entire solution space is represented in the
form of a state space tree. As the program progresses each
state combination is explored, and the previous solution is
replaced by new one if it is not the optimal than the current
solution.
 Example: Job sequencing and Travelling salesman problem.
FORMATIVE PRACTICE
Based on your understanding, arrange the
classroom norms according to the most
important to the least.
1.Treat everyone with respect.
2.Listen to others.
3.Do you best to be successful.
APPLICATION
Based on what you have learned, choose an
activity and create a procedure for:
1.Making a breakfast
2.Doing Laundry
3. Planning Your Day
4. Packing for a Trip
RUBRIC FOR THE ACTIVITY
5
(Exceeds
Expectation)
4
(Meets
Expectation)
3
(Below
Expectations)
1
(Not
Acceptable)
Appropriate use
of words
So clear and
complete
Correct words Some notations
are incorrect
and has
misspelled
words
Incorrect words
Flow of process
presented
So simple and
clear. The
design is
understandable
Clear and
complete
Incomplete or
not well
designed
Unclear or
poorly designed
Directions: Read the questions carefully
and write the letter only. Do this in your
activity notebook.
EVALUATION
1.Which design method involvesbreaking a
problem into smaller sub-problems that can be
solved recursively?
A.Divide and Conquer
B.Dynamic Programming
C.Backtraking
D.Greedy
2. Which design method involves building solutions
incrementally by making decisions at each step that
optimize the overall objective?
A.Divide and Conquer
B.Dynamic Programming
C.Backtraking
D.Greedy
3. Which design method involves exploring all
possible solutions to a problem by constructing
a tree of possibilities?
A.Divide and Conquer
B.Dynamic Programming
C.Backtraking
D.Greedy
4. Which design method involves breaking a
problem into smaller sub-problems and storing
solutions to avoid repeated calculations?
A.Divide and Conquer
B.Dynamic Programming
C.Backtraking
D.Greedy
5. Which design method is used for finding the
shortest path between nodes in a graph?
A.Divide and Conquer
B.Dynamic Programming
C.Backtraking
D.Greedy
6. What classification of implementation
method calls itself again and again until a
base condition is achieved?
A.Exact or approximate
B.Recursion or iteration
C.Serial or parallel
D.Branch and bound
7. What algorithm that allows one
instruction is executed at a time?
A.Distributed
B.Parallel
C.Serial
D.Recursion
8. What algorithm divides the problem into
subproblems and execute them on different
processors?
A.Distributed
B.Parallel
C.Serial
D.Recursion
9. What classification of implementation
method that algorithms are capable of finding
an optimal solution for any problem.
A.Exact
B.Recursion
C.Serial
D.Parallel
10. What algorithm is it if the parallel
algorithms are distributed on different
machines?
A.Distributed
B.Parallel
C.Serial
D.Recursion
ASSIGNMENT
IDENTIFY THE CLASSIFICATIONS OF THE FOLLOWING:
1.Design Approaches
2.Other Classifications
COMPETITIVE LANDSCAPE
DIGITAL COMMUNICATIONS
Cloud
Local
Hybrid
THANK YOU
SOMEONE@EXAMPLE.COM

algorithm design.pptx

  • 1.
  • 4.
    ACTIVITY Choose 5 randomnumbers from 1-9. The numbers should not be arranged consecutively.
  • 6.
    1.What are theclassifications of design approaches? 2.What are the classifications of other classifications? 3.Where does this bubble sorting fall into? 4.Why do you think it is sorting algorithm? 5.How does this bubble sorting helps you in solving? 6.Why is it important to know bubble sorting method?
  • 7.
    What is computationalthinking? What are the elements of computational thinking? What is algorithm?
  • 8.
    CLASSROOM NORMS Treat everyonewith respect. Listen to others. Do your best to be successful.
  • 9.
    123, ARRANGE ME! Arrangethe procedures properly. Use numbers (1,2,3,4,5, …) only.
  • 10.
    123, ARRANGE ME! Group 1: Washing clothes  Group 2: Fixing a broken table  Group 3: Going to school  Group 4: Brushing your teeth  Group 5: Washing dishes
  • 11.
    123, ARRANGE ME! What are the procedures you arranged?  Does following procedures necessary?  What does following procedures do in our daily life?  What do you think is our topic for today?
  • 12.
  • 13.
    LEARNING OBJECTIVES At theend of the lesson the students are able to: 1.Determine and explain the classifications of algorithm design; 2.Illustrate the categories of implementation method and design method through venn diagram, fishbone, diagram, table, and example algorithms; and 3. Appreciate the importance of solving problems in our daily activities.
  • 14.
  • 15.
    1. The classwill be divided into 5 (five) groups. 2.You will identify the classifications of Implementation Method and Design Method. 3.Group 1: make a Venn Diagram of Design Method 4.Group 2: fill in the Table of description in Implementation Method 5.Group 3: make a fishbone diagram of Design Method 6.Group 4: give example algorithms of Implementation Method 7.Group 5: explain the importance of Implementation Method and Design Method. 8.The classifications will be shown via PowerPoint Presentation. 9.10 minutes to do the activity. 10.Presentation of the output will follow.
  • 16.
  • 17.
    GREEDY METHOD At eachstep, decision is made to choose the local optimum, without thinking about the future consequences Example: Fractional Knapsack and Activity Selection
  • 18.
    BRANCH AND BOUND This technique is very useful in solving combinatorial optimization problem that have multiple solutions and we are interested in find the most optimum solution. In this approach, the entire solution space is represented in the form of a state space tree.  Example: Job sequencing and Travelling salesman problem.
  • 19.
    RECURSION OR ITERATION Recursivealgorithm is an algorithm which calls itself again and again until a base condition is achieved. Iterative algorithm use loops and/or data structures like stacks, qeues to solv e any problem. Every recursive solution can be implemented as an iterative solution and vice versa.
  • 20.
    SERIAL OR PARALLELOR DISTRIBUTED ALGORITHMS Serial algorithms, one instruction is executed at a time. Parallel algorithms are those in which we divide the problem into subproblems and execute them on different processors. Distributed algorithms are parallel algorithms that are distributed on different machines.
  • 21.
    DYNAMIC PROGRAMMING  Thisstrategy is similar to divide and conquer, the difference is that whenever we have recursive function calls with the same result, instead of calling them again we try to store the result in a data structure in the form of a table and retrieve the results from the table.  Example: 0-1Knapsack and subset-sum problem
  • 22.
    LINEAR PROGRAMMING there areinequalities in terms of inputs and maximizing or minimizing some linear functions of inputs. Example: Maximum flow or Directed Graph
  • 23.
    REDUCTION (TRANSFORM ANGCONQUER) In this method, we solve a difficult problem by transforming it into a known problem for which we have an optimal solution. Basically, the goal is to find a reducing algorithm whose complexity is not dominated by the resulting reduced algorithms.
  • 24.
    DIVIDE AND CONQUER Thisstrategy involves dividing the problem into sub-problem, recursively solving them, ang then recombining them for the final answer. Example: Merge sort and Quicksort
  • 25.
    BACKTRACKING  This techniqueis very useful in solving combinatorial problems that have a single unique solution. Where we have to find the correct combination of steps that lead to fulfilment of the task.  Example: N-queens problem
  • 26.
    EXACT OR APPROXIMATE Exactalgorithm are algorithms that are capable of finding an optimal solution for any problem are known. Approximate algorithms are the type of algorithms that find the result as an average outcome of sub outcomes to a problem.
  • 27.
  • 28.
  • 29.
    BASED ON THEACTIVITY… How did you find the activity? What did you feel while doing the activity? How did you come up with the result of your activity? What is the importance of teamwork/cooperation in group activity? What are the topics shown on your activity? What is algorithm?
  • 30.
    What do youthink are the classifications for Implementation Method? What are the classifications for Design method? Which of the following classifications greatly impacts you as a student? Which of these classifications can you apply in your daily life? How can we apply algorithm in our daily life? Why is it important to follow procedures?
  • 31.
  • 32.
    WHAT IS ALGORITHM? a procedure to solve a particular problem in a finite number of steps for a finite- sized input.
  • 33.
    CLASSIFICATIONS OF ALGORITHMS: 1.ImplementationMethod 2.Design Method 3.Design Approaches 4.Other Classifications
  • 34.
    IMPORTANCE OF ALGORITHMS: Organization  Problem solving  Performance comparison  Reusability  Research
  • 35.
    ORGANIZATION Algorithms can bevery complex and by classifying them, it becomes easier to organize, understand, and compare different algorithms.
  • 36.
    PROBLEM SOLVING Different problemsrequire different algorithms, and by having a classification, it can help identify the best algorithm for a particular problem.
  • 37.
    PERFORMANCE COMPARISON By classifyingalgorithms, it is possible to compare their performance in terms of time and space complexity, making it easier to choose the best algorithm for a particular use case.
  • 38.
    REUSABILITY By classifying algorithms,it becomes easier to re-use existing algorithms for similar problems, thereby reducing development time and improving efficiency.
  • 39.
    RESEARCH Classifying algorithms isessential for research and development in computer science, as it helps to identify new algorithms and improve existing ones.
  • 40.
    IMPLEMENTATION METHOD: 1. Recursionor Iteration 2. Exact or Approximate 3. Serial or Parallel or Distributed Algorithms
  • 41.
    RECURSION OR ITERATION Recursive algorithm is an algorithm which calls itself again and again until a base condition is achieved.  Iterative algorithm use loops and/or data structures like stacks, qeues to solv e any problem.  Every recursive solution can be implemented as an iterative solution and vice versa.
  • 42.
    EXACT OR APPROXIMATE Exact algorithm are algorithms that are capable of finding an optimal solution for any problem are known.  Approximate algorithms are the type of algorithms that find the result as an average outcome of sub outcomes to a problem.
  • 43.
    SERIAL OR PARALLELOR DISTRIBUTED ALGORITHMS Serial algorithms, one instruction is executed at a time. Parallel algorithms are those in which we divide the problem into subproblems and execute them on different processors. Distributed algorithms are parallel algorithms that are distributed on different machines.
  • 44.
    DESIGN METHOD 1. GreedyMethod 2. Divide and Conquer 3. Dynamic Programming 4. Linear Programming 5. Reduction (Transform and Conquer) 6. Backtracking 7. Branch and Bound
  • 45.
    GREEDY METHOD At eachstep, decision is made to choose the local optimum, without thinking about the future consequences Example: Fractional Knapsack and Activity Selection
  • 47.
    DIVIDE AND CONQUER Thisstrategy involves dividing the problem into sub-problem, recursively solving them, ang then recombining them for the final answer. Example: Merge sort and Quicksort
  • 49.
    DYNAMIC PROGRAMMING  Thisstrategy is similar to divide and conquer, the difference is that whenever we have recursive function calls with the same result, instead of calling them again we try to store the result in a data structure in the form of a table and retrieve the results from the table.  Thus, the overall time complexity is reduced. “Dynamic” means we dynamically decide, whether to call a function or retrieve values from the table.  Example: 0-1Knapsack and subset-sum problem
  • 51.
    LINEAR PROGRAMMING there areinequalities in terms of inputs and maximizing or minimizing some linear functions of inputs. Example: Maximum flow or Directed Graph
  • 53.
    REDUCTION (TRANSFORM ANGCONQUER)  In this method, we solve a difficult problem by transforming it into a known problem for which we have an optimal solution. Basically, the goal is to find a reducing algorithm whose complexity is not dominated by the resulting reduced algorithms.  Example: Selection algorithm for finding the median in a list involves first sorting the list and then finding out the middle element in the sorted list. These techniques are also called transform and conquer.
  • 55.
    BACKTRACKING  This techniqueis very useful in solving combinatorial problems that have a single unique solution. Where we have to find the correct combination of steps that lead to fulfillment of the task. Such problems have multiple stages and there are multiple options at each stage.  This approach is based on exploring each available option at every stage one-by-one. While exploring an option if a point is reached that doesn’t seem to lead to the solution, the program control backtracks one step, and starts exploring the next option. In this way, the program explores all possible course of actions and finds the route that leads to the solution.  Example: N-queens problem
  • 57.
    BRANCH AND BOUND This technique is very useful in solving combinatorial optimization problem that have multiple solutions and we are interested in find the most optimum solution. In this approach, the entire solution space is represented in the form of a state space tree. As the program progresses each state combination is explored, and the previous solution is replaced by new one if it is not the optimal than the current solution.  Example: Job sequencing and Travelling salesman problem.
  • 59.
    FORMATIVE PRACTICE Based onyour understanding, arrange the classroom norms according to the most important to the least. 1.Treat everyone with respect. 2.Listen to others. 3.Do you best to be successful.
  • 60.
  • 61.
    Based on whatyou have learned, choose an activity and create a procedure for: 1.Making a breakfast 2.Doing Laundry 3. Planning Your Day 4. Packing for a Trip
  • 62.
    RUBRIC FOR THEACTIVITY 5 (Exceeds Expectation) 4 (Meets Expectation) 3 (Below Expectations) 1 (Not Acceptable) Appropriate use of words So clear and complete Correct words Some notations are incorrect and has misspelled words Incorrect words Flow of process presented So simple and clear. The design is understandable Clear and complete Incomplete or not well designed Unclear or poorly designed
  • 63.
    Directions: Read thequestions carefully and write the letter only. Do this in your activity notebook. EVALUATION
  • 64.
    1.Which design methodinvolvesbreaking a problem into smaller sub-problems that can be solved recursively? A.Divide and Conquer B.Dynamic Programming C.Backtraking D.Greedy
  • 65.
    2. Which designmethod involves building solutions incrementally by making decisions at each step that optimize the overall objective? A.Divide and Conquer B.Dynamic Programming C.Backtraking D.Greedy
  • 66.
    3. Which designmethod involves exploring all possible solutions to a problem by constructing a tree of possibilities? A.Divide and Conquer B.Dynamic Programming C.Backtraking D.Greedy
  • 67.
    4. Which designmethod involves breaking a problem into smaller sub-problems and storing solutions to avoid repeated calculations? A.Divide and Conquer B.Dynamic Programming C.Backtraking D.Greedy
  • 68.
    5. Which designmethod is used for finding the shortest path between nodes in a graph? A.Divide and Conquer B.Dynamic Programming C.Backtraking D.Greedy
  • 69.
    6. What classificationof implementation method calls itself again and again until a base condition is achieved? A.Exact or approximate B.Recursion or iteration C.Serial or parallel D.Branch and bound
  • 70.
    7. What algorithmthat allows one instruction is executed at a time? A.Distributed B.Parallel C.Serial D.Recursion
  • 71.
    8. What algorithmdivides the problem into subproblems and execute them on different processors? A.Distributed B.Parallel C.Serial D.Recursion
  • 72.
    9. What classificationof implementation method that algorithms are capable of finding an optimal solution for any problem. A.Exact B.Recursion C.Serial D.Parallel
  • 73.
    10. What algorithmis it if the parallel algorithms are distributed on different machines? A.Distributed B.Parallel C.Serial D.Recursion
  • 74.
  • 75.
    IDENTIFY THE CLASSIFICATIONSOF THE FOLLOWING: 1.Design Approaches 2.Other Classifications
  • 76.
  • 77.
  • 78.