\(\DeclarePairedDelimiterX{\Set}[2]{\{}{\}}{#1 \nonscript\;\delimsize\vert\nonscript\; #2}\) \( \DeclarePairedDelimiter{\set}{\{}{\}}\) \( \DeclarePairedDelimiter{\parens}{\left(}{\right)}\) \(\DeclarePairedDelimiterX{\innerproduct}[1]{\langle}{\rangle}{#1}\) \(\newcommand{\ip}[1]{\innerproduct{#1}}\) \(\newcommand{\bmat}[1]{\left[\hspace{2.0pt}\begin{matrix}#1\end{matrix}\hspace{2.0pt}\right]}\) \(\newcommand{\barray}[1]{\left[\hspace{2.0pt}\begin{matrix}#1\end{matrix}\hspace{2.0pt}\right]}\) \(\newcommand{\mat}[1]{\begin{matrix}#1\end{matrix}}\) \(\newcommand{\pmat}[1]{\begin{pmatrix}#1\end{pmatrix}}\) \(\newcommand{\mathword}[1]{\mathop{\textup{#1}}}\)
Needs:
Alphabets
Needed by:
Dot-Dash Code
Links:
Sheet PDF
Graph PDF

Flash Code

Why

Can flashlights speak?

Speech can be made to correspond to words. And words are sequences of letters. So, roughly, can we communicate letters with a flashlight? No sounds allowed.

Discussion

Well, what can we do with a flashlight? Turn it on and off. So we can blink light. Here’s a thought: One blink means $a$. Two blinks means $b$. Three blinks means $c$. Four blinks means $d$. And so on.

Here’s the rub: how do we know when one letter stops, and another begins. Put another way, does 7 blinks mean $(g)$, or $(b, a, d)$, since 2 + 1 + 4 = 7, or $(c, d)$, since 3 + 4 = 7, or $(d, c)$ and so on. If we change the game, maybe we can change the color of the flashlight. Or give a half-flash. Is a half-flash a “quick” flash, or is it a flash in which we have covered up half of the end of the flashlight?

The first question is a clue. The duration of the blink. How about the duration between blinks? A one second pause in between blinks of a particular a letter. A three second pause for blinks in between letters. A five second pause for a space, to indicate a change of a word? Or an additional symbol, a “space”, in our alphabet, communicated with 27 (!) blinks?

Definition

Denote a blink by $\blink$. The flash code1 for the alphabet $A$ (the latin lower case letters) is the function $f: A \to \str(\set{\blink})$ defined by $f(a) = \blink$, $f(b) = \blink\blink$, $f(c) = \blink\blink\blink$, $f(c) = \blink\blink\blink\blink$ and so on. We call $f(a)$ the code word of $a \in A$. It is a sequence of blinks.

The idea is that if we give someone the code word $f(a)$ for a letter of our alphabet $a \in A$, they will be able to tell us $a$. In the language of functions, we want $f$ to have an inverse. Clearly, $f$ is invertible.

It is natural to extend the flash code for $A$ to strings of $A$. Let $\pause$ represent a long pause. Then we encode a sequence $x \in \str(A)$ by applying $f$ to each element of $x$ in turn, and including a $\square$ in between. The flash code for the strings $\str(A)$ is the function $g: \str(A) \to \str(\set{\blink, \pause})$ defined recursively, as $g(x) = f(x_1)$ if $\num{x} = 1$ and $g(x) = f(x_1)\pause g(x_{2:n})$ when $\num{x} > 1$. For example, we encode the word (string) $(b,a,d)$ as

\begin{equation} \blink \blink \pause \blink \pause \blink \blink \blink \blink \label{ref:blinks} \end{equation}
Now suppose we are given a sequence as shown above. Well, so long as $f$ is invertible, we can decode the codewords (the blinks, in this case) in between the squares and recover the word.


  1. The etymology of code is from the Latin codex, in the legal tradition of a list of statutes. We may well use the term correspondence, or function, but code is standard. ↩︎
Copyright © 2023 The Bourbaki Authors — All rights reserved — Version 13a6779cc About Show the old page view