how is an interval written

An interval is typically written as an ordered pair of numbers, separated by a comma and enclosed in brackets or parentheses. The first number represents the lower bound, and the second number represents the upper bound.

For example:
- A closed interval from 2 to 5 would be written as [2, 5].
- An open interval from 3 to 7 would be written as (3, 7).
- A half-open interval from -1 to 2 would be written as (-1, 2].
- A half-closed interval from 0 to 10 would be written as [0, 10).