Lesson TRUTH TABLES

Algebra ->  Conjunction -> Lesson TRUTH TABLES      Log On


   


This Lesson (TRUTH TABLES) was created by by Theo(13342) About Me : View Source, Show
About Theo:

This lesson covers the basics of Truth Tables.

A truth table lists whether a statement is true or false.

If it's true, then it gets a T.
If it's false, then it gets an F.

Logic statements can only be true or false.
There's no in between.

In the following, small letters represent simple statements and large letters represent simple or compound statements.

p and q and r are mostly used for simple statements.
A and B and C are mostly used for compound statements.

A simple statement might be something like p->q

A compound statement might be something like A->B where A represents (p ^ q) and B represents (p v q)

Some terminology:

p means that p is true
~p means that p is false.
^ means "and" (conjunction)
v means "or" (disjunction)
-> means "if then" or "implies"
<-> means "if and only if" or "is equivalent to"

These will be explained as we go.

We'll start with a basic truth table.

That table looks like this:

              p    ~p 
   
              T     F
              F     T


Since there is only one variable in the truth table, only 2 rows are required.

first column is p.
second column is ~p

What this table is telling you is that:

if p is true, then ~p is false.
if p is false, then ~p is true.

p and ~p are negations of each other.

Now we'll look at 2 variables.
Those variables are p and q.
We won't do anything with them yet.
We'll just list them in the table.

       p     q

       T     T
       T     F
       F     T
       F     F


Note that now we have 4 rows.
Each variable by itself requires only 2 rows, but when we look at both, we need to cover all conditions for both, so we'll require 2 * 2 = 4 rows.
There are 2 rows where p is true and there are 2 rows where p is false.
For each of these conditions, the possible values for q are listed.

We have:

when p is true, q can either be true or false.
when p is false, q can either be true or false.

Now we'll look at 3 variables.
Those variables are p and q and r.
We won't do anything with them yet.
We'll just list them in the table.

         p   q   r

         T   T   T
         T   T   F
         T   F   T
         T   F   F
         F   T   T
         F   T   F
         F   F   T
         F   F   F


We now require 2 * 2 * 2 = 8 entries, because we have 3 variables and each of these variables will be compared with each of the other 2. That means 2^3 number of possible combinations.

For every p that's true, we have a q that's either true or false.
For every q that's true, we have an r that's either true or false.

This takes a little getting used to.
Just remember that you need 2 choices for each of the variables.
We'll do 4 variables just to show you the procedure you might want to follow.
There are others, but this one works ok and is consistent with the way the texts do it.

Suppose you had 4 variables?
How many rows would you need?
2^4 = 16 rows sounds about right.
That's 2*2*2*2.
So we're talking about 16 rows in total.
Your first variable will have 8 T's followed by 8 F's once.
Your second variable will have 4 T's followed by 4 F's twice.
Your third variable will have 2 T's followed by 2 F's four times.
Your fourth variable will have 1 T followed by 1 F eight times.

Your table will look like this:

       p   q   r   S
       
       T   T   T   T
       T   T   T   F
       T   T   F   T
       T   T   F   F
       T   F   T   T
       T   F   T   F
       T   F   F   T
       T   F   F   F
       F   T   T   T
       F   T   T   F
       F   T   F   T
       F   T   F   F
       F   F   T   T
       F   F   T   F
       F   F   F   T
       F   F   F   F


Don't worry.
Most of the time you will be dealing with 2 variables.
Some of the time you will be dealing with 3 variables.
I don't think I've seen problems involving 4 variables, and I have definitely not seen problems involving more than 4 variables.

For now, we'll go back to dealing with 2 variables.

Your truth table for p and q is:

       p     q

       T     T
       T     F
       F     T
       F     F


There are some statements you can test against these variables.

They are AND and OR and IMPLIES and EQUIVALENCY.

The AND statement truth table is as follows as it relates to p and q.

       p     q   (p ^ q)

       T     T      T
       T     F      F
       F     T      F
       F     F      F


^ symbol stands for AND.
The AND statement requires p and q to both be TRUE in order for the AND statement to be true.
Otherwise, the AND statement is false.

The OR statement truth table is as follows as it relates to p and q.

       p     q   (p v q)

       T     T      T
       T     F      T
       F     T      T
       F     F      F


The v symbol stands for OR.
The OR statement requires p and q to both be FALSE in order for the OR statement to be false.
Otherwise, the OR statement is true.

The IMPLIES statement truth table is as follows as it relates to p and q.

       p     q   (p -> q)

       T     T      T
       T     F      F
       F     T      T
       F     F      T


-> symbol stands for IMPLIES.
It also stands for IF THEN.
When you say p -> q, then you are saying "p implies q".
When you say p -> q, then you are also saying "if p then q".
"if p then q" means "if p is true, then q is true".

The IMPLIES statement takes a little getting used to.
If p is true and q is true, then the implied statement of p -> q is also true.
If p is true and q is false, then the implied statement of p -> q is false.
If p is false, then the implied statement of p -> q is true, whether or not q is true or false.

In other words, p has to be true in order for the implied statement to even have a possibility of being false.
Once p is false, the implied statement p -> q can never be false because the basic premise of the implied statement requires p to be true.
You can say that p -> q doesn't apply when p is false.
That is true, but the statement itself, by the rules of logic, has to be true or false. There is no in between. Since the statement p -> q cannot be shown to be false when p is false, then the statement has to be true when p is false.
The logic is convoluted and hard to digest.
My recommendation is to follow the rules and don't try to make sense out of them, especially if you're struggling to understand why the logic should be the way that it is. Your life will be so much easier that way. Once you get used to the logic, it won't seem so strange anymore.

The rules for the IMPLIES statement are:

If p is true, then p -> q is true when q is true, and p -> q is false when q is false.
If p is false, then p -> q is true whether or not q is true or false.

The EQUIVALENCY statement truth table is as follows as it relates to p and q.

       p     q   (p <-> q)

       T     T       T
       T     F       F
       F     T       F
       F     F       T


The <-> symbol stands for "is equivalent to".
It also stands for "if and only if".
p <-> q is another way of saying:
"p is true if and only if q is true".

If both p and q are true, then the equivalency statement of p <-> q is true.
If both p and q are false, then the equivalency statement of p <-> q is still true.

In other words, if the the truth table value of p agrees with the truth table value of q, then the equivalency statement of p <-> q is true.

It doesn't matter if they're both true or both false.

The equivalency statement of p <-> q is true just as long as p and q have the same truth table value.

If they don't have the same truth table value, then the equivalency statement is false.

THE FOLLOWING IS BONUS INFORMATION THAT YOU MIGHT SEE SOMEWHERE ELSE BUT WILL PROBABLY HAVE FIRST SEEN HERE IF YOU JUST STARTED TAKING LOGIC AND HAVEN'T DIVED DEEPLY INTO THE RESOURCE MATERIAL YET.

If you know how to use them, then truth tables are a powerful way to prove whether statements are equivalent or not.

I will prove that the IMPLIED statement of p -> q, coupled with the IMPLIED statement of q -> p is equivalent to the EQUIVALENT statement of p <-> q.

This is done to show you how truth tables are used to prove equivalency.

What we want to prove is that (p ->q) ^ (q -> p) <-> (p <-> q)

What this is saying is that:

If I say p is equivalent to q, then I am saying that p implies q and q implies p.
I can say it either way and it will mean the same thing.

Now to prove it.

For conciseness of table headings, I set:

A = (p -> q)
B = (q -> p)
C = (A ^ B)
D = (p <-> q)
E = C <-> D

Note that the small letters represent simple statements while the large letters can represent simple or compound statements. In this case, the large letters represent compound statements.

Here's my truth table.

            p  q  A  B  C  D  E

            T  T  T  T  T  T  T
            T  F  F  T  F  F  T
            F  T  T  F  F  F  T
            F  F  T  T  T  T  T


Note that:

Column C means (A ^ B) which means (p -> q) ^ (q -> p)
Column D means (p <-> q)
Column E means the entries in Column C are equivalent to the entries in Column D.

Since Column E is true for all possible conditions of the truth table, then the conclusion is that:

The statement (p -> q) ^ (q -> p) is equivalent to the statement (p <-> q).

End of proof.






This lesson has been accessed 95771 times.