All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > General > Word Problems
Base-26 (Posted on 2006-09-16) Difficulty: 3 of 5
One professor has written a 3-letter word on the blackboard, and explained that it was a 3-digit number in base 26, using A=0, B=1, C=2, etc.

A second professor figured what the decimal equivalent was, and then used the first professor's notation to write it: 0=A, 1=B, 2=C, etc.

He noticed that the result was also a common 3-letter word.

What were the two words?

  Submitted by Charlie    
No Rating
Solution: (Hide)
The first word can't result in a decimal value greater than 999, and this program does a search:

DECLARE FUNCTION 
isWord! (w$)
OPEN "\words\words3.txt" FOR BINARY AS #1
w$ = "   "
DO
 GET #1, , w$
 IF EOF(1) THEN EXIT 
DO
 n = 0
 FOR i = 1 TO 3
   d = ASC(MID$(w$, i, 1)) - ASC("a")
   n = 26 * n + d
 NEXT
 IF n <= 999 THEN
   n$ = ""
   FOR pn = 1 TO 3
     r = n MOD 10
     n = n \ 10
     n$ = MID$("abcdefghij", r + 1, 1) + n$
   NEXT
   IF isWord(n$) THEN
     PRINT w$, n$
   END IF
 END IF
LOOP

FUNCTION isWord (w$)
 n = LEN(w$)
 w1$ = SPACE$(n)
 OPEN "\words\words\" + LTRIM$(STR$(n)) + ".txt" FOR BINARY AS #2
 l = LOF(2) / n
 low = 1: high = l
 DO
  mid = INT((low + high) / 2)
  GET #2, (mid - 1) * n + 1, w1$
  IF w1$ = w$ THEN isWord = 1: CLOSE 2: EXIT FUNCTION
  IF w1$ < w$ THEN low = mid + 1:  ELSE high = mid - 1
 LOOP UNTIL low > high
 isWord = 0
 CLOSE 2
END FUNCTION

The results were:

aah           aah
adz           bad
ala           cig
alp           dab
and           deb
awl           fid
bah           gid
bed           hid
bee           hie

The words beginning with "a" are leading-zero numbers, which is bad form. Of the remaining ones, the "bed", "hid" pair has the most common words.

Adapted from New Scientist, 5 August 2006, Enigma number 1403.

Comments: ( You must be logged in to post comments.)
  Subject Author Date
Puzzle AnswerK Sengupta2022-08-28 22:26:14
re: The two were a pair of at least six possibilites...vj2006-09-18 10:35:27
SolutionThe two were a pair of at least six possibilites...Dej Mar2006-09-16 21:53:48
Got itJoe2006-09-16 11:26:57
One not so common solutionJoe2006-09-16 10:35:10
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information