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

 

Please answer this with a suitable explanation.
asked in Theory of Computation by Active (1.7k points) 2 5 27 | 59 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 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.


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Top Users Oct 2017
  1. Arjun

    23398 Points

  2. Bikram

    17078 Points

  3. Habibkhan

    8264 Points

  4. srestha

    6296 Points

  5. Debashish Deka

    5438 Points

  6. jothee

    4978 Points

  7. Sachin Mittal 1

    4772 Points

  8. joshi_nitish

    4348 Points

  9. sushmita

    3966 Points

  10. Rishi yadav

    3804 Points


Recent Badges

Famous Question im.raj
Verified Human gk
Notable Question Sanjay Sharma
Popular Question Pravin Paikrao
Notable Question Sanjay Sharma
Notable Question Vineeta
Popular Question rahul sharma 5
Famous Question rahuldb
Great Question jothee
Notable Question Vaishali Trivedi
27,324 questions
35,176 answers
84,111 comments
33,280 users