Version without JavaScript, read-only: workshops, quizzes and running code are not available here. Full version · Catalogue · Sign in

Exercise sheet 4

Modelling and solving: investigations and puzzles

Translating facts into formulas, testing their consistency, running DPLL by hand, and sorting out the inhabitants of two islands. Chapter 4.

Solution
  1. $r$: “the object is rare”, $c$: “it is expensive”. $\Sigma = \{r \to c,\; c \to \lnot r\}$.
  2. Possible: $\Sigma$ is satisfiable, for example with $r = 0$. But if $r = 1$, then $c = 1$, then $\lnot r$: contradiction. Every model has $r = 0$, so $\Sigma \vDash \lnot r$: the object is not rare. About its price, we know nothing.
Solution
  1. With $p$, $j$, $a$: “Pierre (Jacques, André) is blond”. Fact 1: $p \lor j \lor a$. Fact 2: $p \land \lnot j \to a$. Fact 3: $j \to \lnot p$. Fact 4: $(a \land j) \lor (\lnot a \land \lnot j)$, that is, $a \leftrightarrow j$.
  2. By cases on $j$. If $j = 0$: fact 4 gives $a = 0$, fact 1 gives $p = 1$, and fact 2 then requires $a = 1$: contradiction. So $j = 1$: fact 4 gives $a = 1$, fact 3 gives $p = 0$, and facts 1 and 2 are satisfied. The facts are consistent, with a single model: Jacques and André are blond, Pierre is not.
Solution
  1. $(p \lor j \lor a) \land (\lnot p \lor j \lor a) \land (\lnot j \lor \lnot p) \land (\lnot a \lor j) \land (a \lor \lnot j)$. Clause 2 comes from $\lnot(p \land \lnot j) \lor a$; fact 4 gives the last two.
  2. No unit clause at the start. Choice $j = 0$: $\lnot a \lor j$ becomes $\lnot a$, so $a = 0$; $p \lor j \lor a$ becomes $p$, so $p = 1$; $\lnot p \lor j \lor a$ becomes empty: conflict. Backtrack, $j = 1$: $\lnot j \lor \lnot p$ becomes $\lnot p$, so $p = 0$; $a \lor \lnot j$ becomes $a$, so $a = 1$. All the clauses are satisfied: model $p = 0, j = 1, a = 1$.
Solution
  1. “Am I a Negative?”: $x \leftrightarrow \lnot x$, unsatisfiable. Nobody can ask this question: the encounter is impossible. “Am I a Positive?”: $x \leftrightarrow x$, valid: everyone can ask it, we conclude nothing.
  2. $a \leftrightarrow (\lnot a \land \lnot b)$. If $a = 1$, the right-hand side is false: contradiction. So $a = 0$, and $\lnot a \land \lnot b$ must be false, so $b = 1$. Adam is Negative, Barbara Positive.
  3. $c \leftrightarrow (c \oplus d)$. If $c = 1$: $c \oplus d = 1$, so $d = 0$. If $c = 0$: $c \oplus d = 0$, so $d = 0$. Denis is Negative; about Céline, we know nothing.
  4. By question 1, nobody can ask whether they are Negative: the true answer to Zorn's question is no. So $z \leftrightarrow \bot$: Zorn is Negative, and the story is possible.
  5. Let $k$ be “Xylef can ask this question”. By the hint, $k \leftrightarrow (x \leftrightarrow k)$. Now he does ask it, so $k = 1$, and what remains is $x \leftrightarrow 1$: Xylef is Positive.
Solution
  1. $b \leftrightarrow (\lnot a \land \lnot b)$: same structure as Adam. Barnabé is a Knave, Amanda a Knight.
  2. $a \leftrightarrow (a \land \lnot b)$. If $a = 1$: $b = 0$. If $a = 0$: the right-hand side is false whatever $b$ is. Three models: $(a, b) = (1, 0), (0, 0), (0, 1)$. We do not know who is who, but $\lnot(a \land b)$ is true in all three: they are not both Knights.
Solution

With $g$: “the left path leads to the treasure” and $x$: “you are a Knight”, ask the question $g \leftrightarrow x$: “Does the left path lead to the treasure if and only if you are a Knight?”

A Knight answers the true value of $g \leftrightarrow 1$, that is, $g$. A Knave answers the opposite of $g \leftrightarrow 0$, that is, $\lnot\lnot g = g$. In both cases, he answers yes if and only if the left path is the right one. Variant in plain English: “If I asked you whether the left path leads to the treasure, would you answer yes?”