GATE CSE
First time here? Checkout the FAQ!
x
0 votes
33 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

 

Please answer this with a suitable explanation.
asked in Theory of Computation by (39 points)   | 33 views
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 Answer

+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 Active (2k points)  
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.


Top Users Aug 2017
  1. ABKUNDAN

    4670 Points

  2. Bikram

    4556 Points

  3. akash.dinkar12

    3420 Points

  4. rahul sharma 5

    3118 Points

  5. manu00x

    2864 Points

  6. makhdoom ghaya

    2450 Points

  7. just_bhavana

    2136 Points

  8. Tesla!

    2042 Points

  9. stblue

    1930 Points

  10. joshi_nitish

    1686 Points


24,969 questions
32,072 answers
74,565 comments
30,147 users