Yes, I agree with Deepthi's approach. My initial thought/10 second
guess was D because of its [extreme] hint: if door D is the true
statement, fine, then it's one of [A B C] . But if it is not true,
which is a 75% chance, then the spirit must be behind D. But I also
decided to code up a little something in Ruby; looks like O(n*n)
I posted it here on codepad, which can also run code as well as syntax
highlight for you
http://codepad.org/qhQkgDyn
%w just makes a string array; & intersects two arrays , and the
rest should be pretty straightforward
My idea was to just look at the given statements logically and put the
possibilities in arrays or sets. Then just brute force intersect the
sets, leaving one of them true and the other three false/negated with
each iteration. If B is the true door, then all doors have the
common element "d" . This code can perhaps be expanded to solve
more difficult variations on this problem.
~Jack
On Aug 16, 3:55 am, Deepthi Srinivasan <
deeps1...@gmail.com> wrote:
> Its behind door D :)
>
> We have to find which statement is true.. Only one statement is true, so
> find the statement which does not make other statements true..
>
> If statement D is true, then B becomes true, so D is not the true statement
> If statement C is true, A becomes true so C is also not true
> If statement A is true, then D also becomes true so its not A
> So true statement is B. And since D is false the spirit is behind D :)
>
> On Tue, Aug 16, 2011 at 12:42 PM, Lavesh Rawat <
lavesh.ra...@gmail.com>wrote:
>
>
>
>
>
>
>
>
>
> > *4 Doors Riddle - 16 August*
>
> > You are an expert on paranormal activity and have been hired to locate a
> > spirit haunting an old resort hotel. Strong signs indicate that the spirit
> > lies behind one of four doors. The inscriptions on each door read as
> > follows:
>
> > Door A: It's behind B or C
> > Door B: It's behind A or D
> > Door C: It's in here
> > Door D: It's not in here
>
> > Your psychic powers have told you three of the inscriptions are false, and
> > one is true. Behind which door will you find the spirit?
>
> > *Update Your Answers at : *Click Here<
http://dailybrainteaser.blogspot.com/2011/08/4-doors-riddle.html>
>
> > *Solution*
> > Will be updated after 1 day
>
> > --
>
> > "Never explain yourself. Your friends don’t need it and
> > your enemies won’t believe it" .
>
> > --
> > Visithttp://www.gowrikumar.comfor good puzzles in C programming language