Let's substitute each letter of a given word by the value of its ordinal count in the ABC: A=>1, B==>2 .. Z==>26.
Evaluate the total for that word and call it f(k), k being the number of letters in the word.
Let MW(K) be a word for which f(k) is minimal.
Example: assuming the word CAB generates the lowest f(3) then MW(3) is CAB and its f(3)=6.
Question: What triplet of common English words will generate the lowest
Choosing the most common (IMHO) from among the following lists:
cabbage, abandoned, abbreviated.
Any of the following words can be used for the first term:
Each gives a total of 21 for an average letter value of 3.
Any of the following words can be used for the second term:
Each gives a total of 37 for an average letter value of 4.11111111111111
Any of the following words can be used for the third term:
Each gives a total of 52 for an average letter value of 4.72727272727273
Dim crlf$, word$(500)
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
For sz = 7 To 11 Step 2
Open "c:\words\words" + LTrim(Str(sz)) + ".txt" For Binary As #1
w$ = Space$(sz)
lowest = 99999
wCt = 0
Get #1, , w$
If EOF(1) Then Exit Do
v = f(w)
If v <= lowest Then
wCt = wCt + 1
word(wCt) = w
lowest = v
Loop Until EOF(1)
For i = 1 To wCt
Text1.Text = Text1.Text & word(i) & crlf
Text1.Text = Text1.Text & lowest & Str(lowest / sz) & crlf & crlf
Text1.Text = Text1.Text & crlf & " done"
tot = 0
For i = 1 To Len(wd)
ix = InStr("abcdefghijklmnopqrstuvwxyz", Mid(wd, i, 1))
tot = tot + ix
f = tot
Posted by Charlie
on 2017-10-20 16:14:49