def true_state_value(probability):
    """
    compute the true value of the first state according to dynamics
    :param probability: the probability of right action
    :return: the true value

    V(S1)=p*1*(-1+V(S2))+(1-p)*1*(-1+V(S1))
    V(S2)=p*1*(-1+V(S1))+(1-p)*1*(-1+V(S3))
    V(S3)=p*1*(-1+0)+(1-p)*1*(-1+V(S2))
    p is the probability of right action
    ===>       V(S1) = 2*(p-2)/(p*(1-p))
    """
    return 2*(probability-2)/(probability*(1-probability))