Exam 12: Regular Expressions and Finite State Automata

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

Prove that there is no finite-state automaton that accepts the language LL consisting of all strings of xx 's and yy 's of the form xnynx ^ { n } y ^ { n } where nn is a positive integer.

Free
(Essay)
4.7/5
(30)
Correct Answer:
Verified

  Suppose not. That is suppose there is a finite-state automaton   A   that accepts the language   L   consisting of all strings of   x   's and   y   's of the form   x^{n} y^{n}   where   n   is a positive integer. [A contradiction will be derived.] Since   A   has only a finite number of states, these states can be denoted   s_{1}, s_{2}, s_{3}, \ldots, s_{k}  , where   k   is a positive integer.Consider all input strings that consist entirely of   x   's:   x, x^{2}, x^{3}, \ldots  . Now there are infinitely many such strings and only finitely many states. Thus, by the pigeonhole principle, there must be a state   s_{m}   and two input strings   x^{p}   and   x^{q}   with   p \neq q   such that when either   x^{p}   or   x^{q}   are input to   A, A   goes to state   s_{m}  . Now, by supposition,   A   accepts the string   x^{p} y^{p}  . This means that after   p x^{\prime}   's have been input, at which point   A   is in state   s_{m}  , inputting   p   additional b's sends   A   into an accepting state, say   s_{a}  . But that implies that inputting   x^{q} y^{p}   also sends   A   to   s_{a}  , which means that   x^{q} y^{p}   is also accepted by   A  . The reason is that after   q x   's have been input,   A   is also in state   s_{m}  , and from that point, we know that inputting   p   additional b's sends   A   to state   s_{a}  , which is an accepting state. Hence  x ^ { q } y ^ { p }  is in  L  where  p \neq q   But, by supposition, all the strings in  L  have the form  x ^ { n } y ^ { n } , which have the same number of that there is no finite-state automaton that accepts the language  L  consisting of all strings of  x ^ { \prime }  's and  y  's of the form  x ^ { n } y ^ { n }  where  n  is a positive integer. Suppose not. That is suppose there is a finite-state automaton A A that accepts the language L L consisting of all strings of x x 's and y y 's of the form xnyn x^{n} y^{n} where n n is a positive integer. [A contradiction will be derived.] Since A A has only a finite number of states, these states can be denoted s1,s2,s3,,sk s_{1}, s_{2}, s_{3}, \ldots, s_{k} , where k k is a positive integer.Consider all input strings that consist entirely of x x 's: x,x2,x3, x, x^{2}, x^{3}, \ldots . Now there are infinitely many such strings and only finitely many states. Thus, by the pigeonhole principle, there must be a state sm s_{m} and two input strings xp x^{p} and xq x^{q} with pq p \neq q such that when either xp x^{p} or xq x^{q} are input to A,A A, A goes to state sm s_{m} . Now, by supposition, A A accepts the string xpyp x^{p} y^{p} . This means that after px p x^{\prime} 's have been input, at which point A A is in state sm s_{m} , inputting p p additional b's sends A A into an accepting state, say sa s_{a} . But that implies that inputting xqyp x^{q} y^{p} also sends A A to sa s_{a} , which means that xqyp x^{q} y^{p} is also accepted by A A . The reason is that after qx q x 's have been input, A A is also in state sm s_{m} , and from that point, we know that inputting p p additional b's sends A A to state sa s_{a} , which is an accepting state. Hence
xqypx ^ { q } y ^ { p } is in LL where pqp \neq q
But, by supposition, all the strings in LL have the form xnynx ^ { n } y ^ { n } , which have the same number of that there is no finite-state automaton that accepts the language LL consisting of all strings of xx ^ { \prime } 's and yy 's of the form xnynx ^ { n } y ^ { n } where nn is a positive integer.

Consider the regular expression 010010100 ^ { * } 10 ^ { * } \mid 0 ^ { * } 10 ^ { * } 10 ^ { * } (a) Describe the language defined by this expression. (b) Design a finite-state automaton to accept the language defined by the expression.

Free
(Essay)
4.8/5
(33)
Correct Answer:
Verified

a. The language accepted by the automaton is the set of all strings of 0 's and 1 's that contain exactly one 1 or that contain exactly two 1 's.
b.
a. The language accepted by the automaton is the set of all strings of 0 's and 1 's that contain exactly one 1 or that contain exactly two 1 's. b.

Consider the finite-state automaton given by the following transition diagram:  Consider the finite-state automaton given by the following transition diagram:     (a) What is  N \left( s _ { 2 } , a \right)  ? (b) To what state does the automaton go if the string babaa is input to it? (c) Indicate which of the following strings are accepted by the automaton:  a b a b \quad b b a b \quad a b b b a a \quad a  (d) Describe the language accepted by this automaton. (e) Find a regular expression that defines the same language. (a) What is N(s2,a)N \left( s _ { 2 } , a \right) ? (b) To what state does the automaton go if the string babaa is input to it? (c) Indicate which of the following strings are accepted by the automaton: ababbbababbbaaaa b a b \quad b b a b \quad a b b b a a \quad a (d) Describe the language accepted by this automaton. (e) Find a regular expression that defines the same language.

Free
(Essay)
4.7/5
(34)
Correct Answer:
Verified

a. N(s2,a)=s2N \left( s _ { 2 } , a \right) = s _ { 2 }
b. s2s _ { 2 }
c. The strings abbbaaa b b b a a and aa are accepted by the automaton. The strings ababa b a b and bbabb b a b are not accepted by the automaton.
d. The language accepted by the automaton is the set of all strings of aa 's and bb 's that end in an aa .
e. (ab)a( a \mid b ) ^ { * } a

Consider the finite-state automaton given by the following transition diagram:  Consider the finite-state automaton given by the following transition diagram:    (a) To what state does the automaton go if the string 10010010 is input to it? Is this string accepted by the automaton? (b) Indicate which of the following strings are accepted by the automaton:  \begin{array} { l l l l }  000101 & 0100010 & 000100 & 110001 \end{array}   (c) Describe the language accepted by the automaton. (d) Find a regular expression that defines the same language. (a) To what state does the automaton go if the string 10010010 is input to it? Is this string accepted by the automaton? (b) Indicate which of the following strings are accepted by the automaton: 000101 0100010 000100 110001 (c) Describe the language accepted by the automaton. (d) Find a regular expression that defines the same language.

(Essay)
4.9/5
(33)

Let Σ={0,1}\Sigma = \{ 0,1 \} , and let LL be the language over Σ\Sigma consisting of all strings of 0 's and 1 's of length 4 with an equal number of 0 's and 1's. List the elements of LL .

(Essay)
4.9/5
(39)

Let LL be the language defined by the regular expression (xy)x(xy)( x \mid y ) ^ { * } x ( x \mid y ) . (a) Write 3 strings that belong to LL (b) Use words to describe LL .

(Essay)
4.9/5
(40)

Consider the finite-state automaton given by the following next-state table:  Consider the finite-state automaton given by the following next-state table:    (a) Draw the transition diagram for this automaton. (b) Indicate which of the following strings are accepted by the automaton:  \begin{array} { l l l l }  0100 & 1001 & 0110 & 101010 \end{array}   (c) Describe the language accepted by the automaton. (d) Find a regular expression that defines the same language. (a) Draw the transition diagram for this automaton. (b) Indicate which of the following strings are accepted by the automaton: 0100 1001 0110 101010 (c) Describe the language accepted by the automaton. (d) Find a regular expression that defines the same language.

(Essay)
4.8/5
(35)

Consider the language that consists of all strings of 0 's and 1's in which the number of 1's is evenly divisible by 4 . Find a regular expression that defines this language.

(Essay)
4.9/5
(45)

Consider the regular expression a(ab)ba ( a \mid b ) ^ { * } b (a) Describe the language defined by this expression. (b) Design a finite-state automaton to accept the language defined by the expression.

(Essay)
4.7/5
(31)

Let LL be the language defined by the regular expression 0(01)1(01)0 ( 0 \mid 1 ) ^ { * } 1 ( 0 \mid 1 ) ^ { * } . (a) Write 3 strings that belong to LL (b) Use words to describe LL .

(Essay)
4.8/5
(31)

Consider the finite-state automaton given by the following next-state table:  Consider the finite-state automaton given by the following next-state table:    (a) Draw the transition diagram for the automaton. (b) Indicate which of the following strings are accepted by the automaton:  \begin{array} { l l l l }  0100 & 101 & 1110 & 00101 \end{array}   (c) Describe the language accepted by this automaton. (d) Find a regular expression that defines the same language. (a) Draw the transition diagram for the automaton. (b) Indicate which of the following strings are accepted by the automaton: 0100 101 1110 00101 (c) Describe the language accepted by this automaton. (d) Find a regular expression that defines the same language.

(Essay)
4.8/5
(32)

Consider the language that consists of all strings of aa 's and bb 's in which the second character from the beginning is a bb . Find a regular expression that defines this language.

(Essay)
4.9/5
(36)

Consider the finite-state automaton given by the following next-state table:  Consider the finite-state automaton given by the following next-state table:    (a) Draw the transition diagram for this automaton. (b) Indicate which of the following strings are accepted by the automaton:  \text { abba babb ba bbababa }   (c) Describe the language accepted by the automaton. (d) Find a regular expression that defines the same language. (a) Draw the transition diagram for this automaton. (b) Indicate which of the following strings are accepted by the automaton:  abba babb ba bbababa \text { abba babb ba bbababa } (c) Describe the language accepted by the automaton. (d) Find a regular expression that defines the same language.

(Essay)
4.8/5
(32)

Finite-state automata AA and AA ^ { \prime } are defined by the transition diagrams shown below.  Finite-state automata  A  and  A ^ { \prime }  are defined by the transition diagrams shown below.     (a) Find the quotient automaton for A. (b) Find the quotient automaton for A ^ { \prime }   (c) Are A and  A ^ { \prime }   equivalent? Explain. (a) Find the quotient automaton for A. (b) Find the quotient automaton for AA ^ { \prime } (c) Are A and AA ^ { \prime } equivalent? Explain.

(Essay)
4.9/5
(37)
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)