Everything2
Near Matches
Ignore Exact
Full Text
Everything2

The set of decimal representations of numbers divisible by 17 is regular

created by ariels

(idea) by ariels (1.9 d) (print)   ?   (I like it!) 1 C! Sun Mar 12 2000 at 18:32:06

Proposition. Let L=L17 be the set of decimal representations of numbers divisible by 17 (the alphabet is {0,1,...,9}). Then L is a regular language.

Proof. We construct a FSA (with 17 states) recognising L. For simplicity of construction, we shall also recognise numbers with leading zeroes (and the empty string) as being divisible by 17; fixing this is left as an exercise for the reader. Our states shall be {r0, ..., r16}; after reading a word w, we shall be in state r_j, where j = w modulo 17. Clearly, for this to work, the initial state and the sole accepting state must be r0.

Consider a word w with j = w modulo 17. If a is one of the digits {0, 1, ..., 9}, then the string wa will represent the number 10*w+a; dividing by 17, we see that the remainder is (10*w+a) modulo 17 = (10*j+a) modulo 17. We can compute this once and for all (for instance, when w is divisible by 17 with remainder 3, tacking on a 1 at the end brings us to remainder 3*10+1 modulo 17 = 14; you might need to look at 20=17+3 and 201=17*11+14 to be convinced). In other words, for every 0≤j<17 and 0≤a<10, we need a transition from rj to r_10*j+a mod 17.

It is now easy to see that the resulting automaton, with 17 states and 170 transitions, recognises L. It is interesting to note the close parallel to the Myhill / Nerode Theorem; a simple modification of the above argument yields that 17 states are required in any automaton recognising L.


printable version
chaos

Square of a number ending with a 5 Myhill / Nerode Theorem regular language How to determine whether a number is divisible by 7
how to determine whether a number is divisible by n One equals point nine repeating Proof of the Myhill Theorem number theory
finite state automaton rule of three How to determine whether a number is divisible by 3 Ackermann function
exercise for the reader Induction fixed point diagonal argument
The Feynman Point continuum hypothesis Armstrong number LSP
Number mathematics modulo repeating decimal
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Just another sprinkling of indeterminacy
Saidai
currying functions
Squatting
conveyor belt
The Wind in the Willows
((Cover))
Arizona
Alcibiades
Shetland Sheepdog
Oligarchical Collectivism
US Copyright for Recipes
Diseases
How to listen to the stories that cats tell us
New Writeups
Heitah
Why I love Everything2(person)
trixingee
Dungeon Mastering for the first time(idea)
Netrat0
It's Called Subtext, Honey(person)
eyeofthebeholder
The Dragon(idea)
Heitah
consist, comprise, constitute, or compose(idea)
Meezzio
Gotlandssnus(thing)
argv
Astral Plane(idea)
Madara
One Winged Angel(fiction)
Tom Rook
Talk is cheap(poetry)
shaogo
Adelle Davis(person)
Aerobe
race car g sfjsgsd(poetry)
Binah
Dream Log: July 5, 2008(dream)
StrawberryFrog
Forgotten things in space(idea)
antigravpussy
velvet revolution fairy tale(idea)
Heitah
Nerve agent VX(thing)
This affordable entertainment brought to you by The Everything Development Company