Question

In: Computer Science

Give the finite-state automaton and the regular grammar for the following: (a) (ab v ba)* v...

Give the finite-state automaton and the regular grammar for the following:

(a) (ab v ba)* v (ab)*

(b) (11*)*(110 v 01)

(c) All strings over {0,1} containing the string 010

(d) All strings over {0,1} which do not contain the string 010

Solutions

Expert Solution

First of all let's understand the questions what they are telling.

1.(ab v ba)* v (ab)*

where 'a' and 'b' are are symbols on which transitions will occur

and 'v' is the symbol of OR

'*' means repetition 0 or more times

So the questions means machine can take

'ab' OR 'ba' any number of times OR only 'ab' any number of times.

For example following strings can be accepted by the machine

abab,ab,ba,babaab.......

So the finite state automation is

where q0 is the initial state and also the final state

and qd is the dead state

Now the regular grammer is

S -> abS | baS |

2.(11*)*(110 v 01)

Now the question is take 11* any time then it takes 110 OR 01 one time

example is 1101, 110,101.....

So the machine is

where q0 is the initial state and q4 and q6 are the final state.

Now regular grammer is

S -> 1A

A -> 0B | 1C

B -> 1D

C -> 0E | 1C

E -> 1F

3.So the question is all the string will contain 010

example

00010,11010,010......

so machine is

So q0 is the initial state and q3 is the final state

this machine stops when 010 will surely contain.

Grammer is

S -> 1S | 0A

A -> 0A | 1B

B -> 0C | 1S

C -> 0C | 1C |

4.Now 4th question is the opposite of 3rd .

So just make the final state as non final and non finals states as final state so in 3rd qurstion final state is q3 so remove that state because there is no need of it as final states will be q0,q1 and q2

So machine will be

so q0 is initial and q0 ,q1 and q2 are final states.

Grammer is

S -> 1S | 0A |

A -> 0A | 1B |

B -> 1S |


Related Solutions

We demonstrated that if A is recognized by a nondeterministic finite state automaton, it can be...
We demonstrated that if A is recognized by a nondeterministic finite state automaton, it can be recognized by a deterministic finite-state automaton, by giving an algorithm for constructing a machine M' that is deterministic and accepts the same language as a nondeterministic machine M. By the construction algorithm we used, how many states will M' have if M has n states. Justify your answer
What is a finite-state machine ? What is a pushdown automaton ? What is a Turing...
What is a finite-state machine ? What is a pushdown automaton ? What is a Turing machine? What is a Turing complete language? Compare the finite-state machine , pushdown automaton , and Turing machine.?
DFA Python DFA simulator A deterministic finite automaton (DFA) - also known as deterministic finite state...
DFA Python DFA simulator A deterministic finite automaton (DFA) - also known as deterministic finite state machine - is a finite state machine that accepts/rejects finite strings of symbols and only produces a unique computation (or run) of the automaton for each input string. Write a DFA simulator using the python programming language. Read your DFA from a textfile. First line contains a list of the final states (as integers), separated by a space. Rest of file contains the transitions...
a) Give 5 good examples of Regular language. b) Give 5 good examples of Regular Grammar.
a) Give 5 good examples of Regular language. b) Give 5 good examples of Regular Grammar.
Use MATLAB to nd the products AB and BA for the following matrices:
Use MATLAB to nd the products AB and BA for the following matrices:
Automata Theory and Formal Languages Instructions: Draw the DFA (Deterministic Finite Automaton) of the following: DFA...
Automata Theory and Formal Languages Instructions: Draw the DFA (Deterministic Finite Automaton) of the following: DFA in which set of all strings can be accepted which end with ‘a’ DFA in which set of all strings can be accepted which start with ab DFA in which set of all strings can be accepted which contain ab DFA in which set of all strings can be accepted which ends with ab
Automata Theory and Formal Languages Instructions: Draw the DFA (Deterministic Finite Automaton) of the following: DFA...
Automata Theory and Formal Languages Instructions: Draw the DFA (Deterministic Finite Automaton) of the following: DFA for binary number divisible by 2 DFA for binary number divisible by 3 DFA in which set of all strings can be accepted which start with a DFA in which set of all strings can be accepted which contains ‘a’
V and W are finite dimensional inner product spaces,T: V→W is a linear map 1A: Give...
V and W are finite dimensional inner product spaces,T: V→W is a linear map 1A: Give an example of a map T from R2 to itself (with the usual inner product) such that〈Tv,v〉= 0 for every map. 1B: Suppose that V is a complex space. Show that〈Tu,w〉=(1/4)(〈T(u+w),u+w〉−〈T(u−w),u−w〉)+(1/4)i(〈T(u+iw),u+iw〉−〈T(u−iw),u−iw〉 1C: Suppose T is a linear operator on a complex space such that〈Tv,v〉= 0 for all v. Show that T= 0 (i.e. that Tv=0 for all v).
Determine whether or not the following languages are regular. If the language is regular then give...
Determine whether or not the following languages are regular. If the language is regular then give an NFA or regular expression for the language. Otherwise, use the pumping lemma for regular languages or closure properties to prove the language is not regular. 1) L = { 0 n1 k : k ≤ n ≤ 2k} 2) L = { 0 n1 k : n > 0, k > 0 } È { 1 k0 n : k > 0, n...
Prove the following: Let V and W be vector spaces of equal (finite) dimension, and let...
Prove the following: Let V and W be vector spaces of equal (finite) dimension, and let T: V → W be linear. Then the following are equivalent. (a) T is one-to-one. (b) T is onto. (c) Rank(T) = dim(V).
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT