Skip to content
GATEiit

GATE CSE 2024 Session 2 Q62: Strings of length at most 4 in b*ab*(ab*ab*)*

Question

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 ___________

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 15 (official GATE 2024 final answer key)

Concept used: Identify L1L_1 in words, then count by length.

First step: L1L_1 is the set of strings over {a,b}\{a, b\} with an odd number of aa's; count such strings of length 1 to 4 with binomial coefficients.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2024 Session 2 CS question paper and final answer key, organised by IISc Bangalore. Question paper · Answer key