TITLE: How to find the logical formula for a given truth table?
QUESTION [14 upvotes]: Let's say I have a truth table like this:
X  Y   A
t  t  f
t  f  t
f  t  t
f  f  f

Now, I have to find the formula for A. This case is rather easy because I can immediately see that this looks like the inverted values of X~B, thus ¬(X~B). Now, for a more complicated problem I do not know the method.
X  Y  Z  A
t  t  t  f
t  t  f  f
t  f  t  t
t  f  f  f
f  t  t  f
f  t  f  f
f  f  t  t
f  f  f  f

Is there an approach i'm missing here?

REPLY [3 votes]: Pick out the rows where a t appears in the rightmost column, and write down a disjunctive normal form.  In your example, there are only two rows with a t and your expression will have two terms:
$ (X \cdot \bar{Y} \cdot Z)  + (\bar{X} \cdot \bar{Y} \cdot Z) $
Now you have a logical formula for your truth table. You can stop there, or you can use the laws of boolean algebra to get a simpler expression. In this case, you can use the distributive law:
$ (X \cdot \bar{Y} \cdot Z)  + (\bar{X} \cdot \bar{Y} \cdot Z) = (X + \bar{X})\cdot (\bar{Y} \cdot Z) = 1 \cdot (\bar{Y} \cdot Z) = \bar{Y} \cdot Z$