One possible way to encode this equation reads A(j→i)={exp(−β(Ei−Ej))Ei−Ej>01else, implying that if we move to a state with a lower energy, we always accept this move with acceptance probability A(j→i)=1. If the energy is higher, we need to check this acceptance probability with the ratio between the probabilities from our PDF. From a practical point of view, the above ratio is compared with a random number. If the ratio is smaller than a given random number we accept the move to a higher energy, else we stay in the same state.