in Theory of Computation edited by
1,713 views
1 vote
1 vote
Let $L_{1}$ be the language represented by the regular expression $b^{*} a b^{*}\left(a b^{*} a b^{*}\right)^{*}$ and $L_{2}=\left\{w \in(a+b)^{*}|| w \mid \leq 4\right\}$, where $|w|$ denotes the length of string $w$. The number of strings in $L_{2}$ which are also in $L_{1}$ is _________.
in Theory of Computation edited by
by
1.7k views

3 Answers

2 votes
2 votes


in total 15 strings of L2 are present in L1

0 votes
0 votes
15
0 votes
0 votes
If we try to analyze the regular language, we get L1 = set of strings where number of a's is odd.

For all strings of length 'x' half of them will have odd number of a's i.e. x/2 (think why)

So, we can sum up half of total strings of all lengths (upto 4) in L1 = 1/2 + 2/2 + 4/2 + 8/2 + 16/2 = 15.

These all will be readily available in L2 since it is (a+b)*
Answer:

Related questions