def get_probabilities(size, snadders=None, dice_size=6, transitive=False, exact=False):
    """
    Generate the transition probabilities matrix for a board, given:
    
    - its `size` (the number of tiles)
    - the snakes and ladders transitions (a python dictionary)
    - the number of sides in the dice
    - whether a snadder ending where another begins makes the player jump in a
      `transitive` manner or not (note that if the board contains a cycle of
      snadders and the function is called with the transitive parameter set to
      `True`, an infinite cycle will be reached)
    - whether the end move must be `exact` or any value greater than or equal to
      the required amount is enough to win. If `exact` is `True`, a roll of more
      than the required amount makes the player stay in the same tile
    
    The tiles are numbered from `1` to `size`, with an additional tile `0` being
    used for the starting tile (thus, rolling a 2 in the first round moves the
    player to tile 2).
    
    The function returns a dictionary where keys are pairs `(a, b)` and the
    values are the probability of transitioning from tile `a` to tile `b`.
    """
    
    snadders = snadders or {}
    
    # Any probability is 0 by default. We have `size + 1` states, counting the
    # starting tile
    result = {(i, j): 0.0 for i in range(size + 1) for j in range(size + 1)}
    
    for idx in range(size):
        # We're in spot `idx`. We can roll any number between 1 and the
        # "sidedness" of the dice.
        
        # Note that there is no transition from the end state to other states,
        # and so we do not need to consider the case `idx == size`.
        
        for roll in range(1, dice_size + 1):
            end = idx + roll
            
            # If we transitively cross all snadders, do so while one exists;
            # otherwise, just jump once.
            if transitive:
                while end in snadders:
                    end = snadders[end]
            else:
                if end in snadders:
                    end = snadders[end]
            
            # If we went past the end tile, we need to know if this means we won
            # or we don't move
            if end > size:
                if exact:
                    end = idx
                else:
                    end = size
            
            result[idx, end] += 1.0 / dice_size
    
    return result