59 views
Let ‘R’ be a regular expression, then which of the following statements is/are TRUE for every 'R'?

S1: There exists 'S' which satisfies property R + S = S.
S2: There exists 'S' which satisfies property R.S = S

A) only S1 is true

B) only S2 is true

C) Both are true

D) Both are false

in general, only S1 is true because if you take S=(sigma)*, it will absorb all strings of R and will become S,

S2 is false because no matter what you choose S, string in R.S should always start with pattern of R.

but if R contain epsilon both will be true

+1 vote
S1: There exists 'S' which satisfies property R + S = S

Suppose R = anything and S = $(a+b)^{*}$, Then R+S = S

S2: There exists 'S' which satisfies property R.S = S

Suppose R = anything and S = $\varnothing$, Then R.S = S

So both S1 and S2 are true.
answered by Boss (6.4k points) 3 11 32
In the statement 1, since R is an regular expression, it can have '∅' as a value. Am I right?

So can we say that ∅ + S = S  (where S is any regular expression).

Is my understanding right?
yes, you can think in that way also.