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

Home > General > Word Problems
Closest to two dozens (Posted on 2024-04-24) Difficulty: 3 of 5
Remember “Unique and restricted” ? ,b (pid=13696)
There I have asked for a restricted answer to an alphametic puzzle and got a set of many words.

Now I have fiddled with a similar equation and again will allow only answers not using any of the letters appearing in “TWELVE”.

TWELVE + TWELVE = (Oompha, grubby, payoff, droppy ….et al)

Your task is to find an answer to my puzzle such that adding the numerical values of all 6 letters in the word chosen by you (a long list of candidate solutions) will be closest to 24.

Start your chase.
Good luck!

No Solution Yet Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 1 of 20
A variation on the Unique and Restricted program:

clearvars,clc

digs='0123456789';
idx=combinator(10,5,'p');
codes=digs(idx);
i=1;
while i<length(codes)
  code=codes(i,:);
  if code(1)=='0'
    codes(i,:)=[];
  else
    i=i+1;
  end
end

% Now form:
% vList -- values of valid double twelves
% pList -- corresponding patterns (codes) for dbl twelves
% dList -- 1 if pattern is one of a duplicate (or multiple) set

% these lists are all the same length and refer to the
%   same coding of TWELVE.

vList=[]; pList=string.empty; dList=[];

% codes will be ordered lists of 4 digits
%   representing t, w, e,l,v
lets='twelv'; ii=0;
for i=1:length(codes)
  code=codes(i,:);
  ns='twelve';
  for j=1:5
    ns=strrep(ns,lets(j),code(j));
  end
  n=str2double(ns);
  v=2*n;
  vs=char(string(v));  
  tst=setdiff(ns,vs);
  % eleven + eleven  must contain no digits from eleven
  if length(tst)==5
    ii=ii+1;
    vList(ii)=v;
    p=string(pttrn([ns vs]));
    if ismember(p,pList)
      dList(find(pList==p))=1;
      dList(ii)=1;
    end
    pList(ii)=p;      
  end  
end

% create a list of patterns with unique numbers
% (if TWELVE is unique then so is twice that value)
goodSubs=find(dList==0);
goodPats=pList(goodSubs);
 
goal=23;

ct=0; pat12=pttrn('twelve');
fid=fopen('c:\words\words.txt','r');
while ~feof(fid)
  w=lower(fgetl(fid));
  if (length(w)==6 || length(w)==7) ...
      && isequal(w,lower(w)) 
    if length(setdiff('twelv',w))==5
      if length(unique(w))<7
        ct=ct+1;
        codePat=pttrn(['twelve' w]);
        if ismember(codePat,goodPats)
          pf=goodPats==codePat;
          sb=find(pf);
          sb=goodSubs(sb);
          matchNum=vList(sb);  
          for i=1:length(matchNum)
            if sod(matchNum(i))==goal
              matchNum(1)=matchNum(i);
            end
          end
          if sod(matchNum(1))==goal
          fprintf('%s %d %d %d %d\n',w,matchNum(1),matchNum(1)/2,sod(matchNum(1)),length(matchNum))
          end
        end
      end
    end
  end
end
fclose('all');

 
function cd=pttrn(n)
  rp='a';
  ns=char(string(n));
  repl=repmat(' ',1,length(ns));
  for i=1:length(ns)
    if repl(i)==' '
      ix=strfind(ns,ns(i));
      repl(ix)=rp;
      rp=char(rp+1);
    end
  end
  cd=repl;  
end

The line

goal=23;

replaces one where goal was 24, as nothing was found for that.

For 23:

         sum  TWELVE sod

across 903722 451861 23 1
burgoo 903722 451861 23 1
bypass 903722 451861 23 1
cashoo 903722 451861 23 1
congii 903722 451861 23 1
goniff 903722 451861 23 1
kaross 903722 451861 23 1
kumiss 903722 451861 23 1
misadd 903722 451861 23 1
morass 903722 451861 23 1
payoff 903722 451861 23 1
ripoff 903722 451861 23 1
ruboff 903722 451861 23 1
runoff 903722 451861 23 1
scruff 903722 451861 23 1
shroff 903722 451861 23 1
skidoo 903722 451861 23 1
cruyff 903722 451861 23 1
hindoo 903722 451861 23 1
johann 903722 451861 23 1

So

TWELVE         451861
TWELVE         451861
------         ------
ACROSS         903722


  Posted by Charlie on 2024-04-24 18:25:50
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


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