MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

THEORY OF COMPUTATION

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
(a+b)* is equivalent to
A
b*a*
B
(a*b*)*
C
(a*b*)*
D
a*b*
Explanation: 

Detailed explanation-1: -So, a+b means [ab] or a|b, thus (a+b)* means any string of length 0 or more, containing any number of a s and b s in any order. Likewise, (a*b*)* also means any string of length 0 or more, containing any number of a s and b s in any order. The two expressions are different ways of expressing the same language.

Detailed explanation-2: -Regular expressions are equal if and only if they correspond to the same language. Thus for example ( a + b )* = ( a*b* )*, because they both represent the language of all strings over the alphabet a, b.

Detailed explanation-3: -We say that two regular expressions R and S are equivalent if they describe the same language. In other words, if L(R) = L(S) for two regular expressions R and S then R = S. Examples.

Detailed explanation-4: -It is equivalent to the Nd regular expression pattern, which includes the standard decimal digits 0-9 as well as the decimal digits of a number of other character sets. If ECMAScript-compliant behavior is specified, ịs equivalent to [0-9].

There is 1 question to complete.