Question 2774 – Theory-of-Computation
December 2, 2023
Question 3684 – Theory-of-Computation
December 2, 2023
Question 2774 – Theory-of-Computation
December 2, 2023
Question 3684 – Theory-of-Computation
December 2, 2023

Question 3578 – Theory-of-Computation

The number of strings of length 4 that are generated by the regular expression (0​ +​ 1​ + ​ | 2​ +​ 3​ +​ )*, where | is an alternation character and {+, *} are quantification characters, is:

Correct Answer: C

Question 414 Explanation: 
Consider a=0+1+ and b=2+3+

Hence (0+1+ | 2+3+)* = (0+1+ + 2+3+)* = (a+b)*
Now since the min string in 0+1+ is “01” hence “a” has min length two.
Similarly the min string in 2+3+ is “23” , hence “b”has min length two.
We require 4 length strings. +
We can generate 4 length strings using “a” only, or using “b” only or using both.+
Using “a” one time only → 0+1+ only: {0001, 0011, 0111}
using “b” one time only → 2+3+ only : {2223, 2233, 2333}
Using two time, i.e., aa, ab, ba, bb
aa→ 0101
ab→ 0123
ba→ 2301
bb→ 2323
‘Hence total 10 strings {0001, 0011, 0111, 2223, 2233, 2333, 0101, 0123, 2301, 2323}
A
08
B
09
C
10
D
12
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!