Computer Science Department

Slides:



Advertisements
Similar presentations
Chapter 2 Revision of Mathematical Notations and Techniques
Advertisements

Recognising Languages We will tackle the problem of defining languages by considering how we could recognise them. Problem: Is there a method of recognising.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
Recursive Definitions and Structural Induction
Review of Mathematical Notation / Terminology
CS 454 Theory of Computation Sonoma State University, Fall 2011 Instructor: B. (Ravi) Ravikumar Office: 116 I Darwin Hall Original slides by Vahid and.
CS 310 – Fall 2006 Pacific University Theoretical Computer Science CS 310 Chadd Williams Office Mon 3:00 – 4:00 PM 202 Strain.
CS5371 Theory of Computation Lecture 1: Mathematics Review I (Basic Terminology)
CS 310 – Fall 2006 Pacific University Theoretical Computer Science CS 310 Chadd Williams Office Mon 10:30-11:30 am 202 Strain.
Costas Busch - RPI1 Mathematical Preliminaries. Costas Busch - RPI2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
CS 454 Theory of Computation Sonoma State University, Fall 2011 Instructor: B. (Ravi) Ravikumar Office: 116 I Darwin Hall Original slides by Vahid and.
Courtesy Costas Busch - RPI1 Mathematical Preliminaries.
Theoretical Computer Science COMP 335 Fall 2004
Induction and recursion
Set theory Sets: Powerful tool in computer science to solve real world problems. A set is a collection of distinct objects called elements. Traditionally,
 2004 SDU Introduction to the Theory of Computation My name: 冯好娣 My office: 计算中心 430
CS355 - Theory of Computation Lecture 2: Mathematical Preliminaries.
Induction and recursion
Introduction Chapter 0. Three Central Areas 1.Automata 2.Computability 3.Complexity.
CSCI 4325 / 6339 Theory of Computation Chapter One Zhixiang Chen Department of Computer Science University of Texas-Pan American.
INTRODUCTION TO THE THEORY OF COMPUTATION INTRODUCTION MICHAEL SIPSER, SECOND EDITION 1.
L ECTURE 1 T HEORY OF C OMPUTATION Yasir Imtiaz Khan.
1 Chapter 1 Introduction to the Theory of Computation.
Mathematical Preliminaries (Hein 1.1 and 1.2) Sets are collections in which order of elements and duplication of elements do not matter. – {1,a,1,1} =
CSCI 2670 Introduction to Theory of Computing Instructor: Shelby Funk.
Mathematical Preliminaries. Sets Functions Relations Graphs Proof Techniques.
Discrete Structure Sets. 2 Set Theory Set: Collection of objects (“elements”) a  A “a is an element of A” “a is a member of A” a  A “a is not an element.
Sets and Sentences Open Sentences Foundations of Real Analysis.
Theory of Computation, Feodor F. Dragan, Kent State University 1 TheoryofComputation Spring, 2015 (Feodor F. Dragan) Department of Computer Science Kent.
ICS 253: Discrete Structures I Induction and Recursion King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Mathematical Preliminaries
THEORY OF COMPUTATION Komate AMPHAWAN 1. 2.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Classifications LanguageGrammarAutomaton Regular, right- linear Right-linear, left-linear DFA, NFA Context-free PDA Context- sensitive LBA Recursively.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 0 Introduction Some slides are in courtesy of Prof.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
Theory of computation Introduction theory of computation: It comprises the fundamental mathematical properties of computer hardware, software,
Chapter 1 INTRODUCTION TO THE THEORY OF COMPUTATION.
Theory of Computation. Introduction We study this course in order to answer the following questions: What are the fundamental capabilities and limitations.
The Relation Induced by a Partition
Chapter 4 Introduction to Set Theory
Foundations of Computing Science
Chapter 2 Sets and Functions.
CHAPTER 3 SETS, BOOLEAN ALGEBRA & LOGIC CIRCUITS
Introduction Chapter 0.
Methods of Proof.
BCS2143 – Theory of Computer Science
Graphs: Definitions and Basic Properties
Introduction to the Theory of Computation
Propositional Calculus: Boolean Functions and Expressions
Set, Combinatorics, Probability & Number Theory
Formal Modeling Concepts
Lecture 1 Theory of Automata
CIS Automata and Formal Languages – Pei Wang
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
Jaya Krishna, M.Tech, Assistant Professor
THEORY OF COMPUTATION Lecture One: Automata Theory Automata Theory.
Lesson 5 Relations, mappings, countable and uncountable sets
Teori Bahasa dan Automata Lecture 1: Course Overview and Introduction
INTRODUCTION TO THE THEORY OF COMPUTATION
Introduction to Finite Automata
Advanced Algorithms Analysis and Design
CSCI-2400 Models of Computation.
Lesson 5 Relations, mappings, countable and uncountable sets
Teori Bahasa dan Automata Lecture 1: Course Overview and Introduction
Introduction Chapter 0.
Chapter 1 Introduction to the Theory of Computation
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
Foundations of Discrete Mathematics
Terminology and Symbols
Presentation transcript:

Computer Science Department Computer Sciences Department Computer Science Department

Reference Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Computer Sciences Department

Objectives AUTOMATA THEORY COMPUTABILITY THEORY COMPLEXITY THEORY MATHEMATICAL NOTIONS AND TERMINOLOGY DEFINITION THEOREM PROOF Computer Sciences Department

AUTOMATA, COMPUTABILITY, AND COMPLEXITY What are the fundamental capabilities and limitations of computers? Computer Sciences Department

AUTOMATA, COMPUTABILITY, AND COMPLEXITY 1930s  the meaning of computation. COMPLEXITY THEORY Computer problems come in different varieties; some are easy, and some are hard. For example: Easy : the sorting problem is an easy one. Hard: Encoding and Decoding Computer Sciences Department

COMPLEXITY THEORY Computer problems come in different varieties; some are easy, and some are hard. For example, the sorting problem is an easy one. For example, scheduling problem is a hard one or (cryptography - because secret codes should be hard to break without the secret key or password.). Computer Sciences Department

What makes some problems computationally hard and others easy? COMPLEXITY THEORY What makes some problems computationally hard and others easy? First, by understanding which aspect of the problem is at the root of the difficulty. Second, you may be able to settle for less than a perfect solution to the problem. Third, some problems are hard only in the worst case situation, but easy most of the time. Finally, you may consider alternative types of computation such as randomized computation, that can speed up certain tasks. Computer Sciences Department

COMPUTABILITY THEORY “problem of determining whether a mathematical statement is true or false” The theories of computability and complexity are closely related. In complexity theory, the objective is to classify problems as easy ones and hard ones. In computability theory the classification of problems is by those that are solvable and those that are not. Computer Sciences Department

AUTOMATA THEORY Automata theory deals with the definitions and properties of mathematical models of computation. Mathematical models: the finite automaton model, is used in text processing, compilers, and hardware design. the context-free grammar model, is used in programming languages and artificial intelligence. Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY SETS: A set is a group of objects represented as a unit. (any type of object, including numbers, symbols, and even other sets) The objects in a set are called its elements or members. {7, 21, 57} – the set contains the elements 7, 21, and 57. - The symbols denote set membership and nonmembership. - A is a subset of B, written if every member of A also is a member of B. A is a proper subset of B, written , if A is a subset of B and not equal to B. Ex.: The set {1, 2} is a proper subset of {1, 2, 3}. Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY - multiset - ? - infinite set - ? - The set of natural numbers N is written {1,2,3,...}. - The set of integers Z is written {... ,-2,-1,0,1,2,…}. - The set with 0 members is called the empty set and is written Ø. Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY SEQUENCES AND TUPLES A sequence of objects is a list of these objects in some order. For example, the sequence 7, 21, 57 would be written (7, 21, 57). In a set the order doesn't matter, but in a sequence it does. Hence (7,21, 57) is not the same as (57, 7, 21). Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY Sequences may be finite or infinite. Finite sequences often are called tuples. A sequence with k elements is a k-tuple. For example, (7,21, 57) is a 3 -tuple. A 2-tuple is also called a pair. Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY Sets and sequences may appear as elements of other sets and sequences. For example, the power set of A is the set of all subsets of A. If A is the set {0, 1}, the power set of A is the set {Ø, {0}, {1}, {0, 1} }. The set of all pairs whose elements are 0s and 1s is { (0, 0), (0,1), (1, 0), (1,1) }. Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY If A and B are two sets, the Cartesian product or cross product of A and B, written A x B, is the set of all pairs wherein the first element is a member of A and the second element is a member of B. EXAMPLE: If A = {1, 2} and B {x, y, z}, A x B { (1, x), (1, y), (1, z), (2, x), (2, y), (2, z) }. Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY FUNCTIONS AND RELATIONS A function is an object that sets up an input-output relationship. A function takes an input and produces an output. f(a) = b If f is a function whose output value is b when the input value is a. Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY A function also is called a mapping, and, if f (a) = b, we say that f maps a to b. For example, the absolute value function abs takes a number x as input and returns x: if x is positive or negative. abs(2) = abs(-2) = 2. Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY The set of possible inputs to the function is called its domain. The outputs of a function come from a set called its range. The notation for saying that f is a function with domain D and range R is f: DR function abs: Z Z. Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY Example: This function adds 1 to its input and then outputs the result modulo 5. A number modulo m is the remainder after division by m. Consider the functions: {0,1, 2, 3, 4} {O, 1, 2, 3, 4}. n f (n) 1 2 3 4 Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY Example: The function g is the addition function modulo 4. for some sets A1, ... Ak, the input to f is a k-tuple (a1, a2 , ... , ak) and we call the ai the arguments to f. A function with k arguments is called a k-ary function, and k is called the arity of the function. If k is 1, f has a single argument and f is called a unary function. If k is 2, f is a binary function. Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY infix notation - usually is written in infix notation with the + symbol between its two arguments. a + b prefix notation add(a, b). Or + a b postfix notation a b + An example of such a function notation would be S(1,3) in which the function S denotes addition: S(1,3) = 1+3 = 4. A predicate or property is a function whose range is {TRUE, FALSE}. Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY A property whose domain is a set of k-tuples A x …. x A is called a relation. S = {a є D I P(a) = TRUE} ??? equivalence relation??? Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY GRAPHS An undirected graph, or simply a graph, is a set of points with lines connecting some of the points. The points are called nodes or vertices, and the lines are called edges. The number of edges at a particular node is the degree of that node. Graphs frequently are used to represent data. (labeled graph) Subgraph – subset of the set(s) formal description ({1, 2, 3, 4, 5}, {(1, 2), (2, 3), (3, 4), (4, 5), (5, 1)}) formal description ??? Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY A path in a graph is a sequence of nodes connected by edges. A simple path is a path that doesn't repeat any nodes. A graph is connected if every two nodes have a path between them. A path is a cycle if it starts and ends in the same node. A simple cycle is one that contains at least three nodes and repeats only the first and last nodes. A graph is a tree if it is connected and has no simple cycles. A tree may contain a specially designated node called the root. The nodes of degree =>1 in a tree, other than the root, are called the leaves of the tree. A terminal vertex of a tree is a vertex of degree 1. In a rooted tree, the leaves are all terminal vertices. A leaf is a vertex of degree 1. An internal vertex is a vertex of degree at least 2. Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY directed graph - If it has arrows instead of lines. The number of arrows pointing from a particular node is the outdegree of that node, and the number of arrows pointing to a particular node is the indegree. The formal description of the graph is ({1,2,3,4,5,6}, {(1,2), (1,5), (2,1), (2,4), (5,4), (5,6), (6,1), (6,3)}). Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY STRINGS AND LANGUAGES “A language is a set of strings” An alphabet is any nonempty finite set. - The members of the alphabet are the symbols of the alphabet. - We generally use capital Greek letters ∑ and Γ to designate alphabets and a typewriter font for symbols from an alphabet. Examples of alphabets: ∑1 = {0,1}; ∑2 ={a,b,c,d,e,f,g.hij,k,lm,n,o,p,q,r,s,t,u,v,w,x,y,z}; Γ = {0,1,x,y,z}. Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY A string over an alphabet is a finite sequence of symbols from that alphabet, usually written next to one another and not separated by commas. If ∑1 = {0,1}, then 01001 is a string over ∑1. If ω is a string over ∑, the length of ω , written Iωl, is the number of symbols that it contains. The string of length zero is called the empty string and is written ε (The empty string (often written as lowercase epsilon ε) is the string of length zero) The reverse of ω , written ωR, is the string obtained by writing ω in the opposite order. Thus the lexicographic ordering of all strings over the alphabet {0,1} is (ε, O, 1, 00, 01, 10, 11,000,. .. ). Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY BOOLEAN LOGIC Boolean logic is a mathematical system built around the two values TRUE and FALSE. The values TRUE and FALSE are called the Boolean values and are often represented by the values 1 and 0. Boolean operations: negation or NOT (¬), conjunction, or AND (Λ), disjunction or OR (v) Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY Example, if P is the Boolean value representing the truth of the statement "the sun is shining" and Q represents the truth of the statement "today is Monday", we may write P Λ Q to represent the truth value of the statement "the sun is shining and today is Monday“ The exclusive or, or XOR, operation is designated by the Φ symbol and is 1 if either but not both of its two operands are 1. The equality operation, written with the symbol ↔, is 1 if both of its operands have the same value. Finally, the implication operation is designated by the symbol → and is 0 if its first operand is 1 and its second operand is 0; otherwise → is 1. Computer Sciences Department

MATHEMATICAL NOTIONS AND TERMINOLOGY Computer Sciences Department

SUMMARY OF MATHEMATICAL TERMS Very important SUMMARY OF MATHEMATICAL TERMS Computer Sciences Department

DEFINITIONS, THEOREMS, AND PROOFS Definitions describe the objects and notions that we use. A proof is a convincing logical argument that a statement is true. A theorem is a mathematical statement proved true. Computer Sciences Department

FINDING PROOFS The only way to determine the truth or falsity of a mathematical statement is with a mathematical proof. Unfortunately, finding proofs isn't always easy. It can't be reduced to a simple set of rules or processes. Computer Sciences Department

THEOREM 0.20 Computer Sciences Department

THEOREM 0.21 Note: The number of edges at a particular node is the degree of that node. Computer Sciences Department

EXAM PLE 0.19 Computer Sciences Department

The Student should try to explicate Computer Sciences Department

TYPES OF PROOF PROOF BY CONSTRUCTION: One way to prove such a theorem is by demonstrating how to construct the object. PROOF BY CONTRADICTION: assume that the theorem is false and then show that this assumption leads to an obviously false consequence, called a contradiction. PROOF BY INDUCTION: Proof by induction is an advanced method used to show that all elements of an infinite set have a specified property. Computer Sciences Department

Self study THEOREM 0.22 + proof THEOREM 0.24 + proof Computer Sciences Department