Aoccdrnig to rscheearch at Cmabrigde uinervtisy, it deosn't mttaer waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht the frist and lsat ltteres are at the rghit pclae. The rset can be a tatol mses and you can sitll raed it wouthit a porbelm. Tihs is bcuseae we do not raed ervey lteter by it slef but the wrod as a wlohe.The two words in bold have no unjumbled English equivalent, and yet we read them as "research" (only one 'h') and "important" (and 'a' instead of an 'e') respectively.
That aside, it's interesting to see why this phenomenon seems to exist. I ran the following program against my /usr/dict/words file:
I get back that there are 1058 pairs of words which are anagrams and that have their first and last letters in common. There are only 52 triplets of such words, and only 1 quadruplet. This is out of 95226 words with 4 or more characters in my /usr/dict/words file.#!/usr/bin/perl use strict; use warnings; my %words; while (<>) { chomp($_ = lc); for (/\b\w+(?:'\w+)?\b/g) { next unless length > 3; my $order = join "", sort split //; $words{substr($_, 0, 1) . substr($_, -1, 1)}{$order}{$_} = 1; } } for my $k (sort keys %words) { my @multi = grep keys %{ $words{$k}{$_} } > 1, keys %{ $words{$k} } +or next; print "$k\n"; for my $o (sort @multi) { my $w = $words{$k}{$o}; print " $o (" . keys(%$w) . ") @{[ keys %$w ]}\n"; } }
I ran this on my local copy of the King James bible (doesn't everyone have one of those?) and came up with only 60 pairs of words (and no triplets, quadruplets, etc.).
In reply to Re: Fun with words (Golf?)
by japhy
in thread Fun with words (Golf?)
by McDarren
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |