Segmentation of binary sequence via minimizing least square error with total variation regularization