in Theory of Computation edited by
678 views
3 votes
3 votes

Given two regular expressions:

  • $p = (0^* 1^* )^*$  and  
  • $q = 0^* + 1^* + 0^*1 + 10^*$

The length of the smallest string that is present in the language corresponding to regular expression ‘$p$’ and not present in the language corresponding to regular expression ‘$q$’ is ________.

in Theory of Computation edited by
by
678 views

2 Comments

why is epsilon (length 0)  not the answer?
1
1
how come epsilon(length=0) not the answer??
1
1

2 Answers

3 votes
3 votes
Best answer
String 010 is not present in ‘q’ but present in ‘p’ whose length is 3.
selected by

4 Comments

Yes. It is
0
0
Am not getting this please make clear ..
0
0
Sir, 011 is also correct na?
0
0
0 votes
0 votes
Lets consider the binary strings in lexicographic order for lengths starting from $0$ on wards, which will be $\{\epsilon, 0, 1, 01, 10, 11, 000, 001, 010, \ldots \}.$

Here, $p = \Sigma^*$ and generates every binary string.

$\epsilon, 0, 1, 01, 10,11, 000, 001$ are generated by $q$ also but $010$ is not generated by $q.$ $\mid 010 \mid = 3.$

Correct answer: $3.$
Answer:

Related questions