A method for calculating the probability while walking