def expected_win(theirs, mine):
    """Compute the expected win rate of my strategy given theirs"""
    assert abs(theirs.r + theirs.p + theirs.s - 1) < 0.001
    assert abs(mine.r + mine.p + mine.s - 1) < 0.001
    wins = theirs.r * mine.p + theirs.p * mine.s + theirs.s * mine.r
    losses = theirs.r * mine.s + theirs.p * mine.r + theirs.s * mine.p
    return wins - losses