# Computer programming syntax

##### Full Member
thanks much for your response, but my problem who said that we have just those options of comparisons? that's my problem ..

#### Dr.Peterson

##### Elite Member
This specific question is not really math, but computer programming.

The "else" part means "if not". That is, if the comparison is true (X is greater than Y), it will do the first action. Otherwise (that is, if X is not greater than Y), it will do the other.

Now, the rest is math:

If X is not greater than Y, then it must be either equal to Y, or less than Y.

The fact that two numbers can be related by either >, =, or <, and nothing else, is called "trichotomy" ("division into three possibilities"). It is equivalent to the fact that any number on a number line is either positive, zero, or negative (that is, greater than, equal to, or less than zero).

If we weren't talking about real numbers, this might not be true; for example, complex numbers can't be compared in this way. But for real numbers, the fact that they can be put on a number line forces this to be true.

Is there some reason you think something other than those three things could happen?

Please explain why you need to know "who said" this. Is it not obvious?

• topsquark

#### MarkFL

##### Super Moderator
Staff member
thanks much for your response, but my problem who said that we have just those options of comparisons? that's my problem ..
I'm trying to get you to see that there simply are no other options. It's not because someone decreed this to be true, it's that we can see it must be true. Suppose you have one point plotted on a number line in a fixed location, then you allow another point to slide up the number line from $$-\infty$$ to $$\infty$$. Can you see we only have 3 possibilities when comparing the coordinates of the two points? The sliding point can only either be to the left of the fixed point, at the same location, or to the right. There's nowhere else the sliding point can be.

• topsquark

#### topsquark

##### Full Member
I'm going to try this. The real number line comes with a few axioms to make it look pretty. One of those is that given any two real numbers a and b one, and only one, of the following relationships hold: a > b, a = b, b > a. This is one of the "ordering" properties of the reals. It's a definition for the real numbers. (It might seem to be that I am disagreeing with MarkFL here but I'm not... he too is talking about the real number system, I'm just going a step more general.)

The reason I'm saying this is that this is not the case in all number systems. Just as a quick example, the complex numbers do not have this property. Given two complex numbers a and b then the statements a > b or b > a don't even make sense.

However I'm going to assume you are sticking to the real numbers for this question. You can take a > b, a = b, b > a as the only possibilities..

-Dan

• MarkFL