Deterministic and stochastic behaviors of a piecewise-linear system