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

Home > Logic
Rank the Students (Posted on 2025-02-06) Difficulty: 3 of 5
After grading the advanced-math test but before handing it back, the teacher asked the five students in the class to predict how well other members of the class (but not themselves) did on the test.

The class had four boys, Art, Bill, Chuck, and Ed, and one girl, Debbie.

The teacher received the following five pairs of statements, each pair being made by a different student:

  1. Bill did better than Ed;
    Chuck did better than Bill.
  2. Debbie did better than Chuck;
    Art did better than Debbie.
  3. Ed did better than Art;
    Chuck did better than Ed.
  4. Bill did better than Ed;
    Debbie did better than Bill.
  5. Chuck did better than Bill;
    Art did better than Chuck.
The student with the highest grade was completely correct; the boy who came in last was completely wrong; and the other students had one correct prediction and one incorrect prediction.

Rank the students from highest to lowest grade. There were no ties.

No Solution Yet Submitted by K Sengupta    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution Comment 1 of 1
clc,clearvars
s=[false,false
  false,false
  false,false
  false,false
  false,false];
named=['bec'
  'dca'
  'eac'
  'bed'
  'cba'];
students='abcde';
prms=perms(students);
for i=1:length(prms)
  class=prms(i,:);
  a=find(class=='a');
  b=find(class=='b');
  c=find(class=='c');
  d=find(class=='d');
  e=find(class=='e');
  s(1,1)=b>e;    % higher = better
  s(1,2)=c>b;  
  s(2,1)=d>c;
  s(2,2)=a>d;
  s(3,1)=e>a;
  s(3,2)=c>e;
  s(4,1)=b>e;
  s(4,2)=d>b;
  s(5,1)=c>b;
  s(5,2)=a>c;
  stats=sum(s,2);
  best=find(stats==2);
  worst=find(stats==0);
  bestn=class(5); worstn=class(1);
  if length(best)==1 && length(worst)==1
    good=true;
    if strfind(named(best,:),bestn)
      good=false;
    end
    if strfind(named(worst,:),worstn)
      good=false;
    end
    if good
      disp([best' 0 worst'])
      disp(class)
    end
  end
end

finds

     3     0     5
daecb
     5     0     3
bcead

The letters are the initials from worst to best, so one set has Debbie as doing the worst, and the other has Bill doing the worst. Since we know the worst was done by one of the boys, the order from highest to lowest was Debbie, Art, Ed, Chuck, Bill.

We also know that speaker 5 was Debbie and speaker 3 was Bill.

  Posted by Charlie on 2025-02-06 09:39:01
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 (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2025 by Animus Pactum Consulting. All rights reserved. Privacy Information