Sei sulla pagina 1di 6

# 1.

## Pumping lemma is generally used to prove that:

a. A given language is infinite c. regular expressions are equivalent or not
b. A given language is not regular d. None of these

2. Which of the following statement is NOT true about TG? Select correct option:
a. There is exactly one path for certain string c. There may exist no path for certain string
b. There may exist more than one paths for d. There may be no final state
certain string
3. Languages generated by kleene star are always ________
a. Finite c. Sometimes finite & sometimes infinite
b. Infinite d. None of the these

4. The language of all words (made up of a’s and b’s) with at least two a’s cannot be described by the regular
expression.

a. a(a+b)a(a+b)(a+b)ab c. baba(a+b)
b. (a+b)aba(a+b) d. none of these
5. Numbers of states require accepting string ends with 10.
a. 3 c. 1
b. 2 d. can’t be represented.
6.

## a. ((a+ b) (a + b))* c. (a + b)(a + b)

b. (a + b)(a + b)* d. (a + b)*(a + b)*

7.

## In which of the following language Rev(s)=s

a. Equal c. Palindrome
b. Integer d. Factorial

## 8. Which statement is true?

a. The PDA have one accept and one reject state c. The PDA have two accept and two reject state
b. The PDA have one accept and two reject state d. There is no reject state in the PDA.
9. ------------------- is obviously infinite language.

a. EQUAL-EQUAL c. PALINDROME
b. EVEN-EVEN d. FACTORIAL
10. "CFG" stands for _________

## a. Context Free Graph c. Context Finite Graph

b. Context Free Grammar d. Context Finite Gramma
11. The PDA is called non-deterministic PDA when there are more than one out going edges from……… state

b. POP or REJECT d. PUSH or POP

12. The symbols that can’t be replaced by anything are called -----------------

a. Productions c. Non-terminals
b. Terminals d. All of above

## 13. The grammatical rules are often called_____________

a. Productions c. Non-terminals
b. Terminals d. None of given

## a. Context Normal Form c. Chomsky Normal Form

b. Complete Normal Form d. Compared Null Form

## 15. Left hand side of a production in CFG consists of:

a. One terminal c. One non-terminal
b. More than one terminal d. Terminals and non-terminals

## 16. Correct statement.

a. A Mealy generates no language as such c. A Mealy machine has no terminal state
b. A Moore generates no language as such d. All of these

17. To describe the complement of a language, it is very important to describe the ----------- of that language
over which the language is defined.

a. Alphabet c. String
b. Regular Expression d. Word

## 18. Above given TG has _____________ RE.

a. (aa+aa+(ab+ab)(aa+ab)(ab+ba)) c. (aa+bb+(ab+ba)(aa+bb)(ab+ba))
b. (aa+bb+(ab+ba)(aa+bb)(ab+ba)) d. None of these
19. Who did not invent the Turing machine?

## a. Alan Turing c. Turing

b. M. Turing d. None of these

## 20. If L1 and L2 are regular languages is/are also regular language(s).

a. L1 + L2 c. L1
b. L1L2 d. All of above
1. Write down the NFA expression of the following PDA . (10)

## 2. Write Convert the mealy machine into Moore machine. (10)

a)
Next State
Present State
a=0 a=1
State output State Output
Q0 Q1 0 Q3 0
Q1 Q3 1 Q2 0
Q2 Q4 1 Q0 0
Q3 Q0 0 Q4 1
Q4 Q2 0 Q1 0
solution

## Present State State State Output

Q0 Q1 Q30 0
Q1 Q30 Q2 0
Q2 Q4 Q0 0
Q30 Q0 Q4 0
Q31 Q0 Q4 1
Q4 Q2 Q1 1

Here, states ‘Q3’ give only 1 and 0 outputs respectively, so we retain states
‘Q0’, ‘Q1’ , ‘Q2’and ‘Q4’. But states ‘Q3’ produce different outputs (1 and 0). So, we divide
Q3 into Q30 Q31

b) (10)
Running the string abbabbba over the below machine, the corresponding output string will be
11011010, which can be determined by the following table as well

Solution:
It is to be noted that the states are labeled along with the characters to be printed. Running the string
abbabbba over the above machine, the corresponding output string will be 01111010, which can be
determined by the following table as well

It may be noted that the length of output string is l more than that of input string as the initial state prints out the
extra character 1, before the input string is read.

3.
a) To convert the following union of two NFA (10)

## b) In each regular expression draw the FA recognizing corresponding language (10)

i. a(a+b)*
ii. ( (a+b) (a+b) )*
iii. (a+b)* ab (a+b)*
iv. a(a+b)* a+b (a+b)* b
v. (a+b)*
4. Define the following terms. (10)
a. Concatenation.
b. Length of string.
c. Difference between Terminals and non terminals
d. Palindrome.
e. Valid/invalid alphabets?

1 d
2 b
3 a
4 a
5 b
6 a
7 c
8 a
9 a
10 b
11 c
12 d
13 d
14 a
15 c
16 b
17 c
18 b
19 a
20 c