def prob_win_deuce(p: float) -> float:
    """Given probability, p, that server wins a point, returns the probability
    that the server will win deuce if it happens

    Args:
        p (float): probability server wins a point

    Returns:
        float: probability that server will win deuce
    """
    # returns the probability of winning deuce
    return p ** 2 / (1 - 2 * p * (1 - p))