To prove termination, use the energy-function method. An acceptable energy function in this case has the value of x. The value of x is always greater or equal to 0. Also, since x is divided by 2 on each iteration, whenever x > 0, the value of x decreases each time. These are the two conditions necessary to qualify as an energy function.