Answered

How does one go about devising a penalty formula?

The factoring Jupyter notebook discusses how "the Boolean operations of the gates in our multiplication circuit can be reformulated as penalty functions that penalize invalid states; that is, invalid sets of input and output values representing gates have higher penalty values than valid sets."

For an AND gate, the notebook uses the formula 2ab - 4ac - 4bc + 6c, where a and b are the inputs and c is the output.  It's easy to construct a truth table and verify that the formula's value is zero for all valid states and a positive number (2 or 6) for all invalid states.

In general, given a set of logical inputs and outputs and a truth table, how does one go about devising a penalty formula?

1

Comments

2 comments

Please sign in to leave a comment.

Didn't find what you were looking for?

New post