Introduction to the Theory of Computation - PowerPoint PPT Presentation

About This Presentation
Title:

Introduction to the Theory of Computation

Description:

George W. Bush's Intelligence Quiz. While visiting England, George W. Bush is invited to tea with the Queen. ... Bush agrees, and Helms leaves. ... – PowerPoint PPT presentation

Number of Views:64
Avg rating:3.0/5.0
Slides: 13
Provided by: Joh7
Category:

less

Transcript and Presenter's Notes

Title: Introduction to the Theory of Computation


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

2
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!"

3
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.

4
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!"

5
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

6
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
  • for each i gt 0, uvixyiz ?A
  • vy gt 0
  • vxy lt p

7
Example 1
  • Show that B anbncn n gt 0 is not context
    free
  • Select s apbpcp
  • Case 1 v and y contain only one type of alphabet
    symbol. uv2wy2z ? B since there arent enough of
    the third symbol.

8
Example 1
  • Case 2 Either v or y or both contain two
    symbols. Now uv2wy2z ? B because either v2 or y2
    scrambles the order of the symbols.
  • B is not context-free!

9
Example 2
  • Show that C aibjck 0 lt i lt j lt k is not
    context-free.
  • Select s apbpcp
  • Case 1 either v or y or both contain more than
    one symbol. Then uv2xy2z ? C

10
Example 2
  • Case 2 v contains as and y contains bs. Now
    uv2xy2z ? C.
  • Case 3 v contains as and y contains cs. Now
    uxz ? C.
  • Case 4 v contains bs and y contains cs. Now
    uxz ? C.

11
Exercise
  • Show that D ww w ? 0, 1 is not context
    free.
  • Hint Let s 0p1p0p1p

12
Exercises
  • Prove whether or not E 0n02n n gt 0
    is context-free.
  • Prove whether or not F wx w is a substring
    of x over a,b is context-free.
Write a Comment
User Comments (0)
About PowerShow.com