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

Home > General > Word Problems
Four Credible Word Conclusion (Posted on 2023-02-28) Difficulty: 3 of 5
Consider a common 5-letter English word.
  1. If you insert an E after the 2nd letter you will get a common 6-letter English word.
  2. If instead, you insert an E at the end, you will get another common 6-letter English word.
  3. If instead, you insert an E after the 4th letter, you will get another common 6-letter word.
Determine these four words.

Source: Adapted from a problem appearing in NPR's Sunday Puzzle in 2019.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 1 of 2
The program starts by finding 6-letter words with an E in the third position, then checks that the 5-letter word that remains after the removal of the E is a valid word. Then it tries inserting that E in the other two locations, checking for valid words.


let6=fileread("c:\words\words6.txt");
for i=1:6:length(let6)
  w6=let6(i:i+5);
  if w6(3)=='e'
     w5=[w6(1:2) w6(4:end)];
     if isword(w5)
        if isword([w5 'e'])
           if isword([w5(1:4) 'e' w5(5)])
             disp([w5 ' ' w6 ' ' w5 'e ' w5(1:4) 'e' w5(5)])
           end
        end
     end
  end
end

where isword is;

function iw=isword(x)
  ws=string(x);
  xl=length(x);
  fn=['c:\words\words' num2str(xl) '.txt'];
  words=fileread(fn);
  nwords=length(words)/xl;
  first=1; last=nwords;
  while first<=last
     mid=floor((first+last)/2);
     word=string(words(xl*(mid-1)+1:xl*mid));
     if word==ws
        break 
     end
     if word>ws
         last=mid-1;
     end
     if word<ws
         first=mid+1;
     end     
  end
  if word==ws
      iw=true;
  else
      iw=false;
  end
end

finds

>> fourCredibleWords
spars spears sparse spares
>> 

  Posted by Charlie on 2023-02-28 09:37:31
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (9)
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