Download pdf - rev1-16

Transcript
Page 1: rev1-16

7/21/2019 rev1-16

http://slidepdf.com/reader/full/rev1-16 1/2

Spring 2016 CIS 262

Automata, Computability and Complexity

Jean Gallier

Review Session

Released February 17, 2016

Problem 1.  (a) Give an NFA accepting  L =  {aa, bb}∗ (with a single  -transition).

(b) Convert the NFA of question 1(a) to a DFA.

Problem 2. (a) Given a DFA

 D = (

Q,Σ,δ ,q  0, F 

), construct an equivalent DFAD = (Q,Σ, δ , q 0, F ) (i.e. such that L(D) =  L(D)) and such that there are no incoming

transitions into the start state  q 0

 of  D.

(b) Prove of disprove (by giving a counter-example) the following statement:

A DFA  D  accepts a finite language iff its underlying directed graph has no cycle.

Problem 3.   Given any alphabet Σ =  {a1, . . . , ak}, prove by induction on  n  ≥  0 that thefunction L  maps R(Σ)n   into R(Σ)n, that is,  L(R(Σ)n) ⊆  R(Σ)n. Conclude that L(R(Σ)) ⊆R(Σ).

Problem 4.  Given an alphabet Σ, for any language  L over Σ, if  LR

= {wR

|  w ∈  L}  is thereversal language of  L, prove that

(L1 ∪ L2)R = LR

1 ∪ LR

2 ;

(L1L2)R = LR

2LR1 ;

(L∗)R = (LR)∗.

Problem 5.  (a) Let Σ = {a, b}. Give a DFA accepting

L1 =  {w ∈  Σ∗ | w  contains an even number of  a’s}

(There is one with two states and, by the way, 0 = zero is even.)Give a DFA accepting

L2 =  {w ∈  Σ∗ | w  contains a number of  b’s divisible by 3}

(There is one with three states and the number of  b’s is 0, 3, 6, 9, . . ..)

1

Page 2: rev1-16

7/21/2019 rev1-16

http://slidepdf.com/reader/full/rev1-16 2/2

(c) Give a DFA accepting  L3 =  L1 ∩ L2.

Problem 6.   Describe a method for testing whether L(D1) = L(D2), for any two DFA’s,  D1

and  D2  over the same alphabet.

Hint : Recall that for any two sets,  A and  B , we have  A  =  B   iff  A ⊆  B  and  B  ⊆ A  and thatA ⊆  B   iff  A−B  = ∅. Also use the cross-product construction.

2