What four letters can be rearranged to form six different English words? (There are two solutions of which I am aware.) For example, the letters 'E T M I' can be rearranged to form only four different words ITEM, TIME, EMIT, MITE.
(In reply to
Another solution by Dej Mar)
To {EAST, EATS, SATE, SETA, SEAT, TEAS} can be added ETAS. In fact, my computer word list includes ATES, though I can't find that in a real dictionary.
Another set of 7: aril, lair, lari, liar, lira, rail, rial.
The complete list, including rather suspicious "words", with the number on a line following each list is:
ares
arse
ears
eras
rase
sear
sera
7
ates
east
eats
etas
sate
seat
seta
teas
8
aril
lair
lari
liar
lira
rail
rial
7
staw
swat
taws
twas
wast
wats
6
opts
post
pots
spot
stop
tops
6
stow
swot
tows
twos
wost
wots
6
CLS
OPEN "\words\words4.txt" FOR BINARY AS #1
OPEN "word4ana.txt" FOR OUTPUT AS #2
w$ = " "
DO
GET #1, , w$
IF EOF(1) THEN EXIT DO
w2$ = w$
DO
done = 1
FOR i = 2 TO LEN(w2$)
IF MID$(w2$, i, 1) < MID$(w2$, i - 1, 1) THEN
h$ = MID$(w2$, i, 1)
MID$(w2$, i, 1) = MID$(w2$, i - 1, 1)
MID$(w2$, i - 1, 1) = h$
done = 0
END IF
NEXT
LOOP UNTIL done
PRINT #2, w2$; " "; w$
LOOP
CLOSE
SHELL "sort < word4ana.txt > w4ana.txt"
OPEN "w4ana.txt" FOR INPUT AS #1
DO
LINE INPUT #1, l$
IF LEFT$(l$, 4) = LEFT$(prev$, 4) THEN
wCt = wCt + 1
s$(wCt) = l$
ELSE
IF wCt >= 6 THEN
FOR i = 1 TO wCt
PRINT s$(i)
NEXT
PRINT wCt
ct = ct + 1
END IF
prev$ = l$
wCt = 1
s$(1) = l$
END IF
LOOP UNTIL EOF(1)
IF wCt >= 6 THEN
FOR i = 1 TO wCt
PRINT s$(i)
NEXT
END IF
The program sorts the letters of each 4-letter word into ascending sequence and places that ascending anagram before each word itself on a new file, then sorts that file to group anagrammed words together, and then counts the members of the group. Both the ascending anagram and the word itself are printed by the program, but only the words were pasted in the results above.
|
Posted by Charlie
on 2006-09-27 10:12:29 |