def stats(ps):
    """Averages of conflicts at different q rates

    Parameter
    ---------
    ps: list of pairs of rates and conflicts

    Returns
    -------
    statistics """
    s = {}
    c = {}
    for p in ps:
        i,t = p
        c[i] = c.get(i,0) + 1
        s[i] = s.get(i,0) + t
    r = {}
    for i in c:
        r[i] = s[i]/c[i]
    return r