I have the following homework (AI-related): Which boolean function does the following TLU (threshold logic unit) implement? The TLU (threshold logic unit) has five inputs. Its weight vector is (1.1, 3.1, -1, -2, 0.5), and threshold is 1.

So in other words:

  • There are 5 "inputs" that can be either 1 or 0.
  • Inputs are multiplied by corresponding "weights" (i.e. input number 1 is multiplied by 1.1 etc.)
  • after multiplications, results are summed up and that sum needs to be more than 1.

So for example, one function to implement this would be when inputs 1 and 2 are true and inputs 3, 4 and 5 are 0.

I know how to create a truth table and look up the entire set of boolean functions but is there another, more "intelligent" way of finding the function than "brute force" manner I'm using?


Yes, this one is easy enough to analyze without a 'brute force' truth table.

Let's just call the inputs $1$, $2$, $3$, $4$, $5$.

First, it is easy to see that the value of $5$ will never make a difference as to whether the threshold gets passed or not, so $5$ is a "don't care": we can completely ignore it in our analysis and hence it need not show up in our boolean expression.

Second, focusing just on $1$, $2$, $3$, $4$, you can quickly observe that the threshold will only be passed if at least one of $1$ or $2$ are 'on'.

Now, if $1$ is on but $2$ is not, then the threshold will be passed as long as neither $3$ nor $4$ are on. This gives us the term $1 \land \neg 2 \land \neg 3 \land \neg 4$. But actually, it's ok if $2$ would be on as well. So, this term can be simplified to just $1 \land \neg 3 \land \neg 4$

If $2$ is on but $1$ is not, then the threshold is passed as long as not both $3$ and $4$ are on. This gives us $\neg 1 \land 2 \land \neg (3 \land 4)$. And again, since it's actually ok for $1$ to be on, we get $2 \land \neg (3 \land 4)$

Finally, if both $1$ and $2$ are on, then the threshold will be passed no matter what. So: $1 \land 2$

Since these are the only 3 situations in which the threshold will be passed, we thus get:

$$(1 \land \neg 3 \land \neg 4) \lor (2 \land \neg (3 \land 4)) \lor (1 \land 2)$$

  • $\begingroup$ You're genius! Thanks. $\endgroup$ – Marso Feb 23 '18 at 4:52
  • $\begingroup$ @Marso You're welcome! :) $\endgroup$ – Bram28 Feb 23 '18 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.