-2
$\begingroup$

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)

$\endgroup$
2
1
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ I understand pattern I am just not sure how to write it as a regular expression $\endgroup$ – Jay Alli Apr 30 at 10:18
  • $\begingroup$ You merely need to end the string with a $0$. Can you do it now? $\endgroup$ – bigbang Apr 30 at 10:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.