def flip_seq(a_c, a_e):
    """
    Flips a sequence from the probabilities
    of being in a state to not benig in the state.
    """
    a_c[a_e < 1] = -a_c[a_e < 1]
    a_c[a_e == 1] = 1 - a_c[a_e == 1]
    return a_c
