3

Is there a way of checking if a binary boolean operator is associative just by looking at its truth table, similar to how you can check to see if the middle two rows are different to check if it is commutative?

This question seems to answer my problem: Is there an easy way to see associativity or non-associativity from an operation's table? but it concludes that checking all the triples of inputs is the best method (or other methods with the same worst case). I was wondering if the fact that it is a boolean function might mean that there are other methods that are applicable.

OctopuSS7
  • 135

1 Answers1

2

Here's what I do when I need to check whether one of the 16 binary Boolean operations is associative. I can't promise that this is the most "efficient" trick, but it's easy to do by hand and is definitely faster than the naive method of checking all triples $x,y,z$ for $(x \bullet y) \bullet z = x \bullet (y \bullet z)$.


First check whether the operation $\bullet$ is idempotent, i.e. whether $x \bullet x = x$ always. You can do this by checking that the "top" row is all true, and the "bottom" row is all false. If a binary Boolean operation is idempotent, then it is associative, so you're done.

If the operation is not idempotent, then it is associative precisely if $T \bullet T = F \bullet F$ (the rightmost values in the top and bottom rows are the same) and $T \bullet F = F \bullet T$ (the rightmost values in the middle two rows are the same, your commutativity test).

Z. A. K.
  • 11,359
  • From the 16 cases, your method seems to get the right 8 cases in which the operation is associative. But I find it very confusing some of your phrasing. For example, in your second paragraph, what do you mean with "'top' row is all true, and 'bottom' row is all false"? Certainly you don't mean the row of element $0$ is composed with $1$s and the row of $1$ with $0$s (which would not be associative). Could you please explain me the meaning of your phrase? (Or change it to a perhaps clear one.) – amrsa Nov 06 '22 at 11:04
  • A truth table for an operation $\bullet$ consists of four rows with three columns each. Of course, these four rows can technically be written in 24 different orders, but conventionally, they are written so that the first (top) row's entries are $T, T, T \bullet T$. Similarly, the bottom row's entries are $F,F,F\bullet F$, and the mixed cases $T,F,T\bullet F$ and $F,T, F\bullet T$ are in the middle (which is why @OctopuSS7 can check the middle rows for commutativity). – Z. A. K. Nov 06 '22 at 11:35
  • 1
    Ok it's a completely different thing than the original operation table. But it's very easy to check directly if an operation is idempotent from its multiplication table: the diagonal elements coincide with the ones in corresponding row and column so that the main diagonal is the sequence of elements in the same order. – amrsa Nov 06 '22 at 11:41
  • I see what you mean and fully agree, all these tests are much easier using the 2x2 operation table. I stuck with truth tables since that corresponds more closely to (my interpretation of) what OP asked for. – Z. A. K. Nov 06 '22 at 11:45