Discussion
Write an Regular expression :
Starting with 0's or 1's ending with '01' is equivalent to :
Answer: C
The expression is (0 + 1)* 01.
(0 + 1)* matches any string of 0s and 1s, including the empty string, so it covers whatever comes first. Appending 01 forces the string to end with 0 followed by 1. Every binary string ending in 01 can be split this way, and every string the expression generates ends in 01.
The other options fix the wrong ending: (0 + 1)* 11 ends in 11, (0 + 1)* 00 in 00, and (0 + 1)* 10 in 10.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development