Regular Expressions questions

Q61

GATE CS 2024 CS-1Regular LanguagesNAT2 marks
Consider the following two regular expressions over the alphabet \{0,1\}:
r=0∗+1∗r = 0^* + 1^*
s=01∗+10∗s = 01^* + 10^*
The total number of strings of length less than or equal to 5, which are neither in rr nor in ss, is _________
Show answer without attempting

Answer: 44

Q22

GATE CS 2024 CS-2Regular LanguagesMCQ1 mark−1/3 if wrong
Which one of the following regular expressions is equivalent to the language accepted by the DFA given below?
Question figure
Show answer without attempting

Answer: A

Q41

GATE CS 2024 CS-2Regular LanguagesMCQ2 marks−2/3 if wrong
Let MM be the 5-state NFA with ϵ\epsilon-transitions shown in the diagram below.

Which one of the following regular expressions represents the language accepted by MM ?
Question figure
Show answer without attempting

Answer: B

Q62

GATE CS 2024 CS-2Regular LanguagesNAT2 marks
Let L1L_1 be the language represented by the regular expression b∗ab∗(ab∗ab∗)∗b^*ab^*(ab^*ab^*)^* and L2={w∈(a+b)∗∣∣w∣≤4}L_2 = \{ w \in (a + b)^* \mid |w| \le 4\}, where ∣w∣|w| denotes the length of string ww. The number of strings in L2L_2 which are also in L1L_1 is ___________
Show answer without attempting

Answer: 15

Q14

GATE CS 2023 CSRegular LanguagesMCQ1 mark−1/3 if wrong
Consider the Deterministic Finite-state Automaton (DFA) A\mathcal{A} shown below. The DFA runs on the alphabet {0,1}\{0, 1\}, and has the set of states {s,p,q,r}\{s, p, q, r\}, with ss being the start state and pp being the only final state.

Which one of the following regular expressions correctly describes the language accepted by A\mathcal{A}?
Question figure
Show answer without attempting

Answer: C

Q12

GATE CS 2022 CSRegular LanguagesMCQ1 mark−1/3 if wrong
Which one of the following regular expressions correctly represents the language of the finite automaton given below?
Question figure
Show answer without attempting

Answer: D

Q47

GATE CS 2021 CS-2Regular LanguagesMSQ2 marks
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.
More than one option can be correct.
Show answer without attempting

Answer: A, B, C

Q7

GATE CS 2020 CSRegular LanguagesMCQ1 mark−1/3 if wrong
Which one of the following regular expressions represents the set of all binary strings with an odd number of 1’s?
Show answer without attempting

Answer: Marks to all

Q32

GATE CS 2020 CSRegular LanguagesMCQ2 marks−2/3 if wrong
Consider the following languages.

L1={wxyx∣w,x,y∈(0+1)+}L_1 = \{wxyx \mid w, x, y \in (0+1)^+\}
L2={xy∣x,y∈(a+b)∗,∣x∣=∣y∣,x≠y}L_2 = \{xy \mid x, y \in (a+b)^*, |x| = |y|, x \ne y\}

Which one of the following is TRUE?
Show answer without attempting

Answer: A

Q16

GATE CS 2016 CS-1Regular LanguagesMCQ1 mark−1/3 if wrong
Which of the following languages is generated by the given grammar?
S⟶aS∣bS∣ϵS \longrightarrow aS \mid bS \mid \epsilon
Show answer without attempting

Answer: D

Q18

GATE CS 2016 CS-1Regular LanguagesMCQ1 mark−1/3 if wrong
Which one of the following regular expressions represents the language: the set of all binary strings having two consecutive 0s and two consecutive 1s?
Show answer without attempting

Answer: B

Q17

GATE CS 2016 CS-2Regular LanguagesMCQ1 mark−1/3 if wrong
Language L1L_1 is defined by the grammar: S1→aS1b∣εS_1 \to aS_1b \mid \varepsilon
Language L2L_2 is defined by the grammar: S2→abS2∣εS_2 \to abS_2 \mid \varepsilon

Consider the following statements:
PP: L1L_1 is regular
QQ: L2L_2 is regular

Which one of the following is TRUE?
Show answer without attempting

Answer: C

Q60

GATE CS 2015 CS-2Regular LanguagesMCQ2 marks−2/3 if wrong
Consider the alphabet Σ={0,1}\Sigma = \{0, 1\}, the null/empty string λ\lambda and the sets of strings X0X_0, X1X_1, and X2X_2 generated by the corresponding non-terminals of a regular grammar. X0X_0, X1X_1, and X2X_2 are related as follows.

X0=1X1X_0 = 1 X_1
X1=0X1+1X2X_1 = 0 X_1 + 1 X_2
X2=0X1+{λ}X_2 = 0 X_1 + \{\lambda\}

Which one of the following choices precisely represents the strings in X0X_0?
Show answer without attempting

Answer: C

Q15

GATE CS 2014 CS-3Regular LanguagesNAT1 mark
The length of the shortest string NOT in the language (over Σ={a,b}\Sigma = \{a, b\}) of the following regular expression is ______________.

a∗b∗(ba)∗a∗a^*b^*(ba)^*a^*
Show answer without attempting

Answer: 3

Q36

GATE CS 2014 CS-1Regular LanguagesMCQ2 marks−2/3 if wrong
Which of the regular expressions given below represent the following DFA?

I) 0∗1(1+00∗1)∗0^*1(1+00^*1)^*
II) 0∗1∗1+11∗0∗10^*1^*1+11^*0^*1
III) (0+1)∗1(0+1)^*1
Question figure
Show answer without attempting

Answer: B

Q8

GATE CS 2013 CSRegular LanguagesMCQ1 mark−1/3 if wrong
Consider the languages L1=ΦL_1 = \Phi and L2={a}L_2 = \{a\}. Which one of the following represents L1L2∗∪L1∗L_1 L_2^* \cup L_1^*?
Show answer without attempting

Answer: A

Q25

GATE CS 2012 CSRegular LanguagesMCQ1 mark−1/3 if wrong
Given the language L={ab,aa,baa}L = \{ab, aa, baa\}, which of the following strings are in L∗L^*?

1) abaabaaabaa
2) aaaabaaaa
3) baaaaabaaaab
4) baaaaabaa
Show answer without attempting

Answer: C

0/170 correct0 marks

Related topics in Regular Languages