The propositions are given as below. P: Grizzly bears have been seen in the area. Q:Hiking is safe on the trail. R:Berries are ripe along the trail.
Now tell me, what will be the logical expression of this, and why:
"If berries are ripe along the trail, hiking is safe if and only if grizzly bears have not been seen in the area."
The problem is from the book "discrete mathematics and its application" by Keeneth H.Rosen page no.17 in its sixth edition.
Now I had tried to do myself. And I finished with $((R\rightarrow Q)\leftrightarrow(\neg P))$. But in my book the ans was $(R\rightarrow(Q\leftrightarrow(\neg P)))$, but I can't understand why this is the answer. I think the answer should be $((R\rightarrow Q)\leftrightarrow(\neg P))$ because $\rightarrow$ has precedence over $\leftrightarrow$.
Could anyone please tell me what is the right answer is and why.
Sometimes, people set orders of precedence in logical expressions, like "$\Rightarrow$ before $\Leftrightarrow$", but that's definitely not standard in every field. In the english language, this rule is wrong.
An if-clause of the shape "If $A$, then $B$" reads as $A \Rightarrow B$, even if $A$ and $B$ are more complicated expressions. The sentence "$A$ if and only if $B$" binds $A$ and $B$ together, and reads $(A \Leftrightarrow B)$ but it can't bind any statements outside the sentence. Thus "If $A$, then $B$ if and only if $C$" reads as $A \Rightarrow (B \Leftrightarrow C)$. The comma is another indicator of the intended order of precedence, since it separates $A$ from $B$ and $C$. As the comments mentioned, there are no absolute rules here, so take this with a grain of salt.