Introduction to Algorithms (2 nd edition) by Cormen, Leiserson, Rivest & Stein Chapter 1: The Role of Algorithms in Computing (slides by N. Adlai A. DePano)

Slides:



Advertisements
Similar presentations
Fundamentals of Python: From First Programs Through Data Structures
Advertisements

CS 253: Algorithms Syllabus Chapter 1 Appendix A.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2001 Lecture 1 (Part 1) Introduction/Overview Tuesday, 9/4/01.
CPSC 411, Fall 2008: Set 1 1 CPSC 411 Design and Analysis of Algorithms Set 1: Introduction and Review Prof. Jennifer Welch Fall 2008.
Text Chapters 1, 2. Sorting ä Sorting Problem: ä Input: A sequence of n numbers ä Output: A permutation (reordering) of the input sequence such that:
CSCI 3 Introduction to Computer Science. CSCI 3 Course Description: –An overview of the fundamentals of computer science. Topics covered include number.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2002 Lecture 1 (Part 1) Introduction/Overview Tuesday, 9/3/02.
CS3381 Des & Anal of Alg ( SemA) City Univ of HK / Dept of CS / Helena Wong 1. Introduction - 1 Introduction.
1. The Role of the Algorithms in Computer Hsu, Lih-Hsing
Concept of Basic Time Complexity Problem size (Input size) Time complexity analysis.
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 1 Program Design
Text Chapters 1, 2. Sorting ä Sorting Problem: ä Input: A sequence of n numbers ä Output: A permutation (reordering) of the input sequence such that:
The Fundamentals: Algorithms, the Integers & Matrices.
COMP s1 Computing 2 Complexity
1.1 Chapter 1: Introduction What is the course all about? Problems, instances and algorithms Running time v.s. computational complexity General description.
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.
CS223 Algorithms D-Term 2013 Instructor: Mohamed Eltabakh WPI, CS Introduction Slide 1.
CMPS 3223 Theory of Computation Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided.
1 Ethics of Computing MONT 113G, Spring 2012 Session 13 Limits of Computer Science.
Fundamentals of Algorithms MCS - 2 Lecture # 1
Chapter 11 An Introduction to Visual Basic 2008 Why Windows and Why Visual Basic How You Develop a Visual Basic Application The Different Versions of Visual.
Chapter 3 Sec 3.3 With Question/Answer Animations 1.
RESOURCES, TRADE-OFFS, AND LIMITATIONS Group 5 8/27/2014.
ECOE 456/556: Algorithms and Computational Complexity Lecture 1 Serdar Taşıran.
BY Lecturer: Aisha Dawood.  an algorithm is any well-defined computational procedure that takes some value, or set of values, as input and produces.
1. The Role of the Algorithms in Computer Algorithms – 1/2 Algorithm: Any well-defined computation procedure that takes some value, or set of values,
Computer programming.
Analysis of Algorithms CSCI Previous Evaluations of Programs Correctness – does the algorithm do what it is supposed to do? Generality – does it.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
1 Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples: b number of comparisons needed to find the.
1Computer Sciences Department. Book: Introduction to Algorithms, by: Thomas H. Cormen Charles E. Leiserson Ronald L. Rivest Clifford Stein Electronic:
1 CPSC 320: Intermediate Algorithm Design and Analysis July 28, 2014.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
Chapter 11 An Introduction to Visual Basic 2005 Why Windows and Why Visual Basic How You Develop a Visual Basic Application The Different Versions of Visual.
Chapter 10 Algorithm Analysis.  Introduction  Generalizing Running Time  Doing a Timing Analysis  Big-Oh Notation  Analyzing Some Simple Programs.
Chapter Algorithms 3.2 The Growth of Functions 3.3 Complexity of Algorithms 3.4 The Integers and Division 3.5 Primes and Greatest Common Divisors.
New Mexico Computer Science For All Algorithm Analysis Maureen Psaila-Dombrowski.
Umans Complexity Theory Lectures Lecture 1a: Problems and Languages.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
Beauty and Joy of Computing Limits of Computing Ivona Bezáková CS10: UC Berkeley, April 14, 2014 (Slides inspired by Dan Garcia’s slides.)
CSCE 411 Design and Analysis of Algorithms Set 1: Introduction Slides by Prof. Jennifer Welch Spring 2014 CSCE 411, Spring 2013: Set 1 1.
CS404 Design and Analysis of Algorithms BBy DDr. M V S Peri Sastry BB.E, PhD(BITS-Pilani)
Introduction to Algorithms (2 nd edition) by Cormen, Leiserson, Rivest & Stein Chapter 2: Getting Started.
Computer Science Background for Biologists CSC 487/687 Computing for Bioinformatics Fall 2005.
Computer Science/Ch. Algorithmic Foundation of CS 4-1 Chapter 4 Chapter 4 Algorithmic Foundation of Computer Science.
Text Chapters 2 Analyzing Algorithms.  goal: predicting resources that an algorithm requires memory, communication bandwidth, hardware, memory, communication.
Chapter 1. The Role of the Algorithms in Computer.
CES 592 Theory of Software Systems B. Ravikumar (Ravi) Office: 124 Darwin Hall.
 Tower of Hanoi – Link 1 Tower of Hanoi – Link 1  Tower of Hanoi – Link 2 Tower of Hanoi – Link 2.
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
Introduction to Algorithms Book by Thomas H. Cormen Charles E. Leiserson Ronald L. Rivest and Clifford Stein Powerpoint by Michael Block.
Introduction to Algorithms (2 nd edition) by Cormen, Leiserson, Rivest & Stein Chapter 2: Getting Started (slides enhanced by N. Adlai A. DePano)
CSCE 411 Design and Analysis of Algorithms Set 1: Introduction and Review Prof. Jennifer Welch Spring 2012 CSCE 411, Spring 2012: Set 1 1.
1 The Role of Algorithms in Computing. 2 Computational problems A computational problem specifies an input-output relationship  What does the.
Introductory Lecture. What is Discrete Mathematics? Discrete mathematics is the part of mathematics devoted to the study of discrete (as opposed to continuous)
Design and Analysis of Algorithms Faculty Name : Ruhi Fatima Course Description This course provides techniques to prove.
Advanced Algorithms Analysis and Design
Introduction to Algorithms
Introduction to the Design and Analysis of Algorithms
Introduction to Algorithms
Algorithm Analysis CSE 2011 Winter September 2018.
CS 583 Fall 2006 Analysis of Algorithms
Introduction to Algorithms
CSCE 411 Design and Analysis of Algorithms
Definition In simple terms, an algorithm is a series of instructions to solve a problem (complete a task) We focus on Deterministic Algorithms Under the.
Objective of This Course
Introduction to Algorithms
Design and Analysis of Algorithms
Presentation transcript:

Introduction to Algorithms (2 nd edition) by Cormen, Leiserson, Rivest & Stein Chapter 1: The Role of Algorithms in Computing (slides by N. Adlai A. DePano)

Algorithms Informally, an algorithm is … A well-defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values, as output. algorithm input output A sequence of computational steps that transform the input into output.

Algorithms Empirically, an algorithm is … A tool for solving a well-specified computational problem. Problem specification includes what the input is, what the desired output should be. Algorithm describes a specific computational procedure for achieving the desired output for a given input.

Algorithms The Sorting Problem: Input:A sequence of n numbers [a 1, a 2, …, a n ]. Output:A permutation or reordering [a' 1, a' 2, …, a' n ] of the input sequence such that a' 1  a' 2  …  a' n. An instance of the Sorting Problem: Input:A sequence of 6 number [31, 41, 59, 26, 41, 58]. Expected output for given instance: Expected Output:The permutation of the input [26, 31, 41, 41, 58, 59].

Algorithms Some definitions … An algorithm is said to be correct if, for every input instance, it halts with the correct output. A correct algorithm solves the given computational problem. Focus will be on correct algorithms; incorrect algorithms can sometimes be useful. Algorithm specification may be in English, as a computer program, even as a hardware design.

Gallery of Problems The Human Genome Project seeks to identify all the 100,000 genes in human DNA, determining the sequences of the 3 billion chemical base pairs comprising human DNA, storing this information in databases, and developing tools for data analysis. Algorithms are needed (most of which are novel) to solve the many problems listed here … The huge network that is the Internet and the huge amount of data that courses through it require algorithms to efficiently manage and manipulate this data.

Gallery of Problems E-commerce enables goods and services to be negotiated and exchanged electronically. Crucial is the maintenance of privacy and security for all transactions. Traditional manufacturing and commerce require allocation of scarce resources in the most beneficial way. Linear programming algorithms are used extensively in commercial optimization problems.

Some algorithms  Shortest path algorithm Given a weighted graph and two distinguished vertices -- the source and the destination -- compute the most efficient way to get from one to the other  Matrix multiplication algorithm Given a sequence of conformable matrices, compute the most efficient way of forming the product of the matrix sequence

Some algorithms  Convex hull algorithm Given a set of points on the plane, compute the smallest convex body that contains the points  String matching algorithm Given a sequence of characters, compute where (if at all) a second sequence of characters occurs in the first

Hard problems  Usual measure of efficiency is speed How long does an algorithm take to produce its result? Define formally measures of efficiency  Problems exist that, in all probability, will take a long time to solve Exponential complexity NP-complete problems  Problems exist that are unsolvable

Hard problems  NP-complete problems are interesting in and of themselves Some of them arise in real applications Some of them look very similar to problems for which efficient solutions do exist Knowing the difference is crucial  Not known whether NP-complete problems really are as hard as they seem, or, perhaps, the machinery for solving them efficiently has not been developed just yet

Hard problems  P  NP conjecture Fundamental open problem in the theory of computational complexity Open now for 30+ years

Algorithms as a technology  Even if computers were infinitely fast and memory was plentiful and free Study of algorithms still important – still need to establish algorithm correctness Since time and space resources are infinite, any correct algorithm would do  Real-world computers are fast but not infinitely so  Memory is cheap but not unlimited

Efficiency  Time and space efficiency are the goal  Algorithms often differ dramatically in their efficiency Example: Two sorting algorithms  I NSERTION -S ORT – time efficiency is c 1 n 2  M ERGE -S ORT – time efficiency is c 1 nlogn For which problem instances would one algorithm be preferable to the other?

Efficiency Answer depends on several factors:  Speed of machine performing the computation Internal clock speed Shared environment I/O needed by algorithm  Quality of implementation (coding) Compiler optimization Implementation details (e.g., data structures)  Size of problem instance Most stable parameter – used as independent variable

Efficiency  I NSERTION -S ORT Implemented by an ace programmer and run on a machine A that performs 10 9 instructions per second such that time efficiency is given by: t A (n) = 2n 2 instructions (i.e., c 1 =2)  M ERGE -S ORT Implemented by a novice programmer and run on a machine B that performs 10 7 instructions per second such that time efficiency is given by: t B (n) = 50nlogn instructions (i.e., c 1 =50)

Efficiency n2n 2 / nlogn/ , , , , ,000,0002, ,000,00050, ,000,000200, , ,000,0005,000, , Problem Size Machine A Insertion- Sort Machine B Merge- Sort

Efficiency  Graphical comparison

Algorithms vis-à-vis other technologies  Are algorithms really that important in the face of dramatic advances in other technologies? Hardware: super-fast clock speeds, parallelism, pipelining Graphical User Interfaces (GUI) Object Oriented Systems LANs and WANs  YES! Algorithms are at the core of most technologies used in contemporary computation