00:00

in this video i explain the importance of constructing truth tables with this

helpful step-by-step tutorial even though we’ve been doing logic for

thousands of years it has only been in the last 130 years where we started

making truth tables so let’s see how to construct a truth table

hi everyone welcome back i’m dave this video constructing truth tables

helpful step-by-step tutorial is part of the series logic and mathematical proof

in-depth tutorials for beginners the link to the series is below in the

description so let’s get started so first i’m going to cover how to set

up a true table and then we’ll talk about a two variable example and we’ll

see it in practice and then we’ll do a three variable

example we’re also going to work on a puzzle problem where we put in

implications in order so that’ll be fun so let’s get started

00:01

first up is how to set up a truth table so whenever we um are going to be um

constructing a true table we need to make uh sure that we understand the

structure of a compound statement and that’s what’s important in terms of

logic so we’re going to take into account the

structure by parsing a statement into simpler statements

and once we do that then we can make the columns of our truth table so when

constructing compound statements parentheses are used to specify the order

in particular the logical connectives and the innermost parentheses are

applied first so in this example here p and q or the negation of r

is this is the disjunction so to cut down the number of parentheses

used of course we’re going to specify the negation connective is applied

before all other connectives so here’s an example of how you would

00:02

start a truth table so here you would have the column over here

the column r right here is going to go true false true false true false true

false so this is the uh innermost uh variable or the last variable in the

list here so we have three variables here in our in our statement p q and r

and then the next column from the right we’ll go true false false

fault sorry true true false false true true false false and then in the very

first column we’ll go all trues and then all falses and this makes sure that we

have all the possibilities for our propositional variables here

so again we parse the statement down we look at all the variables and then we’re

going to put in some more columns here in just a moment and we’re going to see

what those are here so for instance what if you have not p or q

well this is the disjunction right here and so um

00:03

you know we’re going to say not the negation of the conjunction right

so now and sometimes people don’t use parentheses so you want to have an order

of operations here or order of logical connectives so the highest priority to

lowest right so we always apply negation first

working from left to right and then we play um

then and then the and and then the or and then implication and then last is

always equivalence so and you know just as we um just as i

mentioned a minute ago we’re gonna to you know

make all possible combinations for however many variables that we have

in the first example we saw we had p q and r but you may have more

so you want to make the right most column true false true false true false

true false however many however many that you need

and then the column leftward will be true true false false and so forth so

00:04

here’s the unfilled truth table for this one right here you know how you set it

up right so first thing i notice is we got three variables here p q and r so i

need to have my p q and r here again the right most one goes true false

true false true false true false true false

and then the next column true true false false true true false false

and then the last column in this example is all trues

and then all falses and this makes sure that we have all the possible

combinations for the p q’s and r’s now when i’m looking at the statement

right here we want to parse it into simpler statements so this is an or here

so this these are the two simpler statements so i have a column for this

one right here and i have a column for this one right here

so i’m going to first fill in these columns

and this one and then the last one will be the or so i’ll look at these two

columns and i’ll do an or between these values right here and that will give us

the final column and then our truth table will be filled out

00:05

so we’re going to see some examples on how to do this now

all right so first one is going to be a two variable example

and so let’s look at this one right here so i’m going to go with a

you know we have true and fall p and q only

so my table is going to start off here with a p and a q

and then what else do we need in order to build up this compound

statement it’s going to be an implication of this one and this one

now when i look at the first part right here pnq or q

i have compound statements also so i’m going to be looking at

p and q is in the innermost parentheses there

and then i need to do an or with that so my next column will be p and q or

and then i’ll have the q okay and so that takes care of the hypothesis there

00:06

now i’ll need a negation of q column and then i’ll have the whole implication

so the whole implication is between this one and this one

so this last column will be p and q or q implies the negation of q

so that’ll be the whole last column right there which is the whole statement

here and so let’s see here we need true false true false true true false false

true false true false and now we have our columns here

all right perfect so there’s our truth table all set up there

now remember the definition of and this is going to be true false false false

and then we have an or now what is the or coming between the or is coming

00:07

between these two right here so the or here

is going to be an or between these two columns right here so true or true

which is true false or false is false false or true is true

false or false is false and so that gives us our our next column there

and then we want to negate the q so here’s the q so i’m going to have false true

and then false true so that’s negation of the q column there

all right and then to lastly to build this implication here i need to look

between these two columns here so i have true false that’s false

also implies a true is true true implies a false is false

all supplies are true is true okay so now if you don’t remember how to

00:08

do the and or the or or the implication so we covered these definitions in the

last video so make sure and look up and make sure to watch the previous video

before this one here so this will give us a true table for this

statement right here and there it is so there’s the complete truth table right

there and now let’s move on to the next example here

so in the next example here we have we want to construct a truth table for each

of the following so we’re going to do five here

and then actually we’re going to arrange them so that each compound statement

implies all the following ones so that’s going to be fun

so let’s do that right here let’s start making our truth tables

00:09

so first one is um here we go number one so we have not p if and only if q

and let’s make the truth table for that right here so we have p and then q

and then not p so we got true false true false true true false false

and then not p is right here which is going to be false false true true

and so we’re looking at the m uh equivalence between these two right here

and so let’s write that right here not p if and only if q okay good

so um they’re disagreeing here so it’s false true true false

all right so there’s the truth table for number one here

um now let’s look at number two over here so we have p implies

00:10

let’s just start making the truth table so we have a p and a q

and we have a not p and then we have a not p implies a q

and then we have p implies all that p implies not p implies q okay good

so looking at number two we need to know pmq of course we have a not p we have a

not p implies the q and then we have the whole statement there

so here we go true false true false then we have true true false false

okay now i’m going to negate the p so false false true false sorry true true

all right now for this column we’re going to do the implication

um not p implies a q so make sure we go the right way this is

the hypothesis here so false implies a true is true

00:11

false implies a true so sorry false implies a false that’s true

and then true implies a true is true and then true implies a false is false

and so now the last column here is the whole statement in number two

which is p here is going to imply this one right here so now i’m looking at

this column true implies a true is true true implies a true is true

it also implies a true is true false implies a true is true so this right here

is all trues right here so so far we got number one and number two

and i’m going to start a new column over here so this will be

um a new table over here so this would be number one which is false true true

00:12

false and then the second one we got was true true all trues

all right so very good so i’m just trying to keep things in order this is

what we got for number one this is what we got for statement number two now

let’s do state number three here here we go we can do statement number

three right here statement number three here is

so to do statement number three we’re going to need a of course a p and a q

and we’re going to need q implies p and we’re going to need p implies that p

implies q implies p and then we’re going to need the negation of

that let’s drop it down here actually we have more space down here so i’m still

00:13

looking at number three here so i’m gonna go with p and q and then q implies p

and then p implies a q implies a p and then negation of that

okay so there’s going to be my columns there so start here with p

true false true false all right very good so now q implies a p

make sure and go the right way here so q is starting here so i have true implies

a true false implies a true true implies a false boss implies a true

all right so far so good now i need to do p implies this one so p

implies this one so true implies a true is true true implies a true is true

and these are both falses so they’re going to apply that we got trues here

00:14

and then i have negation here so i’m going to negate this column right here

and so that means we’re going to get all falses

okay so this was statement number three here we got all falses so it’s come up

to our table where we’re keeping track of everything and we got all falses

right here all right excellent so now let’s do four p or q

that one should be pretty quick we’ll come up over here and do that p q p or q

right so let’s just remember what this is so we got true false true false

true true false false there’s all the possibilities

and then this is just the definition of the or p or q

so the definition of the or is just all trues except this one is false

00:15

all right so that’s how we’re going to go here true true true false there we go

so there’s number four and then number five is the negation of p and q

so let’s do that right here so p q and then we have to do negation of p in

the negation of p and q so we got true false true false

and then we got true true false false here we go

true false true false true true false false now the negation of p is false false

true true and then now we’re going to do the and so not p and q

and remember the end is going to be true when they’re both true and false

otherwise so i’m looking at false false true and then false

00:16

and so that’ll be the last column over here that we need so false false

true false all right so we made all five true

tables that was number five and this one was number four

so we made all five truth tables and now it wants us to arrange them so that um

each one implies all the rest now when i have this all falses here i

know that when i have a false hypothesis it’s going to imply

whatever comes after it so i’m going to try to put

number three here first so i’m going to try to reorder them here

false false false balls so no matter what i come what comes after it the

implication will be true um and then um probably i’m going to say

this one might be next let’s see if we try that here let’s try false true false

00:17

it has the next most falses and then we can try number one perhaps

let’s see if we put a number one here so that was five and one

so false false true false so let’s see here

false implies a false false implies a false so that’s all good

false implies a false false implies a true that’s good

all supplies are true true implies a true

now if i put a true here neither one of these is going to have to be true the

rest of the way so so far it’s correct uh these all imply each other uh three

implies five five plus one but we still have

uh to go with i’m gonna put two last so the next one i’m going to try is 4

so 4 i get true true true and then false so false implies a true

00:18

true implies a true true implies a true false applies and so

then the last one here we’ll go with is all trues

so this true implies a true is correct true implies true true implies true

false implies a true so now uh three implies all of these

five implies all of these one implies all these four implies two

and so there we have there’s the order right there

uh in terms of these five statements there all right so that was a lot of fun

now let’s look at a three variable example here

so three variable example here we’re gonna have p q and r

and so we’re gonna have more than just four rows so here we go right here

and let’s do that here we’re gonna need four rows here now

so p q uh we’re gonna need more than four rows so here we go we’re gonna need

00:19

a p and a q and an r and we’re gonna go here true false

here we’re gonna go true true false false true true

false false and here we’re going to go true true false false

false and then false and that will give us all possible

combinations between p q and r’s now what is the statement that we need

to build up so we need to uh build up here and we need a not r

so i’ll do that column right here so that’s going to be a

false well i’ll just write the columns down first let’s go here with the

column separator i’m going to use a not r and then i’m going to say p and not r

and that will give us our hypothesis and then i’m going to look at a column

for p or q and then i’m going to look at the implication so p and not r implies

00:20

with parentheses uh p or q all right so there’s our columns that we need

to build our final statement there and let’s go across here all right

so first one i want to do is negate the r so false true false true

false true and then a false and a true now i’m going to do the and so p and not

r so let’s make sure look at the right columns i need to look at these two

columns here and do an and now remember an end is always false unless they’re

both true so let’s see here we got a false true false true false

false so these are all false because the p’s are all false

and then you know we got two two true uh trues here that’s true

00:21

and then we have a true here and a true here so that’s true

all right very good so there’s p and not r

now we have the or now remember the or is always true unless they’re both false

now what columns are we’re looking at we’re looking at these two columns here

and so you know remember the or is always true unless they’re both false so true

true and then false and then false so these are both falses right here so

these are both falses right here all right good

so now the last thing is to build the implication so i need to look at these

two columns right here and write out an implication so i’m

looking at a false implies a true true true false supplies are true

true implies a true and these are all falses so it doesn’t

really matter what’s here we have an implication

00:22

and the hypothesis here is all falses so these are all trues

so in fact this right here is something that we’re going to call tautology

and the next video coming up is going to be all about tautologies contingencies

and contradictions and so i hope that you stick around for that video now

you know if you have any questions or ideas i hope that you use the comment

section below to let me know and don’t forget that this video is part

of the series logic and mathematical proof in-depth tutorials for beginners

thank you for watching and i’ll see you next time

if you like this video please press this

button and subscribe to my channel now i want to turn it over to you math can be

difficult because it requires time and energy to become skills i want you to

tell everyone what you do to succeed in your studies either way let us know what

you think in the comments