08 June 2015

Faint amusement from arrows

In logic, we talk about propositions, giving them names, say p or q. For example, p might be the proposition 'it is raining', and q the proposition 'I will get wet'. Then to represent the proposition 'if it is raining then I will get wet', we can say 'p IMPLIES q', which is often written with a double-arrow:

 p \Rightarrow q.

In ASCII, this can be approximated by 'p => q'.

In full, this operator has the following truth table:

p q p => q
T T T
T F F
F T T
F F T

(This appears slightly strange, but the only way we can disprove the claim 'p implies q' is if p happens but q doesn't.)

In many programming languages, you can ask whether object x is 'less than' object y, where this is natural for things like numbers, but can be extended to objects of other types. In particular, for Boolean objects, it's very common for False to be 'less than' True. If we look at the truth table for  x \le y , represented in many languages as 'x <= y', we find

x y x <= y
F F T
F T T
T F F
T T T

The witty thing (and recall that this only provides faint amusement) is that we can compare these tables to conclude:

p <= q means p => q.

Comments are closed.