function state_next = update_state(state,bin_size)
move_size = randn(1,1);

if move_size < (1.5-state)*bin_size
    state_next = 1;
elseif move_size < (2.5-state)*bin_size
    state_next = 2;
elseif move_size < (3.5-state)*bin_size
    state_next = 3;
elseif move_size < (4.5-state)*bin_size
    state_next = 4;
elseif move_size < (5.5-state)*bin_size
    state_next = 5;
elseif move_size < (6.5-state)*bin_size
    state_next = 6;
elseif move_size < (7.5-state)*bin_size
    state_next = 7;
elseif move_size < (8.5-state)*bin_size
    state_next = 8;
elseif move_size < (9.5-state)*bin_size
    state_next = 9;
else
    state_next = 10;
end

