Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

Re: Three liars, in FORTRAN [long]



Hello John:

Thanks for the algorithm. I had no trouble with the translation of
your program into True Basic and the output is exactly as yours, as it
should. I notice that your program never received the sentences
provided by A, B and C. It is just a way of reproducing your own
"systematic elimination" approach.

The values in columns 1, 2 and 3 are all possible situations in terms
of who is or is not a truth teller. Your triple do-loop generates these
values systematically. The routine for generating values in columns
4, 5 and 6 would be trivial for a human being who knows sentences
provided by A, B and C. You found a clever way of generating these
values from the i, j, k, not from the real input (3 sentences).

Therefore I am not sure that we can say that "a problem was solved
by a machine". Your intervention (a change in the program) will be
needed for each new problem, and for each new variant of three
sentences. In that sense it is not like a program for solving a quadratic
equation, for example. Such program does not need to be changed for
a new set of a, b and c.

I wish I was clever enough to solve the problem as well as you did.
Thanks for sharing.
Ludwik Kowalski
---------------------------------------------------------------------------------

A: "There are 3 truth tellers here".
B: "No, only 1 of us is a truth teller."
C: "The second person is telling the truth."

! A B C op(A) op(B) op(C) agrees?
!----- ----- ----- ----- ----- ----- -------
! false false false false false false yes
! false false true false true false no
! false true false false true true no
! false true true false false true no
! true false false false true false no
! true false true false false false no
! true true false false false true no
! true true true true false true no
!
! where the first three columns are the 'states' of the
! 3 men ('false' means 'liar'), the next three columns are
! the correctness of the opinions held by the men ('false'
! means that their voiced opinion does not match the known
! state of the three men), and the last column indicates
! agreement, i.e. are all persons who are liars actually
! lying, and vice versa.
!
! The script [can be] generalized to arbitrary numbers of
! people and opinions. Note also that arbitrary numeric
! values of 'true' and 'false' generate the correct truth
! table. :-)
!
! Regards, John