Systems in the small - Introduction to Algorithms

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Systems in the small - Introduction to Algorithms - Presentation Transcript

    1. Systems in the Small: An Introduction to Algorithms David Millard (dem@ecs.soton.ac.uk)
    2. Overview
      • Definitions
      • Characteristics
      • Example Algorithm – Searching a List
      • Complexity
      • Assumptions
      • Algorithms that have Changed the World
      • Break
      • Activity: Building a Sorting Algorithm
    3. Definitions - Etymology
      • Algorism (n)
      • Arab mathematician Abu Abdullah Muhammad ibn Musa al-Khwarizmi (early 9th century)
      • Europe became aware of his work on Algebra
      • Arab numerals became associated with his name
      • Has since evolved to mean all processes for solving tasks
    4. Definitions - Dictionary
      • Algorithm (n)
      • “ An algorithm is a sequence of finite instructions, often used for calculation and data processing…”
      • Wikipedia
      • "A step-by-step problem-solving procedure, especially an established, recursive computational procedure for solving a problem in a finite number of steps.”
      • Answers.com
      • “ A step-by-step procedure for solving a problem or accomplishing some end especially by a computer”
      • Merriam Webster Dictionary
    5. Definitions - Dictionary
      • Algorithm (n)
      • “ An algorithm is a sequence of finite instructions, often used for calculation and data processing…”
      • Wikipedia
      • "A step-by-step problem-solving procedure, especially an established, recursive computational procedure for solving a problem in a finite number of steps.”
      • Answers.com
      • “ A step-by-step procedure for solving a problem or accomplishing some end especially by a computer”
      • Merriam Webster Dictionary
    6. Definitions - Dictionary
      • Algorithm (n)
      • “ An algorithm is a sequence of finite instructions , often used for calculation and data processing…”
      • Wikipedia
      • "A step-by-step problem-solving procedure, especially an established, recursive computational procedure for solving a problem in a finite number of steps .”
      • Answers.com
      • “ A step-by-step procedure for solving a problem or accomplishing some end especially by a computer”
      • Merriam Webster Dictionary
    7. Definitions - Dictionary
      • Algorithm (n)
      • “ An algorithm is a sequence of finite instructions , often used for calculation and data processing …”
      • Wikipedia
      • "A step-by-step problem-solving procedure, especially an established, recursive computational procedure for solving a problem in a finite number of steps .”
      • Answers.com
      • “ A step-by-step procedure for solving a problem or accomplishing some end especially by a computer”
      • Merriam Webster Dictionary
    8. Characteristics of an Algorithm
      • Performance
      • What else?
    9. Characteristics of an Algorithm
      • Performance
      • Efficiency
      • Understandability
      • Scalability
      • Reusability
      • Reliability
      • Elegance
        • Elegance (n). Of scientific processes, demonstrations, inventions, etc.: ‘Neatness’, ingenious simplicity, convenience, and effectiveness - OED
    10. An Example Algorithm
      • Scenario: We have a list of things arranged in order (for example, people by Birthday). How might we find a given value (for example, a particular month)?
    11. An Example Algorithm
      • Brute Force : Ask the first person, if they are not the month we want ask the next person. Continue until we find the right month
    12. An Example Algorithm
      • Binary Search : Ask the middle person. If they are not the month we want then compare their month to our desired month. If it is earlier then discard them and everyone before them, if later discard them and everyone after them. Choose the new middle person and continue until we find the right month.
    13. Complexity: Which is Best?
    14. Complexity: Which is Best?
      • Brute Force
        • best– 1
        • worst – n
          • For 16 people worst = 16
        • O (n)
    15. Complexity: Which is Best?
      • Brute Force
        • best– 1
        • worst – n
          • For 16 people worst = 16
        • O (n)
      • Binary Search
        • best– 1
        • worst – log 2 n
          • For 16 people worst = 4
          • 2 x 2 x 2 x 2= 16
        • O (log 2 n)
    16. Assumptions
      • A nice way to make life easier
        • In our search example we assumed that the list was ordered
        • So we assumed that our values had order!
          • (what about a list of animals, musical notes or colours)
      • Assumptions simplify problems
          • Assumptions must be realistic
          • Assumptions must be clearly stated
    17. An Algorithm to Change the World
      • In 1996 two Standord PhD students (Larry Page and Sergey Brin) started looking at the Web as a mathematical graph
      • They developed an algorithm called PageRank that evaluated the importance of each node in the graph according to its connections to other nodes
    18. An Algorithm to Change the World
      • In 1998 Larry and Sergey created a Web Search Engine called Google based on PageRank
      • Summer 2000 they had indexed 1 billion pages
      • August 2008 Google is valued at $ 157 billion
    19. Summary
      • Algorithms are:
        • A Sequence
        • … of finite steps
        • … to solve a problem!
      • They can be characterised in a number of different ways (performance, efficiency, reusability, etc.)
      • Complexity is a measure of how long an algorithm will take (or how many resources it might use)
      • And a good algorithm can change the world :-)
    20. Break
    21. Welcome Back
      • In Binary Search our list was already in order
      • But what algorithm could create that order?
      • Get into groups of around 4 people
      • Create an Algorithm that could take an unordered list and return an ordered list (suitable for Binary search)
        • Write down your algorithm using English
        • Try and be as unambiguous as possible
    22. Let’s Try Some Out
    23. Examples of Sorting Algorithms
      • Bubble Sort
        • Swaps pairs of numbers repeatedly until no more left to swap
      8 3 7 4 0 1 8 3 7 4 0 1 3 8 7 4 0 1 3 8 7 4 0 1 3 7 8 4 0 1
    24. Examples of Sorting Algorithms
      • Insertion Sort
        • Creates a second ordered list by placing each element from the first list in turn
      8 3 7 4 0 1 3 7 4 0 1 8 7 4 0 1 3 8 4 0 1 3 7 8 0 1 3 4 7 8 1 0 3 4 7 8 0 1 3 4 7 8
    25. Examples of Sorting Algorithms
      • Quick Sort
        • Uses a pivot point
        • Reorders the list so that all elements with higher value are after the pivot and those with lower are before
        • Pivot is now in correct position, repeat for each side
      8 3 7 4 0 1 8 3 7 4 0 1 3 0 1 4 8 7 3 0 1 4 8 7
    26. Summary
      • Algorithms are:
        • A Sequence
        • … of finite steps
        • … to solve a problem
      • They can be characterised in a number of different ways (performance, efficiency, reusability, etc.)
      • Complexity is a measure of how long an algorithm will take (or how many resources it might use)
      • And a good algorithm can change the world :-)

    + hoosfooshoosfoos, 2 years ago

    custom

    714 views, 0 favs, 1 embeds more stats

    A brief presentation to introduce new IT students t more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 714
      • 653 on SlideShare
      • 61 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 29
    Most viewed embeds
    • 61 views on https://secure.ecs.soton.ac.uk

    more

    All embeds
    • 61 views on https://secure.ecs.soton.ac.uk

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Tags