def prior_probability_of_category_k(k, c, nk):
    """
    Function that calculates the prior probability of category k. This is equation 3-4 in [Ande90]_

    Parameters
    ----------
    k : int
        Category index. For example, k can be 0 or 1 or 2 etc
    c : float
        Coupling probability. This is the probability that two objects come from the same category
    nk : list
        List containing the number of objects in each category. For example, if there are two objects in category 0,
        three objects in category 1 and 4 objects in category 2, then nk = [2, 3, 4]

    Returns
    -------
    float
        The prior probability of category k

    """
    n = sum(nk)
    return (c * nk[k]) / (1 - c + c * n)