Assume that p, q, and r are in

Slides:



Advertisements
Similar presentations
CS2303-THEORY OF COMPUTATION Closure Properties of Regular Languages
Advertisements

COMP-421 Compiler Design Presented by Dr Ioanna Dionysiou.
YES-NO machines Finite State Automata as language recognizers.
1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Languages.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
CS 310 – Fall 2006 Pacific University CS310 Strings, String Operators, and Languages Sections: August 30, 2006.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
1 Languages and Finite Automata or how to talk to machines...
CS5371 Theory of Computation Lecture 1: Mathematics Review I (Basic Terminology)
Fall 2006Costas Busch - RPI1 Languages. Fall 2006Costas Busch - RPI2 Language: a set of strings String: a sequence of symbols from some alphabet Example:
1 Regular Expressions/Languages Regular languages –Inductive definitions –Regular expressions syntax semantics Not covered in lecture.
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,
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
Introduction to CS Theory Lecture 1 – Introduction Piotr Faliszewski
Chapter 2 Languages.
1 Proof of the Day: Let P= {(b, acbb), (aac, a), (b, ca)}. 1.Prove that P has a match. 2. Find Q which is P encoded in binary. 3.What match of Q corresponds.
CSC312 Automata Theory Lecture # 2 Languages.
CSC312 Automata Theory Lecture # 2 Languages.
Costas Busch - LSU1 Languages. Costas Busch - LSU2 Language: a set of strings String: a sequence of symbols from some alphabet Example: Strings: cat,
Formal Methods in SE Theory of Automata Qasiar Javaid Assistant Professor Lecture # 06.
Lecture Two: Formal Languages Formal Languages, Lecture 2, slide 1 Amjad Ali.
1 Strings and Languages. 2 Review Sets and sequences Functions and relations Graphs Boolean logic:      Proof techniques: – Construction, Contradiction,
CMSC 330: Organization of Programming Languages Theory of Regular Expressions.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
MA/CSSE 474 Theory of Computation Functions, Closure, Decision Problems.
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} =
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2006.
1 State SymbolRead- Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
1 Exercise: Prove that the set S = { π : π is a permutation of {1, 2, 3, …, n} for some integer n ≥ 1 } is countable.
1 Assignment #1 is due on Friday. Any questions?.
1 Module 14 Regular languages –Inductive definitions –Regular expressions syntax semantics.
MA/CSSE 474 Theory of Computation Regular Expressions Intro.
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)
1 String v is a prefix of w if w= v y for some string y. String v is a suffix of w if w= x v for some string x. String v is a substring of w if there are.
1 Problem of the Day: Describe using set descriptor notation the complements of (a) { , a, aa, aaa} over ∑ = {a} (b) { , a, aa, aaa} over ∑ = {a,b} (c)
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2010.
Recursive Definations Regular Expressions Ch # 4 by Cohen
Lecture 2 Overview Topics What I forgot from last lecture Proof techniques continued Alphabets, strings, languages Automata June 2, 2015 CSCE 355 Foundations.
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.
1 Proof of the Day: Some students claimed to prove that 2 k = 2 k+1 – 1. Try to prove by induction that: 2 k = 2 k+1 – 1. Where does the proof go off-track?
P Symbol Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
1 Let S = { π : π is a permutation of {1, 2, 3, …, n} for some integer n ≥ 1 }. (a) List the elements of S for n= 1, 2, and 3. (b) Prove that the set S.
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.
1 Proof of the Day: The length of a string is the number of symbols it contains. For example, the length of is five. Let L = { w such that w is a.
Chapter 1 INTRODUCTION TO THE THEORY OF COMPUTATION.
Alphabet, String, Language. 2 Alphabet and Strings An alphabet is a finite, non-empty set of symbols. –Denoted by  –{ 0, 1 } is a binary alphabet. –{
CSCI 2670 Introduction to Theory of Computing
Regular Languages, Regular Operations, Closure
Languages.
Languages Prof. Busch - LSU.
Languages Costas Busch - LSU.
Formal Language & Automata Theory
Languages, prefixes, sets, cardinality, functions
CSC 320: Fall 2009 Dr. Wendy Myrvold ECS 552
Closure Properties of Regular Languages
CS 250, Discrete Structures, Fall 2015 Nitesh Saxena
Languages, prefixes, sets, cardinality, functions
Convert to a DFA: Start state: Final States: State Symbol Read- Q E(Q)
Introduction Reading: Sections 1.5 – 1.7.
Convert to a DFA: Start state: Final States: P Symbol Q E(Q) a b.
Chapter 1 Introduction to the Theory of Computation
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
CSC312 Automata Theory Lecture # 2 Languages.
Languages Fall 2018.
CSCE 355 Foundations of Computation
Terminology and Symbols
Presentation transcript:

Assume that p, q, and r are in . Note that the number of pairs (p,q) with p + q = k is k+1. Use this to prove that the number of 3-tuples (p, q, r) with p+q+r = k is 1 + 2 + 3 + … + k + k+1 = (k+1) (k+2)/2. 2. Prove that the set S= { (p,q,r) : p, q, and r are in } is countable.

Announcements Several people forgot to sign the attendance sheet on Wed. but since I was able to hand back the proof of the day to all but one student, I know everyone else was there and I gave you credit for attendance. For tutorial #2, I have posted some practice questions on induction. You can also come and ask any other questions you have about the course material.

Office hours For all of these office hours, please let me know either at the end of class or by e-mail that you are coming so I don’t have to be there when nobody wants to see me. TWF: 12:30-1:20 WF: 1:30-2:15 MWR: 3:40-4:30

CSC 320: Lecture 4 Mathematics of computation

Mathematics of Computation Introduction to the mathematics of formal language theory: Alphabets, strings, languages. Mathematical operations on strings: concatenation, substring, prefix, suffix, reversal. Union, concatenation and Kleene star for languages. These definitions lead up to our first class of languages- the regular languages.

Review: Representing Data Alphabet: finite set of symbols Ex. { a, b, c, … , z} String: finite sequence of alphabet symbols Ex. abaab, hello, cccc Inputs and outputs of computations: represented by strings. ε represents an empty string (length 0)

Empty Set and Empty String Students frequently are confused about the empty set and an empty string. Empty set = Φ = { } = set with 0 elements. Empty string= ε = ̀̀ ̀ ́ ́= string with 0 symbols. Example: The set {ε} is a set containing one string.

Language: set of strings First names of students taking CSC 320 {Allan, Andrew, Arturo, Arvand, Bradley, Brent, Caleb, Christopher, Daniel, David, Eric, Farbod, Francesco, Graham, John, Joshua, Julius, Manpreet, Mark, Matthew, Michael, Nicholas, Przemyslaw, Rayeez, Riley, Ryan, Simritpal, SongZi} Strings over {a,b} with even length {ε , aa, ab, ba, bb, aaaa, aaab, aaba, …} Syntactically correct JAVA programs

Notational Conventions x, y, z real numbers k, n integers A, B matrices p, q primes Σ, Σ´,Σ1 Σ2 alphabets a, b, c, 0, 1 symbols u, v, w, x, y, z strings L, L1, L2 languages

Concatenation of strings x and y denoted x ۰ y or simply xy means write down x followed by y. Theorem: For any string w, ε ۰ w = w = w ۰ ε. String v is a prefix of w if w= v y for some string y. String v is a suffix of w if w= x v for some string x. String v is a substring of w if there are strings x and y such that w= x v y. The reversal of string w, denoted wR, is w “spelled backwards”.

= = Matrix multiplication: 1 2 1 3 1 1 1 2 1 3 Concatenation: 1 3 1 = 1 1 2 = 1 3 Concatenation: ab ۰ bb = abbb bb ۰ ab = bbab

Example (from assignment question): P= {(aaa, a), (a, aa), (abb, a) } has a match which is: (a, aa) (aaa, a) (aaa, a) (a, aa) (aaa, a) (a, aa) (a, aa) (a, aa)(a, aa) It uses (aaa,a) 3 times and (a,aa) 6 times and (abb,a) 0 times. The match is aaaaa aaaaa aaaaa (15 a's concatenated together)

Σ* = set of all strings over alphabet Σ Language over Σ – any subset of Σ* Examples: Σ = {0, 1} L1 = { w  Σ* : w has an even number of 0’s} L2 = { w  Σ* : w is the binary representation of a prime number with no leading zeroes} L3 = Σ* L4 = { } = Φ L5 = { ε }

Operations on Languages: Complement of L defined over Σ = = { w  Σ* : w is not in L } 2. Concatenation of Languages L1 ۰ L2 = L1 L2 = {w= x۰y for some x  L1 and y L2} 3. Kleene star of L, L* = { w= w1 w2 w3 … wk for some k ≥ 0 and w1, w2, w3, … ,wk are all in L} 4. L+ = L ۰L* (Concatenate together one or more strings from L.)

Operations on Languages: Complement of L defined over Σ = = { w  Σ* : w is not in L } 2. Concatenation of Languages L1 ۰ L2 = L1 L2 = {w= x۰y for some x  L1 and y L2} 3. Kleene star of L, L* = { w= w1 w2 w3 … wk for some k ≥ 0 and w1, w2, w3, … ,wk are all in L} 4. L+ = L ۰L* (Concatenate together one or more strings from L.)

Regular expressions over Σ: [Basis] 1. Φ and σ for each σ ∈ Σ are regular expressions. [Inductive step] If α and β are regular expressions, then so are: 2. ( αβ) 3. (α⋃β) and 4. α* Note: Regular expressions are strings over Σ ⋃ { ( , ) , Φ , ⋃ , * } for some alphabet Σ.

Precedence of Operators Kleene star Concatenation Union Exponents Multiplication Addition highest ⇩ lowest