1
$\begingroup$

Below is a question I encountered:

Question

My answer was $\{x \mid x \in Z, -1 \leq x \leq 4 \}$

However, the textbook answer stated $\{x \mid x \in Z, -1 \leq x < 5\}$

Can $\leq$ and $<$ be used interchangeably in this situation? Is there a more accepted convention?

Thanks,

George

$\endgroup$
  • $\begingroup$ Both are correct if it's a question about integers. I don't know of a convention. I prefer the first one.because you have to read the second one particularly carefully to check it. $\endgroup$ – Ethan Bolker Mar 8 '17 at 0:12
  • 1
    $\begingroup$ I think the photo is cut off. I can't see the numbers on the bottom number line :| $\endgroup$ – Timothy Cho Mar 8 '17 at 0:12
  • 2
    $\begingroup$ Perhaps your book was written by a computer scientist :) [When describing a range of integers, many programming languages and many style conventions will include the left endpoint but exclude the right]. $\endgroup$ – benguin Mar 8 '17 at 0:21
1
$\begingroup$

I don't think that there's a convention about if you should use $\leq$ or $<$, but I do think that whichever you do you should be consistent. Writing $-1\leq x<5$ like the book has can very easily lead to confusion because people will miss the fact that the "or equal" was dropped. In fact, when I read this at first I went "Ah ha! The book has a typo, it should say $-2<x<5$."

$\endgroup$
  • $\begingroup$ In computer science, it's generally considered better to write $−1\leq x<5$ or $x\in[-1, 5)$, and use half-open intervals generally. Why? Because the algebra of half-open intervals is nicer: the length of the interval $[a, b)$ is $b-a$, not $b-a-1$; if we split $[a, c)$ at $b$, we get $[a, b)$ and $[b, c)$ instead of $[a, b-1]$ and $[b, c)$, etc. In general, we avoid double counting the boundaries, or having to sprinkle "-1" all over the place. $\endgroup$ – Max Apr 13 '17 at 7:54
0
$\begingroup$

If we take you literally, the answer to your question "Can $\leq$ and $<$ be used interchangeably in this situation?" is no: $\leq$ and $<$ cannot "be used interchangeably." For the statement $x\leq 4$ is not equivalent to the statement $x<4$. You can't interchange $\leq$ with $<$ without changing something else in the statement.

But perhaps you didn't write what you meant to ask. Perhaps you meant: is there a reason to prefer the notation $x\leq 4$ to the notation $x<5$ when $x$ denotes an integer? In that case, the answer to your question is still no: it's just a convention; both inequalities refer to the same set of integers.

$\endgroup$
  • $\begingroup$ Sorry about the confusion, yes I meant the question in the latter paragraph. $\endgroup$ – George Tian Mar 8 '17 at 2:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.