cartesian product for generating all possible observation sequences