In mathematics, a function on the real numbers is called a step function if it can be written as a finite linear combination of indicator functions of intervals. Informally speaking, a step function is a piecewise constant function having only finitely many pieces.
A function f : R → R {\displaystyle f\colon \mathbb {R} \rightarrow \mathbb {R} } is called a step function if it can be written as [citation needed]
where n ≥ 0 {\displaystyle n\geq 0} , α i {\displaystyle \alpha _{i}} are real numbers, A i {\displaystyle A_{i}} are intervals, and χ A {\displaystyle \chi _{A}} is the indicator function of A {\displaystyle A} :
In this definition, the intervals A i {\displaystyle A_{i}} can be assumed to have the following two properties:
Indeed, if that is not the case to start with, a different set of intervals can be picked for which these assumptions hold. For example, the step function
can be written as
Sometimes, the intervals are required to be right-open[1] or allowed to be singleton.[2] The condition that the collection of intervals must be finite is often dropped, especially in school mathematics,[3][4][5] though it must still be locally finite, resulting in the definition of piecewise constant functions.
{{cite web}}
{{cite book}}