Introduction to the Theory of Computation John Paxton Montana State University Summer 2003.

Slides:



Advertisements
Similar presentations
SPEAKING Nguyen Nhan Thien Nguyen Hong Oanh PORTFOLIO.
Advertisements

Pumping Lemma Problem: Solution:
Theory of Computation CS3102 – Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Nathan Brunelle Department of Computer.
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
CS 3240: Languages and Computation Properties of Context-Free Languages.
Penn State Math Club March 31 st, MacArthur Puzzle Directions: Write down the number of the month in which you are born Double it Add 5 Multiply.
CS21 Decidability and Tractability
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
1 Introduction to Computability Theory Lecture4: Non Regular Languages Prof. Amos Israeli.
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
Lecture 15UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 15.
CS 302: Discrete Math II A Review. An alphabet Σ is a finite set (e.g., Σ = {0,1}) A string over Σ is a finite-length sequence of elements of Σ For x.
Introduction to the Theory of Computation John Paxton Montana State University Summer 2003.
CS 310 – Fall 2006 Pacific University CS310 Pumping Lemma Sections:1.4 page 77 September 27, 2006.
Chap 2 Context-Free Languages. Context-free Grammars is not regular Context-free grammar : eg. G 1 : A  0A1substitution rules A  Bproduction rules B.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 4 Context-free grammars Jan Maluszynski, IDA, 2007
CS5371 Theory of Computation Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression)
Introduction to the Theory of Computation John Paxton Montana State University Summer 2003.
Introduction to the Theory of Computation John Paxton Montana State University Summer 2003.
1 Introduction to Computability Theory Lecture4: Non Regular Languages Prof. Amos Israeli.
Introduction to the Theory of Computation John Paxton Montana State University Summer 2003.
1 Module 36 Non context-free languages –Examples and Intuition Pumping lemma for CFL’s –Pumping condition –No proof of pumping lemma –Applying pumping.
Introduction to the Theory of Computation John Paxton Montana State University Summer 2003.
CS5371 Theory of Computation Lecture 9: Automata Theory VII (Pumping Lemma, Non-CFL)
Introduction to the Theory of Computation John Paxton Montana State University Summer 2003.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.3: Non-Context-Free Languages) David Martin With.
Transparency No. P2C5-1 Formal Language and Automata Theory Part II Chapter 5 The Pumping Lemma and Closure properties for Context-free Languages.
Homework #7 Solutions. #1. Use the pumping lemma for CFL’s to show L = {a i b j a i b j | i, j > 0} is not a CFL. Proof by contradiction using the Pumping.
Today Chapter 2: (Pushdown automata) Non-CF languages CFL pumping lemma Closure properties of CFL.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
Complexity and Computability Theory I Lecture #13 Instructor: Rina Zviel-Girshin Lea Epstein Yael Moses.
CSE 3813 Introduction to Formal Languages and Automata Chapter 8 Properties of Context-free Languages These class notes are based on material from our.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
1 Properties of Context-Free Languages Is a certain language context-free? Is the family of CFLs closed under a certain operation?
Context-free Languages Chapter 2. Ambiguity.
On the phone In this unit you are going to: take and report telephone messages. make, accept ad refuse invitations. listen for details. read about telephone.
CSCI 2670 Introduction to Theory of Computing September 22, 2005.
Mineral Area College Is it wrong for professors to leave graded exams, papers, etc. outside their office for students to pick up?
1 L= { w c w R : w  {a, b}* } is accepted by the PDA below. Use a construction like the one for intersection for regular languages to design a PDA that.
Cs3102: Theory of Computation Class 8: Non-Context-Free Languages Spring 2010 University of Virginia David Evans.
Test # 2 Friday, November 2 nd Covers all of Chapter 2 Test # 2 will be 20% of final score (same as Test #1) Final Exam will be 40% of the final score.
Making a phone call. Introducing yourself Asking to speak to somebody Asking who the caller is Telling the caller that someone is not available Taking.
Non-CF Languages The language L = { a n b n c n | n  0 } does not appear to be context-free. Informal: A PDA can compare #a’s with #b’s. But by the time.
CS355 - Theory of Computation Regular Expressions.
Non-Context-Free Languages Section 2.3 CSC 4170 Theory of Computation.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
CSCI 3130: Formal languages and automata theory Tutorial 3 Chin.
Critique this PDA for L= { u u R v v R : u ∈ {0,1}* and v ∈ {0,1}+ } u0εu0 u1εu1 uεεvε v00vε v11vε vεεfε sεεtε t0εt0 t1εt1 t00tε t11tε tεεuε After you.
CSCI 2670 Introduction to Theory of Computing September 23, 2004.
Chapter 8 Properties of Context-free Languages These class notes are based on material from our textbook, An Introduction to Formal Languages and Automata,
January 20, 2016CS21 Lecture 71 CS21 Decidability and Tractability Lecture 7 January 20, 2016.
Lecture # 31 Theory Of Automata By Dr. MM Alam 1.
Reporting orders!!! Let me tell you a story…. Tom and Ada are very happy together since primary school Ada: 17 years old (Studying) Tom: 20 years old.
CS 154 Formal Languages and Computability March 17 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
 2004 SDU Lecture8 NON-Context-free languages.  2004 SDU 2 Are all languages context free? Ans: No. # of PDAs on  < # of languages on  Pumping lemma:
CS 461 – Oct. 5 Pumping lemma #2 –Understanding –Use to show a language is not a CFL Next: Applications of CFLs –Expression grammars and Compiling.
Complexity and Computability Theory I Lecture #12 Instructor: Rina Zviel-Girshin Lea Epstein.
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
1 Use the pumping theorem for context-free languages to prove that L= { a n b a n b a p : n, p ≥ 0, p ≥ n } is not context-free. Hint: For the pumping.
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.
Context-Free Languages
Comparative Study Exam Questions.
Non-Context-Free Languages
Context-Free Grammars
COSC 3340: Introduction to Theory of Computation
BRIGHT 1 Unit 5 People Around Me.
COSC 3340: Introduction to Theory of Computation
Intro to Theory of Computation
Presentation transcript:

Introduction to the Theory of Computation John Paxton Montana State University Summer 2003

Humor George W. Bush's Intelligence Quiz While visiting England, George W. Bush is invited to tea with the Queen. He asks her what her leadership philosophy is. She says that it is to surround herself with intelligent people. He asks how she knows if they're intelligent. "I do so by asking them the right questions," says the Queen. "Allow me to demonstrate." She phones Tony Blair and says, "Mr. Prime Minister. Please answer this question: Your mother has a child, and your father has a child, and this child is not your brother or sister. Who is it?" Tony Blair responds, "It's me, ma'am." "Correct. Thank you and good-bye, sir," says the Queen. She hangs up and says, "Did you get that, Mr. Bush?" "Yes ma'am. Thanks a lot. I'll definitely be using that!"

Humor Upon returning to Washington, he decides he'd better put the Chairman of the Senate Foreign Relations Committee to the test. He summons Jesse Helms to the White House and says, "Senator Helms, I wonder if you can answer a question for me." "Why, of course, sir. What's on your mind?" "Uh, your mother has a child, and your father has a child, and this child is not your brother or your sister. Who is it?" Helms hems and haws and finally asks, "Can I think about it and get back to you?" Bush agrees, and Helms leaves. He immediately calls a meeting of other senior senators, and they puzzle over the question for several hours, but nobody can come up with an answer. Finally, in desperation, Helms calls Colin Powell at the State Department and explains his problem.

Humor "Now look here Colin Powell, your mother has a child, and your father has a child, and this child is not your brother, or your sister. Who is it?" Powell answers immediately, "It's me, of course." Much relieved, Helms rushes back to the White House and exclaims, "I know the answer, sir! I know who it is! It's Colin Powell!" And Bush replies in disgust, "Wrong, It's Tony Blair!"

2.3 Non-Context-Free Languages To show that a language is not context- free, we can use the pumping lemma for context-free languages

Pumping Lemma If A is a Context-Free Language, there there is a number p (the pumping length) where, if s is any string in A of length at least p, then s may be divided into five pieces s = uvxyz satisfying these conditions: 1.for each i >= 0, uv i xy i z  A 2.|vy| > 0 3.|vxy| <= p

Example 1 Show that B = { a n b n c n | n >= 0 } is not context free Select s = a p b p c p Case 1: v and y contain only one type of alphabet symbol. uv 2 wy 2 z  B since there aren’t enough of the third symbol.

Example 1 Case 2: Either v or y or both contain two symbols. Now uv 2 wy 2 z  B because either v 2 or y 2 scrambles the order of the symbols. B is not context-free!

Example 2 Show that C = {a i b j c k | 0 <= i <= j <= k} is not context-free. Select s = a p b p c p Case 1: either v or y or both contain more than one symbol. Then uv2xy2z  C

Example 2 Case 2: v contains a’s and y contains b’s. Now uv 2 xy 2 z  C. Case 3: v contains a’s and y contains c’s. Now uxz  C. Case 4: v contains b’s and y contains c’s. Now uxz  C.

Exercise Show that D = { ww | w  {0, 1}* } is not context free. Hint: Let s = 0 p 1 p 0 p 1 p

Exercises Prove whether or not E = { 0 n #0 2n | n >= 0 } is context-free. Prove whether or not F = { w#x | w is a substring of x over {a,b}* } is context-free.