import random
import math


def accept_or_reject(delta_e, beta):
    """
    Accept or reject a new state based on change in energy and temperature.
    
    Parameters:
    ```````````
    delta_e : float
        change in energy
    
    beta : float
        inverse of temperature
        
    Returns:
    ````````
    accept : bool
        T/F value of whether to accept change
    """
    if delta_e == 0:
        accept = True
    else:
        random_number = random.random()
        p_acc = math.exp(-beta * delta_e)
        
        if random_number < p_acc:
            accept = True
        else:
            accept = False
    
    return accept