def path_probability(trans_mat, quad_to_matrix_index, path):
	"""
	Computes the probability of a given path
	:param trans_mat: trained transition matrix (numpy matrix)
	:param quad_to_matrix_index: dictionary to keep track of indicies
	:param path: input path of neo4j types
	:return: float representing probability of seeing that path generated by the MArkov chain
	"""
	product = 1
	tuple_list = []
	for path_index in range(1, len(path) - 2 + 1):
		if path_index % 2 == 1:
			tup = tuple(path[path_index:path_index + 2])
			tuple_list.append(tup)
	for tup_index in range(len(tuple_list) - 2 + 1):
		quad = tuple_list[tup_index] + tuple_list[tup_index + 1]
		(i, j) = quad_to_matrix_index[quad]
		product *= trans_mat[i, j]
	return product