Use of Math.random() for state.