def discernability_penalty(adf, quasiid_columns):
    """Compute Discernability Penalty (DP)."""
    sizes = adf.groupby(quasiid_columns).size()

    dp = 0
    for size in sizes:
        dp += size**2
    return dp