in Theory of Computation edited by
2,005 views
9 votes
9 votes

Let the language $D$ be defined in the binary alphabet $\{0,1\}$ as follows:

$D:= \{ w \in \{0,1\}^* \mid  \text{ substrings 01 and 10 occur an equal number of times in w} \}$

For example , $101 \in D$ while $1010 \notin D$. Which of the following must be TRUE of the language $D$ ?

  1. $D$ is regular
  2. $D$ is context-free but not regular
  3. $D$ is decidable but not context-free
  4. $D$ is decidable but not in NP
  5. $D$ is undecidable
in Theory of Computation edited by
by
2.0k views

2 Comments

D is regular, this is a problem picked up straight from Sipser.
3
3
3
3

2 Answers

13 votes
13 votes
Best answer

Regular expression for the language D$=0(0+1)^*0+1(0+1)^*1$

DFA: http://flolac.iis.sinica.edu.tw/flolac11/lib/exe/logic_computation_theory_hw2s.pdf

edited by

2 Comments

Dfa could be possible for this.

Follow this link you'll understand better https://gateoverflow.in/47443/isi2014-cs-4a

0
0
Regular expression should include $\in, 0, 1$ as well
2
2
1 vote
1 vote
We can also write the regular  expression as :

(1*100*11*)*+(0*011*00*)*

hence D is regular.
Answer:

Related questions