Algorithms Describing what you know. Contents What are they and were do we find them? Why show the algorithm? What formalisms are used for presenting.

Slides:



Advertisements
Similar presentations
Analysis of Computer Algorithms
Advertisements

INSTRUCTION SET ARCHITECTURES
Style for Special CS Components. Mathematics “Our confidence in any science is roughly proportional to the amount of mathematics it employs” (Bronowski.
Lecture3: Algorithm Analysis Bohyung Han CSE, POSTECH CSED233: Data Structures (2014F)
Computation and representation Joe Lau. Overview of lecture What is computation? Brief history Computational explanations in cognitive science Levels.
Math 1241, Spring 2014 Section 3.1, Part One Introduction to Limits Finding Limits From a Graph One-sided and Infinite Limits.
Learning Objectives Explain similarities and differences among algorithms, programs, and heuristic solutions List the five essential properties of an algorithm.
Chapter 10 Algorithmic Thinking. Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Learning Objectives List the five essential.
ISBN Chapter 3 Describing Syntax and Semantics.
1 Semantic Description of Programming languages. 2 Static versus Dynamic Semantics n Static Semantics represents legal forms of programs that cannot be.
Proof Points Key ideas when proving mathematical ideas.
CSC401 – Analysis of Algorithms Lecture Notes 1 Introduction
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
Algorithms and Problem Solving-1 Algorithms and Problem Solving.
Algorithms and Problem Solving. Learn about problem solving skills Explore the algorithmic approach for problem solving Learn about algorithm development.
CS 330 Programming Languages 09 / 16 / 2008 Instructor: Michael Eckmann.
Introduction to Analysis of Algorithms Prof. Thomas Costello (reorganized by Prof. Karen Daniels)
Describing Syntax and Semantics
Chapter 1 Program Design
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Chapter 8: Introduction to High-Level Language Programming Invitation to Computer Science, C++ Version, Fourth Edition.
Design and Analysis of Algorithms
The Project AH Computing. Functional Requirements  What the product must do!  Examples attractive welcome screen all options available as clickable.
Introduction to High-Level Language Programming
Writing up.
Programming Logic and Design Sixth Edition Chapter 2 Working with Data, Creating Modules, and Designing High-Quality Programs.
Simple Program Design Third Edition A Step-by-Step Approach
Overview of Computing. Computer Science What is computer science? The systematic study of computing systems and computation. Contains theories for understanding.
Reading and Writing Mathematical Proofs
CSC135 Review A Slide to a week review of the material covered 1.
Invariant Based Programming in Education Tutorial, FM’08 Linda Mannila
Writing for Computer Science 7. Algorithms 8. Editing Cho, Ho-Gi GNU OSLab.
Introduction Algorithms and Conventions The design and analysis of algorithms is the core subject matter of Computer Science. Given a problem, we want.
School of Computer Science & Information Technology G6DICP - Lecture 9 Software Development Techniques.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
CSCI 3327 Visual Basic Chapter 4: Control Statements in Visual Basic (Part 1B) UTPA – Fall 2011.
How Solvable Is Intelligence? A brief introduction to AI Dr. Richard Fox Department of Computer Science Northern Kentucky University.
Algorithms & Flowchart
CS Data Structures I Chapter 2 Principles of Programming & Software Engineering.
Getting Started with MATLAB (part2) 1. Basic Data manipulation 2. Basic Data Understanding 1. The Binary System 2. The ASCII Table 3. Creating Good Variables.
1 CSC 221: Computer Programming I Spring 2008 course overview  What did we set out to learn?  What did you actually learn?  Where do you go from here?
Computer Science 101 Theory of Computing. Computer Science is... The study of algorithms, with respect to –their formal properties –their linguistic realizations.
Computer Science, Algorithms, Abstractions, & Information CSC 2001.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Principle of Programming Lanugages 3: Compilation of statements Statements in C Assertion Hoare logic Department of Information Science and Engineering.
Chapter 10 Algorithmic Thinking. Learning Objectives Explain similarities and differences among algorithms, programs, and heuristic solutions List the.
Introduction CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Chapter 1 Software Development Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
LECTURE 22: BIG-OH COMPLEXITY CSC 212 – Data Structures.
ST Intro to R programming Big picture language features -- just a brief description here -- more later:
Algorithms and Flowcharts
CSC 108H: Introduction to Computer Programming Summer 2011 Marek Janicki.
Advanced Algorithms Analysis and Design
ICS 3UI - Introduction to Computer Science
Pseudocode and comments
Big-O notation.
Programming Problem steps must be able to be fully & unambiguously described Problem types; Can be clearly described Cannot be clearly described (e.g.
Introduction to Computer Programming
Algorithms Furqan Majeed.
2008/09/24: Lecture 6b CMSC 104, Section 0101 John Y. Park
Microsoft Visual Basic 2005 BASICS
Program Control using Java - Theory
CSC Classes Required for TCC CS Degree
Objective of This Course
Algorithms and Problem Solving
WRITING AN ALGORITHM, PSEUDOCODE, AND FLOWCHART LESSON 2.
Presentation transcript:

Algorithms Describing what you know

Contents What are they and were do we find them? Why show the algorithm? What formalisms are used for presenting algorithms? Notes on notation Algorithmic performance

Where do we find them In computer science and engineering almost everywhere. Every other paper you read will include and introduce an algorithm in one form or another (see formalisms later) Most of the books you have read include them in some form or another

What are they? “In mathematics and computer science, an algorithm is a step-by-step procedure for calculations. Algorithms are used for calculation, data processing, and automated reasoning.” Source: Mind you… – The steps are not as important as is the correctness of the algorithm and to prove that it meets some performance claims. In most cases coming up with the algorithm is a lot more work than actually presenting it – This is often because: some steps might be unclear; validation/verification might be missing on incomplete; usefulness of the algorithm omitted.

Why is an algorithm important? It might be better than others – What is better? uses less memory; uses less CPU time; It is faster; It improves a previous case; does it maybe take up less space and requires less resources; or maybe all the above together?? It might be explaining a very complex process It might be used to show the feasibility of a result and that a problem is computable (deterministic as we say) regardless of cost

So what would expect to see in it? The steps that make up the algorithm The structures used by the algorithm for input, output and internal representation of data Where does it have meaning (the scope) and any known limitations What properties will show that the algorithms is correct (preconditions, postconditions, loop invariants) Demonstration of correctness A complexity analysis for time and resources requirements Experiments confirming the theoretical result.

What formalisms are used? There are certain styles for presenting algorithms so that they are understandable and clear List style Pseudocode Prosecode Literate code

Formalism – list style Algorithm broken down into a sequence of steps (numbered or named) See loops as involving ‘goto’ statements Good – Discuss while presenting – No restriction to text Bad – Sometimes easy to get lost in the discussion

Formalism - pseudocode Algorithm presented in a block-structure language Each line is numbered Good – Immediately obvious structure Bad – Statements tend to be short (and unclear) – Not allowed to include many comments

Formalism - prosecode Number each step Don’t break a loop over several steps Use sub-numbering for step parts Include explanatory text Good – Direct and clear explanation of the algorithm Bad – More effective when the algorithm has been previously discussed

Formalism – Literate code Introduce algorithmic detail gradually While introducing detail discuss underlying ideas The following example is incomplete

Notation For algorithms mathematical notation is preferable to a programming notation Quick: – Use x i not x[i] – Use × or ∙ not * or x – Avoid specific language constructors (for, variable++, etc) – Nesting can be used by numbering subsections Mathematics provide a wealth of symbols that enable us to describe almost anything we like –  s  {CSC135}  x, y  {ASSIGNMENTS} with x  y  If H(s, x)    H(s,y)    s will learn some LaTeX

Environment The steps of an algorithm is part of its description Environment description is the remainder of the algorithm – Data structures, input and outputs all should be clearly and unambiguously defined (think mathematics) – Other software/hardware, even the operating system If you are describing an algorithm for faster read-write operations on Blue-Ray discs then hardware and operating system aspects are important – Specify all variables – Mention assumptions and expectations – Mention possible errors – Say what the algorithms does Be consistent

Performance When comparing an algorithm state criteria used. Possibilities include (and are not limited to): – Processing time (or speed) Not easy to define due to various factors. Better use a mathematic model for times based performance evaluation – Memory and disk requirements Various ways of manipulation could affect performance. When describing the algorithm, be clear on memory usage – Disk and network traffic Seek time & transfer rate are important. Sequential access vs. random access can make the difference. Caching is also important. – Applicability Be sure you are comparing similar requirements & functionality algorithms. – Asymptotic analysis: used to compare algorithm performance (big O notation, another course)

Algorithms end summary What are they, why should we present them? What is to be expected What formalisms can be used Notation Environment Performance