!= logical equivalancies

Okay, now for some math/logic geekitude!

Another way of looking at not equal to is to look at its logical equivalent: greater than or less than.

A != B is logically equivalent to (A>B)||(A<B)

For example:

We know that 5 does not equal 3 so we know that 5!=3 will be true.

Verify: 5!=3 is equivalent to (5>3)||(5<3). The left side is true and the right is false, but since there is at least one true statement the OR statement it true.

We also know that 3 does not equal 5 so 3!=5 will be true. [this second line is a bit silly, but it’s important]

Verify: 3!=5 is equivalent to (3>5)||(3<5). The left side is false and the right side is true, but since there is at least one true statement the OR statement is true.

We know that 3 equals three so 3!=3 will have to be false.

Verify: 3!=3 is equivalent to (3>3)||(3<3). The left side is false and the right side is false, since both parts are false the OR statement is false.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s