Algosim documentation: OpenInterval

OpenInterval

Returns an open interval of real numbers.

Syntax

Description

Conceptually, OpenInterval(a, b) returns the open interval (a, b). However, there are a few differences between the mathematical object (a, b) and OpenInterval(a, b).

First, since the mathematical set (a, b) contains an infinite number of real numbers when a < b (the typical case), it cannot be represented as a true Algosim set, since that would require a computer with an infinite amount of memory. Therefore, OpenInterval(a, b) only returns a finite number of equally spaced numbers from this interval.

Second, the returned object isn’t an Algosim set but a list. This is because lists are easier to work with in practice. Still, Algosim is designed in such a way that you often can think of OpenInterval(a, b) as the mathematical object (a, b).

Specifically, OpenInterval(a, b, δ) returns the list of all numbers

a + δ, a + 2⋅δ, ...

that are less than or equal to b − δ. In particular, if a ≥ b, the empty list is returned. Otherwise, the number of elements depends on δ. If omitted, δ is chosen so that the list contains about 1000 elements.

See also