TITLE: Writing Propositions With Propositional Variables
QUESTION [5 upvotes]: The puzzle I am working on is: 
"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).
a) Berries are ripe along the trail, but grizzly bears have
not been seen in the area.
b)Grizzly bears have not been seen in the area and hiking on the trail is safe, but berries are ripe along the
trail.
c) If berries are ripe along the trail, hiking is safe if and
only if grizzly bears have not been seen in the area.
d)It is not safe to hike on the trail, but grizzly bears have
not been seen in the area and the berries along the trail
are ripe.
e) For hiking on the trail to be safe, it is necessary but not
sufficient that berries not be ripe along the trail and
for grizzly bears not to have been seen in the area.
f) Hiking is not safe on the trail whenever grizzly bears
have been seen in the area and berries are ripe along
the trail.
The only one that I bewilder by is e). The answer I came by was $(\neg p \wedge \neg r) \implies q$. However, the true answer is, "$(q→(¬r∧¬p))∧¬((¬r∧¬p)→q)$". Would someone be so gracious as to explain to me why this is the answer?

REPLY [4 votes]: Your $(\neg p \wedge \neg r) \implies q$ expresses that $(\neg p \wedge \neg r)$ is a sufficient condition for $q$, which was exactly what you were asked not to express. But the model answer you're quoting is itself quite problematic.
In think the right answer to (e) should have been
$$ q \rightarrow (\neg r\land \neg p) $$
This expresses that $(\neg r\land \neg p)$ is a necessary condition for $q$.
However, the part that says that this condition is "not sufficient" cannot be expressed purely propositionally. The given answer tries to express it by a negated implication
$$ \neg((\neg r \land \neg p) \to q) $$
but this is actually logically equivalent (try truth tables if you're not sure!) to
$$ \neg r \land \neg p \land \neg q $$
that is, "berries are not ripe and bears have not been seen, but nevertheless it is not safe to hike". Note in particular that it asserts positively that it is not safe; that is not at all what we mean by "such-and-such is not a sufficient condition".
What goes wrong here is that when we speak about necessary and sufficient conditions, this language always implies a quantification over all possible worlds (where it is left doubly implicit what a "possible" world is). Propositional logic itself cannot express such a quantification; in order to do so we need to move either to first-order logic (which has explicit quantifiers), or at least to modal logic where we can express

$A$ is a necessary condition for $B$: $\Box(B\to A)$.
$A$ is a sufficient condition for $B$: $\Box(A\to B)$.
$A$ is not a sufficient condition for $B$: $\neg \Box(A\to B)$ -- or equivalently $\Diamond \neg (A\to B)$.

The $\Box$ represents the implicit quantification over all worlds. The reason why nothing obviously goes wrong when we express the two first sentences without the $\Box$ is that the $\Box$ is in front of everything else, and it is conventional to understand that everything in a formula that is not explicitly specified is universally quantified. So in those cases the propositional formula actually succeeds in expressing the intuitive meaning we want.
In the third case (denying that a condition is sufficient), the quantification is either not at the front or not a universal quantification ($\Diamond$ roughly claims that it is possible that such-and-such). Therefore meaning get lost when we leave it unwritten.