Which of the following options cannot be true?
Union of two non-regular languages is a regular language.
Union of regular and non-regular language is a regular language.
Intersection of regular and non-regular language is a non-regular language.
Complement of a non-regular language is a regular language.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider the following Finite Automata with S as the initial state.


Select the correct option.

If S is the only final state then FA accepts only one string.
If F is the only final state then FA accepts (0+1)+
Language accepted by FA will be (0+1)* if and only if S and F both are final states.
None of these.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider the following language L such that L={wwr | |w|=2 & w ϵ {a,b}* }. The number of states in min DFA accepting L will be ___
11
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
Consider the following ϵ-NFA. Number of final states in NFA (without ϵ move) will be _____

1
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
Consider the following language L1 and L2 over ∑={a,b}, such that

L1={a^2x | x>=0}

L2={a^3y | y>=0}

Consider a language L3 such that, L3= L1.L2. The number of states in minimal DFA accepting L3 will be _________

4
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
Consider a language L over ∑={a} such that every string in L contains odd number of a’s. The min DFA which accept (L*)* has ________number of states.
1
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
Consider the following regular expression:

R= a(aa)* (bb*)*b

Select the correct language generated by R from the given options:

L = {a^(2n+1) b^(2m+1) | m, n ≥ 0 }
L = {a^(2n+1) b^m | m, n ≥ 0 }
L = {a^(2n+1) b^(m+1) | m, n ≥ 0 }
None
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider the following grammar G, such that

S→ aA | bB | ϵ

A→aA | bB | ϵ

B→aA | bB

The number of states in minimal DFA which accepts L(G) _______

2
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
Consider the following languages.

LA = {a^x a^y | x,y ≥ 0 & x = y}

LB = {a^x a^y | x,y ≥ 0 & x ≠ y }

Select the correct option.

Both LA and LB are regular.
Both LA and LB are non-regular.
LA is regular while LB is non-regular.
LA is non-regular while LB is regular.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider the following statements

S1: The equivalence of a DFA and a DPDA is decidable.

S2: The equivalence of a NFA and a DPDA is undecidable.

Select the correct option.

Both S1 and S2 are correct.
Both S1 and S2 are false.
S1 is correct while S2 is false.
S1 is false while S2 is correct.

Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider the following grammar, where set {a,b,d} are terminals and set {S,A,B} are non-terminals.

S → Aa

A → d | SB

B → ϵ | b

Select the correct option

Follow(S)={ $}
Follow(S)={ $,b}
Follow(S)={ $,a,b}
None of these
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider the following grammar, where set {a,b,d} are terminals and set {S,A,B} are non-terminals. [MSQ]

S → Aa

A → d | SB

B → ϵ | b

Select the correct option / options.

Given grammar is LL(1).
Given grammar is LR(0) but not LL(1).
Given grammar is SLR(1) but not LR(0).
Given grammar is LALR(1) but not LL(1).
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider the following code.

int main (void)

{

int num_val=2;

num_val *=5;

printf( “\n Output %d \n”,num_val++);

return 0 ;

}

The number of tokens in following code are ____

27
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
Consider the following SDT which counts the number of zeros & ones in string.

N→L {N.c=L.c}

L→L1 B {L.c=L1.c+B.c}

L→B {X}

B→0 {Y}

B→1 {B.c=1}

Select the correct semantic action in place of X and Y.

X= {L.c=B.c} & Y= {B.c=1}
X= {L.c = B.c} & Y= {B.c=0}
X={L.c=B.c +B.c} & Y= {B.c=0}
X={L.c=B.c +B.c} & Y= {B.c=1}
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider the following code segments A and B [MSQ]

Code A:

for(int i=0; i<=100; i++)

{

sum= x/y * i;

a[i]= b[i] + c[i];

}

Code B:

t=x/y;

for(int i=0; i<=100; i+=2)

{

sum= t * i;

a[i]= b[i] + c[i];

a[i+1]= b[i+1] + c[i+1];


}

Select the correct option / options.

Code B will be obtained after applying code motion (code optimization) on Code A
Code B will be obtained after applying loop unrolling (code optimization) on Code A.
Code B will be obtained after applying loop jamming (code optimization) on Code A.
None of these
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.00
Consider the following code segment A and its equivalent code segment B

Code A

for(int i=1 ; i<1000; i++)

{

x= i * 5;

}

Code B

x=0;

for(int i=1 ; i<1000; i++)

{

x= x + 5;

}

Select the correct option.

Code B will be obtained after applying code motion (code optimization) on Code A.
Code B will be obtained after applying loop unrolling (code optimization) on Code A
Code B will be obtained after applying loop jamming (code optimization) on Code A
Code B will be obtained after applying strength reduction (code optimization) on Code A.
Difficulty Level: 1
Positive Marks: 1.00
Negative Marks: 0.33
Consider the language L={w ϵ {a,b}* | all strings end with b}. Select the correct regular expression for language L. [MSQ]

(a* + bb*a* )* bb*
(a+b)(a+b)*b + b
(a+b)*b
(a+b)*b*
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
How many 3 state DFA's can be constructed with a designated initial and a designated final state which accepts empty language over alphabet {a, b}?
189
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
Let L1 and L2 are two languages such that (L1 ∪ L2 ) are accepted by finite automata. Select the option /options which is / are necessarily true. [MSQ]
There exists a DFA for L1
There exists a DFA for L2.
There exists a DFA for (L1 ∪ L2)*
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.00
Consider the following finite automata.

Select the correct option/ options with respect to given finite automata.

The FA accepts all strings which start and end with the same symbol.
The given FA is a minimal DFA.
The FA accepts all strings which do not end with “ab” or “ba”.
The regular expression to represent the language accepted by FA is: a(a+ba)* + b(b+ab)*
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the following languages L1 and L2 such that

L1 ={a^i b^j c^k d^l | i=k OR j=l}

L2 ={a^i b^k c^j d^l | i=k AND j=l}

Select the correct option..

Both L1 and L2 are CFL but not DCFL.
Both L1 and L2 are DCFL but not regular.
L1 is DCFL but not regular and L2 is CFL but not DCFL.
L1 is CFL but not DCFL and L2 is DCFL but not regular.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the following languages

L1= {ww | w ϵ {a}* }

L2= {wXw | w ϵ {a}* & X is a symbol other than {a,b} }

Select the correct option.

Both are CSL but not CFL
L1 is CSL but not CFL and L2 is regular
L1 is regular and L2 is CFL but not regular
Both L1 and L2 are regular.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66

Both are CSL but not CFL
L1 is CFL but not DCFL and L2 is CSL but not CFL.
L1 is DCFL but not regular and L2 is CSL but not CFL.

L1 is DCFL but not regular and L2 is CFL but not DCFL.

Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66

Both L1 and L2 are regular.
L1 is CSL (non-regular) and L2 is regular.
L1 is regular and L2 is CSL(non-regular).
Both L1 and L2 are CSL (non-regular).
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the following problem P. [MSQ]

P: Given a Turing machine M over the input alphabet Σ, any state q of M And a word w∈Σ*, does the computation of M on w visit the state q.

Select the correct option / options with reference to problem P.

We can prove problem P undecidable by reducing problem P into the halting problem.
We can prove problem P undecidable by reducing the halting problem into problem P.
We can prove problem P semidecidable (recursively enumerable) by reducing problem P into the halting problem.
We can prove problem P semidecidable (recursively enumerable) by reducing the halting problem into problem P.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the following problems.

P1: Whether a Turing machine takes 2021 steps on some input.

P2: Whether a Turing machine accepts some string of length 2021.

Select the correct option

Both P1 and P2 are decidable problems
Both P1 and P2 are undecidable problems.
P1 is decidable and P2 is an undecidable problem.
P1 is undecidable and P2 is a decidable problem.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the following parse tree for string “id*id+id”. With this given information, select the correct option.

“+” is having more priority than “*” and “+” is right associative
“+” is having more priority than “*” and “+” is left associative.
“+” is having more priority than “*” and for “+” associativity is not defined.
None of these
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the grammar given below, where set {(, ), t, a} are terminals and set {S, X} are non-terminals.

S→(X) | (t)

X→aS | S


Select the correct option / options. [MSQ]

The grammar has indirect left recursion, hence it is not LL(1).
The grammar is SLR(1) as well as LALR(1)
Follow(S)={$, ) }
The number of states in DFA using LALR(1) and SLR(1) are the same.
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the following grammar, where set {x, y, w, z, e} are terminals and set {S,A,B} are non-terminals.

S→ xAw | yBw | xBe | yAe

A→z

B→z


Select the correct option / options. [MSQ]

The grammar is LL(1)
The grammar is SLR(1)
The grammar is LALR(1)
The grammar is CLR(1)
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the following relation table


id

+

*

$

id

.>

.>

.>

+

<.

.>

<.

.>

*

<.

.>

.>

.>

$

<.

<.

<.

Select the correct function table from the option.

id

+

*

$

f

5

2

4

0

g

4

1

3

0

id

+

*

$

f

4

2

4

0

g

5

1

3

0

id

+

*

$

f

5

2

3

0

g

4

1

4

0

id

+

*

$

f

4

1

4

0

g

5

2

3

0

Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the following expression (a-b)+c*(d+e). Assuming that all operations take their operands from registers, what is the minimum number of registers needed to execute this program, without spilling into memory.
2
3
4
5
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the basic block given below.

a = b + c

c = a + d

f = a +b

d = f - b

e = c - d

a = e + b

The minimum number of nodes and edges present in the DAG representation of the above basic block respectively are

6 and 6
7 and 8
9 and 12
5 and 6
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66
Consider the following three address code.

  1. i=1
  2. j=1
  3. t1=2*i
  4. t2=t1+j
  5. t3=5*t2
  6. t4=t3+10
  7. a[t4]=10.5
  8. j=j+2
  9. if j<7 goto (3)
  10. i=i+2
  11. if i < 15 goto (2)
  12. i=5
  13. t5=i-3
  14. t6=10*t5
  15. a[t6]=5.0
  16. i=i+1
  17. If i <12 goto (13)

The number of nodes and edges in the control flow graph of the above three address code are _______ and _________ respectively

8, 9
8, 10
9, 12
9, 10
Difficulty Level: 1
Positive Marks: 2.00
Negative Marks: 0.66