import math


def probability(ec, en, t):
    """
    Probability function
    :param ec: current energy
    :param en: next energy
    :param t: temperature ratio
    :return: probability value
    """
    return math.exp((ec - en) / t)