GATE CS 2024 Set 1 — Question 61
NAT+2 / -0MediumRegular ExpressionsFinite Automata & Regular LanguagesTheory of Computation
Theory of Computation → Finite Automata & Regular Languages → Regular Expressions
Last updated
Question
Consider the following two regular expressions over the alphabet :The total number of strings of length less than or equal to 5, which are neither in nor in , is _________
Correct answer
44 to 44
Solution
To find the number of strings of length that are neither in nor in , we first identify the strings in for each length .
Strings in are of the form or .
1.Regular Expression :
Strings in are of the form or .- : (1 string)
- : (2 strings)
- : (2 strings)
- : (2 strings)
- : (2 strings)
- : (2 strings)
Strings in are of the form or .
- : None (0 strings)
- : (2 strings)
- : (2 strings)
- : (2 strings)
- : (2 strings)
- : (2 strings)
- : (1 string)
- : (2 strings)
- : (4 strings)
- : (4 strings)
- : (4 strings)
- : (4 strings)
4.Total strings of length over :
Total = .5.Strings neither in nor in :
Count = Total - .More questions on Finite Automata & Regular Languages
2024 Set 2 Q22Which one of the following regular expressions is equivalent to the language accepted by the DFA…2024 Set 1 Q23Let be two regular languages and a language which is not regular. Which of the…2024 Set 2 Q41Let be the 5-state NFA with -transitions shown in the diagram below. [figure] Which…2024 Set 1 Q50Consider the 5-state DFA accepting the language shown below. For any…2024 Set 2 Q52Consider a context-free grammar with the following 3 rules.…
Practice GATE CS PYQs with adaptive difficulty
Timed practice, skill tracking, and AI explanations — free to start.
Start practicing free