




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





CS 162 Fall 2015
September 29, 2015 Timothy Johnson
(b) The set of all strings with three consecutive 0’s (not necessarily at the end).
(c) The set of strings with 011 as a substring.
(c) The set of strings that either begin or end (or both) with 01.
(d) The set of strings such that the number of 0’s is divisible by five, and the number of 1’s is divisible by 3.
(a) Show by induction on n that for all n ≥ 0, δˆ(q, an) = q, where an^ is the string consisting of n a’s. Base case: n = 0 δˆ(q, ) = q, by definition. Induction step: Assume that δˆ(q, ak) = q.
δˆ(q, ak+1) = δˆ(ˆδ(q, ak), a) = δˆ(q, a) = q
Therefore, by induction, δˆ(q, an) = q for all n ≥ 0. (b) Show that either {a∗} ⊆ L(A) or {a∗} ∩ L(A) = ∅. By the previous part, for all states q, for all n ≥ 0, ˆδ(q, an) = q. In particular, this is true for the initial state q 0. So for any input in {a∗}, we will end in state q 0. First, suppose that our initial state q 0 is a final state. Then we accept every string in {a∗}, so {a∗} ⊆ L(A). Otherwise, suppose that q 0 is not a final state. Then we reject every string in {a∗}, so {a∗} ∩ L(A) = ∅.
Our NFA is drawn below.
(b) The set of strings over alphabet { 0 , 1 ,... , 9 } such that the final digit has not appeared before.
(c) The set of strings of 0’s and 1’s such that there are two 0’s separated by a number of positions that is a multiple of 4. Note that 0 is an allowable multiple of 4.