Assignment no.1

advertisement
Ramrao Adik Institute of Technology
Department of Computer Engineering
Subject- TCS
S.E.- A, B, C
Semester- IV
Date-: 05/02/2015
Assignment no.1
Q. 1 a)
b)
Give the application of R.E. and Finite Automata.
Design DFA to check whether a given binary number is divisible by 4 or not.
Q.2 a)
Design FSM to determine whether a ternary number is divisible by 5 or not.
{Input=0, 1, 2}
Give difference between NFA and DFA.
b)
Q.3 a)
Construct NFA that accepts a set of all strings over ∑ ={a,b} ending in “abb”.
Convert NFA to DFA.
OR
Convert the NFA with- Є to DFA
Є
2
a
b
Є
1
b
Q.4 a)
Q. 5 a)
b)
4
3
a
a
b
Construct a NFA with epsilon for the following regular expression
(00+11)*(10)*
OR
Give formal definition of Regular Expression . Give R.E. for the following-:
Set of all strings over {a,b} that contains
i)
Exactly 2 a’s
ii)
At least 2 a’s
iii)
At most 2 a’s
Explain Chomsky Hierarchy.
Consider the following grammar :S -> i C t S | i C t S e S | a
C -> b
For the string ‘ibtibtaea’ find the following -:
i)
Leftmost derivation
ii)
Rightmost derivation
iii)
Parse Tree
iv)
Check if grammar is Ambiguous
Download