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

Home > Logic
Four Crossed Female Athlete Ascertainment (Posted on 2022-11-11) Difficulty: 3 of 5
Four girls, Willow, Ximena, Yvonne, and Zelda, are standing in a line. Exactly one girl plays baseball and soccer but not basketball.

The following facts are known:

  1. Two girls who do NOT play baseball are standing next to Willow.
  2. Ximena is the only girl standing next to exactly one soccer player.
  3. Yvonne is the only girl NOT standing next to exactly one basketball player.
Who plays baseball and soccer, but not basketball?

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 |
clc
lines=perms('wxyz');

base=4; soc=2; basket=1;
for i=1:length(lines)
   line=lines(i,:);
   if all(line([1 4])~='w')
     w=strfind(line,'w');
     x=strfind(line,'x');
     y=strfind(line,'y');
     for a=0:7
       g(1)=a;
       for b=0:7
         g(2)=b;
         for c=0:7
           g(3)=c;
           for d=0:7
             g(4)=d;
             srch=base+soc;
             ix=find(g==srch);
             if length(ix)==1
               if ~any(bitand(g([w-1 w+1]),base))
                 nxtto=zeros(1,6);
                 for j=1:4
                   if bitand(g(j),soc)
                     nxtto([j j+2])=nxtto([j j+2])+1;
                   end
                 end
                 nxtto=nxtto(2:5);
                 f=find(nxtto==1);
                 if length(f)==1
                   if line(f)=='x'
                     nxtto=zeros(1,6);
                     for j=1:4
                       if bitand(g(j),basket)
                         nxtto([j j+2])=nxtto([j j+2])+1;
                       end
                     end
                     nxtto=nxtto(2:5);
                     f=find(nxtto==1);
                     if length(f)==3
                       if line(10-sum(f))=='y'
                         disp(line)
                         disp(char(g+48))
                         disp(' ')
                       end
                     end
                   end
                 end
               end
             end
           end
         end
       end
     end
   end
end

finds these 8 scenarios that fit:

zwxy
1106
 
zwxy
1506
 
yzwx
6031
 
yzwx
6071
 
yxwz
6011
 
yxwz
6051
 
xwzy
1306
 
xwzy
1706

The first line of each lists the order of the girls, by initial.

The second line in each case shows below each girl's initial, a number whose bits represent baseball (value 4), soccer (value 2) and basketball (1). In each case, Yvonne has a 6 (i.e. 4+2) below her initial, indicating she plays baseball and soccer but not basketball. No other girl has a 6 under her initial.

  Posted by Charlie on 2022-11-11 10:26:34
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 (1)
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