def match_probability(h, bands, similarity):
    """
    Function returning the probability two pairs will match given a number
    of a signature's integers, the number of bands dividing the signature
    matrix and the desired similarity.

    Args:
        h (int): Number of integers in the minhash signature.
        bands (int): Number of bands dividing the signature matrix.
        similarity (float): Desired Jaccard similarity.

    Returns:
        float: The match probability.

    """
    return 1.0 - (1.0 - similarity ** (h / bands)) ** bands