# Introduction to Logic: Part 2 : Constructing Truth Tables

This article continues assuming you've read the Introduction to Logic: Part 1, where we discussed negation, conjunction, and disjunction statements.## Truth Table Construction

We read that each of the previous statements have their own truth table. A truth table is a visual tool that helps us see the logical outcomes of every possible combination of statements. For the following example, let p,q, and r be statements.p && [(q || r) && (r || p)]

### Number of combinations

The total number of possible outcomes is equal to 2^n, where n is equal to the number of statements. In this example we have three statements in the form of p, q, and r. Thus the number of combinations is 2^3, or 8.### Organizing the table

When creating the truth table, it's extremely important that you keep it organized. My method for constructing organized truth tables is:- Begin with statements themselves
- Place the simplest compound statements to the left of the table, and move progressively to the more complex compound statements

**p && [(q || r) && (r || p)]**, here's how you should construct the truth table:

p | q | r | q || r | r || p | (q || r) && (r || p) | p && [(q || r) && (r || p)] |
---|

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 |

### Filling in the table

So now we know how to populate the initial fields. Now we get down to the meat of the situation: Evaluating the compound statements to complete the truth table. The great thing about how we organized the truth table is that we can solve simple compound statements and use the solutions to solve complex compound statements. Let's walk through the population of a row. For the sake of demonstration, let's choose a more complex combination: p is true, q is false, r is true.p | q | r | q || r | r || p | (q || r) && (r || p) | p && [(q || r) && (r || p)] |
---|---|---|---|---|---|---|

T | F | T |

p | q | r | q || r | r || p | (q || r) && (r || p) | p && [(q || r) && (r || p)] |
---|---|---|---|---|---|---|

T | F | T | T |

p | q | r | q || r | r || p | (q || r) && (r || p) | p && [(q || r) && (r || p)] |
---|---|---|---|---|---|---|

T | F | T | T | T |

p | q | r | q || r | r || p | (q || r) && (r || p) | p && [(q || r) && (r || p)] |
---|---|---|---|---|---|---|

T | F | T | T | T | T |

p | q | r | q || r | r || p | (q || r) && (r || p) | p && [(q || r) && (r || p)] |
---|---|---|---|---|---|---|

T | F | T | T | T | T | T |

### Final Product

Repeating this process for all 8 combinations, the following truth table is produced:p | q | r | q || r | r || p | (q || r) && (r || p) | p && [(q || r) && (r || p)] |
---|---|---|---|---|---|---|

T | T | T | T | T | T | T |

T | T | F | T | T | T | T |

T | F | T | T | T | T | T |

T | F | F | F | T | F | F |

F | T | T | T | T | T | F |

F | T | F | T | F | F | F |

F | F | T | T | T | T | F |

F | F | F | F | F | F | F |