Find_MAP when optimizing a Potential

I think this might just be too hard for the naive way find_MAP tries to optimize discrete models without knowing about constraints. With 100 bernoullis the probability that it will ever propose a valid state is very very small. Every one of the 100 samples must be either a 0 or 1, but the optimizer doesn’t know this.

As @cluhmann hinted, the Binomial does much better because now the optimizer only has to consider one direction of motion, and everything in the range (0, 100) is a valid state.