• edited by
3,045 views
4 4 votes

The number of strings of length 4 that are generated by the regular expression $(0^+ 1^+ | \,2^+ 3^+ )^{*}$, where | is an alternation character and ${+, ^{*}}$ are quantification characters, is :

  1. $08$
  2. $09$
  3. $10$
  4. $12$

2 Answers

4 4 votes

Given RegExp = (0+1+|2+3+)∗

We can assume this exp as (A+|B+)*  . We can form the string with A(01) or B(23) or both(01,23). So below are the 10 possible 4 char strings.

With 01 --> 0111, 0011, 0001, 0101

With 23 --> 2333, 2233, 2223, 2323

Using both 01 and 23 --> 0123, 2301

Hope it helps.. Thanks :)

0 0 votes

I think answer is (D).

Number of sequences are as:

0001, 0011, 0111, 0123, 0122, 0012, 0112, 2223, 2233, 2333, 2301, 2330

 

 

Position:
Show:

Related questions

1 1 vote
2 2 answers
3.6k
3.6k views
Misbah Ghaya asked Sep 28, 2016
3,586 views
Which of the following is FALSE ?The grammar $S \rightarrow aS|aSbS|\in$, where $S$ is the only non-terminal symbol, and $\in$ is the null string, is ambiguous.An unambig...
2 2 votes
1 1 answer
3.3k
3.3k views
Misbah Ghaya asked Sep 28, 2016
3,348 views
In Data mining, ______ is a method of incremental conceptual clustering.STRINGCOBWEBCORBAOLAD
1 1 vote
1 answers 1 answer
2.7k
2.7k views
Misbah Ghaya asked Sep 28, 2016
2,726 views
Discovery of cross sales opportunities is called as _____.AssociationVisualizationCorrelationSegmentation
1 1 vote
2 2 answers
5.5k
5.5k views
Misbah Ghaya asked Sep 28, 2016
5,463 views
In Data mining, classification rules are extracted from _______.DataInformationDecision TreeDatabase