• edited by
646 views
0 0 votes
  1. Let L be a regular language over $\{0,1\}$. Define the reverse of the language $L$ to be the language $L^R = \{ w \in \{0,1\}^* \: \: : \: \: \text{ reverse }(w) \in L\}$, where $\text{reverse}(w)$ denotes the string $w$ in reverse. For example $\text{reverse}(0001)=1000$. Show that $L^R$ is regular.
  2. Let $L=\{x \: \: : \: \: x \in \{0,1\}^*$, $x$ contains an odd number of $1's$ and $00$ as a substring$\}.$  Construct a regular expression for the language $L$.

2 Answers

0 0 votes
Part $(ii)$

Regular Exp where 00 substring is reached when even $\#1s$ = $((0^*10^*1)^*0^*) 00 (0^* 1 0^* (0^*10^*10^*)^*)$

Regular Exp where 00 substring is reached when odd $\#1s$ = $ (0^* 1 0^* (0^*10^*10^*)^*) 00 (0^* 1 0^* (0^*10^*10^*)^*) $

So resulting Regular Expression with 00 as substring and odd $\# 1s$ =  

 

$$\underbrace{((0^*10^*1)^*0^*)}_{Even \quad1s}00\underbrace{(0^* 1 0^* (0^*10^*10^*)^*)}_{Odd \quad1s} + \underbrace{(0^* 1 0^* (0^*10^*10^*)^*)}_{Odd \quad1s}00\underbrace{((0^* 1 0^* (0^*10^*10^*)^*))}_{Even \quad1s}$$
Position:
Show:

Related questions

1 1 vote
1 1 answer
1.2k
1.2k views
go_editor asked Sep 18, 2018
1,170 views
Consider the array $A=[20,13,19,8,3,5,4]$ that represents a heap. Draw the heap after removing the element $20.$List all the distinct integer keys $k$ such that, when $k$...
1 1 vote
0 0 answers
822
822 views
go_editor asked Sep 18, 2018
822 views
Consider sending a large file of $360,000$ bits from Host $A$ to Host $B,$ connected through a router, as shown in the below figure $2.$ Assume that there is no queuing a...
2 2 votes
4 4 answers
2.3k
2.3k views
go_editor asked Sep 18, 2018
2,256 views
Consider the following extract from a program, written in a C-like language, that computes the transpose of a matrix.for (i=0; i<N; i++) for (j=0; j<N; j++) B[i,j]=A[i,j]...
0 0 votes
0 0 answers
469
469 views
go_editor asked Sep 18, 2018
469 views
Commodity items have some positive or negative changes in their prices each week. Each trading company picks a portfolio of commodity items, that is, they have one or mor...