'Decode the integer `path` into a tuple of ints where the ith-elem
is the index to select from vector given by matrix[i].
Diego Buthay (dbuthay@gmail.com) made a significant contribution to
the this algorithm.
:param path: integer
:param matrix: list of lists
:return: Tuple of integers'

def _decode_path(self, path, matrix):

    matrix.append([1])
    get_count = (lambda y: reduce(operator.mul, map(len, matrix[(y + 1):])))
    remainder = path
    decoded_path = []
    for i in xrange((len(matrix) - 1)):
        base = get_count(i)
        decoded_path.append((remainder / base))
        remainder = (remainder % base)
    matrix.pop()
    return decoded_path
