def tail(_b, _x):
    """Determine the number of trailing b's in vector x.

    Parameters
    ----------
    b: int
        Integer for counting at tail of vector.

    x: array
        Vector of integers.

    Returns
    -------
    tail: int
        Number of trailing b's in x.
    """
    _tail = 0
    for i in range(len(_x)):
        if _x[len(_x) - i - 1] == _b:
            _tail += 1
        else:
            break
    return _tail
