It is always preferable to replace the english clauses with some predicates ..Let us see through examples ..For first one I m assuming as :
p : It rains
q : Erick will be sick.
So the statement " If it rains Erick will be sick " is translated as p --> q
Now it is given it did not rain meaning we have : ∼p
And the conclusion is given to be "Erick is not sick." which is ∼q
So with the given set of statements we can say that p --> q holds but it does not mean that ∼p --> ∼q should hold necessarily..Hence the conclusion "Erick is not sick." which is ∼q is invalid..
Hence S1 is invalid.
Now for S2 , we have :
p : I study
q : I will not fail mathematics
r : I do not play basketball
So ,
"If I study then I will not fail mathematics" is translated as : p --> q
"If I do not play basketball, then I will study" is translated as : r --> p
N it is given he failed in maths meaning : ∼q is given
So from contrapositive statement of 1st one we get ∼q --> ∼p
from contrapositive statement of 2nd one we get ∼p --> ∼r
So ∼r suggests that he must have played basketball..
Hence S2 is valid..
Hence B) is the correct answer..