Regular Expression


Q1.

Consider the regular expression R = (a + b)^* (aa + bb) (a + b)^* Which deterministic finite automaton accepts the language represented by the regular expression R?
GateOverflow

Q2.

Which of the following regular expressions represent(s) the set of all binary numbers that are divisible by three? Assume that the string \epsilon is divisible by three.[MSQ]
GateOverflow

Q3.

Which one of the following regular expressions represents the set of all binary strings with an odd number of 1's?
GateOverflow

Q4.

Which one of the following regular expressions represents the language: the set of all binary strings having two consecutive 0s and two consecutive 1s?
GateOverflow

Q5.

Consider the following definition of a lexical token id for an identifier in a programming language, using extended regular expressions: letter \rightarrow [A-Za-z] digit \rightarrow [0-9] id \rightarrow letter (letter\;| \;digit)^* Which one of the following Non-deterministic Finite-state Automata with - transitions accepts the set of valid identifiers? (A double-circle denotes a final state)
GateOverflow

Q6.

Which of the following regular expressions describes the language over\{0, 1\} consisting of strings that contain exactly two 1's?
GateOverflow

Q7.

Which regular expression best describes the language accepted by the non-deterministic automaton below?
GateOverflow

Q8.

Consider the regular expression R = (a + b)^* \ (aa + bb) \ (a + b)^* Which one of the regular expressions given below defines the same language as defined by the regular expression R ?
GateOverflow

Q9.

Consider the Deterministic Finite-state Automaton (DFA) A shown below. The DFA runs on the alphabet {0, 1}, and has the set of states {s, p, q, r}, with s being the start state and p being the only final state.Which one of the following regular expressions correctly describes the language accepted by A?
GateOverflow

Q10.

The length of the shortest string NOT in the language (over \Sigma={a,b}) of the following regular expression is _________. a*b* (ba)* a*
GateOverflow