-2
$\begingroup$

Antonio, Luis and Robert have received the gift of a dog, a cat and a canary, and each of them wants to keep an animal. They agree to the following conditions:

  1. Antonio does not keep the dog.

  2. If Robert keeps the canary, Antonio does not keep the cat.

  3. If Luis keeps the dog, Antonio keeps the cat; And viceversa, if Antonio keeps the cat, Luis keeps the dog.

Study if there is any possible distribution of animals that agrees with the above conditions. If so, tell me what these deals are. [Indication. Use truth tables.]

  • 0
    Done, assuming that "Lluís=Luis". Is it Catalan or Spanish?2017-01-28
  • 0
    Does 'stay' mean 'keep'?2017-01-28
  • 1
    So, how far did you get? Where did you get stuck?2017-01-28
  • 0
    I don't know how can i do this exercise.2017-01-28
  • 1
    "Study if there is any possible distribution of animals that agrees with the above conditions. If so, tell me what these deals are. " What if I don't want to. ... You *could* have said "please"... And a sentence or two such as "I'm really stuck and want your help" would have made me more inclined to be helpful.2017-01-28

1 Answers 1

0

Let's use $S(x,y)$ for '$y$ stays with $x$'

Then to say that exactly one of the three animals gets assigned to exactly one of the three people:

Dog1: $S(Antonio, dog) \lor S(Luis, dog) \lor S(Robert,dog)$

Dog2: $\neg(S(Antonio, dog) \land S(Luis, dog))$

Dog3: $\neg(S(Antonio, dog) \land S(Robert, dog))$

Dog4: $\neg(S(Luis, dog) \land S(Robert, dog))$

Cat1: $S(Antonio, cat) \lor S(Luis, cat) \lor S(Robert,cat)$

Cat2: $\neg(S(Antonio, cat) \land S(Luis, cat))$

Cat3: $\neg(S(Antonio, cat) \land S(Robert, cat))$

Cat4: $\neg(S(Luis, cat) \land S(Robert, cat))$

Canarie1: $S(Antonio, canarie) \lor S(Luis, canarie) \lor S(Robert,canarie)$

Canarie2: $\neg(S(Antonio, canarie) \land S(Luis, canarie))$

Canarie3: $\neg(S(Antonio, canarie) \land S(Robert, canarie))$

Canarie4: $\neg(S(Luis, canarie) \land S(Robert, canarie))$

Antonio1: $S(Antonio, dog) \lor S(Antonio, cat) \lor S(Antonio,canarie)$

Antonio2: $\neg(S(Antonio, dog) \land S(Antonio, cat))$

Antonio3: $\neg(S(Antonio, dog) \land S(Antonio, canarie))$

Antonio4: $\neg(S(Antonio, cat) \land S(Antonio, canarie))$

Luis1: $S(Luis, dog) \lor S(Luis, cat) \lor S(Luis,canarie)$

Luis2: $\neg(S(Luis, dog) \land S(Luis, cat))$

Luis3: $\neg(S(Luis, dog) \land S(Luis, canarie))$

Luis4: $\neg(S(Luis, cat) \land S(Luis, canarie))$

Robert1: $S(Robert, dog) \lor S(Robert, cat) \lor S(Robert,canarie)$

Robert2: $\neg(S(Robert, dog) \land S(Robert, cat))$

Robert3: $\neg(S(Robert, dog) \land S(Robert, canarie))$

Robert4: $\neg(S(Robert, cat) \land S(Robert, canarie))$

And then we are given:

  1. $\neg S(Antonio, dog)$

  2. $S(Robert, canarie) \rightarrow \neg S(Antonio,cat)$

  3. $S(Luis, dog) \leftrightarrow S(Antonio, cat)$

And now:

  1. $\qquad S(Antonio,cat)$ Assumption

  2. $\qquad S(Luis,dog)$ (3,4)

  3. $\qquad \neg S(Antonio,canarie)$ (4,Antonio4)

  4. $\qquad \neg S(Luis,canarie)$ (5,Luis3)

  5. $\qquad S(Robert,canarie)$ (6,7,Canarie1)

  6. $\qquad \neg S(Antonio,cat)$ (2,8)

  7. $\qquad \bot$ (1,9)

  8. $\neg S(Antonio,cat)$ (4-10)

  9. $S(Antonio,canarie)$ (1,11,Antonio1)

  10. $\qquad S(Luis,dog)$ Assumption

  11. $\qquad S(Antonio,cat)$ (3,13)

  12. $\qquad \bot$ (11,14)

  13. $\neg S(Luis,dog)$ (13-15)

  14. $\neg S(Luis,canarie)$ (12,Canarie2)

  15. $S(Luis,cat)$ (16,17,Luis1)

  16. $S(Robert,dog)$ (1,16,Dog1)

So there! The canarie stays with Antonio, the cat with Luis, and the dog with Robert.

And by the way, since we have 9 different atomic variables, a truth-table would require $2^9=512$ rows!

  • 0
    The solution space to be explored has $3^3 = 27$ elements (the possible mappings of 3 pets to 3 owners). Your observation about truth-tables just shows that it is very inefficient to represent the solution space using your predicate $S(x, y)$.2017-01-28
  • 0
    @RobArthan Yes, the solution was obvious ... but the OP was given an 'Indication' to use truth-tables ... I wanted to do something in between... which still shows that a formal logic solution is indeed very inefficient!2017-01-28
  • 0
    @Bram32: Fair enough!2017-01-29