Design and Analysis of Algorithms

Slides:



Advertisements
Similar presentations
Analysis of Computer Algorithms
Advertisements

Models of Computation Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Analysis of Algorithms Week 1, Lecture 2.
Chapter 11: Models of Computation
CS2303-THEORY OF COMPUTATION
CS 345: Chapter 9 Algorithmic Universality and Its Robustness
8/25/2009 Sofya Raskhodnikova Intro to Theory of Computation L ECTURE 1 Theory of Computation Course information Overview of the area Finite Automata Sofya.
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.
Complexity 7-1 Complexity Andrei Bulatov Complexity of Problems.
What is an Algorithm? (And how do we analyze one?)
Theory of Computation What types of things are computable? How can we demonstrate what things are computable?
Lecture 14 Go over midterm results Algorithms Efficiency More on prime numbers.
CSE 830: Design and Theory of Algorithms
1. By the end of this lecture you should be able … To describe in general terms how computers function To describe the fetch-execute cycle To explain.
Computability and Complexity 3-1 Turing Machine Computability and Complexity Andrei Bulatov.
Grammars, Languages and Finite-state automata Languages are described by grammars We need an algorithm that takes as input grammar sentence And gives a.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Design and Analysis of Algorithms - Chapter 11 Algorithm An algorithm is a.
TK3043 Analysis and Design of Algorithms Introduction to Algorithms.
Theory of Computation. Computation Computation is a general term for any type of information processing that can be represented as an algorithm precisely.
Joseph L. Lindo Algorithms and Data Structures Sir Joseph Lindo University of the Cordilleras.
Introduction Dr. Ying Lu RAIK 283: Data Structures & Algorithms.
HOW TO SOLVE IT? Algorithms. An Algorithm An algorithm is any well-defined (computational) procedure that takes some value, or set of values, as input.
The Turing machine Olena Lastivka. Definition Turing machine is a theoretical device that manipulates symbols on a strip of tape according to a table.
Fundamentals of Algorithms MCS - 2 Lecture # 1
Introduction Algorithms and Conventions The design and analysis of algorithms is the core subject matter of Computer Science. Given a problem, we want.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
111 Discrete Mathematics Computability Brief introduction to computable functions, recursive functions, etc. Jeanine Meyer.
Distributed Computing with Turing Machine. Turing machine  Turing machines are an abstract model of computation. They provide a precise, formal definition.
1 Models of Computation o Turing Machines o Finite store + Tape o transition function: o If in state S1 and current cell is a 0 (1) then write 1 (0) and.
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
CSC 3210 Computer Organization and Programming Chapter 1 THE COMPUTER D.M. Rasanjalee Himali.
Introduction to Algorithms By Mr. Venkatadri. M. Two Phases of Programming A typical programming task can be divided into two phases: Problem solving.
Algorithms CS139 – Aug 30, Problem Solving Your roommate, who is taking CS139, is in a panic. He is worried that he might lose his financial aid.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
Introduction To PROLOG World view of imperative languages. World view of relational languages. A PROLOG program. Running a PROLOG program. A PROLOG.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Models of Computation - Turing Machines Dale Roberts, Lecturer.
Introduction to Problem Solving. Steps in Programming A Very Simplified Picture –Problem Definition & Analysis – High Level Strategy for a solution –Arriving.
Algorithms & Flowchart
Chapter 2: General Problem Solving Concepts
1 Section 2.1 Algorithms. 2 Algorithm A finite set of precise instructions for performing a computation or for solving a problem.
CSE 311 Foundations of Computing I Lecture 26 Computability: Turing machines, Undecidability of the Halting Problem Spring
CSE 311 Foundations of Computing I Lecture 29 Computability: Turing machines, Undecidability of the Halting Problem Autumn 2012 CSE 3111.
Design and Analysis of Algorithms - Chapter 11 Algorithm b An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining.
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
Computer Science 101 Theory of Computing. Computer Science is... The study of algorithms, with respect to –their formal properties –their linguistic realizations.
1 Theory of Computation 計算理論 2 Instructor: 顏嗣鈞 Web: Time: 9:10-12:10 PM, Monday Place: BL.
UNIT-I INTRODUCTION ANALYSIS AND DESIGN OF ALGORITHMS CHAPTER 1:
CS404 Design and Analysis of Algorithms BBy DDr. M V S Peri Sastry BB.E, PhD(BITS-Pilani)
Fundamentals of Informatics Lecture 3 Turing Machines Bas Luttik.
Capabilities of computing systems Numeric and symbolic Computations A look at Computability theory Turing Machines.
Introduction to design and analysis algorithm
1 Section 13.1 Turing Machines A Turing machine (TM) is a simple computer that has an infinite amount of storage in the form of cells on an infinite tape.
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
CS 461 – Oct. 28 TM applications –Recognize a language √ –Arithmetic √ –Enumerate a set –Encode a data structure or problem to solve Two kinds of TMs –Decider:
Design and Analysis of Algorithms Faculty Name : Ruhi Fatima Course Description This course provides techniques to prove.
1 Introduction to design and analysis algorithm. 2.
Computer Systems Architecture Edited by Original lecture by Ian Sunley Areas: Computer users Basic topics What is a computer?
Chapter 9 Turing Machines What would happen if we change the stack in Pushdown Automata into some other storage device? Truing Machines, which maintains.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
Fall 2013 Lecture 27: Turing machines and decidability CSE 311: Foundations of Computing.
Advanced Algorithms Analysis and Design
CSE202: Introduction to Formal Languages and Automata Theory
INTRODUCTION TO PROBLEM SOLVING
TK3043 Analysis and Design of Algorithms
CSE 311 Foundations of Computing I
Courtsey & Copyright: DESIGN AND ANALYSIS OF ALGORITHMS Courtsey & Copyright:
Chapter 9 TURING MACHINES.
Objective of This Course
Theory of Computation Turing Machines.
Presentation transcript:

Design and Analysis of Algorithms Text Book: Horowitz, S. Sahni, Fundamentals of Computer Algorithms Reference Book: Introduction to algorithms  By Thomas H. Cormen

Notion: Algorithms An algorithm is a sequence of unambiguous instructions for solving a computational problem, i.e., for obtaining a required output for any legitimate input in a finite amount of time. “computer” problem algorithm input output Algorithm is thus a sequence of computational steps that transform the input into the output.

More precisely, an algorithm is a method or process to solve a problem satisfying the following properties: Finiteness terminates after a finite number of steps Definiteness Each step must be rigorously and unambiguously specified. Input Valid inputs must be clearly specified. Output can be proved to produce the correct output given a valid can be proved to produce the correct output given a valid input. Effectiveness Steps must be sufficiently simple and basic. Can be carried out with pen and paper These are also called characteristics of an algorithm

Examples Is the following a legitimate algorithm? i 1 While (i <= 10) do a  i + 1 Print the value of a End of loop Stop

Four key terms: Natural Language Algorithm Program : A program is the expression of an algorithm in a programming language Psuedocode-mix of algorithm and some programming language. Key Points: Each step of an algorithm must be unambiguous. The same algorithm can be represented in several different ways. There might exists more than one algorithm for a certain problem. Algorithms for the same problem can be based on very different ideas and can solve the problem with dramatically different speeds.

Two main issues related to algorithms How to design algorithms How to analyze algorithm efficiency

Analysis of Algorithms How good is the algorithm? (Determined by the complexity) time efficiency space efficiency Does there exist a better algorithm? lower bounds optimality

Importance of Analyze Algorithm Need to recognize limitations of various algorithms for solving a problem Need to understand relationship between problem size and running time When is a running program not good enough? Need to learn how to analyze an algorithm's running time without coding it Need to learn techniques for writing more efficient code

What do we analyze about them? Correctness Does the input/output relation match algorithm requirement? Amount of work done (aka complexity) Basic operations to do task Amount of space used Memory used Simplicity, clarity Verification and implementation. Optimality Is it impossible to do better?

Models of Computation Reference: The design and analysis of computer algorithms by Aho Ullman

Three models of computation Random Access Machines RASP Machines(Stored program model) Turing Machines

Random Access Machine (RAM)

Each register holds an integer Program can’t modify itself RAM Assumptions Each register holds an integer Program can’t modify itself Memory instructions involve simple arithmetic Addition, subtraction Multiplication, division and control states (got, if-then, etc.)

RASP Machine stored program model Same as RAM but allow program to change itself as it is now stored in the memory Same power as RAM Example Von Neumann architecture Let RAM use memory registers to store modifiable program of RASP

Turing Machine A Turing machine includes A (conceptual) tape that extends infinitely in both directions Holds the input to the Turing machine Serves as memory Is divided into cells A unit that reads one cell of the tape at a time and writes a symbol in that cell It is controlled by finite automaton that has finite number of states.

Example of a finite automaton containing two states is a light switch. In this example, the two states are on and off. If the state of the lightswitch is on, pushing the switch is the input that will cause a transition to the off state. Each cell contains one symbol Symbols must come from a finite set of symbols called the alphabet Alphabet for a given Turing machine Contains a special symbol b (for “blank”) Usually contains the symbols 0 and 1 Sometimes contains additional symbols

Each operation involves Writing a symbol in the cell (replacing the symbol already there) Going into a new state (could be same state) Moving one cell left or right

Each instruction says something like if (you are in state i) and (you are reading symbol j) then write symbol k onto the tape go into state s move in direction d