Brian Mitchell - Drexel University MCS680-FCS 1 Brian Mitchell

Slides:



Advertisements
Similar presentations
MATH 224 – Discrete Mathematics
Advertisements

5/19/2015CS 2011 CS 201 – Data Structures and Discrete Mathematics I Syllabus Spring 2014.
Cpt S 122 – Data Structures Course Introduction
CS 46101–600/CS Design and Analysis of Algorithms Dr. Angela Guercio Spring 2010.
CS 581: Introduction to the Theory of Computation Lecture 1 James Hook Portland State University
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2001 Lecture 1 (Part 1) Introduction/Overview Tuesday, 9/4/01.
CS421 - Course Information Website Syllabus Schedule The Book:
Complexity Analysis (Part I)
General information CSE 230 : Introduction to Software Engineering
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2002 Lecture 1 (Part 1) Introduction/Overview Tuesday, 9/3/02.
Welcome to MAT 170. Basic Course Information Instructor Office Office Hours Beth Jones PSA 725 Tuesday and Thursday 8 am – 8:30 am Tuesday and Thursday.
Overview Discrete Mathematics and Its Applications Baojian Hua
CSC 171 – FALL 2004 COMPUTER PROGRAMMING LECTURE 0 ADMINISTRATION.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2004 Lecture 1 (Part 1) Introduction/Overview Wednesday, 9/8/04.
COMP 110 Introduction to Programming Mr. Joshua Stough August 22, 2007 Monday/Wednesday/Friday 3:00-4:15 Gardner Hall 307.
CS 581: Introduction to the Theory of Computation Lecture 1 James Hook Portland State University
COMP 151: Computer Programming II Spring Course Topics Review of Java and basics of software engineering (3 classes. Chapters 1 and 2) Recursion.
WEEK 1 CS 361: ADVANCED DATA STRUCTURES AND ALGORITHMS Dong Si Dept. of Computer Science 1.
© 2004 Goodrich, Tamassia CS2210 Data Structures and Algorithms Lecture 1: Course Overview Instructor: Olga Veksler.
CS223 Algorithms D-Term 2013 Instructor: Mohamed Eltabakh WPI, CS Introduction Slide 1.
Week 2 CS 361: Advanced Data Structures and Algorithms
Syllabus and Class Policies MATH 130: Summer 2014.
CPS120: Introduction to Computer Science Fall: 2002 Instructor: Paul J. Millis.
Object Oriented Programming (OOP) Design Lecture 1 : Course Overview Bong-Soo Sohn Assistant Professor School of Computer Science and Engineering Chung-Ang.
ITEC 2620A Introduction to Data Structures
CST 229 Introduction to Grammars Dr. Sherry Yang Room 213 (503)
Introduction to Discrete Mathematics J. H. Wang Sep. 14, 2010.
CS 390 Introduction to Theoretical Computer Science.
CSCI 51 Introduction to Computer Science Dr. Joshua Stough January 20, 2009.
Bilgisayar Mühendisliği Bölümü CENG 102 – Computer Programming Melek OKTAY Syllabus Administrative Information.
Discrete Mathematics CS204 Spring CS204 Discrete Mathematics Instructor: Professor Chin-Wan Chung (Office: Rm 3406, Tel:3537) 1.Lecture 1)Time:
CSE 2320 Algorithms and Data Structures Dimitrios Kosmopoulos Introduction.
Week 12 - Wednesday.  What did we talk about last time?  Asymptotic notation.
ICS102: Introduction To Computing King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Course Introduction.
1 Dr. J. Michael Moore Data Structures and Algorithms CSCE 221 Adapted from slides provided with the textbook, Nancy Amato, and Scott Schaefer.
Principles of Computer Science I Honors Section Note Set 1 CSE 1341 – H 1.
Object Oriented Programming (OOP) Design Lecture 1 : Course Overview Bong-Soo Sohn Associate Professor School of Computer Science and Engineering Chung-Ang.
CPS120: Introduction to Computer Science Winter 2002 Instructor: Paul J. Millis.
Introduction to ECE 2401 Data Structure Fall 2005 Chapter 0 Chen, Chang-Sheng
Welcome to CIS 2168 ! Data Structures and Algorithms
Algorithm Analysis CS 400/600 – Data Structures. Algorithm Analysis2 Abstract Data Types Abstract Data Type (ADT): a definition for a data type solely.
Data Structures and Algorithm Analysis Introduction Lecturer: Ligang Dong, egan Tel: , Office: SIEE Building.
Brian Mitchell - Drexel University MCS680-FCS 1 Patterns, Automata & Regular Expressions int MSTWeight(int graph[][], int size)
CMSC 2021 CMSC 202 Computer Science II for Majors Spring 2002 Sections Ms. Susan Mitchell.
CMSC 2021 CMSC 202 Computer Science II for Majors Spring 2001 Sections Ms. Susan Mitchell.
Design and Analysis of Algorithms (09 Credits / 5 hours per week) Sixth Semester: Computer Science & Engineering M.B.Chandak
1 CS 381 Introduction to Discrete Structures Lecture #1 Syllabus Week 1.
Course Info Instructor U.T. Nguyen Office: CSEB Office hours: Tuesday, 14:30-15:30 Thursday, 12:00-12:45 By.
COP4020 INTRODUCTION FALL COURSE DESCRIPTION Programming Languages introduces the fundamentals of the design and implementation of programming languages.
Why do we study algorithms?. 2 First results are about bats and dolphins.
CSE 3358 NOTE SET 2 Data Structures and Algorithms 1.
CENG 707 Data Structures and Algorithms
Lecture 1 (Part 1) Introduction/Overview Tuesday, 9/9/08
Applied Discrete Mathematics Week 2: Functions and Sequences
COMP 283 Discrete Structures
Lecture 1 Introduction/Overview Text: Chapters 1, 2 Wed. 1/28/04
CPSC 311 Section 502 Analysis of Algorithm
Principles of Computing – UFCFA Lecture-1
CS 583 Fall 2006 Analysis of Algorithms
CS 201 – Data Structures and Discrete Mathematics I
CS 201 – Data Structures and Discrete Mathematics I
Foundations II: Data Structures and Algorithms
CMPT 438 Algorithms Instructor: Tina Tian.
ITEC 2620M Introduction to Data Structures
26 July 2011 SC 611 Class 1.
MCS680: Foundations Of Computer Science
Principles of Computing – UFCFA Week 1
Design and Analysis of Algorithms
COMP 122 – Design and Analysis of Algorithms
Presentation transcript:

Brian Mitchell - Drexel University MCS680-FCS 1 Brian Mitchell Drexel University Fall 1997 MCS680: Foundations Of Computer Science int MSTWeight(int graph[][], int size) { int i,j; int weight = 0; for(i=0; i<size; i++) for(j=0; j<size; j++) weight+= graph[i][j]; return weight; } 1111 n n O(1) O(n) Running Time = 2O(1) + O(n 2 ) = O(n 2 )

Brian Mitchell - Drexel University MCS680-FCS 2 Introduction Instructor Brian Mitchell - “Brian” (215) Course Information Foundations of Computer Science (FCS) MCS 680 Section 510 Wednesday 6:00 - 9:00 PM Room Location: Curtis 250A Office Hours By Appointment Online Information Please check course web page several times per week. The web page will be my primary mechanism for communicating: Special and Emergency Information Syllabus Assignments Solutions to Problems

Brian Mitchell - Drexel University MCS680-FCS 3 Introduction Course Objective –To provide a solid background in the theoretical and mathematical aspects of Computer Science Provide essential background knowledge that is required for success in other core computer science graduate courses Textbook A.V.Aho, J.D.Ullman, Foundations of Computer Science, W.H. Freeman and Co., Additional References H.R. Lewis, C.H. Papadimitriou, Elements Of The Theory Of Computation, Prentice Hall, T.H. Cormen, C.E. Leiserson & R.L. Rivest, Introduction To Algorithms, McGraw Hill, 1996.

Brian Mitchell - Drexel University MCS680-FCS 4 Introduction Homework, Exams Assignments & Programming Projects: Homework sets consisting of 4-5 problems will be regularly assigned (consult web page). Based on difficulty, you will have 1-2 weeks to complete each assignment. Some assignments might require you to write a small program or a program fragment. For this course you may develop programming solutions using the ‘C’, ‘C++’ or Java programming languages Midterm: A 90 minute midterm exam will be given during the 5th or 6th week of the course. Final: A 2 hour final exam will be given during our regularly scheduled class time on finals week.

Brian Mitchell - Drexel University MCS680-FCS 5 Introduction Grading –The following distribution will be used to determine your final grade in this course: 50%: Homework & Programming Projects 20%: Midterm Exam 30%: Final Exam Policies –All homework and programming assignments are individual efforts, unless specifically stated otherwise in the assignment definition. You may use your colleagues for advice, however, all assignments must be your original work –Late assignments will be penalized 10% per week. Any assignment not submitted within 2 weeks of the deadline will not be accepted unless you work out special arrangements with me.

Brian Mitchell - Drexel University MCS680-FCS 6 Introduction Tentative List Of Topics –Summation and Logarithm Review –Ineration, Induction & Recursion –Big-Oh Analysis –Running Time –Recurrence Relations –Trees (Mathematical Aspects & Algorithms) –Sets –Graph Theory & Graph Algorithms –Relations –Automata –Regular Expressions –Context Free Grammars –Propositional Logic –Predicate Logic

Brian Mitchell - Drexel University MCS680-FCS 7 Summations Algorithms often contain an interative control construct –Loops (while, for, do…while) –Algorithm analysis can be performed by examining the sum of the times spent on each execution of the loop –Example: What is the value of i?  n j=1 j = 1+2+…+(n-1)+n int i; for (i=1; i<=n; i++) { i += i; }

Brian Mitchell - Drexel University MCS680-FCS 8 Summations Properties of sums ajaj =  n j=1 ajaj   j=1 lim n  If the limit does not exist, the sum diverges; otherwise, it converges.  n j=1 ca j + db j =  n j=1 ajaj c+ dbjbj  n j=1 Summations obey the linearity property

Brian Mitchell - Drexel University MCS680-FCS 9 Common Summations  n j=1 j = n(n+1) 2  n j=0 x j = x n x-1  n j=1 a j - a j-1 = a n - a 0  n-1 j=0 a j - a j+1 = a 0 - a n  n j=1 c = n c

Brian Mitchell - Drexel University MCS680-FCS 10 Summation Example Consider: int foo(int n) { int i,j,k; for (i=1; i<=n; i++) for(j=1; j<=n; j++) k += i + j; } How much time is spent performing the addition operations in the above code fragment if an add operation takes 2 clock cycles on a Pentium 120Mhz microprocessor?  n i=1  n j=1 addOps =  n addOps n i=1 = n 2 addOps On a 120Mhz microprocessor each clock cycle takes ns. (10 -9 seconds). Thus the total amount of time the code fragement spends adding is: = n 2 ( E-9) = n 2 ns.

Brian Mitchell - Drexel University MCS680-FCS 11 Summation Example- Results

Brian Mitchell - Drexel University MCS680-FCS 12 Summation Example int foo(int n) { int i,j,k; for (i=1; i<=n; i++) for(j=1; j<=n; j++) k += (i + j); } What is the value of k?

Brian Mitchell - Drexel University MCS680-FCS 13 Summation Example int foo(int n) { int i,j,k; for (i=1; i<=n; i++) for(j=1; j<=i; j++) k += (i + j); } What is the value of k?

Brian Mitchell - Drexel University MCS680-FCS 14 Logarithms Logarithms appear often during the analysis of algorithms –General form: log b x b is the base of the logarithm if b is not specified then 10 is assumed –Definition: The logarithm to the base b of x represents the power to which b must be raised to produce x –Examples:log 2 8 = 3 (since 2 3 = 8) log 3 81 = 4 (since 3 4 = 81) log 10 1 = 0 (since 10 0 = 1) –During the analysis of algorithms, log 2 x appears often We will use lg x to represent log 2 x

Brian Mitchell - Drexel University MCS680-FCS 15 Logarithms Notation –lg n = log 2 n = (log n / log 2) –ln n = log e n Identities –log b 1 = 0 –log b k n = (log b n) k –log b log b n = log b (log b n) –log b (a/c) = log b a - log b c –log b n = (1/ log n b) –log c n = (log arb n / log arb c) - c is any base –log b (1/n) = - log b n –log b n r = r log b n –log b nj = log b n + log b j –a = b log b a –a log b n = n log b a

Brian Mitchell - Drexel University MCS680-FCS 16 Logarithms Logarithmic algorithms grow slowly with respect to the amount of input data: –Bubble sort growth  n 2 –Quick sort growth  n lg n

Brian Mitchell - Drexel University MCS680-FCS 17 Data Models, Data Structures & Algorithms Data Models –Abstractions used to formulate problems –Any mathematical concept can be treated as a data model Values that the data objects can assume Operations on the data –Programming languages (‘C/C++’, Pascal, Java...) support primitive data models Integers, floating point, strings, chars,... Operations: +, -, /, *, %,, =, ==... However there are other important data models –Sets, graphs, trees, expressions –These data models are mathematically understood, however, most programming languages do not provide intrinsic support

Brian Mitchell - Drexel University MCS680-FCS 18 Data Models, Data Structures & Algorithms Data Structures Most programming languages do not directly support important data models –Must represent the needed data model by using abstractions that are supported by the language Data structures are methods for representing a data model in a programming language Consider the following weighted and directed graph: A B C D

Brian Mitchell - Drexel University MCS680-FCS 19 Data Structures A B C D This graph can be represented in a table: ABCDABCD A0001A0001 B4000B4000 C3200C3200 D0600D A table can be represented in a computer language as a two-dimensional array: int graph[4][4];... graph[0][1] = 4; graph[0][2] = 3; graph[1][2] = 2; graph[1][3] = 6; graph[3][0] = 1;

Brian Mitchell - Drexel University MCS680-FCS 20 Algorithms Precise an unambiguous specification of a sequence of steps that can be carried out automatically In Computer Science, algorithms are expressed using programming languages Consider an algorithm for calculating the total weight of a graph. –Our data structure is a two-dimensional graph int GraphWeight(int graph[][], int size) { int i,j,weight; weight = 0; for(i=0; i<size; i++) for(j=0; j<size; j++) weight+= graph[i][j]; return weight; }

Brian Mitchell - Drexel University MCS680-FCS 21 Running Times Of Algorithms Desire to analyze algorithm running time Used to determine how “good” an algorithm performs –Inputs of various sizes –Best Case –Worst Case –Average Case –Bounding Performance We use “Big-Oh” analysis to model running time (also known as execution complexity) –O(n) –O(n 2 ) –O(2 n ) –O(n log n) –O(n lg n)