edited by
8,797 views
23 votes
23 votes

Which of the following regular expressions describes the language over$\{0, 1\}$ consisting of strings that contain exactly two $1$'s?

  1. $(0 + 1)^ * \ 11(0 + 1) ^*$
  2. $0 ^* \ 110 ^*$
  3. $0 ^* 10 ^* 10 ^*$
  4. $(0 + 1) ^* 1(0 + 1) ^* 1 (0 + 1) ^*$
edited by

3 Answers

Best answer
37 votes
37 votes
  1. with at least $2$ consecutive $1$'s, any no of $0$'s and any no of $1$'s
  2. exactly two consecutive $1$'s
  3. exactly two $1$'s but need not be consecutive
  4. any no of $1$'s and $0$'s with at least two $1$'s


Hence, (C) is the correct option.

edited by
14 votes
14 votes
A. We can get any number of 1.

B.More strict .. means it is covering only one possibility of containing exactly two ones.eg. 0110 ,11  . But 0101 is also satisfying the condition which is not covered by option B.

C. It is covering all d possibility of containing exactly two one's . 101,11,0011,01010........

D. Any no. Of one we can take from here

 

So, answer is option C.
0 votes
0 votes

Draw the Deterministic finite automata with all the transitions for ∑ = {0,1} for no. of 1’s equal to two and get it’s corresponding Regular expression.

Answer:

Related questions

6.4k
views
3 answers
37 votes
Ishrat Jahan asked Oct 29, 2014
6,363 views
A Binary Search Tree (BST) stores values in the range $37$ to $573$. Consider the following sequence of keys.$81, 537, 102, 439, 285, 376, 305$52, 97, 121, ... and $52$ is a leafIV is a postorder sequence of some BST with $149$ as the root
7.9k
views
2 answers
30 votes
Ishrat Jahan asked Oct 28, 2014
7,892 views
Match the following flag bits used in the context of virtual memory management on the left side with the different purposes on the right side of the table below. ... d, III-a, IV-b}$\text{I-b, II-c, III-d, IV-a}$
5.8k
views
4 answers
26 votes
Ishrat Jahan asked Oct 28, 2014
5,774 views
If the time-slice used in the round-robin scheduling policy is more than the maximum time required to execute any process, then the policy ... job firstdegenerate to priority schedulingdegenerate to first come first servenone of the above
10.9k
views
4 answers
24 votes
Ishrat Jahan asked Oct 28, 2014
10,942 views
Consider the C program below. What does it print?# include <stdio.h> # define swapl (a, b) tmp = a; a = b; b = tmp void swap2 ( int a, int b) { int tmp; tmp = a; a = ... $5, 4$4, 5$4, 4$