Answer: option A
Pre-requisite:
- When $P \Rightarrow Q$ is given, it means condition P is sufficient for condition Q.
- When the first condition is necessary for the second condition, then the second condition is sufficient for the first condition. i.e If Q is necessary for P then P is sufficient for Q.
- Precedence

Question:
Let p,q,r denote the statements ”It is raining”, “It is cold”, and “It is pleasant”, respectively. Then the statement “It is not raining and it is pleasant, and it is not pleasant only if it is raining and it is cold” is represented as
Solution:
We will solve the question in parts
Part 1: “It is not raining and it is pleasant”
- It is not raining = $\sim p$
- and = $\wedge$
- it is pleasant = r
so finally it is equivalent to $\sim p \wedge r$
Part 2: “It is not pleasant only if it is raining and it is cold”
In part 2, remember that $\wedge$ has more priority than $\Rightarrow$ and hence “it is raining and it is cold” will be combined first. - (By pre-requisite 3)
It is not pleasant = $\sim r$
it is raining and it is cold = $p \wedge q$
only if = $\Rightarrow$
so this is equivalent to $\sim r \Rightarrow p \wedge q $
Finally both the parts are connected using $\wedge$ operation.
$(¬p∧r)∧(¬r→(p∧q))$
Direction of Implication $\Rightarrow$ ?
“It is not pleasant only if it is raining and it is cold”
“It is not pleasant” only when “It is raining and it is cold”, this tells, you will not feel pleasant only when it is raining and it is cold. So “raining and cold” is a necessary condition to “not feel pleasant”. Hence “not feel pleasant” is a sufficient condition for “raining and cold” – (By pre-requisite 2)
Now since “not feel pleasant” is a sufficient condition for “raining and cold”, we can write $\left (\sim r\rightarrow \left ( p \wedge q \right ) \right )$ – (By pre-requisite 1)
PC: https://web.stanford.edu/class/archive/cs/cs103/cs103.1152/lectures/07/Slides07.pdf