Homework 3 - PowerPoint PPT Presentation

1 / 5
About This Presentation
Title:

Homework 3

Description:

Indicate clearly which equivalence class corresponds to each state of the new automaton. ... 5. Run the CYK algorithm on the input string ababa' for the above grammar. ... – PowerPoint PPT presentation

Number of Views:22
Avg rating:3.0/5.0
Slides: 6
Provided by: chengch
Category:
Tags: homework | run | up

less

Transcript and Presenter's Notes

Title: Homework 3


1
Homework 3
  • due 1/4

2
  • 1 Minimize the following DFA. Indicate clearly
    which equivalence class corresponds to each state
    of the new automaton.

3
  • Let A x?a,bthe number of as in x 2 x
    the number of bs in x
  • 2. Consider the context-free grammar G with start
    symbol S and productions
  • S ? aAB aBA bAA e A ? aS bAAA
  • B ? aABB aBAB aBBA bS
  • Show that
  • 2.1 L(G) ? A, and
  • 2.2 A ? L(G) Hence L(G) A.
  • Hints (for 2.1)
  • For A we have A ? a ? a(a) A(a)
    12b(a)2B(a).
  • For B and S, you should find similar
    assertions.
  • 3. Find a nondeterministic pushdown automata
    (pda) which accepts the language A by empty
    stack.

4
  • 4. Consider the grammar
  • S?ST a T? BS B? b
  • the input ababa is a member of L(G).
  • 2.1 Draw a parse tree for it.
  • 2.2 Give a left-most derivation for the input
    ababa.
  • 5. Run the CYK algorithm on the input string
    ababa for the above grammar. You should draw a
    chart and fill it completely.

5
  • 6. Refine the CKY algorithm so that it can count
    the number of parse trees of a given string.
  • Hint In such modification, each cell T(i,j)
    would be a list of pairs (X, k) ,where X is a
    nonterminal and k is a positive number, meaning
    that the are k X-parse trees for the substring
    xij. Accordingly, the input would have exactly k
    parse trees if (S, k) belongs to the list T(0.n).
  • 7. Use pumping lemma to show that the language A
    ww w ? a,b is not context free.
  • 8. Design a PDA to accept the language
  • B x?a,b x is even A, where A
    ww w ? a,b .
  • Hint See page 10 of p2ch3.ppt
Write a Comment
User Comments (0)
About PowerShow.com