Jumat, 25 April 2008

Puzzle Again ?

I've search in the internet about logical puzzles, most of them is very difficult to solve :)

But I found this one, maybe a little more alike to the first puzzle posted in this blog.



On the Shelf



Five children each have their favourite amongst the tinned foods stacked on

the bottom shelf of their mother's pantry. From the clues given below, can you

discover the contents and manufacturer's name on the label of each tin and say

whose preference it is?



Clues:

1) Danny's favourite is in a tin at one end of the shelf; it is not chicken

curry, which is not made by Williams.

2) The tin of Jones spaghetti stands next to Philip's choice, which is not

in an even-numbered tin.

3) Jenny's great love is baked beans; the tin containing them is further to

the left on the shelf than Clive's preference.

4) The ravioli is in the tin numbered 4 in the diagram.

5) Kate's favourite snack is made by Roberts.

6) The name 'Smiths' appears on the tin at the left-hand end of the shelf.



Children: Clive, Danny, Jenny, Kate, Philip.

Manufacturers: Bloggs, Jones, Roberts, Smiths, Williams.

Foods: baked beans, chicken curry, ravioli, spaghetti, tomato soup.



$$$

From the clues, we can define the scopes as :

Children(x)
x : {Clive,Danny,Jenny,Kate,Philip}

Manufacturers(x)
x : {Bloggs,Jones,Roberts,Smiths,Williams}

Tin(x)
x : {BakedBeans,ChickenCurry,Ravioli,Spaghetti,TomatoSoup}

and additional scope :

Number(x)
x: {1,2,3,4,5}

because it has 5 possible positions from left to right


We define the 1-1 relational scopes as :


Favourite(x,y)
x : {(Scope of Tin)} = {BakedBeans,ChickenCurry,Ravioli,Spaghetti,TomatoSoup}
y : {(Scope of Children)} = {Clive,Danny,Jenny,Kate,Philip}

Position(x,y)
x : {(Scope of Tin)} = {BakedBeans,ChickenCurry,Ravioli,Spaghetti,TomatoSoup}
y : {(Scope of Number)} = {1,2,3,4,5}

ProducedBy(x,y)

x : {(Scope of Tin)} = {BakedBeans,ChickenCurry,Ravioli,Spaghetti,TomatoSoup}
y : {(Scope of Manufacturer)} = {Bloggs,Jones,Roberts,Smiths,Williams}

And additional 1-1 relational scopes :

LessOne(x,y)
x : {(Scope of Number)} = {1,2,3,4,5}
y : {(Scope of Number)} = {1,2,3,4,5}

And additional many-to-many relational scopes :

Less(x,y)
x : {(Scope of Number)} = {1,2,3,4,5}
y : {(Scope of Number)} = {1,2,3,4,5}

We got the fact that :


ProducedBy(Spaghetti,Jones) => clue 2

Favourite(BakedBeans,Jeanny) => clue 3

Position(Ravioli,4) => clue 4

And additional facts :

LessOne(1,2)
LessOne(2,3)
LessOne(3,4)
LessOne(4,5)

False :


Favourite(ChickenCurry,Danny) => clue 1

ProducedBy(ChickenCurry,Williams) => clue 1



And the rules are :


Favourite(y,Danny) -> Position(y,1) v Position(y,5) => clue 1

StandsNext(Spaghetti,y) -> Favourite(y,Philip) => clue 2

Favourite(x,Philip) -> Position(y,1) v Position(y,3) v Position(y,5) => clue 2

LeftSide(BakedBeans,y) -> Favourite(y,Clive) => clue 3

Favourite(x,Kate) -> ProducedBy(x,Roberts) => clue 5

ProducedBy(x,Smith) -> Position(x,1) => clue 6


Additional Rules :

StandsNext -> RightSide(x,y) v LeftSide(x,y)
RightSide(x,y) -> Position(x,u) ^ Position(y,w) ^ LessOne(w,u)
LeftSide(x,y) -> Position(x,u) ^ Position(y,w) ^ Less(u,w)





Tidak ada komentar: