Precedence between implication and bi-implication

logiclogic-translationpropositional-calculus

I came across this question:

Let p, q, and r be the propositions

p : Grizzly bears have been seen in the area.
q : Hiking is safe on the trail.
r : Berries are ripe along the trail.

Write these propositions using p, q, and r and logical connectives (including negations).

If berries are ripe along the trail, hiking is safe if and
only if grizzly bears have not been seen in the area.

I see an If r,q iff ~p where
If r,q is the part "If berries are ripe along the trail, hiking is safe"
and ~p is "grizzly bears have not been seen in the area"

and I came up with (r -> q) <-> ~p

But the answer given is: r -> (q <-> ~p)

Can someone please explain the difference in precedence?

Best Answer

The fact that there is a comma between "If berries are ripe along the trail" and the following phrase usually means that the sentence should be read as

"If berries are ripe along the trail, then hiking is safe if and only if grizzly bears have not been seen in the area",

where the consequent of the conditional is the whole sentence after "then". So, the logic translation of the sentence should be

$r \to (q \leftrightarrow \lnot p)$

and the given answer is correct.


By the way, given the interpretation of the propositions $p$, $q$ and $r$, equivalent English sentences whose logic translation is $(r \to q) \leftrightarrow \lnot p$ could be:

  • If berries are ripe along the trail then hiking is safe, if and only if grizzly bears have not been seen in the area.
  • The fact that berries are ripe along the trail implies that hiking is safe, if and only if grizzly bears have not been seen in the area.
  • The following are equivalent: 'if berries are ripe along the trail then hiking is safe', and 'grizzly bears have not been seen in the area'.
  • Grizzly bears have not been seen in the area if an only if the fact that berries are ripe along the trail implies that hiking is safe.

They are not very elegant, but I'm not a native English speaker.


Anyway, natural language is ambiguous, so in any logic translation from natural language there is a dose of arbitrariness.