recategorized by
832 views
1 votes
1 votes

Regular expression $(a \mid b)(a \mid b)$ denotes the set

  1. $\{a,b,ab,aa\}$
  2. $\{a,b,ba,bb\}$
  3. $\{a,b\}$
  4. $\{aa,ab,ba,bb\}$
recategorized by

3 Answers

1 votes
1 votes
Given regular expression is $(a | b)(a | b)$.

This translates to picking either a or b followed by either a or b, which means the strings that the above regular expression would generate are ${aa, ab, ba, bb}$.

$\therefore$ Option D is correct.
0 votes
0 votes
Given regular expression can be written as:

$L=(a+b)(a+b)=(a+b)^2$,which accept all the strings of $a,b$ whose length is exactly $2.$

so $L=(a+b)^2=(\ aa,\ ab, \ ba,\ bb)$

Option A) wrong because it generates one length string like $a,b$ and $ba,bb$ is missing.

Option B) same explanation as A, and $aa,ab$ is missing.

Option C) wrong, produces one-length strings.

Option D) correct.

So Option $D$ is correct.

Note: in regular expression $+$ or $|$ sign represent concatenation. Concatenation provides a choice between strings.
0 votes
0 votes

Option D: $\{aa,ab,ba,bb\}$


here (a | b) (a | b), clearly it will have length of 2 so you can easily eliminate all the options other than D.

Also here (a | b) is equivalent to (a+b) i.e. either a or b.

So, (a | b)(a | b) can only produce: ‘aa’, ‘ab’, ‘ba’ and ‘bb’.

Answer:

Related questions

1 votes
1 votes
1 answer
2
admin asked Apr 2, 2020
1,594 views
If every string of a language can be determined, whether it is legal or illegal in finite time, the language is calleddecidableundecidableinterpretivenon-deterministic
0 votes
0 votes
1 answer
3
admin asked Apr 2, 2020
656 views
The defining language for developing a formalism in which language definitions can be stated, is calledsyntactic meta languagedecidable languageintermediate languagehigh ...
2 votes
2 votes
1 answer
4
admin asked Apr 2, 2020
872 views
Two finite state machines are said to be equivalent if theyhave same number of stateshave same number of edgeshave same number of states and edgesrecognize same set of to...