On the other hand, perhaps you mean, if I not only *play* optimally but also *bet* optimally across some specified bet spread, over a specified number of shoes dealt to particular penetration, etc., then this is even harder to answer, since “optimal betting” has a lot of wiggle-room for particular assumptions (are bets constrained to be integral multiples of a base amount, etc.).

]]>Is there a way to calculate the average bet (for optimal play) based on all the information that is available in your code? ]]>

Each person’s claim has two components, a “care” mask (like “don’t care” in a Karnaugh map) to track which people they’re making claims about. The other component is a bit array of “in” and “out” indicators. A candidate solution is just a bit array of “in” and “out,” and to check it we just test it against everyone’s bit array, masking out the don’t cares and inverting the guilty.

The third rule in your example is tricky since it has a dependency. To represent this, there’s still one “care” mask, but there are three possible bit arrays to check. If Ray is innocent, at least one of these should match (OR). If Ray is guilty, none of them should match (e.g. De Morgan’s law).

To generate a puzzle from here, I’d probably just do the dumb thing: generate random claim sets and use this solver to check for each of the constraints you listed.

]]>