A (real) interval is a set of real numbers between two other numbers. Intervals of
are commonly used in graphs. An open interval excludes the end points, while the end points of a closed interval are elements. Some intervals may partially open and closed.
An (integer) interval is basically the same as a real interval, except it consists of integers.
Formal definitions
Real interval
- Open interval:

- Closed interval:
![{\displaystyle [a,b]=\{x\in \mathbb {R} :a\leq x\leq b\}}](https://services.fandom.com/mathoid-facade/v1/media/math/render/svg/fb3b34973eec9b61be1e2094b51da20e6dd10b79)
- Left open, right closed:
![{\displaystyle (a,b]=\{x\in \mathbb {R} :a<x\leq b\}}](https://services.fandom.com/mathoid-facade/v1/media/math/render/svg/10b109004266558c5fc593f638e73d0df57887a1)
- Right closed, right open:

Integer interval
- Open interval:

- Closed interval:
![{\displaystyle [a,b]=\{x\in \mathbb {Z} :a\leq x\leq b\}}](https://services.fandom.com/mathoid-facade/v1/media/math/render/svg/6aa9963a93294d0c8936bc33046a220b09c64d1b)
- Left open, right closed:
![{\displaystyle (a,b]=\{x\in \mathbb {Z} :a<x\leq b\}}](https://services.fandom.com/mathoid-facade/v1/media/math/render/svg/c24889ee5e3d9fd7cab00e05beef36cb412235bc)
- Right closed, right open:

Arbitrary partially ordered set
Let
be a poset.
Let
be the irreflexive kernel of
Then, an interval may be defined as:
- Open interval:

- Closed interval:
![{\displaystyle [a,b]=\{x\in S:a\leq x\leq b\}}](https://services.fandom.com/mathoid-facade/v1/media/math/render/svg/eb9aee712581fe63e5fcd162dc14469b6d58c0ae)
- Left open, right closed:
![{\displaystyle (a,b]=\{x\in S:a<x\leq b\}}](https://services.fandom.com/mathoid-facade/v1/media/math/render/svg/ca757e14133ee2807995a87d6a4751ba110346d3)
- Right closed, right open:
