import math


def get_epsilon_of_fedmd_nfdp(n, k, replacement=True):
    """Return epsilon of FedMD-NFDP

    Args:
        n (int): training set size
        k (int): sampling size
        replacement (bool, optional): sampling w/o replacement. Defaults to True.

    Returns:
        float: epsilon of FedMD-NFDP
    """
    if replacement:
        return k * math.log((n + 1) / n)
    else:
        return math.log((n + 1) / (n + 1 - k))