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:
- Bill did better than Ed;
Chuck did better than Bill.
- Debbie did better than Chuck;
Art did better than Debbie.
- Ed did better than Art;
Chuck did better than Ed.
- Bill did better than Ed;
Debbie did better than Bill.
- 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.
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 |