Mobile number validator
CO2BTL 3 – ApplySDG 9 — Industry, Innovation & InfrastructureModule 2
An Indian mobile number: ten digits, the first between 6 and 9. "h" stands for a high leading digit and "d" for any digit, so the machine is a chain of ten states rather than a chain of ten states each with ten outgoing edges. The abstraction is the whole trick — the language over real digits is the same shape.
The expression
hdddddddddThe machine below is its minimal DFA — 12 states over {d, h}. Open it in the playground to see the parse tree and the ε-NFA it came from.
Input
Narration
Start in state {{q0}} with "hddddddddd" still to read.
Run many strings
One string per line. A blank line means the empty string.