for(i = 0; i < M i++)
x[i] += (rand() >= RAND_MAX / 2) ? 1 : -1;