Let $\psi(x): [0,4] \to \Re$ be the step function defined by $$\psi(x) = \begin{cases} 2, & \text{if $x\in$ [0,1)} \\ -1, & \text{if $x\in$ [1,2)}\\ 1, & \text{if $x\in$ [2,4]} \end{cases}$$
Find constants $a_i \in \Re$, $b_i \in[0,4]$ such that $\psi(x)$ can be as $\psi(x)= \sum_{i=1}^3 a_ih(x-b_i)$ for $x \in [0,4]$, where $h(x)$ is heaviside function. $$\psi(x) = \begin{cases} 1, & \text{if $x\ge 0$ } \\ 0, & \text{if $x\lt 0$} \end{cases}$$
I don't know how to graph $\psi(x)$ in latex. Sorry for that. Therefore I start by stating that $$\psi(x)= a_1h(x-b_1) + a_2h(x-b_2) + a_3h(x-b_3) = 2h(x-1) -1h(x-2) +1h(x-4)$$ where $2, -1, 1$ are the $a_i$. I took these from $\psi(x)$ value.
And the $b_i$ are $1,1,2$ which is the end of interval for the $\psi(x)$ Now depending on $x$ and $h(x)$ we have different result for $\psi(x)$. This would bring for these intervals the same as the function $\psi(x)$.
I humbly ask if someone could verify if what I have done makes sense. Any hints or solution verification is highly appreciated. Thanks!