• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Regular languages and finite automata

Question 141

Suppose that L1 is a regular language and L2 is a context-free language. Which one of the following languages is NOT necessarily context-free?
  • L1∩L2
  • L1⋅L2
  • L1−L2
  • L1∪L2

Question 142

Which one of the following regular expressions represents the set of all binary strings with an odd number of 1′s ?
  • ((0+1)*1(0+1)*1)*10*
  • (0*10*10*)*0*1
  • 10*(0*10*10*)*
  • (0*10*10*)*10*
  • None

Question 143

Consider the following statements. I. If L1∪L2 is regular, then both L1 and L2 must be regular. II. The class of regular languages is closed under infinite union. Which of the above statements is/are TRUE ?
  • Ⅰ only
  • Ⅱ only
  • Both Ⅰ and Ⅱ
  • Neither Ⅰ nor Ⅱ

Question 144

Consider the following languages.
L1 = { wxyx ∣ w,x,y ∈ (0+1)+ }
L2 = { xy ∣ x,y ∈ (a+b)*, ∣x∣=∣y∣, x≠y } 
Which one of the following is TRUE ?
  • L1 is regular and L2 is context- free
  • L1 context- free but not regular and L2 is context-free
  • Neither L1 nor L2 is context- free
  • L1 context- free but L2 is not context-free

Question 145

Consider the following language.

L = { x∈{a,b}* ∣ number of a’s in x divisible by 2 but not divisible by 3 } 

The minimum number of states in DFA that accepts L is _________ . 

  • 6

  • 5

  • 7

  • 4

Question 146

Consider the following language:
L = { w∈{0,1}∗ ∣ w ends with the substring 011 } 
Which one of the following deterministic finite automata accepts L? (A) : (B) : (C) : (D) :
  • A
  • B
  • C
  • D

Question 147

Let L⊆{0,1}∗ be an arbitrary regular language accepted by a minimal DFA with k states. Which one of the following languages must necessarily be accepted by a minimal DFA with k states?
  • L−{01}
  • L∪{01}
  • {0,1}*–L
  • L⋅L

Question 148

Consider the following deterministic finite automaton (DFA) The number of strings of length 8 accepted by the above automaton is ___________
  • 256
  • 128
  • 512
  • 127

Question 149

Suppose we want to design a synchronous circuit that processes a string of 0’s and 1’s. Given a string, it produces another string by replacing the first 1 in any subsequence of consecutive 1’s by a 0. Consider the following example.
Input sequence : 00100011000011100
Output sequence : 00000001000001100 
A Mealy Machine is a state machine where both the next state and the output are functions of the present state and the current input. The above mentioned circuit can be designed as a two-state Mealy machine. The states in the Mealy machine can be represented using Boolean values 0 and 1. We denote the current state, the next state, the next incoming bit, and the output bit of the Mealy machine by the variables s,t,b and y respectively. Assume the initial state of the Mealy machine is 0. What are the Boolean expressions corresponding to t and y in terms of s and b?
  • t = s+b y = sb
  • t = b y = sb
  • t = b y = sb\'
  • t = s+b y = sb\'

Question 150

Which of the following regular expressions represent(s) the set of all binary numbers that are divisible by three? Assume that the string ϵ is divisible by three.
  • (0+1(01*0)*1)*
  • (0+11+10(1+00)*01)*
  • (0*(1(01*0)*1)*)*
  • (0+11+11(1+00)*00)*

There are 154 questions to complete.

Last Updated :
Take a part in the ongoing discussion