Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1 INTRODUCTION 1
1.1 ANAGRAM ENGINE 1
1.2 DEFINITIONS OF ANAGRAM 1
1.3 HISTORY 2
1.4 SOME FACTS TO ITS RELEVANCE 3
1.4.1 PANAGRAM 3
1.4.2 AMBIGRAM 3
1.4.3 BLANAGRAM 5
1.4.4 PALINDROME 5
1.4.5 SCRABBLE 7
2 AIM 9
2.1 PERMUTATION 9
2.2 COUNTING PERMUTATIONS 10
2.3 DICTIONARY 11
2.3.1 TYPES OF DICTIONARIES 12
2.3.2 ANAGRAM DICTIONARY 13
2.3.3 ONLINE DICTIONARY 14
2.4 SCOPE 14
2.4.1 ASTRONOMY 14
2.4.2 PSEUDONYMS 15
2.4.3 GAMES AND PUZZLES 16
2.4.4 ANAGRAMMATIC POEM 16
2.4.5 DICTIONARY ATTRIBUTE 17
2.4.6 CRYPTIC CROSSWORD 17
2.4.7 SECURITY AND ENCRYPTION 24
2.4.7.1 SKYPE SOFTWARE 24
1
3.7 DISCUSSIONS 31
32
3.7.3 WHAT SET OF LETTERS HAS THE MOST ONE-WORD
ANAGRAMS? 33
4 RESULT 41
4.1 PROGRAM RUN 41
4.2 PERFORMANCE ANALYSIS 42
4.2.1 A SLOW ALGORITHM 42
4.2.2 A FAST ALGORITHM 42
4.3 PLATFORM USAGE 43
4.3.1 PERMUTATION.C 43
4.3.2 DICTIONARY.C 43
4.3.3 FUSE.C 44
4.3.4 RESULTANT 44
5 SUMMARY 45
5.1 CONCLUSIONS 46
6 BILBIOGRAPHY/REFERENCES 47
2
1. INTRODUCTION
1 . 1 T H E A N AG R AM E N G I N E
1 . 2 D E F I N I T I O N S O F AN A G R AM
L i t e r a l l y, t h i s m e a n s t h e l e t t e r s o f a w o r d a r e r e a d b a c k w a r d s .
Can also refer to the change of one word into another by the
transposition of letters. Often, the letters of a word read out of
order to discover hidden meaning.
3
linguistic meaning. The meaning of the new word so created is
seen in the context of or in contrast to that of the old word so
as to create humorous or interesting associations between the
t w o . A n a g r a m s a r e a t yp e o f w o r d p l a y.
1 . 3 H I S T O RY
4
1 . 4 S O M E FAC T S TO I T S R E L E VAN C E
1 . 4 . 1 PAN G R AM
E a c h i s s h o r t e r t h a n t h e l a s t , b u t l e t t e r s a r e s t i l l r e p e a t e d . To
arrive at a perfect pangram, the use of obscure foreign words
and abbreviations is often required, as seen in these examples:
• T V q u i z d r a g n ym p h b l e w J F K ' s c o x .
• C wm fjord-bank gl yphs vext quiz.
1 . 4 . 2 AM B I G R AM
5
AM B I G R AM T Y P E S
Rotational
A design that presents several instances of words when
rotated through a fixed angle. This is usually 180 degrees,
but rotational ambigrams of other angles exist, for
example 90 or 45 degrees. The word spelled out from the
alternative direction(s) is often the same, but may be a
different word to the initiall y presented form. A simple
example is the lower-case abbreviation for "Down", dn,
which looks like the lower-case word up when rotated 180
degrees.
Mirror
A design that can be read when reflected or viewed
t h r o u g h a m i r r o r, u s u a l l y a s t h e s a m e w o r d o r p h r a s e b o t h
wa ys, but not always.
Figure-ground
A design in which the spaces between the letters of one
word form another word.
Chain
A design where a word (or sometimes words) are
interlinked forming a repeating chain. Letters are usually
overlapped meaning that a word will start partway through
another word. Sometimes chain ambigrams are presented
in the form of a circle.
Space-filling
Similar to chain ambigrams, but tile to fill the 2-
dimensional plane.
3-dimensional
A design where an object is presented that will appear to
read several letters or words when viewed from different
angles. Such designs can be generated using constructive
solid geometry.
Perceptual shift
A d e s i g n w i t h n o s ym m e t r y b u t c a n b e r e a d a s t w o
different words depending on how the curves of the letters
are interpreted.
6
Natural
A natural ambigram is a word that possesses one or more
o f t h e a b o v e s ym m e t r i e s w h e n w r i t t e n i n i t s n a t u r a l s t a t e ,
a n d r e q u i r i n g n o t yp o g r a p h i c s t y l i n g . F o r e x a m p l e t h e
words "dollop", "suns" and "solos" are natural rotational
ambigrams. The word "bud" forms a natural mirror
ambigram when reflected h o r i z o n t a l l y. The word
"CHOICE", in all capitals, forms a natural mirror ambigram
w h e n r e f l e c t e d v e r t i c a l l y.
1 . 4 . 3 B L AN AG R AM
1 . 4 . 4 PAL I N D R O M E
T Y P E S O F PAL I N D R O M E
7
Symmetry by characters
Symmetry by words
Symmetry by lines
Still other palindromes take the line as the unit. The poem
D o p p e l g a n g e r, c o m p o s e d b y J a m e s A . L i n d o n , i s a n e x a m p l e .
8
musical form known as crab canon, in particular the canon a 2
c a n c r i za n s o f J o h a n n S e b a s t i a n B a c h ' s T h e M u s i c a l O f f e r i n g .
1 . 4 . 5 S C R AB B L E
9
Macy's department store, which created a demand for the
game.
N O TAT I O N S Y S T E M
I n t h e n o t a t i o n s ys t e m c o m m o n i n t o u r n a m e n t p l a y, c o l u m n s a r e
labeled "A-O" and rows "1-15". A play is usually identified in
the format xy WORD score or WORD xy score, where: x
d e n o t e s t h e c o l u m n o r r o w o n w h i c h t h e p l a y' s m a i n w o r d
extends; y denotes the second coordinate of the main word's
f i r s t l e t t e r, a n d W O R D i s t h e m a i n w o r d . A l t h o u g h u n n e c e s s a r y,
additional words formed by the play are occasionally listed
after the main word and a slash. In the case where the play of
a single tile formed words in each direction, one of the words is
arbitrarily chosen to serve as the main word for purposes of
notation.
10
2 AI M
2 . 1 P E R M U TAT I O N
P e r m u t a t i o n i s t h e r e a r r a n g e m e n t o f o b j e c t s o r s ym b o l s i n t o
distinguishable sequences. Each unique ordering is called a
permutation.For example, with the numerals one to six, each
possible ordering consists of a complete list of the numerals,
without repetitions. There are 720 total permutations of these
numerals, one of which is: "4, 5, 6, 1, 2, 3".
11
• In abstract algebra and related areas, the elements of
permutation may not be arranged in a linear order, or
indeed in any order at all. Under this refined definition, a
permutation is a bijection from a finite set, X, onto itself.
This allows for the definition of groups of permutations;
see permutation group.
• In combinatorics, the term permutation also has a
traditional meaning which includes ordered lists without
repetition and where one or more elements from the list
are omitted from the distinguishable orderings; for
example, a permutation of "1,2,4,3" with "5" and "6"
omitted.
2 . 2 C O U N T I N G P E R M U TAT I O N S
I n t h i s s e c t i o n o n l y, t h e t r a d i t i o n a l d e f i n i t i o n i s u s e d : a
permutation is an ordered list without repetitions, perhaps
missing some elements. The number of permutations of a
sequence is:
where:
O t h e r, o l d e r n o t a t i o n s i n c l u d e n P r , P n , r , o r n P r . A c o m m o n
modern notation is (n)r which is called a falling factorial.
H o w e v e r, t h e s a m e n o t a t i o n i s u s e d f o r t h e r i s i n g f a c t o r i a l ( a l s o
called Pochhammer symbol)
12
With the rising factorial notation, the number of permutations is
(n − r + 1)r.
2 . 3 D I C T I O N AR Y
WORD ORDER
To d a y, d i c t i o n a r i e s o f m o s t l a n g u a g e s w i t h a l p h a b e t i c a n d
s y l l a b i c w r i t i n g s ys t e m s l i s t w o r d s i n l e x i c o g r a p h i c o r d e r,
usually alphabetical or some analogous phonetic system.
13
pin yin spelling, Japanese dictionar y use the order of the kana
s yllabic script, and Korean dictionaries use the hangul
alphabet. However the dictionary for these languages also
usually include a list of characters sorted in a non-phonetic
w a y, i n o r d e r t o a l l o w r e a d e r s t o f i n d w o r d s w r i t t e n i n
logograms whose pronunciation is not known. Chinese
characters may be sorted according to one of many schemes
based on the component parts of the characters (radicals,
number of strokes, overall shape).
2 . 3 . 1 T Y P E S O F D I C T I O N AR I E S
Language dictionaries
Collins English dictionary
English-Zulu Zulu-English dictionary
Webster's third new international
dictionary of the English language
English-Xhosa dictionary
The Oxford dictionary of abbreviations
Dictionary of contemporary slang
A dictionary of English usage in Southern
Africa
Subject dictionaries
Dictionary of library terms
Dictionary of legal words and phrases
Dictionary of feminist theory
A dictionary of birds
Dictionary of applied ecology
Dictionary of advertising and marketing
A political and economic dictionary of
Africa
Biographical dictionaries
Dictionary of African biography
14
A biographical dictionary of artists
The biographical dictionary of scientists
An African biographical dictionary
Biographical dictionary of the Middle East
2 . 3 . 2 A N AG R AM D I C T I O N AR Y
I n t h e o t h e r k i n d o f a n a g r a m d i c t i o n a r y, w o r d s a r e c a t e g o r i z e d
into equivalence classes that consist of words with the same
n u m b e r o f e a c h k i n d o f l e t t e r. T h u s w o r d s w i l l o n l y a p p e a r w h e n
other words can be made from the same letters.
2 . 3 . 3 O N L I N E D I C T I O N AR I E S
15
Language dictionaries, multi-lingual
dictionaries, specialty dictionaries, the
Endangered Language Repository - the
sanctuary for endangered languages on the
World Wide Web, and more
Online Medical & Science dictionaries
Oxford Reference Online
2.4 SCOPE
2.4.1 AS TRON OM Y
2.4.2 PSEUDONYMS
T h e p s e u d o n ym s a d o p t e d b y a u t h o r s a r e o f t e n t r a n s p o s e d
forms, more or less exact, of their names; thus "Calvinus"
becomes "Alcuinus" (V = U); "Francois Rabelais" = "Alcofribas
N a s i e r " ; " A r r i g o B o i t o " = " To b i a G o r r i o " ; " E d w a r d G o r e y " =
16
"Ogdred Wear y", = "Regera Dowd y" or = "E. G. Dead worr y"
(and others); "Vladim ir Nabokov" = "Vi vian Darkbloom ", =
" V i v i a n B l o o d m a r k " o r = " D o r i a n V i v a l c o m b " ; " B r y a n Wa l l e r
Proctor" = "Barry Cornwall, poet"; "Henry Rogers" = "R. E. H.
G r e y s o n " ; " ( S a n c h e ) d e G r a m o n t " = " Te d M o r g a n " , a n d s o o n . I t
is to be noted that several of these are "imperfect anagrams",
letters having been left out in some cases for the sake of easy
pronunciation.
" Te l l i a m e d " , a s i m p l e r e v e r s a l , i s t h e t i t l e o f a w e l l k n o w n w o r k
b y " D e M a i l l e t " . O n e o f t h e m o s t r e m a r k a b l e p s e u d o n ym s o f t h i s
c l a s s i s t h e n a m e " Vo l t a i r e " , w h i c h t h e c e l e b r a t e d p h i l o s o p h e r
assumed instead of his family name, François Marie Arouet,
and which is now generally allowed to be an anagram of
" A r o u e t , l [ e ] j [ e u n e ] " ( U = V, J = I ) t h a t i s , " A r o u e t t h e y o u n g e r " .
Anagramming may also be used to good effect in farce or
parod y. A writer might take an unpleasant person he knows,
base a character in a book on him, and then transpose the
letters in the source's name.
2 . 4 . 3 G AM E S A N D P U Z Z L E S
A n a g r a m s a r e i n t h e m s e l v e s a r e c r e a t i o n a l a c t i v i t y, b u t a l s o
make up part of many other games, puzzles and game shows.
• I n S c r a b b l e , t h e p l a ye r s m u s t m a k e w o r d s b y p l a c i n g
lettered tiles on a grid to score points in an effort to have
scored more points than the opponent at the end of the
game. A version of Scrabble called Clabbers, the name
itself being an anagram of Scrabble, allows for tiles to be
placed in any order on the board as long as they anagram
to a valid word.
17
• I n B o g g l e , p l a ye r s m a k e w o r d s f r o m a g r i d o f s i x t e e n
random letters by joining adjacent cubes to make valid
words.
• O n t h e B r i t i s h g a m e s h o w B r a i n Te a s e r , c o n t e s t a n t s a r e
shown a word broken into randomly arranged segments
and must announce the whole word. At the end of the
game there is a "Pyramid" which starts with a three-letter
word. A letter appears in the line below to which the
p l a ye r m u s t a d d t h e e x i s t i n g l e t t e r s t o f i n d a s o l u t i o n . T h e
p a t t e r n c o n t i n u e s u n t i l t h e p l a ye r r e a c h e s t h e f i n a l e i g h t -
l e t t e r a n a g r a m . T h e p l a ye r w i n s t h e g a m e b y s o l v i n g a l l
the anagrams within the allotted time.
• In several newspapers across the United States people
figure out anagrams in the Jumble word search.
2 . 4 . 4 A N AG R AM M AT I C P O E M
2 . 4 . 5 D I C T I O N AR Y AT T R I B U T E S
1. Meanings
2. Spellings
3. Adjectives
4. Adverbs
5. Conjunctions
6. Interjections
7. Nouns
8. Prepositions
9. Pronouns
18
1 0 . Ve r b s
2 . 4 . 6 C RY P T I C C R O S S W O R D
Ty p e s o f c l u e
Pure cryptic
19
would give the answer ALLELUIA, a word used by Christians to
praise God, but not what first springs to mind on reading the
clue. Notice the question mark - this is often (though by no
means alwa ys) used by compilers to indicate this sort of clue is
one where you need to interpret the words in a different
fashion. The way that a clue reads as an ordinary sentence is
called its surface reading and is often used to disguise the
need for a different interpretation of the clue's component
words.
T h i s t yp e o f c l u e r a r e l y a p p e a r s i n A m e r i c a n c r yp t i c s , b u t i s
c o m m o n i n B r i t i s h a n d C a n a d i a n c r yp t i c s .
Double definition
A c l u e m a y, r a t h e r t h a n h a v i n g a d e f i n i t i o n p a r t a n d a w o r d p l a y
part, have two definition parts. Thus
would have the answer BLIND, because both "not seeing" and
"window covering" can mean blind. Note that since these
definitions come from the same root word, an American
magazine might not allow this clue. American double definitions
tend to require both parts to come from different roots, like in
this clue:
T h e s e c l u e s t e n d t o b e s h o r t ; i n p a r t i c u l a r, t w o - w o r d c l u e s a r e
almost alwa ys double definition clues.
20
Burn milk making hot drink for clergyman (6)
Hidden words
Another example:
gives DOG, which is the first part of, or "introduction to", the
word "do-gooder", and means "canine".
Reversals
21
Hidden backw ards
Sometimes the above two clue types are combined. A word may
be hidden backwards, such as in the clue:
"Charade" clues
For example:
Containers
A c o n t a i n e r c l u e p u t s o n e s e t o f l e t t e r s i n s i d e a n o t h e r. S o :
An agrams
22
Chaperone shredded corset (6)
g i v e s E S C O R T, w h i c h m e a n s c h a p e r o n e a n d i s a n a n a g r a m o f
corset, indicated by the word shredded.
c h e w i s t h e a n a g r a m i n d i c a t o r, h o n e y d e w c l u e s m e l o n , w h i c h i s
t o b e a n a g r a m m e d , a n d f r u i t i s t h e d e f i n i t i o n f o r t h e a n s w e r,
LEMON.
Homophones
Homophones are words that sound the same but have different
meanings, such as "night" and "knight". Homophone clues
always have an indicator word or phrase that has to do with
23
p h o n e t i c s , s u c h a s " r e p o r t e d l y" , " t h e y s a y" , " v o c a l " , " t o t h e
audience", "by the sound of it", and "is heard".
w h i c h i s a c l u e f o r PA R E , w h i c h m e a n s " s h a v e " a n d i s a
h o m o p h o n e o f p a i r, o r " t w i n s " . T h e h o m o p h o n e i s i n d i c a t e d b y
"we hear".
Deletions
An example of a beheadment:
T h e a n s w e r w o u l d b e TA R , a n o t h e r w o r d f o r " s a i l o r " , w h i c h i s a
" c e l e b r i t y" , o r s t a r, w i t h o u t t h e f i r s t l e t t e r.
An example of curtailment:
24
Challenging sweetheart heartlessly (6)
Combination clues
A c l u e m a y e m p l o y m o r e t h a n o n e m e t h o d o f w o r d p l a y. F o r
example:
"& lit."
This satisfies the "& lit." clue definition, but as read is clearly a
cr yp tic clue. Another e xam ple:
T h e a n a g r a m h a s i t s r e a c h t i l l t h e c r y p t o g r a p h y. T h i s i s v e r y
n i c e t o o l f o r t h e e n c r y p t i o n a n d d e c r yp t i o n p u r p o s e . T h e r e m a y
25
b e m a n y w a y s t o e n c r y p t a n d d e c r yp t a d a t a b u t i f t h e p r o g r a m
is intended to be made simpler and less complex in all areas
then the anagram implementation suits.
2 . 4 . 7 . 1 S K Y P E S O F T WAR E
Ever since Skype was launched, we have said it is, and will
r e m a i n , s e c u r e . Yo u r S k y p e - t o - S k yp e c a l l s , c h a t s a n d o t h e r
c o m m u n i c a t i o n s a r e e n d - t o - e n d e n c r yp e d .
We’re happy to report that the work is now complete and you
c a n d o w n l o a d t h e f u l l r e p o r t f r o m S k yp e s e c u r i t y c e n t e r ( P G P
signature). There’s also an executive summary available. Note
t h a t w h i l e t h e f u l l r e p o r t w a s c o m p i l e d b y D r. To m B e r s o n f r o m
Anagram Laboratories, the summary is written in-house by
Sk ype based on the full report .
I n s h o r t , t h e c o n c l u s i o n o f t h e r e p o r t i s t h a t S k yp e u s e s
standards-based methods and a sound design to secure its
users, software and system, and does what it says — is secure.
Of course, security is never “done”, so security continues to be
a n i m p o r t a n t t r a c k i n a l l S k yp e d e v e l o p m e n t s a n d o p e r a t i o n s .
W h o a r e To m B e r s o n a n d A n a g r a m a n y w a y ? I n t h e i r o w n w o r d s :
To m i s a l o n g - t i m e v e t e r a n i n f o r m a t i o n s e c u r i t y e x p e r t w i d e l y
r e s p e c t e d b y h i s p e e r s i n t h e s e c u r i t y i n d u s t r y. T h i s i s a
standard method of doing this type of research — you don’t just
want to get anyone “off the street” to do it for you because the
name is unknown in the industry and the quality cannot be
trusted. Our selection process for finding the right person and
c o m p a n y t o d o t h e S k yp e s e c u r i t y r e v i e w s t a r t e d m o r e t h a n a
26
year ago, and we’re happy to have ended up working with Dr
Berson.
3 M AT E R I AL S AN D M E T H O D S
3 . 1 P L AT F O R M
P e r l i s a d yn a m i c p r o g r a m m i n g l a n g u a g e c r e a t e d b y L a r r y Wa l l
and first released in 1987. Perl borrows features from a variety
27
o f o t h e r l a n g u a g e s i n c l u d i n g C , s h e l l s c r i p t i n g ( s h ) , AW K , s e d
and Lisp.
S t r u c t u r a l l y, P e r l i s b a s e d o n t h e b r a c e - d e l i m i t e d b l o c k s t y l e o f
AW K a n d C , a n d w a s w i d e l y a d o p t e d f o r i t s s t r e n g t h s i n s t r i n g
processing, and lack of the arbitrary limitations of many
scripting languages at the time.
D y n a m i c l a n g u a g e s a n d d yn a m i c t yp i n g a r e n o t i d e n t i c a l
concepts, and a dynamic language need not be dynamically
t yp ed, though man y d ynam ic languages are d ynam icall y t yped.
3.2 OVERVIEW
3 . 3 F E AT U R E S
28
Perl also takes features from shell programming. All variables
are marked with leading sigils, which unambiguously identify
t h e d a t a t yp e ( s c a l a r, a r r a y, h a s h , e t c . ) o f t h e v a r i a b l e i n
c o n t e x t . I m p o r t a n t l y, s i g i l s a l l o w v a r i a b l e s t o b e i n t e r p o l a t e d
directly into strings. Perl has many built-in functions which
provide tools often used in shell programming (though many of
these tools are implemented by programs external to the shell)
like sorting, and calling on system facilities.
3.4 DESIGN
Perl has many features that ease the programmer's task at the
expense of greater CPU and memory requirements. These
include automatic memor y management; dynamic typing;
29
strings, lists, and hashes; regular expressions; introspection
and an eval() function.
Wa l l w a s t r a i n e d a s a l i n g u i s t , a n d t h e d e s i g n o f P e r l i s v e r y
much informed by linguistic principles. Examples include
Huffman coding (common constructions should be short), good
end-weighting (the important information should come first),
and a large collection of language primitives. Perl favors
language constructs that are natural for humans to read and
w r i t e , e v e n w h e r e t h e y c o m p l i c a t e t h e P e r l i n t e r p r e t e r.
Perl syntax reflects the idea that "things that are different
should look different". For example, scalars, arrays, and
hashes have different leading sigils. Arra y indices and hash
ke ys use different kinds of braces. Strings and regular
expressions have different standard delimiters. This approach
can be contrasted with languages like Lisp, where the same S-
e x p r e s s i o n c o n s t r u c t a n d b a s i c s yn t a x i s u s e d f o r m a n y
different purposes.
Perl has several mottos that convey aspects of its design and
use. One is "There's more than one way to do it ." (TIMTOW TDI,
u s u a l l y p r o n o u n c e d ' Ti m To a d y ' ) . O t h e r s a r e " P e r l : t h e S w i s s
Army Chainsaw of Programming Languages" and "No
unnecessary limits". A stated design goal of Perl is to make
easy tasks eas y and difficult tasks possible. Perl has also been
c a l l e d " T h e D u c t Ta p e o f t h e I n t e r n e t " .
30
Perl. There has only ever been one implementation of the
i n t e r p r e t e r. T h a t i n t e r p r e t e r, t o g e t h e r w i t h i t s f u n c t i o n a l t e s t s ,
stands as a de facto specification of the language.
3 . 5 A P P L I C AT I O N S
P e r l h a s b e e n u s e d s i n c e t h e e a r l y d a ys o f t h e W e b t o w r i t e
CGI scripts. It is known as one of "the three Ps" (along with
P y t h o n a n d P H P ) , t h e m o s t p o p u l a r d yn a m i c l a n g u a g e s f o r
writing Web applications (which now also include Ruby). It is
also an integral component of the popular LAMP solution stack
for web development. Large projects written in Perl include
S l a s h , B u g z i l l a , T W i k i a n d M o v a b l e Ty p e . M a n y h i g h - t r a f f i c
websites, such as Amazon.com, Livejournal.com,
Ti c k e t m a s t e r. c o m a n d I M D b . c o m u s e P e r l e x t e n s i v e l y.
P e r l i s o f t e n u s e d a s a g l u e l a n g u a g e , t yi n g t o g e t h e r s ys t e m s
and interfaces that were not specifically designed to
interoperate, and for "data munging", ie. converting or
processing large amounts of data for tasks like creating
reports. In fact, these strengths are intimately linked. The
combination makes perl a popular all-purpose tool for system
administrators, particularly as short programs can be entered
and run on a single command line.
3 . 6 I M P L E M E N TAT I O N
P e r l i s i m p l e m e n t e d a s a c o r e i n t e r p r e t e r, w r i t t e n i n C , t o g e t h e r
with a large collection of modules, written in Perl and C. The
source distribution is, as of 2005, 12 MB when packaged in a
tar file and compressed. The interpreter is 150,000 lines of C
c o d e a n d c o m p i l e s t o a 1 M B e x e c u t a b l e o n t yp i c a l m a c h i n e
a r c h i t e c t u r e s . A l t e r n a t i v e l y, t h e i n t e r p r e t e r c a n b e c o m p i l e d t o
a link library and embedded in other programs. There are
nearly 500 modules in the distribution, comprising 200,000
31
lines of Perl and an additional 350,000 lines of C code. (Much
of the C code in the modules consists of character encoding
tables.)
32
rely on the functional tests to ensure that changes to the
i n t e r p r e t e r d o n o t i n t r o d u c e b u g s ; c o n v e r s e l y, P e r l u s e r s w h o
see the interpreter pass its functional tests on their system can
h a v e a h i g h d e g r e e o f c o n f i d e n c e t h a t i t i s w o r k i n g p r o p e r l y.
3.7 DISCUSSIONS
3 . 7 . 1 A R E T H E R E A N Y U N U S U AL VAR I E T I E S O F A N AG R AM S ?
( A d a p t e d f r o m W o r d s a t P l a y b y O . V. M i c h a e l s e n , a n d w i t h
a d d i t i o n a l m a t e r i a l f r o m W i l l i a m Tu n s t a l l - P e d o e )
A n a n t i g r a m , o r a n t o n ym o u s a n a g r a m , h a s a n o p p o s i t e m e a n i n g
to the subject text. Such anagrams are quite uncommon and
often accidentally discovered. Here are some great examples:
33
• Evian = naive.
• Pat = tap.
• Samaroid = dioramas.
Tr a n s p o s e d c o u p l e t s , o r p a i r a g r a m s , a r e s i n g l e - w o r d a n a g r a m s
that placed together create a short meaningful phrase.
• A c t o r s c o - s t a r.
• Best bets.
• Demo mode.
• Elvis lives.
• Float aloft.
• Latent talent.
• American Cinerama.
• L o v e l y v o l l e y.
• Nameless salesmen.
• Oriental relation.
• Outer route.
• Streaming emigrants.
3 . 7 . 2 W H AT I S T H E L O N G E S T O N E - W O R D A N AG R AM ?
• conversationalists = conservationalists
• Hydroxydeoxycorticosterones =
Hydroxydesoxycorticosterone.
34
3 . 7 . 3 W H AT S E T O F L E T T E R S H AS T H E M O S T O N E - W O R D
A N AG R AM S ?
• a n e s t r i , a s t e r i n , e r a n i s t , n a s t i e r, r a t i n e s , r e s i a n t , r e s t a i n ,
r e t a i n s , r e t i n a s , r e t s i n a , s a i n t e r, s t a i n e r, s t a r n i e , s t e a r i n
W o r d Wa y s h a s f o r s o m e y e a r s b e e n c o l l e c t i n g a n a g r a m s o f
' a e g i n r s t ' . W i l l i a m Tu n s t a l l - P e d o e i n d i c a t e s t h a t a w h o p p i n g
157 of these have some justification.
3 . 7 . 4 W H AT I S T H E P O I N T O F AN A G R AM S ?
E s s e n t i a l l y, a n a g r a m m i n g i s a r e c r e a t i o n a l a c t i v i t y. G r e a t
pleasure can be obtained when one finds a witty anagram in
someone's name. We will often find the 'hidden truth' in an
anagram of a person's name:
• M a t t h i a s N . R i t c h i e . = I a m t h e A n t i c h r i s t ! ( M i c k Tu l l y,
1998)
35
To p i c a l a n a g r a m s f r o m c u r r e n t e v e n t s a r e f r e q u e n t l y a s o u r c e
of interest. For example:
• B o s n i a n Wa r C r i m e s . = S e r b i a n r a c i s m w o n . ( To m M y e r s ,
1999)
• Whitehouse Intern Miss Monica Samille Lewinsky = Hey!
William Clinton arouses me. Hi! I'm Ken's witness!
( W i l l i a m Tu n s t a l l - P e d o e , 1 9 9 8 )
3 . 7 . 5 H O W D O Y O U C R E AT E A N AG R AM S ?
3 . 7 . 6 W H AT AR E T H E H AL L M AR K S O F A G O O D AN AG R AM ?
36
Condensations that sound like newspaper headlines are quite
acceptable. Simply reordering the words can make a difference.
• Male chauvinism =
Va l i u m m a c h i n e s - - i s q u i t e b i z a r r e a n d m e a n i n g l e s s .
Ah, masculine vim -- is a bit b e t t e r.
I ' m s u c h a v i l e m a n . ( J a yb u r, 2 0 0 0 ) - - m a k e s g r e a t s e n s e .
( 3 ) E x p l a n a t i o n . A n a n a g r a m s h o u l d b e s e l f - e x p l a n a t o r y, s e l f -
sufficient; it should not need an y extra explanation or comment.
O c c a s i o n a l l y, such as when the subject matter is
obscure/regional or the anagram refers to a little-known aspect
of the original, it may validly be accompanied by some brief
d e t a i l s ; h o w e v e r, i n m o s t c a s e s , t h e a n a g r a m i s w e a k i f a n
explanation is required.
• Ta m - o ' - s h a n t e r =
One smart hat. (Janet Muggeridge, 1999)
• Gastroenterologist =
I let go torrents o' gas. -- the use of the shortened form of
'of' is a minor f l a w.
(Larry Brash, 2000)
37
(5) Avoidance of repetition of words in original phrase.
Repeating a key word from the original in its anagram detracts
from the cleverness of the result. The repetition of 'the' and
o t h e r s h o r t n o n - k e y w o r d s i s q u i t e O K , o f c o u r s e . O c c a s i o n a l l y,
the repetition is acceptable. Such an anagram is sometimes
referred to as a parallelogram.
( 6 ) H u m o u r, b e i t r u d e , w i t t y, s a r c a s t i c , o r a b u s i v e , w i l l a l w a y s
improve an anagram, especially when the punchline contains a
real surprise. WARNING: Eating and drinking whilst reading
alt.anagrams can lead to the contents of your oral cavity being
sprayed over your monitor or drinks being spilt onto your
ke yboard.
38
Perhaps the ultimate in flow allowed through punctuation is an
anagram with the phrase in the left side continuing on in the
right-hand side, for one coherent thought. These are usually
more impressive if one or the other side is a set phrase. An
example:
• A McDonald's burger =
Real dog and crumbs. -- adding an 'A' to the subject made
this one work.
( M i c k Tu l l y, 1 9 9 8 )
( 11 ) W e l l - k n o w n s u b j e c t t e x t . T h e m o r e f a m o u s t h e n a m e o f t h e
person or thing being anagrammed, the better the result is
likely to be.
39
(12) Selectness. An anagram should represent your best efforts
with the given letters. Don't make hundreds of readers sift
through your efforts to find the good ones (or quit in disgust):
do the selection yourself, though you may solicit readers'
opinions on which of a couple wording options works best.
Remember: if you've done twenty anagrams on the same base
phrase, at least ten of them are crap. No, don't tell us how you
were experimenting with different approaches, and don't add
comments to explain their glories. At least ten of them are crap.
e . g . To f i n d t h e a n a g r a m s o f a w o r d w e f i r s t r e d u c e i t t o b a s e
form and then we search the
anagram dictionary for this base form. For example, to find the
anagrams of “snap” we reduce it to its base form “anps” and
search the anagram dictionary for “anps” and return the value
at this index, the words “pans” and “snap”. The input word itself
m a y n o t b e i n t h e g i v e n d i c t i o n a r y, w h a t t h e p r o g r a m f i n d s i s a l l
t h e w o r d s t h a t a r e a n a g r a m s o f i t i n t h e g i v e n d i c t i o n a r y.
3 . 7 . 8 M ET H O D S ( C O N T D . . . )
40
Computers have enabled a new method of creating anagrams,
the anagram ser ver, anagram sol ve r or anagrammer. These
are often used to find solutions for crosswords, Scrabble,
Boggle and other word games. A large number of these are
available on the Internet. When the anagrammist enters a word
or phrase the program or server utilizes an exhaustive
database of words to produce a list containing every possible
combination of words or phrases from the input word or phrase.
Some programs such as Lexpert (used for Scrabble) only allow
one-word answers. Many anagram servers can control the
search results, by excluding or including certain words, limiting
the number or length of words in each anagram, or limiting the
number of results. Anagram solvers are often banned from
o n l i n e a n a g r a m g a m e s , s u c h a s Ya h o o ! L i t e r a t i w h e r e t h e y c a n
be used for an unfair advantage, in some cases allowing a
pla ye r to ne ver miss a single word .
41
4 R E S ULT S
4 . 1 P R O G R AM R U N :
Earth
Anagram generated:
Heart
42
Abroad
Anagram generated:
Aboard
Raw
Anagram generated:
Wa r
Acme
Anagram generated:
Came
Mace
Aligned
Anagram generated:
Leading
Dealing
4 . 2 P E R F O R M AN C E AN ALY S I S
E x a m i n e A l l P e r m u t a t i o n s . ‘ ‘ c h o l e c y s t o d u o d e n o s t o m y’ ’
h a s 2 2 ! p e r m u t a t i o n s . O n e p i c o s e c o n d e a c h g i v e s 1 . 11 0 9
seconds, or a few
d e c a d e s . ( T h e r u l e o f t h u m b t h a t ‘ ‘ s e c o n d s i s a n a n o c e n t u r y’ ’
is half a percent off the true value of 3. 155107 seconds per
y e a r. )
Examine All Pairs of Words. Assume 230,000
43
words in the dictionary
S TAT I S T I C S :
4 . 2 . 2 A FAS T A L G O R I T H M
The Idea. Sign words so that those in the same anagram class
have the same signature, and then collect equal signatures.
The Signature. Sort letters within a word. The signature of
‘‘deposit’’ is ‘‘deiopst’’, which is also the
signature of ‘‘dopiest’’. Collecting the Classes. Sort the words
by their signatures.
A S u m m a r y. S o r t t h i s w a y ( w i t h a h o r i z o n t a l w a v e o f t h e h a n d )
then that way (a vertical wave).
4 . 3 P L AT F O R M U S AG E :
As implemented in c/c++:
44
1. permutation.c
2. stack.h
3. data.h
4. d i c t i o n a r y. c
5. fuse.c
4 . 3 . 1 P E R M U TAT I O N . C
stack.h
data.h
4 . 3 . 2 D I C T I O N AR Y. C
4.3.3 FUSE.C
This is the final module which results in the fusing of the above
two module explained. This takes in the output of the
p e r m u t a t i o n . c a n d g i v e s i t a s a n i n p u t t o t h e d i c t i o n a r y. c a n d
after checking the dictionary for each and every permuted word.
The result is show to the user whether the word is present of
45
not. If the word is present then anagram found or else not
found.
4 . 3 . 4 R E S U LTAN T:
5 S U M M ARY
A N AG R AM
AIM
46
Generation of an anagram by the user for the specified word,
which is presented as an input to the program.
SCOPE
3.1 Astronomy
3.2 P s e u d o n ym s
3.3 Anagrammatic Poem
3.4 Dictionaries
3.5 Scrabble game and puzzles
3.6 Security reasons
P L AT F O R M
ACTIVEPERL
CONCLUSIONS
47
6 B I L B I O G R AP H Y / R E F E R E N C E S
Where can one find anagram generators, books, and Web sites?
Several programs are available, and more are being written all
the time to meet specific needs. Many of our regular
contributors have developed or are developing anagram
generators and checkers themselves. This is only a partial list
of the programs available:
48
* One of the most popular is Anagram Genius, a commercial
Mac/Windows package. Information and a categorised archive
of anagrams discovered with Anagram Genius is available at
h t t p : / / w w w. a n a g r a m g e n i u s . c o m / .
49
* Manarags 2 (for DOS/Windows, written in 32-bit C++) is
available from To m 7's download page at
h t t p : / / w w w. a n d r e w. c m u . e d u / ~ t w m / m a n a / .
* A l s o , a t h t t p : / / w w w. g t o a l . c o m / w o r d g a m e s / a n a g r a m s . h t m l y o u
will find - if the site is having a good day - a list with links to
various other anagram generators' source code, available from
the gtoal.com site.
Also, various anagram aids exist. One is the Mar yana pattern-
a n c h o r e d a n a g r a m m e r, d e s c r i b i n g i t s e l f a s " e x t r e m e l y u s e f u l f o r
cheating at Scrabble". It is available for download at
h t t p : / / r u n s l i n u x . n e t / p r o j e c t s / m a r g a n a / m a r g a n a - 1 . 1 . t a r. g z . In
addition, several people have written anagram checker
programs that determine the difference in letters of the subject
text and the anagram-in-progress, letting you know how many
of each letter are still available for use. Information on some
anagram checkers, as well as further details on many of the
anagram generators mentioned above, can be found at
h t t p : / / w w w. a n a g r a m m y. c o m / r e s o u r c e s / g e n e r a t o r s . h t m l .
2. Can you point me to an online anagram generator?
50
increase the load on these sites. Some anagram generation
sites have been closed down or become unusable due to high
traffic.
3. What are the best books on anagrams?
To m M y e r s h a s a J a v a a p p l e t t h a t c r e a t e s a n i m a t e d a n a g r a m s
a v a i l a b l e a t h i s s i t e h t t p : / / w w w. a n i - g r a m . c o m / .
51