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

Home > Logic
Quiz Results (Posted on 2004-09-02) Difficulty: 3 of 5
Five students each answered five questions on an quiz consisting of two multiple-choice questions (A, B or C) and three True-False questions. They answered the questions as follows:
Student Q1 Q2 Q3 Q4 Q5 
Alex    A  A  T  T  T 
Bert    B  B  T  F  T 
Carl    A  B  T  T  F 
Dave    B  C  T  T  F 
Eddy    C  A  F  T  T 
No two students got the same number of correct answers. Who got the most correct answers?

See The Solution Submitted by Brian Smith    
Rating: 3.2222 (9 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution re: solution -- uniqueness proved w/ computer | Comment 5 of 30 |
(In reply to solution by Charlie)

The program

DATA aattt,bbtft,abttf,bcttf,caftt
FOR p = 1 TO 5: READ ans$(p): NEXT
FOR a1 = 1 TO 3
 a$(1) = MID$("abc", a1, 1)
 FOR a2 = 1 TO 3
  a$(2) = MID$("abc", a2, 1)
   FOR a3 = 1 TO 2
    a$(3) = MID$("tf", a3, 1)
     FOR a4 = 1 TO 2
      a$(4) = MID$("tf", a4, 1)
       FOR a5 = 1 TO 2
        a$(5) = MID$("tf", a5, 1)
        REDIM aCt(5)
        good = 1
        FOR p = 1 TO 5
         ct(p) = 0
         FOR i = 1 TO 5
          IF a$(i) = MID$(ans$(p), i, 1) THEN ct(p) = ct(p) + 1
         NEXT i
         IF aCt(ct(p)) > 0 THEN good = 0: EXIT FOR
         aCt(ct(p)) = aCt(ct(p)) + 1
        NEXT p
        IF good THEN
          FOR i = 1 TO 5
            PRINT a$(i);
          NEXT i
          PRINT
          FOR p = 1 TO 5
            PRINT ct(p)
          NEXT
        END IF
       NEXT a5
     NEXT a4
   NEXT a3
 NEXT a2
NEXT a1

would find all solutions, and found only

bctff
 1
 3
 2
 4
 0

as the correct answers, and the scores of the quiz takers.


  Posted by Charlie on 2004-09-02 08:59:06
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 (10)
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