I have an HMM where the outcomes are not always visible. Suppose we want to know the probability of being in a certain state and observing certain outcome, given that we only know the sum of all past outcomes. This assumes, of course, that the outcomes are quantifiable and possible to sum together.
Formally what I'm looking for is: \begin{equation} p(X_n=x_n, Z_n=z_n | \sum_{i=1}^n x_i) \end{equation} Where $n$ denotes the current time step, $X_n = x_n$ is the current observation, and $Z_n=z_n$ is the current state. Note that we don't know the actual sequence $x_1, ..., x_n$ but only the total sum.
This corresponds to a knapsack problem which I am unsure of how to solve. I'm thinking the forward algorithm could be useful, but with some smart modification. For the sake of simplicity we can assume that there only are two different recurring states, and that the outcome probabilities corresponds to a fair or loaded dice.