i ma getting a string 0101010 from first statement which i hope second second could'nt generate making them not equal...please correct me if i did a mistake

The Gateway to Computer Science Excellence

+1 vote

Best answer

The two regular expressions are not equivalent. The first regular expressions denotes the set of strings having any combination of 1's and 01*0's. Whereas the second regular expression denotes the set of all strings where any number of 1's are followed by any number of 01*0's followed by any number of 1's. So strings of the form 10101010 are generated by the first regular expression but it isn't generated by the second regular expression.

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.3k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.1k
- Non GATE 1.5k
- Others 1.5k
- Admissions 595
- Exam Queries 576
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 17

50,650 questions

56,242 answers

194,288 comments

95,936 users