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

Home > Logic
Four For Dinner Identification (Posted on 2023-03-13) Difficulty: 3 of 5
A family of four - Mr. & Mrs. Delon, their daughter Amelia, and their son Liam - went out to dinner. They each had a different meat, potato, and vegetable.
  • The meats were either steak, ham, chicken, or lamb.
  • The potatoes were either baked, mashed, french fried, or boiled.
  • The vegetables were peas, carrots, corn, or spinach.
The following facts are known:
  1. One child had lamb and the other french fried potatoes.
  2. One of the females had spinach and the other chicken.
  3. Mr. Delon sat on the right of the person who had corn, who sat on the right of the person who had chicken, who sat on the right of the person who had baked potatoes, who sat on the right of the person who had peas.
  4. One parent had boiled potatoes and the other steak.
  5. One of the males had steak and the other had french fried potatoes.
From the clues given above, determine the meal eaten by each member of the family.

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

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution Comment 2 of 2 |
clearvars,clc
idents=perms('fmds');
meats=perms('shcl');
potatos=perms('bmfp');
vegies=perms('pcms');
lim=length(idents);

for id=1:lim
  ident=idents(id,:);
  for mt=1:lim
    meat=meats(mt,:);
    for pot=1:lim
      potato=potatos(pot,:);
      for veg=1:lim
        vegie=vegies(veg,:);

        ix=find(meat=='l' | potato=='f');
        who=sort(ident(ix));
        if ~isequal(who,'ds')
          continue
        end
        ix=find(meat=='c' | vegie=='s');
        who=sort(ident(ix));
        if ~isequal(who,'dm')
          continue
        end
        ix=find(meat=='s' | potato=='p');
        who=sort(ident(ix));
        if ~isequal(who,'fm')
          continue
        end
        ix=find(meat=='s' | potato=='f');
        who=sort(ident(ix));
        if who~='fs'
          continue
        end
        MrD=find(ident=='f');
        corn=find(vegie=='m');
        chicken=find(meat=='c');
        baked=find(potato=='b');
        peas=find(vegie=='p');
        if MrD==peas
          if mod(MrD-corn,4)==1 ...
              && mod(corn-chicken,4)==1 ...
              && mod(chicken-baked,4)==1 ...
              && mod(baked-peas,4)==1 ...
              && mod(corn-chicken,4)==1 
            disp(ident)
            disp(meat)
            disp(potato)
            disp(vegie)
            disp([MrD corn chicken baked])
            disp(' ')
          end
        end
      end
    end
  end

end

shows

sfdm   identities by family relationship
hslc   meat
fmbp   potatos
mpsc   vegetable
     2     1     4     3 positions
 
dmsf
lchs
bpfm
scmp
     4     3     2     1
 
msfd
chsl
pfmb
cmps
     3     2     1     4
 
fdms
slch
mbpf
pscm
     1     4     3     2
 
which are all really the same with the table rotated differently.

The father ate steak, mashed potatos and peas.
The daughter ate lamb, baked potatos and spinach.
The mother ate chicken, boiled potatos (p for peeled), and carrots.
The son ate ham, french fries and corn (m for maize).

  Posted by Charlie on 2023-03-13 14:37:00
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


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