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

Home > Logic
Lunchtime Variety (Posted on 2024-09-09) Difficulty: 3 of 5
Grant, Neal and Kyle just finished their lunch. One of the boys had a ham sandwich, another a turkey sandwich and the third, a chicken sandwich.

If only one of the following four statements is true, who had what for lunch?

1. Kyle had the turkey sandwich.
2. Neal did not have a chicken sandwich.
3. Kyle did not have a chicken sandwich.
4. Neal did not have the ham sandwich.

No Solution Yet Submitted by K Sengupta    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution re: some thoughts | Comment 2 of 5 |
(In reply to some thoughts by Charlie)

Well, I misread the clues: Statement 2 was not about Kyle but about Neal. Statement 2 is the true statement and Kyle had chicken, Neal had ham and Grant had turkey:


sands=perms('thc');
for i=1:length(sands)
  assign=[ string(['k' sands(i,1)]),string(['n' sands(i,2)]),string(['g' sands(i,3)])];
  s(1)=ismember("kt",assign);
  s(2)=~ismember( "nc",assign);
  s(3)=~ismember("kc",assign);
  s(4)=~ismember("nh",assign);  
  disp(assign)
  disp(s )
  disp(' ')
end

    "kc"    "nh"    "gt"
   0   1   0   0                             Only one is true (1)
 
    "kc"    "nt"    "gh"
   0   1   0   1
 
    "kh"    "nc"    "gt"
   0   0   1   1
 
    "kh"    "nt"    "gc"
   0   1   1   1
 
    "kt"    "nc"    "gh"
   1   0   1   1
 
    "kt"    "nh"    "gc"
   1   1   1   0

  Posted by Charlie on 2024-09-09 08:59:12
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 (4)
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