Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
17.1k views
in Computer by (15 points)
retagged by

Which of the following regular expression identities are true

1. (r + s)* = r* s*

2. (r + s)* = r* + s*

3. (r + s)* = (r*s*)*

4. r* s* = r* + s*

Please log in or register to answer this question.

1 Answer

0 votes
by (65.0k points)
edited by

Answer: (r + s)* = (r*s*)*

Explanation.
Let take string” rrssrs”
Take + as either one of the path and * as the loop either 0 or more times.
Option (A)  (r + s)* = r* s*
left side  may be
While()
{
Either r or s
};
Left side realize the string. Where as right side fails to realize the string. Because r* s*=
While()
{r}
While()
{s}.
Option (B) (r + s)* = r* + s*
Left side realize the string where as r* + s* =
If()
{
while()
{r
}
Else
{
while()
{s}
}
So right side fails to realize the string “rrssrs”.
Option (C)    (r + s)* = (r*s*)* .

While()
{
While()
{
R
}
While()
{
S
}
}

Right side also realize the string. Hence the answer.

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...