This article is from the Puzzles FAQ, by Chris Cole chris@questrel.questrel.com and Matthew Daly mwdaly@pobox.com with numerous contributions by others.
A "pangram" is a sentence containing all 26 letters.
What is the shortest pangram (measured by number of letters or words)?
What is the shortest word list using all 26 letters in alphabetical order?
In reverse alphabetical order?
language/english/sentences/pangram.s
The single-letter words that have meanings unrelated to their letter shapes
or sounds, position in the alphabet, etc. are:
a - indefinite article; on; in; at; to; he; him; she; her; they; them; it; I;
have; of; all
c - 100; cocaine; programming language
d - 500
e - base of natural logs; eccentricity; enlarging
g - acceleration of gravity; general ability; $1000; general audience
i - one; unit vector in x direction; personal pronoun; in; aye
j - one; unit vector in y direction
k - 1000; 1024; strikeout; unit vector in z direction
l - 50; ell; elevated railroad
m - 1000; em; pica; an antigen of human blood
n - an indefinite number; en; an antigen of human blood
o - oh
q - quality of oscillatory circuit
R - one of the three Rs; restricted audience
t - t-shirt
u - upper class
v - five
w - w particle
x - unknown quantity; atmospherics; adults only
y - unknown quantity; YMCA
z - unknown quantity; buzzing sound; z particle
It is therefore advisable to exclude single-letter words, with the
possible exception of 'a'.
As always, word acceptability varies with the dictionaries used. We use these:
9C - Merriam-Webster's Ninth New Collegiate Dictionary, 1986
NI3 - Merriam-Webster's Third New International Dictionary, 1961
NI2 - Merriam-Webster's New International Dictionary, Second Edition, 1935
OED - Oxford English Dictionary with Supplements, 1933 - 85
'+' indicates obsolete, dialectical, slang, or otherwise substandard word.
Some exceptional pangrams:
Using only words in 9C:
Sympathizing would fix Quaker objectives. (5 words, 36 letters)
Quick brown fox, jump over the lazy dogs. (8 words, 32 letters)
Pack my box with five dozen liquor jugs. (8 words, 32 letters)
Jackdaws love my big sphinx of quartz. (7 words, 31 letters)
The five boxing wizards jump quickly. (6 words, 31 letters)
How quickly daft jumping zebras vex. (6 words, 30 letters)
Dub waltz, nymph, for quick jigs vex. (7 words, 28 letters,
Stephen Smith, from a palindrome by Gyles Brandreth)
Quartz glyph job vex'd cwm finks. (6 words?, 26 letters)
Cwm, fjord-bank glyphs vext quiz. (6 words, 26 letters, Dmitri Borgmann)
Using words in 9C and NI3:
Veldt jynx grimps waqf zho buck. (6 words, 26 letters, Michael Jones)
Using words in 9C, NI3 and NI3+:
Squdgy fez, blank jimp crwth vox. (6 words, 26 letters, Claude Shannon)
Using words in 9C, NI3, NI2 and NI2+:
Phlegms fyrd wuz qvint jackbox. (5 words, 26 letters, Dmitri Borgmann)
Some exceptional panalphabetic word lists:
jackbox viewfinder phlegmy quartz (4 words, 31 letters, Mary Hazard)
benzoxycamphors quick-flowing juventude (3 words, 36 letters, Darryl Francis)
Some exceptional nearly panalphabetic isogrammatic word lists:
blacksmith gunpowdery (2 words, 20 letters)
humpbacks frowzy tingled (3 words, 22 letters)
Some exceptional panalphabetic word lists with letters in alphabetical order:
Using only words in 9C:
a BCD ef ghi jack limn op querist ulva wax oyez (11 words, 37 letters)
ABC defog hijack limn op querist ulva wax oyez (9 words, 38 letters)
Using words in 9C and NI3:
a BCD ef ghi jak limn op qres to uva wax oyez (12 words, 34 letters)
ABC defy ghi jak limn op qres to uva wax oyez (11 words, 35 letters)
ABC defy ghi jak limn opaquers turves wax oyez (9 words, 38 letters)
scabicide afghani jokul manrope querist purview oxygenize (7 words, 51 letters)
Using words in 9C, NI3 and NI3+:
a BCD ef ghi jak limn op QRS to uva wax yez (12 words, 32 letters)
ABC defy ghi jak limn op QRS to uva wax yez (11 words, 33 letters)
ab cad ef ghi jak limn op qre stun vow ox yez (12 words, 34 letters)
ABC defy ghi jak limn op querist uva wax yez (10 words, 35 letters)
Using words in 9C, NI3, NI3+, NI2 and NI2+:
ABC def ghi jak limn op qre struv wax yez (10 words, 32 letters)
ABC def ghi jak limn opaquer struv wax yez (9 words, 34 letters)
Using words in 9C, NI3, NI3+, NI2, NI2+ and the OED:
ABC defog hij klam nop QRS tu vow XYZ (9 words, 29 letters, Jeff Grant)
ABC def ghi jak limn op qres tu vow XYZ (10 words, 30 letters)
ABC defog hij klam nop querist uvrow XYZ (8 words, 33 letters, Jeff Grant)
ABC defyghe bij sklim nop querist uvrow XYZ (8 words, 36 letters)
ABC defog hijack limnophil querist uvrow XYZ (7 words, 38 letters, Jeff Grant)
Some exceptional panalphabetic word lists with letters in reverse alpha order:
Using words from 9C:
lazy ox ow vug tsar quip on milk jib hag fed cab a (13 words, 38 letters)
lazy ox wave uts reequip on milk jihad gifted cabal (10 words, 42 letters)
Using words from 9C and NI3:
lazy ox ow vug tsar quip on milk jib hag fed caba (12 words, 38 letters)
lazy ox wave uts roque pon milk jihad gifted caba (10 words, 40 letters)
Using words from 9C, NI3 and NI2:
zo yex wu vug tsar quip on milk jib hag fed caba (12 words, 37 letters)
zo yex wave uts roque pon milk jihad gifted caba (10 words, 39 letters)
All words are main entries in 9C except the following:
9C: ghi (at 'ghee')
NI3: caba, fyrd, jak, opaquers, pon, qre(s), squdgy, uva
NI3+: jimp, QRS (at 'QRS complex'), sklim, vox (at 'vox populi'), yez
NI2: benzoxycamphors, jackbox, limnophil, quick-flowing, yex, zo
NI2+: def, juventude, klam, quar, qvint, struv, tu, wuz
OED: defyghe (at 'defy'), bij (at 'buy'), hij, nop, uvrow (at 'yuffrouw'),
XYZ (at 'X')
The first time I saw this pangram was in Gyles Brandeth's _The Joy of Lex_.
It appeared there as:
Waltz, nymph, for quick jigs vex Bud. (7 words, 28 letters, proper noun.)
I always wondered why they didn't try modifying it as:
Waltz, nymph, for quick jigs vex buds. (7 words, 29 letters, no proper noun.)
However, why fast dances would irritate incipient flowers is beyond me,
so I tried again:
Waltz, dumb nymph, for quick jigs vex. (7 words, 29 letters, no proper noun,
makes more sense.)
However, sounds kind of sexist, and we can maybe chop off a letter and
eliminate the sexism, although suffering some loss of sense:
Waltz, bud nymph, for quick jigs vex. (7 words, 28 letters, no proper noun,
makes less sense.)
There are river nymphs and tree nymphs and mountain nymphs, so there can
be nymphs of the aforementioned incipent flowers, right? Sense is a matter
of opinion, so you can move the bud around or turn it into another imperative
verb rather than a noun-as-adjective:
Waltz, nymph, bud, for quick jigs vex. (7 words, 28 letters, no proper noun,
sense is dubious.)
[We've all heard of budding youth, right?]
Waltz, nymph, for quick bud jigs vex. (7 words, 28 letters, no proper noun,
sense is dubious.)
[Yeah, we've all learned to dance a merry jig that looks like one of those
infamous incipient flowers.]
Dub waltz, nymph, for quick jigs vex. (7 words, 28 letters, no proper noun,
came up with this on the spot and
actually it looks pretty good!)
[The idea being that a nymph, being in control of the soundtrack for a TV
sitcom, has to change the music to which a grandmother is listening, from
something from Ireland to something from Strauss.]
-- Stephen Joseph Smith <sjsmith@cs.umd.edu>
It is fairly straightforward, if time-consuming, to search for minimal
pangrams given a suitable lexicon, and the enclosed program does this.
The run time is of the order of 20 MIPS-days if fed `Official Scrabble
Words', a document nominally listing all sufficiently short words
playable in tournament Scrabble in Britain.
I also enclose a lexicon which will reproduce the OSW results much more
quickly.
The results are dominated by onomatopoeic interjections (`pst', `sh',
etc.), and words borrowed from Welsh (`cwm', `crwth') and Arabic (`qat',
`suq'). Other lexicons will contain a very different leavening of such
words, and yield a very different set of pangrams.
Readers are invited to form sentences (or, less challenging, newspaper
headlines) from these pangrams. Few are amenable to this sort of thing.
-- Steve Thomas
-----cut-----here-----
#include <stdio.h>
#include <ctype.h>
extern void *malloc ();
extern void *realloc ();
long getword ();
#define MAXWORD 26
int list[MAXWORD];
int lp;
struct list {
struct list *next;
char *word;
};
struct word {
long mask;
struct list *list;
} *w;
int wp;
int wsize;
char wordbuf[BUFSIZ];
char *letters = "qxjzvwfkbyhpmgcdultnoriase";
int cmp (ap, bp)
struct word *ap, *bp;
{
char *p;
long a = ap->mask, b = bp->mask;
for (p = letters; *p; p++)
{
long m = 1L << (*p - 'a');
if ((a & m) != (b & m))
if ((a & m) != 0)
return -1;
else
return 1;
}
return 0;
}
void *
newmem (p, size)
void *p;
int size;
{
if (p)
p = realloc (p, size);
else
p = malloc (size);
if (p == NULL) {
fprintf (stderr, "Out of memory\n");
exit (1);
}
return p;
}
char *
dupstr (s)
char *s;
{
char *p = newmem ((void *)NULL, strlen (s) + 1);
strcpy (p, s);
return p;
}
main (argc, argv)
int argc;
char **argv;
{
long m;
int i, j;
while ((m = getword (stdin)) != 0)
{
if (wp >= wsize)
{
wsize += 1000;
w = newmem (w, wsize * sizeof (struct word));
}
w[wp].mask = m;
w[wp].list = newmem ((void *)NULL, sizeof (struct list));
w[wp].list->word = dupstr (wordbuf);
w[wp].list->next = (struct list *)NULL;
wp++;
}
qsort (w, wp, sizeof (struct word), cmp);
for (i = 1, j = 1; j < wp; j++)
{
if (w[j].mask == w[i - 1].mask) {
w[j].list->next = w[i - 1].list;
w[i - 1].list = w[j].list;
} else
w[i++] = w[j];
}
wp = i;
pangram (0L, 0, letters);
exit (0);
}
pangram (sofar, min, lets)
long sofar;
int min;
char *lets;
{
register int i;
register long must;
if (sofar == 0x3ffffff) {
print ();
return;
}
for (; *lets; lets++)
if ((sofar & (1 << (*lets - 'a'))) == 0)
break;
must = 1 << (*lets - 'a');
for (i = min; i < wp; i++)
{
if (w[i].mask & sofar)
continue;
if ((w[i].mask & must) == 0)
continue;
list[lp++] = i;
pangram (w[i].mask | sofar, i + 1, lets);
--lp;
}
}
long
getword (fp)
FILE *fp;
{
long mask, m;
char *p;
char c;
while (fgets (wordbuf, sizeof (wordbuf), fp) != NULL) {
p = wordbuf;
mask = 0L;
while ((c = *p++) != '\0') {
if (!islower (c))
break;
m = 1L << (c - 'a');
if ((mask & m) != 0)
break;
mask |= m;
}
if (c == '\n')
p[-1] = c = '\0';
if (c == '\0' && mask)
return mask;
}
return 0;
}
print ()
{
int i;
for (i = 0; i < lp; i++)
{
struct word *p = &w[list[i]];
struct list *l;
if (p->list->next == NULL)
printf ("%s", p->list->word);
else {
printf ("(");
for (l = p->list; l; l = l->next) {
printf ("%s", l->word);
if (l->next)
printf (" ");
}
printf (")");
}
if (i != lp - 1)
printf (" ");
}
printf ("\n");
fflush (stdout);
}
 
Continue to: