MA/CSSE 474 Theory of Computation Functions, Closure, Decision Problems.

Slides:



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

Formal Languages Languages: English, Spanish,... PASCAL, C,... Problem: How do we define a language? i.e. what sentences belong to a language? e.g.Large.
Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
CSCI 2670 Introduction to Theory of Computing October 19, 2005.
1 Lecture 4: Formal Definition of Solvability Analysis of decision problems –Two types of inputs:yes inputs and no inputs –Language recognition problem.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
Sets Definition of a Set: NAME = {list of elements or description of elements} i.e. B = {1,2,3} or C = {x  Z + | -4 < x < 4} Axiom of Extension: A set.
Discrete Mathematics Lecture 7 Alexander Bukharovich New York University.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
Costas Busch - RPI1 Mathematical Preliminaries. Costas Busch - RPI2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
Courtesy Costas Busch - RPI1 Mathematical Preliminaries.
1 Module 4: Formal Definition of Solvability Analysis of decision problems –Two types of inputs:yes inputs and no inputs –Language recognition problem.
Theoretical Computer Science COMP 335 Fall 2004
Lecture 1 String and Language. String string is a finite sequence of symbols. For example, string ( s, t, r, i, n, g) CS4384 ( C, S, 4, 3, 8) (1,
Relations Chapter 9.
Week 8 - Wednesday.  What did we talk about last time?  Cardinality  Countability  Relations.
Chapter 7 Functions Dr. Curry Guinn. Outline of Today Section 7.1: Functions Defined on General Sets Section 7.2: One-to-One and Onto Section 7.3: The.
1 Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Mathematical Tools and Techniques.
CSCI 4325 / 6339 Theory of Computation Chapter One Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Formal Methods in SE Theory of Automata Qasiar Javaid Assistant Professor Lecture # 06.
Mathematical Preliminaries Strings and Languages Preliminaries 1.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
1 Language Definitions Lecture # 2. Defining Languages The languages can be defined in different ways, such as Descriptive definition, Recursive definition,
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} =
Mathematical Preliminaries. Sets Functions Relations Graphs Proof Techniques.
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
MA/CSSE 474 Theory of Computation Decision Problems DFSMs.
MA/CSSE 474 Theory of Computation Regular Expressions Intro.
Relations, Functions, and Countability
Language: Set of Strings
Languages and Strings Chapter 2. (1) Lexical analysis: Scan the program and break it up into variable names, numbers, etc. (2) Parsing: Create a tree.
Strings and Languages CS 130: Theory of Computation HMU textbook, Chapter 1 (Sec 1.5)
Discrete Mathematics R. Johnsonbaugh
Why Study the Theory of Computation? Implementations come and go. Chapter 1.
COMPSCI 102 Introduction to Discrete Mathematics.
ELEMENTARY SET THEORY.
Mathematical Preliminaries
Sets 2/10/121. What is a Set? Informally, a collection of objects, determined by its members, treated as a single mathematical object Not a real definition:
Discrete Mathematics Lecture # 15 Types of Relations (contd.)
Math 344 Winter 07 Group Theory Part 2: Subgroups and Isomorphism
Introduction to Real Analysis Dr. Weihu Hong Clayton State University 8/27/2009.
Basic Structures: Sets, Functions, Sequences, and Sums.
Cardinality with Applications to Computability Lecture 33 Section 7.5 Wed, Apr 12, 2006.
Sets Definition: A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a.
Great Theoretical Ideas in Computer Science.
Languages and Strings Chapter 2.
1 Mathematical Preliminaries. 2 Sets Functions Relations Graphs Proof Techniques.
Strings and Languages Denning, Section 2.7. Alphabet An alphabet V is a finite nonempty set of symbols. Each symbol is a non- divisible or atomic object.
Discrete Structures Li Tak Sing( 李德成 ) mt263f ppt 1.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Week 8 - Monday.  What did we talk about last time?  Properties of functions  One-to-one  Onto  Inverses  Cardinality.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
1 Recursive Definitions and Structural Induction CS/APMA 202 Rosen section 3.4 Aaron Bloomfield.
“It is impossible to define every concept.” For example a “set” can not be defined. But Here are a list of things we shall simply assume about sets. A.
MA/CSSE 474 Theory of Computation How many regular/non-regular languages are there? Closure properties of Regular Languages (if there is time) Pumping.
MA/CSSE 474 Theory of Computation Languages, prefixes, sets, cardinality, functions.
MA/CSSE 474 Theory of Computation Decision Problems, Continued DFSMs.
Languages and Strings Chapter 2. (1) Lexical analysis: Scan the program and break it up into variable names, numbers, etc. (2) Parsing: Create a tree.
MA/CSSE 474 Theory of Computation Regular Expressions Intro.
CSCI 2670 Introduction to Theory of Computing
Languages, prefixes, sets, cardinality, functions
Assume that p, q, and r are in
Mathematical Preliminaries Strings and Languages
MA/CSSE 474 Theory of Computation
Languages, prefixes, sets, cardinality, functions
Chapter 1 Introduction to the Theory of Computation
CSCI 2670 Introduction to Theory of Computing
MA/CSSE 474 Theory of Computation
Presentation transcript:

MA/CSSE 474 Theory of Computation Functions, Closure, Decision Problems

Your Questions? Syllabus Yesterday's discussion Reading Assignments HW1 or HW2 Anything else Must not be a FSM

Responses to Reading Quiz 1 From #4: ℘ ( ∅ ) = { ∅ } (not ℘ ( ∅ ) = ∅ ) What is ℘ ( ℘ ( ∅ ))? From #4: {a, b} X {1, 2, 3} X ∅ = ∅ #10: (representing {1, 4, 9, 16, 25, 36, …} in the form: {x  A : P(x)} {x ∊ ℕ : x>0 ∧ ∃ y ∊ℕ (y*y = x)} Why not {x ∊ ℕ : x>0 ∧ sqrt(x) ∊ ℕ } ? From #15:  x  ℕ (  y  ℕ (y < x)). Why is this not satisfiable? (e, g, by x=3, y=2)

Responses to Reading Quiz 1 #16: Let ℕ be the set of nonnegative integers. Let A be the set of nonnegative integers x such that x  3 0. Show that | ℕ | = |A|. Define a function f : ℕ →A by f(n) = 3n. f is one-to-one: if f(n) = f(m), then 3n = 3m, so m=n. f is onto: Let k ∊ A. Then k = 3m for some m ∊ ℕ. So k = f(m).

Responses to Reading Quiz 1 #18: Prove by induction:  n>0 (n!  2 n-1 ). Why is the following "proof" of the induction step shaky at best, perhaps wrong? (n+1)!  2 n what we're trying to show (n+1)n!  2(2 n-1 ) definitions of ! And exponents ( n+1 )  2 induction hypothesis (n!  2 n-1 ) Since n is at least 1, this statement is true, therefore (n+1)!  2 n is true.

Relations on Strings: aaa is a substring of aaabbbaaa aaaaaa is not a substring of aaabbbaaa aaa is a proper substring of aaabbbaaa Every string is a substring of itself.  is a substring of every string. s is a prefix of t iff:  x   * (t = sx). s is a proper prefix of t iff: s is a prefix of t and s  t. Examples: The prefixes of abba are: , a, ab, abb, abba. The proper prefixes of abba are: , a, ab, abb. Every string is a prefix of itself.  is a prefix of every string. s is a suffix of t iff:  x   * (t = xs) then continue as above: proper suffix, self, 

Defining a Language A language is a (finite or infinite) set of strings over a finite alphabet . Examples: Let  = { a, b } Some languages over  : , {  }, { a, b }, { , a, aa, aaa, aaaa, aaaaa } If  is nonempty, the language  * contains an infinite number of strings, including: , a, b, ab, ababaa.

Example Language Definitions 1. L = {x  { a, b }* : all a ’s precede all b ’s} , a, aa, aabbb, and bb are in L. aba, ba, and abc are not in L. 2. L = {x :  y  { a, b }* : x = y a } Simple English description: 3. L = {x#y: x, y  { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }* and, when x and y are viewed as the decimal representations of natural numbers, square(x) = y}. Examples: 3#9, 12#144, 3#8, 12, 12#12#12, # 4.L = { a n : n  0} uses replication, simpler description of L? 5.L = Ø = { } 6.L = {ε} Are the last two different languages?

Natural Languages are Tricky L = {w: w is a sentence in English}. Examples: Kerry hit the ball. Colorless green ideas sleep furiously. The window needs fixed. Ball the Stacy hit blue.

A Halting Problem Language L = {w: w is a Java program that, when given any finite input string, is guaranteed to halt}. Is this language well specified? Can we decide which strings L contains?

Languages and Prefixes What are the following languages: L = {w  { a, b }*: no prefix of w contains b } L = {w  { a, b }*: no prefix of w starts with a } L = {w  { a, b }*: every prefix of w starts with a }

Sets and Relations

Cardinality of a set. a natural number (if S is finite), “countably infinite” (if S has the same number of elements as there are integers), or “uncountably infinite” (if S has more elements than there are integers). The cardinality of every set we will consider is one of the following :

Sets of Sets The power set of S is the set of all subsets of S. Let S = {1, 2, 3}. Then: P (S) = { , {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}}.   P(S) is a partition of a set S iff: Every element of  is nonempty, Every pair of elements of  is disjoint, and the union of all the elements of  equals S. Some partitions of S: {{1}, {2, 3}} or {{1, 3}, {2}} or {{1, 2, 3}}. How many different partitions of S?

Closure A set S is closed under binary operation op iff  x,y  S ( x op y  S), closed under unary function f iff  x  S (f(x)  S) Examples ℕ + (the set of all positive integers) is closed under addition and multiplication but not negation, subtraction, or division. What is the closure of N+ under subtraction? Under division? The set of all finite sets is closed under union and intersection. Closed under infinite union? If S is not closed under unary function f, a closure of S is a set S' such that a)S is a subset of S' b)S' is closed under f c)No proper subset of S' contains S and is closed under f

Equivalence Relations A relation on a set A is any set of ordered pairs of elements of A. A relation R  A  A is an equivalence relation iff it is: reflexive, symmetric, and transitive. Examples of equivalence relations: Equality Lives-at-Same-Address-As Same-Length-As Contains the same number of a's as Show that ≡ ₃ is an equivalence relation