retagged by
689 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
retagged by

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
Answer:

Related questions

455
views
3 answers
4 votes
GO Classes asked Jan 13
455 views
Below you see the transition table of a finite state automaton. The initial state is $0;$ the final state is $4.$ $\emptyset$ denotes the fail state, where no successful transition ... mathrm{abbb}^+\mathrm{c}^+\mathrm{c}$a b^* b b(c c)^+$
656
views
1 answers
3 votes
GO Classes asked Jan 13
656 views
Which of the following is/are undecidable?$L=\left\{\langle M\rangle \mid M\right.$ is a TM, $\mathrm{L}(M) \neq \emptyset$ ... \}$L=\{\langle M\rangle \mid M$ is a DFA and $L(M)$ is uncountable $\}$
626
views
1 answers
4 votes
GO Classes asked Jan 13
626 views
Which of the following statements about Turing machines is false?For every context-sensitive language $L$, there is a Turing machine that accepts precisely the ... behaviour of any given Turing machine $B$ on any given finite input.
857
views
1 answers
6 votes
GO Classes asked Jan 13
857 views
Consider the following non-deterministic pushdown automaton. The input alphabet is $\{a, b\}$, the stack alphabet is $\{*, a, b\}$ ... $a, b: a b$.How many strings of length $12$ are accepted by this NPDA?