<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def acceptance_prob(old_cost, new_cost, T):
 """annealing equation, with modifications to work towards a lower value"""

    #if start pos is not valid, always move
    if old_cost == 1e20:
        return 1.0
    #if we have found a valid ps before, never move to nonvalid pos
    if new_cost == 1e20:
        return 0.0
    #always move if new cost is better
    if new_cost < old_cost:
        return 1.0
    #maybe move if old cost is better than new cost depending on T and random value
    return np.exp(((old_cost-new_cost)/old_cost)/T)