2

This is from an old exam, the last Task no one could solve correctly and I'm curious how it's done :p

Show that the set of decimal representation (without leading zeroes) of the divisible numbers by 4 (natural numbers) is regular.

By this thread How to prove a language is regular? I know that one can make a DFA to Show that a language is regular.

But is that possible at all because we have infinite natural numbers that are divisible by 4..

I cannot even imagine how that DFA would look like :o

Maybe there is another way of showing this, too?

Edit: Removed..

cnmesr
  • 167
  • 2
  • 10

1 Answers1

4

A decimal number is divisible by 4 if the number formed by its last two digits are divisible by 4. Stated differently, divisibility by 4 depends only on the last two digits. That should be enough for you to show that your language is regular.

The language of numbers in base $b$ divisible by $m$ is regular for all $b,m$, but that's somewhat harder to show.

Gilles 'SO- stop being evil'
  • 43,613
  • 8
  • 118
  • 182
Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503
  • Can you please check my Edit? I've used your explanation and the given link and had created it like that. But I don't know how to continue :s I hope the part I created is correct at least? – cnmesr Oct 19 '17 at 23:42
  • Unfortunately I cannot replace your TA. – Yuval Filmus Oct 20 '17 at 00:07