Digital Garden
Maths
Discrete Maths
Intervals

Intervals

If we have a set of real numbers, we can define a subset of this set by specifying a range of values. This subset is called an interval. To define an interval, we need two real numbers, aa and bb, with a<ba < b.

We can then define the following types of intervals:

  • Open interval: We include all the numbers between aa and bb, but not aa and bb themselves. This is denoted as (a,b)={x∈R∣a<x<b}(a, b) = \{x \in \mathbb{R} \mid a < x < b\}.
  • Closed interval: We include all the numbers between aa and bb, as well as aa and bb themselves. This is denoted as [a,b]={x∈R∣a≀x≀b}[a, b] = \{x \in \mathbb{R} \mid a \leq x \leq b\}.
  • Half-open interval: We include one of the bounds but not the other. This is denoted as [a,b)={x∈R∣a≀x<b}[a, b) = \{x \in \mathbb{R} \mid a \leq x < b\} or (a,b]={x∈R∣a<x≀b}(a, b] = \{x \in \mathbb{R} \mid a < x \leq b\}.
  • Unbounded/Infinite interval: On one or both sides, the interval extends indefinitely. This is denoted as (βˆ’βˆž,b]={x∈R∣x≀b}(-\infty, b] = \{x \in \mathbb{R} \mid x \leq b\} if we want all numbers less or equal than bb, or (a,∞)={x∈R∣x>a}(a, \infty) = \{x \in \mathbb{R} \mid x > a\} if we want all numbers greater than aa. We can also have intervals that are unbounded on both sides, such as (βˆ’βˆž,∞)=R(-\infty, \infty) = \mathbb{R}.
Info

Note that the bound of the interval that is included is always the one with the square bracket if it is excluded it is the one with the round bracket.

For example, [a,b)[a, b) includes aa but not bb, while (a,b](a, b] includes bb but not aa.

Also, note that the unbounded side with ∞\infty is always excluded i.e. uses the round bracket.

All types of intervals visualized on the number line.
Example

Examples of intervals:

  • (2,5)(2, 5) is the set of all real numbers between 2 and 5, but not including 2 and 5.
  • [3,7][3, 7] is the set of all real numbers between 3 and 7, including 3 and 7.
  • (βˆ’βˆž,4](-\infty, 4] is the set of all real numbers less than or equal to 4.
  • (6,∞)(6, \infty) is the set of all real numbers greater than 6.