I need help writing the regular expression over the alphabet (0,1) represent the even numbers in base ten. So basically the regular expression would show represent an even number in binary. (also if you know what the FSA would look for that it would help as well)
Asked
Active
Viewed 590 times
-2
-
1A number being even doesn't depend on the base... – Yuval Filmus Apr 30 '21 at 08:38
-
https://cs.stackexchange.com/q/45570/755 – D.W. Apr 30 '21 at 20:55
1 Answers
1
Here are the first few even natural numbers: $$ \begin{array}{r} 0 \\ 10 \\ 100 \\ 110 \\ 1000 \end{array} $$ Here are the first few odd natural numbers: $$ \begin{array}{r} 1 \\ 11 \\ 101 \\ 111 \\ 1001 \end{array} $$ Notice any pattern? You take it from here.

Yuval Filmus
- 276,994
- 27
- 311
- 503
-
I understand pattern I am just not sure how to write it as a regular expression – Jay Alli Apr 30 '21 at 10:18
-