What would be a regular expression for the language of words containing a single 1 and an even number of 0s?
Asked
Active
Viewed 726 times
4
-
3What have you tried? Where did you get stuck? – Yuval Filmus Dec 15 '18 at 23:53
-
Basically stuck on the whole part. I tried splitting them up into two different expressions, one for a single 1 and one for an even number of 0's but still got no where – user97862 Dec 16 '18 at 00:05
1 Answers
3
If a word contains exactly one 1 and an even number of zeroes, then we can decompose it in one of two different ways:
- An even number of 0s, followed by 1, followed by an even number of 0s.
- An odd number of 0s, followed by 1, followed by an odd number of 0s.
You take it from here.

Yuval Filmus
- 276,994
- 27
- 311
- 503