Artificial intelligent assistant

I have confusion while translating propostions to logical expressions I have following propositions: `p:Grizzly bears have been seen in the area.` `q:Hiking is safe on the trail.` `r:Berries are ripe along the trail.` I need to convert following compound statement to logical expressions by using logical connectives. `If berries are ripe along the trail,hiking is safe if and only if grizzly bears have not been seen in the area` What I think is true is: `~p <-> (r^q)` Note:I have considered `comma` in above statement as `and`. But answer given at the end of book is: `r -> ( q <-> ~p )`

The comma is not to be read as an and, it is the "then" of the first _if_. So.

> If berries are ripe along the trail, then the following holds: hiking is safe if and only if bears have not been seen in the area

Thus

> If $r$, then ($q$ if and only if $\
eg p$).

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 9cbd32dc655698af158d331d9dd07f15