r/computerscience • • Oct 21 '25

Discrete maths

Post image

First year here. Can someone explain how both of these are P implies Q even though they have different meanings?

522 Upvotes

90 comments sorted by

View all comments

Show parent comment

1

u/ChatOfTheLost91 Oct 25 '25

This is how I made it up:

"It rains if I wear coat" will give you Q->P, but it's "only if" instead of "if", so it will be the opposite, i.e. P->Q

Similarly

"Only if it rains, I wear coat". Had it been "if" instead of "only if", it would have given P->Q, but it's "only if", so the relation flips and it's Q->P here

P: It rains, Q: I wear coat