Necessary but not sufficient in logic I am working through sample questions and am having a bit of trouble understanding the solution.
Write using logical connectives:
p : Grizzly bears have been seen in the area.
q : Hiking is safe on the trail.
r : Berries are ripe along the trail.
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.
I came up with 
$$q \rightarrow(\lnot r \land \lnot p)$$
However, the solution is
$$q \rightarrow (\lnot r \land \lnot p) \land \lnot((\lnot r\land \lnot p)\rightarrow q)$$
I am wondering why the attached part is required. I guess my problem would be with understanding the question at hand. Would the last two propositions be sufficient enough for the first proposition to be true, are they both together still insufficient? 
Any help is appreciated! Thank you. 
 A: 
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.

$$(\underbrace{(\lnot r \land \lnot p)\leftarrow q}_{\text{it is neccessary}}) \underbrace{\land}_{\text{and/but}} (\underbrace{\lnot((\lnot r\land \lnot p)\rightarrow q)}_{\text{it is not sufficient}})$$
A: "For $\;P\;$, it is necessary that $\;Q\;$" formally translates to $\;P \implies Q\;$, and "for $\;P\;$, it is sufficient that $\;Q\;$" translates to $\;Q \implies P\;$.
Therefore "for $\;P\;$, it is necessary but not sufficient that $\;Q\;$" is $\;(P \implies Q) \land \lnot (Q \implies P)\;$, which exactly matches the solution you were given.  And it is an exercise in propositional logic to see that this expression can be simplified to $\;\lnot (Q \implies P)\;$ (i.e., "for $\;P\;$, it is not sufficient that $\;Q\;$") which can be further simplified to $\;\lnot P \land Q\;$.
(As an aside, this shows that the "necessary" part is superfluous in "necessary but not sufficient".)
So in your case, $\;P := q\;$ and $\;Q := \lnot r \land \lnot p\;$, and therefore "for $\;q\;$, it is necessary but not sufficient that $\;\lnot r \land \lnot p\;$" translates to $\;\lnot q \land \lnot r \land \lnot p\;$, so that is your answer.
Finally, note the solution that you were given $\;(q \rightarrow (\lnot r \land \lnot p)) \;\land\; \lnot((\lnot r\land \lnot p)\rightarrow q)\;$ is just a more complex way of writing $\;\lnot q \land \lnot r \land \lnot p\;$.
A: Your interpretation about insufficiency is correct. The attached part is to discount sufficiency; i.e., the converse is not true. If the original statement had only been "it is necessary that berries...", then your original solution would apply.
A: This is a great problem. I've long forgotten how fun this stuff can be.
I believe the longer solution is correct because even though there are no bears and no berries, that is not sufficient for safety to be realized.
I would read the correct solution as:
"There is safety when there are no bears and no berries AND when other danger-causing variables (other than bears and berries) are eliminated."
A: When you say "Q is necessary for P to be true" , that is ( P--> Q) you rule out only one row in the truth table, that is , you exclude the case in which P is true and Q is false. 
It means that the cases ( T,T) and ( F,F) are still possible. 
But these cases are the two remaining ones ( out of the 3 cases that are still available) in which " Q is sufficient for P to be true" is true, that is ( Q--> P). 
So, "being necessary for P" does not by itself imply " not being sufficiency". 
This is why " Q is necessary but not sufficient" says more than simply " Q is necessary". 
This is also why " Q is not sufficient" has to be added , via a conjunct. 
The conjunct rules out the (T,T) case and the ( F,F) case. 
Note : in the ordered pairs I wrote, the first truth vale is the possible value of P, the second one is the possible value of Q. 

A: 
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.

This is a bit vague. Do ripe berries on their own really pose a threat to hikers? Or is it the combination of bears and berries that is dangerous?
Unless this is some kind of trick question, I think the author meant: If the berries are ripe along the trail ($r$) and grizzly bears have been seen in the area ($p$), then hiking is not safe on the trail ($\neg q$). (Bears eat berries. Berries alone are seldom dangerous.)
If this is the case, the answer should be:$$r\land p\implies \neg q$$or equivalently  $$q\implies \neg r \lor \neg p$$
