in Theory of Computation retagged by
534 views
4 votes
4 votes

This question concerns two languages over the alphabet $\Sigma=\{1,-1\}$ (note that this is an alphabet with just two symbols: $1$ and $-1 ).$ The two symbols are interpreted, in the natural way, as the numbers $1$ and $-1,$ in order to define the languages, which are:

  • $L_1=\left\{x \in \Sigma^* \mid\right.$ the sum of the numbers in $x$ is divisible by $3\}$
  • $L_2=\left\{x \in \Sigma^* \mid\right.$ the sum of the numbers in $x$ is $0\}$.

Thus, for example, the first two words below are in both $L_1$ and $L_2$, whereas the third and fourth are in $L_1$ but not in $L_2$.

$$\epsilon \qquad \quad 1\;1-1\;1-1-1 \qquad \quad1\;1-1\;1\;1-1\;1 \qquad \quad -1-1-1-1\;1$$

Which of the above languages is/are regular?

  1. Only $\text{L}_1$
  2. Only $\text{L}_2$
  3. Both
  4. None
in Theory of Computation retagged by
534 views

1 comment

Sir Please elaborate the answer.
0
0

1 Answer

3 votes
3 votes
The language $\mathrm{L}_1$ is regular. The language $\mathrm{L}_2$ is not regular but is CFL.
edited by

3 Comments

Can you please explain the reason for that, I have no clue how to conclude
0
0
L1 is a language which is divisible by 3 so yes you can make a dfa for it so it will be a regular language.

L2 is a language with no. of 1’s and -1’s equal (in order to make sum zero) so it is not regular due to dependency of same power on symbols.
but yes we can define a pda for it so it is cfl
1
1
language of equal number of 1's and -1 is cfl or dfcl?
0
0
Answer:

Related questions