1 Strings and Languages. 2 Review Sets and sequences Functions and relations Graphs Boolean logic:      Proof techniques: – Construction, Contradiction,

Slides:



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

Chapter 2 Revision of Mathematical Notations and Techniques
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.
Properties of Regular Languages
1 Lecture 32 Closure Properties for CFL’s –Kleene Closure construction examples proof of correctness –Others covered less thoroughly in lecture union,
Deterministic Finite Automata (DFA)
YES-NO machines Finite State Automata as language recognizers.
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Languages.
1 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY (For next time: Read Chapter 1.3 of the book)
1 More Properties of Regular Languages. 2 We have proven Regular languages are closed under: Union Concatenation Star operation Reverse.
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.
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 CS310 Strings, String Operators, and Languages Sections: August 30, 2006.
1 Languages and Finite Automata or how to talk to machines...
CS5371 Theory of Computation Lecture 1: Mathematics Review I (Basic Terminology)
Sets 1.
Sets 1.
1 Module 31 Closure Properties for CFL’s –Kleene Closure construction examples proof of correctness –Others covered less thoroughly in lecture union, concatenation.
Costas Busch - RPI1 Mathematical Preliminaries. Costas Busch - RPI2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
Courtesy Costas Busch - RPI1 Mathematical Preliminaries.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
FSA Lecture 1 Finite State Machines. Creating a Automaton  Given a language L over an alphabet , design a deterministic finite automaton (DFA) M such.
Theoretical Computer Science COMP 335 Fall 2004
Fall 2006Costas Busch - RPI1 Languages. Fall 2006Costas Busch - RPI2 Language: a set of strings String: a sequence of symbols from some alphabet Example:
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
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,
Great Theoretical Ideas in Computer Science.
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
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,
1 Chapter 1 Automata: the Methods & the Madness Angkor Wat, Cambodia.
Two examples English-Words English-Sentences alphabet S ={a,b,c,d,…}
1 Chapter 1 Introduction to the Theory of Computation.
1 Undecidability Reading: Chapter 8 & 9. 2 Decidability vs. Undecidability There are two types of TMs (based on halting): (Recursive) TMs that always.
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.
CSCI 2670 Introduction to Theory of Computing Instructor: Shelby Funk.
Mathematical Preliminaries. Sets Functions Relations Graphs Proof Techniques.
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
A Universal Turing Machine
Strings and Languages CS 130: Theory of Computation HMU textbook, Chapter 1 (Sec 1.5)
Mathematical Preliminaries
Class Discussion Can you draw a DFA that accepts the language {a k b k | k = 0,1,2,…} over the alphabet  ={a,b}?
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2010.
Deterministic Finite Automata COMPSCI 102 Lecture 2.
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.
Introduction Why do we study Theory of Computation ?
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.
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. –{
A Universal Turing Machine
Language Theory Module 03.1 COP4020 – Programming Language Concepts Dr. Manuel E. Bermudez.
Languages.
CIS Automata and Formal Languages – Pei Wang
Languages Prof. Busch - LSU.
Languages Costas Busch - LSU.
PROPERTIES OF REGULAR LANGUAGES
COP4620 – Programming Language Translators Dr. Manuel E. Bermudez
CS 154, Lecture 3: DFANFA, Regular Expressions.
COSC 3340: Introduction to Theory of Computation
Definition: Let G = (V, T, P, S) be a CFL
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
Properties of Context-Free Languages
Chapter 1 Introduction to the Theory of Computation
Languages Fall 2018.
CSCE 355 Foundations of Computation
Terminology and Symbols
Presentation transcript:

1 Strings and Languages

2 Review Sets and sequences Functions and relations Graphs Boolean logic:      Proof techniques: – Construction, Contradiction, Pigeon Hole Principle, Induction

3 Deductive Proof (1/2) Thm: Every horse has infinite no. of legs. Proof: Horses have an even number of legs. Behind they have two legs, and in front they have fore legs. This makes six legs, which is certainly an odd number of legs for a horse. But the only number that is both odd and even is infinity. Therefore, horses have an infinite number of legs.

4 Deductive Proof (2/2) Thm : All numbers are equal to zero. Proof: Suppose that a=b. Then a = b a^2 = ab a^2 - b^2 = ab - b^2 (a + b)(a - b) = b(a - b) a + b = b a = 0

5 Problems and Languages Problem: defined using input and output Decision Problem: output is either yes or no Language: set of all inputs where output is yes

6 Alphabets An alphabet is a finite non-empty set. An alphabet is generally denoted by the symbol Σ.

7 Strings (or words) Defined over an alphabet Σ Is a finite sequence of symbols from Σ Length of string w (|w|) – length of sequence λ – the empty string Concatenation of w 1 and w 2 – copy of w 1 followed by copy of w 2 Reversal w R – w’s symbols reversed

8 Languages A language over Σ is a set of strings over Σ Σ * is the set of all strings over Σ A language L over Σ is a subset of Σ * (L  Σ * )

9 Operations on Languages Star (L*) Concatenation (L 1.L 2 ) Union (L 1  L 2 ) Intersection (L 1  L 2 ) Complement Reversal L R

10 Questions (1/3) What is the language for the following decision problem? Decision Problem: – Input: String w – Output: Yes, if |w| is even What is the decision problem for the language L = {u0v | u,v  {0,1}* } ? What alphabet is the language L defined over? Describe the language L R.

11 Questions (2/3) What is the size of the empty set? What is the size of the set containing just the empty string? Let L 2 = {λ, 00,0000} be defined over the alphabet ∑ = {0}. Describe the strings in the set L 2 *. Describe the complement of L 2.

12 Questions (3/3) Let L 3 = {awb | w  {a,b}*}. Define the language L 3 R How would you prove that L 3 = {a}.{a,b}*.{b}? How would you prove that L 3 ≠ L 3 R