Knaph

The course as a book

Logic Level 3: Letters for Claims

A first, slow taste of formal logic - letters for claims, symbols for not, and, or and if, truth tables, and checking whether an argument is valid by looking at every way the world could be.

Letters for Claims

One Letter, One Claim

Mia is writing notes about the school trip. Again and again she writes "The coach is late." Her hand hurts. Could one letter do the job of the whole sentence?

A short name for a claim

Mia gives the claim a short name: P = The coach is late. Now P stands for the whole sentence. Wherever she writes P, she means that claim.

A capital letter that stands for a claim is a sentence letter. Maths does the same with variables: a letter stands in for something. In algebra it stands for a number. Here it stands for a claim.

Mia sits at a desk with a notebook, and a thought bubble holds the sentence "The coach is late" with an arrow to a round badge with the letter P.

Only a claim can get a letter. A claim is a sentence that is true or false. "Is the coach late?" is a question. "Hurry up!" is an order. Neither is true or false, so neither gets a letter.

Four sentence cards in a row. Two are claims and have a letter badge: "The coach is late" and "Mia is cold". Two are crossed out in red: the question "Is the coach late?" and the order "Hurry up!".

The key

Always write a key first. A key is a list that says what each letter means.

One letter means one claim, all the way through. If P means "The coach is late" on the first line, it means that on the last line. If you change it halfway, you will fool yourself.

Use one letter for one claim, never two. Use a new letter for a new claim.

A key panel lists P = The coach is late and Q = Mia is cold. Below it, the long sentence "The coach is late and Mia is cold" is shown built from the two badges P and Q with the word and between them.

Simple and built

A simple claim gets one letter. "The coach is late" is P.

A longer claim may be built from simple ones, with words like not, and, or, if. "The coach is late and Mia is cold" is built from P and Q. We keep the word between the letters. The next lessons give those words their own signs.

Letters for claims are an old and tested idea. In 1879 Gottlob Frege published a system of logic written in symbols.

Careful

A letter stands for a whole claim, not for one word. P is not "late". P is the sentence "The coach is late".

Try it at home

  1. Write down three things people said at home today. Cross out any that are questions or orders.
  2. Give each claim that is left a letter, and write the key.
  3. Find a sentence with "and" in it. Split it into two claims and give each its own letter.

Words to know

  • sentence letter - a capital letter that stands for one claim
  • key - a list that says what each letter means
  • simple claim - a claim with no not, and, or or if in it
  • built claim - a claim made from simple claims and words like not, and, or, if

Big idea

A letter is a short name for one claim. Write a key, and let each letter mean the same claim all the way through.

Lesson page →

Same Shape, Different Words

Jo says: "If the bus is late, we miss the film. The bus is late. So we miss the film." Sam says: "If the oven is hot, the cake will rise. The oven is hot. So the cake will rise." One is about buses, one about cakes. Are they really two different arguments?

Take the words away

Give each argument a key. For Jo: P = The bus is late, Q = We miss the film. For Sam: P = The oven is hot, Q = The cake will rise. Now both arguments read the same:

If P then Q
P
So Q

This is the argument's form (logicians say logical form): its shape, with the topic taken away.

Two panels side by side, one about a late bus and one about a hot oven. Arrows from both lead down to one shared box that reads: If P then Q, P, So Q.

One check covers many

In Level 1 we saw that validity is about shape, not about facts. So if the shape "If P then Q, P, so Q" is valid, every argument with that shape is valid. Buses, cakes, anything.

The same works for a bad shape. "If P then Q, Q, so P" goes backwards. In Level 2 we saw that "If it rained, the grass is wet. The grass is wet. So it rained" can fail: a sprinkler did it. Every argument of that backwards shape can fail in the same way.

A card in the centre reads If P then Q, P, So Q. Four small topic labels around it - bus, oven, rain and bell - each joined to the card by an arrow, to show that one shape fits them all.

When translating hides the shape

Take "If Tom is hungry, Tom eats. Tom is hungry. So Tom eats." If you give the second "Tom is hungry" a new letter R, you get "If P then Q, R, so Q". The shape is gone.

The other mistake is one letter for two claims. Then different claims look the same, and you may check a shape the argument does not have. One claim, one letter. Two claims, two letters.

Two translations of the Tom argument. On the left, a red-crossed one where the same claim has two letters, P and R. On the right, a green-ticked one where the same claim has the same letter P both times.

Careful

A valid shape does not make the conclusion true. If a reason is false, the conclusion can still be false. Valid only means: if the reasons were true, the conclusion would be too.

Try it at home

  1. Write a short "If ..., then ..." argument about your day, with a second line and a "So" line. Then write its shape with P and Q.
  2. Swap the topic: write another argument with the same shape about food or sport.
  3. Now write the backwards shape (If P then Q, Q, so P) for your topic. Can you think of a reason Q might be true without P?

Words to know

  • form - the shape of an argument, with the topic taken away (logical form)
  • shape - the pattern of claims and words like if, not, or, so
  • translation - writing an argument in letters
  • valid - if the reasons were true, the conclusion would have to be true

Big idea

Two arguments about different things can have the same shape. Validity belongs to the shape, so one check covers every argument that has it.

Lesson page →

Not, in Symbols

Hana says: "The soup is hot." Her brother tastes it and says: "No, it isn't." He has said the opposite of her claim. How do we write that opposite with a letter?

The not sign

Let P = The soup is hot. We write the opposite as ¬P, and read it "not P". It says: "The soup is not hot."

The sign ¬ is the negation sign. It goes in front of a whole claim. "The soup is not hot" does not need a new letter. It is just ¬P.

Every claim is either true or false, and ¬ flips that. Here is the whole table. Each row is one way things could be.

P¬P
TF
FT

In row one the soup is hot, so P is true and ¬P is false. In row two the soup is not hot, so P is false and ¬P is true.

Three soup bowls in a row: hot with steam, lukewarm and cold. Under each is its value: P is true for the hot one and false for the others, and the not-P value is the opposite in every case.

Not not

What if we put two ¬ signs on one claim? "It is not true that the soup is not hot." That is ¬¬P.

P¬P¬¬P
TFT
FTF

Flip twice and you are back where you started. ¬¬P has the same value as P in every row, so it says the same thing.

Care with not

The ¬ goes on the whole claim. Let P = All the lights are on. Then ¬P is "Not all the lights are on": some light is off.

It is not "All the lights are off." In Level 2 we saw that "not all" and "all not" are different. Letters make this easy to forget, so write the key as the full claim and put ¬ on all of it.

A row of five light bulbs, three lit and two dark. A green pill says "Not all are on: true" and a red pill says "All are off: false".

Careful

Not hot is not the same as cold. A lukewarm soup makes P false and ¬P true, but "The soup is cold" is also false.

Try it at home

  1. Pick a claim about your room, like "The light is on". Write P = ... and say ¬P in words. Check: exactly one of them is true.
  2. Say ¬¬P in words for "The door is shut". Does it mean the same as P?
  3. Take "All the cups are clean". Write its opposite in words, and find the single cup that would prove it true.

Words to know

  • negation - the opposite of a claim; it flips true and false
  • ¬P - read "not P"; true when P is false, false when P is true
  • ¬¬P - read "not not P"; it says the same as P

Big idea

¬P is the opposite of P, and it flips the value. Put ¬ on the whole claim, not on a part of it.

Lesson page →

Brackets and the Main Step

2 × (3 + 4) is 14. But 2 × 3 + 4 is 10. The same numbers and signs, and the brackets change the answer. Do brackets matter in logic too?

Brackets group

Two more signs, one line each for now. ∧ means "and". ∨ means "or", with both allowed. Their tables come in the next module.

Let P = The gate is open, and Q = The dog is out. Look at two claims:

  • ¬(P ∧ Q) - the brackets hold P ∧ Q together, so ¬ rules the whole: "It is not true that both the gate is open and the dog is out." Short: not both.
  • ¬P ∧ Q - no brackets, so ¬ sticks to P alone: "The gate is not open, and the dog is out."

They are different claims. Suppose the gate is open and the dog is in. Then "not both" is true, but "The gate is not open, and the dog is out" is false.

A garden with an open gate and a dog sitting inside the fence. Two labels below: not-both, written ¬(P ∧ Q), is marked true in green, and ¬P ∧ Q is marked false in red.

The main connective

In 2 × (3 + 4), you do the brackets first. The times sign is the last step. It decides what the whole thing is: a product.

A connective is a sign like ¬, ∧ or ∨. The main connective (the last step, the one that rules the whole claim) is the one you do last. It tells you what kind of claim you have:

  • ¬(P ∧ Q) - main connective ¬, so it is a not-claim.
  • ¬P ∧ Q - main connective ∧, so it is an and-claim.
  • P ∨ ¬Q - main connective ∨, so it is an or-claim.

To find it, cover each bracket with a finger. Whatever sign is left outside is the last step. Order of operations works the same way in arithmetic.

Three formulas in a row, each with its main connective circled in amber: ¬(P ∧ Q) with the first not circled, ¬P ∧ Q with the and circled, and P ∨ ¬Q with the or circled.

Careful

¬ only grabs what comes right after it: one letter, or one bracketed part. In ¬P ∧ Q it grabs only P.

Try it at home

  1. On paper, work out 2 × (3 + 4) and 2 × 3 + 4. Which sign is last in each?
  2. Let P = I have my hat, Q = It is sunny. Say ¬(P ∧ Q) and ¬P ∧ Q in plain words.
  3. Circle the main connective in each: ¬(P ∨ Q), ¬P ∨ Q, ¬¬P.

Words to know

  • connective - a sign that joins claims or changes one, like ¬, ∧, ∨
  • brackets - ( ) that group part of a claim so it is read as one piece
  • main connective - the last step; it decides what kind of claim the whole thing is
  • ∧ - and
  • ∨ - or, with both allowed

Big idea

Brackets say what belongs together. The main connective is the last step, and it decides what kind of claim you have.

Lesson page →

Every Way It Could Be

Every Way It Could Be

Sam packs for a day out. Will it rain? Will it be windy? Each answer is yes or no, so the day can turn out in more than one way. How many ways are there, and how do we list them all?

One letter, two ways

Key: P = It is raining. The world can be one of two ways. P is true, or P is false.

We write each way as one row of a table. A row is one way the world could be. T means true and F means false.

P
T
F

Two panels side by side. The left one shows rain falling, with the letter P and a green T. The right one shows a dry sky, with the letter P and a red F.

Two letters, four rows

Add Q = It is windy. For each way of P, Q can be true or false. So we get 2 × 2 = 4 rows.

PQ
TT
TF
FT
FF

Always write the rows in this order. Both true. P true, Q false. P false, Q true. Both false. A fixed order means nobody forgets a row.

Each new letter doubles the rows. One letter gives 2 rows. Two letters give 4. Three letters give 8.

Three small tables side by side: one letter with 2 rows, two letters with 4 rows and three letters with 8 rows. Under each is its row count.

The table for and

We give the word "and" a sign: ∧. P ∧ Q reads "P and Q". When is it true? Look at every row.

A truth table lists every row and the value of the claim in that row.

PQP ∧ Q
TTT
TFF
FTF
FFF

Only the first row has T. If it is not raining, or it is not windy, "It is raining and it is windy" is false.

A truth table for P and Q with a third column P and Q. The first row is circled in amber and has a green T. The other three rows have a red F.

Careful

One row is one way the world could be, not one letter. Two letters do not give two rows. They give four.

Try it at home

  1. Pick two things about today that could be true or false, such as "It is cold" and "I am hungry". Write the key.
  2. Draw the four rows for them in the fixed order.
  3. Put a pencil mark on the one row that is how today really is.
  4. Write "both" as a claim with ∧. Is it true in your marked row?

Words to know

  • row - one way the world could be, with a value for each letter
  • truth table - a list of every row and the value of a claim in each
  • ∧ - the sign for and: true only when both parts are true

Big idea

A table has one row for every way the world could be. Each new letter doubles the rows, and P ∧ Q is true only in the first one.

Lesson page →

Or and And in Symbols

A café menu says "soup or salad". A fire alarm rings for "smoke or heat". Both use the word or. Do they mean the same thing?

Two signs, side by side

In Level 2 we met two kinds of or. Now we give or a sign: ∨. It always allows both. Here are ∧ and ∨ together.

PQP ∧ QP ∨ Q
TTTT
TFFT
FTFT
FFFF

P ∨ Q is false in one row only: the last, where both parts are false.

Two truth tables side by side. The and table has a green T only in its first row, which is circled. The or table has a red F only in its last row, which is circled.

Two kinds of or

A fire alarm rings for smoke or heat. If there is smoke and heat, it still rings. That is ∨: at least one, both allowed.

"Soup or salad" on a menu means one of them, not both. That is the only-one or. It is not ∨.

A menu card reading soup or salad, marked only one, beside an alarm panel reading smoke or heat, marked both allowed.

The only-one or in symbols

We can build it from signs we know: (P ∨ Q) ∧ ¬(P ∧ Q). In words: at least one, and not both.

PQP ∨ Q¬(P ∧ Q)(P ∨ Q) ∧ ¬(P ∧ Q)
TTTFF
TFTTT
FTTTT
FFFTF

The answer is T when exactly one of P and Q is true. The first row is the one ∨ would accept and this claim refuses.

A truth table with five columns ending in the only-one claim. Its last column reads F, T, T, F and is tinted. The first and last rows are false.

Careful

Do not read ∨ as only one of them. In a table, both true is T for ∨. To rule out both, you must add ¬(P ∧ Q).

Try it at home

  1. Find two rules at home that use the word or, such as a label on a medicine, a road sign or a menu.
  2. For each one, ask: if both are true, is that allowed?
  3. Write "allowed" or "not allowed". Allowed is ∨. Not allowed is the only-one or.

Words to know

  • ∨ - the sign for or: true when at least one part is true, both allowed
  • only-one or - or with both ruled out: (P ∨ Q) ∧ ¬(P ∧ Q)

Big idea

The sign ∨ is false only when both parts are false. The only-one or needs an extra step to rule out both.

Lesson page →

Tables for Bigger Claims

What if a claim has three letters and three signs, like ¬(P ∧ Q) ∨ R? That is 8 rows. How do we fill them in without getting lost?

Inside out

First find the main connective (the last step, the one that rules the whole claim). In ¬(P ∧ Q) ∨ R it is ∨.

Then work from the inside out. Step 1: P ∧ Q. Step 2: put ¬ on that. Step 3: join the result to R with ∨.

Three boxes joined by arrows: step 1 is P and Q, step 2 is not of P and Q, step 3 is not of P and Q or R. A letter badge R points into the last box.

A column for each step

Give each step its own column. The main connective's column comes last.

PQRP ∧ Q¬(P ∧ Q)¬(P ∧ Q) ∨ R
TTTTFT
TTFTFF
TFTFTT
TFFFTT
FTTFTT
FTFFTT
FFTFTT
FFFFTT

Row 2 is the only F. There P and Q are true, so ¬(P ∧ Q) is false. R is false too, so ∨ has no true part.

The eight-row truth table for not-P-and-Q or R. The last column is tinted and the second row, the only false one, is circled in amber.

The helper columns

The columns P ∧ Q and ¬(P ∧ Q) are helper columns. They are scratch work, one for each bracket or sign.

The row order for three letters never changes. P: TTTTFFFF. Q: TTFFTTFF. R: TFTFTFTF.

Careful

Do not jump to the last column. If you skip a helper column, one wrong value will hide inside your head.

Try it at home

  1. Take the claim ¬P ∨ Q. Write its key from two things about your day.
  2. Draw a table with columns P, Q, ¬P and ¬P ∨ Q, and fill in the four rows.
  3. Which row is the only false one? Say in words what that day looks like.

Words to know

  • main connective - the last step, the one that rules the whole claim
  • helper column - a column for one part, filled in before the main column

Big idea

Build one column per step, inside out, and the main connective's column comes last.

Lesson page →

Two Sentences, One Meaning

Ann says "The tea is not both hot and sweet." Ben says "The tea is not hot, or it is not sweet." Do they say the same thing? A truth table can tell us.

Same column, same meaning

Key: P = The tea is hot. Q = The tea is sweet. Ann's claim is ¬(P ∧ Q). Ben's is ¬P ∨ ¬Q.

Two panels with an equals sign between them. The left one says the tea is not both hot and sweet, with the letters not of P and Q. The right one says the tea is not hot or not sweet, with not P or not Q.

Checking by table

Two claims are equivalent when their columns match in every row.

PQ¬(P ∧ Q)¬P ∨ ¬Q
TTFF
TFTT
FTTT
FFTT

The last two columns match in all four rows. Ann and Ben say the same thing.

In Level 2 we found two laws in words. They are named after Augustus De Morgan, a British logician of the 1800s. The other one is ¬(P ∨ Q) = ¬P ∧ ¬Q. Check it: ¬(P ∨ Q) is F, F, F, T. ¬P ∧ ¬Q is F, F, F, T.

Two four-column truth tables. In each, the last two columns are the same in every row, F, T, T, T on the left and F, F, F, T on the right, under a label that says same in every row.

One different row is enough

Is ¬(P ∧ Q) equivalent to ¬P ∧ ¬Q? Look at the columns.

PQ¬(P ∧ Q)¬P ∧ ¬Q
TTFF
TFTF
FTTF
FFTT

They differ in rows 2 and 3. One differing row would be enough to say: not the same.

A truth table with the columns not-P-and-Q and not-P-and-not-Q. The second and third rows are circled in amber because the two last columns differ there.

Careful

Matching in most rows is not enough. Equivalent means every row matches, so check all of them.

Try it at home

  1. Say "not both" about two things at home, such as "It is not both cold and wet."
  2. Say it again in the other way: "It is not cold, or it is not wet."
  3. Check each of the four ways the day could be. Do the two sentences agree in all of them?

Words to know

  • equivalent - two claims whose columns match in every row; they say the same thing
  • De Morgan's laws - ¬(P ∧ Q) = ¬P ∨ ¬Q and ¬(P ∨ Q) = ¬P ∧ ¬Q

Big idea

Two claims are equivalent when their columns match in every row. One row that differs is enough to show they are not.

Lesson page →

If, by Table

The If Table

Mum says: "If you tidy your room, you can stay up late." Four things could happen that evening. In which of them did Mum break her promise?

A promise as a claim

In Level 2 we met if-then. Now it gets a sign: →. Key: P = You tidy your room. Q = You can stay up late. Then P → Q reads "if P, then Q".

P is the if part. Q is the then part. There are four ways the evening can go, so four rows. Ask the same question of each row: was the promise broken?

A mother stands in a tidy bedroom and says her promise, which appears in a speech bubble: if you tidy your room, you can stay up late. A child looks at the clock.

The four rows

Row 1: you tidy up, and you stay up late. The promise is kept. True.

Row 2: you tidy up, and Mum sends you to bed. The promise is broken. False.

Row 3: you do not tidy up, and you stay up late. Mum was kind. She broke nothing. True.

Row 4: you do not tidy up, and you go to bed. Mum broke nothing. True.

PQP → Q
TTT
TFF
FTT
FFT

A truth table for P and Q with a third column P arrow Q. The second row, where P is true and Q is false, is circled in amber and has a red F. The other three rows have a green T.

Why the last two rows are true

Rows 3 and 4 feel odd. You did not tidy up, so the promise was never tested. A claim has to be true or false. This one has not been shown false, so it counts as true.

Logic chose this on purpose. An if-claim is false only when someone can catch it out: the if part is true and the then part is false. Nothing else breaks it.

The same table with the third and fourth rows circled in amber and a label that says the promise was not tested. Both rows have a green T.

Careful

The arrow does not mean "causes". "If 2 + 2 = 4, then Paris is in France" has a true if part and a true then part, so it is true. One does not cause the other.

Try it at home

  1. Think of a promise at home, such as "If you wash up, I will make tea". Write the key with P and Q.
  2. Draw the four rows in the fixed order. Beside each, write kept or broken.
  3. Circle the one row that breaks the promise.
  4. Ask someone which row they think is odd, and explain why it is true.

Words to know

  • → - the sign for if-then: P → Q is false only when P is true and Q is false
  • if part - the first part, P, in P → Q
  • then part - the second part, Q, in P → Q
  • broken promise - the one row where the if part is true and the then part is false

Big idea

P → Q is false in one row only: P true and Q false. When P is false, the promise is not broken, so the claim is true.

Lesson page →

Only If, in Letters

A sign at the pool says: "You can swim only if a lifeguard is there." Another says: "You can swim if a lifeguard is there." One small word changes the arrow. Which way does it point?

If and only if are different

Key: P = A lifeguard is there. Q = You can swim.

"Q if P" means: if P, then Q. The word after if is the if part. So "You can swim if a lifeguard is there" is P → Q.

"Q only if P" means: Q cannot happen without P. If you swim, a lifeguard is there. So "You can swim only if a lifeguard is there" is Q → P.

Two signs at a swimming pool. The first says swim if a lifeguard is there, with the arrow from P to Q. The second says swim only if a lifeguard is there, with the arrow from Q to P.

Unless

"The match is cancelled unless it stops raining." Key: P = The match is cancelled. Q = It stops raining.

"P unless Q" means: if Q does not happen, then P. In letters, ¬Q → P. Check it by table.

PQ¬Q → PP ∨ Q
TTTT
TFTT
FTTT
FFFF

The two columns match in every row, so "P unless Q" says the same as P ∨ Q.

A truth table with columns P, Q, not Q arrow P, and P or Q. The last row is circled in amber. In that row both of the last two columns show a red F, and the other rows show a green T.

Needed and enough

Take the claim: if a shape is a square, it has four sides. That is P → Q, with P = It is a square and Q = It has four sides.

Being a square is enough for having four sides: it settles the matter. Having four sides is needed for being a square: a shape without four sides cannot be a square.

Every arrow P → Q says both things. P is enough for Q, and Q is needed for P. The arrow starts at the enough thing and ends at the needed thing.

Careful

"If" and "only if" are not twins. "You can swim if a lifeguard is there" does not say a lifeguard is needed. Only "only if" says that.

Try it at home

  1. Write one sentence with if and one with only if about something at home, such as stairs or a door.
  2. Give each a key, then write each as an arrow.
  3. Say which part is needed and which is enough.
  4. Swap the two parts of one arrow. Does the sentence still say the same thing?

Words to know

  • only if - the word after it is needed: Q only if P is Q → P
  • unless - P unless Q is ¬Q → P, the same as P ∨ Q
  • needed - you cannot do without it
  • enough - it settles the matter by itself

Big idea

"Q if P" is P → Q, and "Q only if P" is Q → P. "P unless Q" is ¬Q → P, the same as P ∨ Q.

Lesson page →

If and Only If

A hall light has one switch. When the switch is up, the light is on. When the switch is down, the light is off. The light and the switch always agree. Is there a sign for "always agree"?

Two arrows in one

Key: P = The light is on. Q = The switch is up. The light is on if the switch is up: Q → P. The light is on only if the switch is up: P → Q.

Say both at once and you get the sign ↔. P ↔ Q reads "P if and only if Q". It is a short way to write (P → Q) ∧ (Q → P).

Two hall light panels. In the first the switch is up and the light is on. In the second the switch is down and the light is off. A double arrow joins the letters P and Q.

The table

Build it column by column. First P → Q. Then Q → P. Then join them with and.

PQP → QQ → PP ↔ Q
TTTTT
TFFTF
FTTFF
FFTTT

P ↔ Q is true when P and Q have the same value: both true or both false. It is false when they differ.

A truth table with columns P, Q, P arrow Q, Q arrow P and P double arrow Q. In the last column the first and last rows are circled in amber with a green T. The middle two rows have a red F.

Where we use it

Definitions use if and only if. "A number is even if and only if it divides by 2 with nothing left over." Both arrows hold, so the two sides always match.

Level 2 gave it a longer name: needed and enough. The if part is enough, and the then part is needed, both at once.

Careful

P ↔ Q does not say that P and Q are true. It says they match. If both are false, P ↔ Q is still true.

Try it at home

  1. Find a switch at home and the thing it controls. Write P and Q in a key.
  2. Try every row: switch up or down, light on or off. Which rows could really happen?
  3. Write the claim with ↔ and say it aloud.
  4. Find a word with a strict definition, and say it with "if and only if".

Words to know

  • ↔ - the sign for if and only if: true when both sides have the same value
  • biconditional - the logicians' name for a claim with ↔
  • same value - both true, or both false

Big idea

P ↔ Q is (P → Q) ∧ (Q → P). It is true when P and Q have the same value, and false when they differ.

Lesson page →

An If and Its Mirror

"If it rains, the ground is wet." Look at the wet ground. Is it safe to say "If the ground is wet, it rained"? And what is the safe way to turn an if-claim around?

The safe turn

Key: P = It rains. Q = The ground is wet. The claim is P → Q.

In Level 2 we met the contrapositive: turn the claim round and put not on both parts. "If the ground is not wet, it did not rain." In letters: ¬Q → ¬P. A third form is ¬P ∨ Q: "It does not rain, or the ground is wet."

PQP → Q¬Q → ¬P¬P ∨ Q
TTTTT
TFFFF
FTTTT
FFTTT

The three columns match in every row. So the three claims are equivalent: they say the same thing.

A truth table with columns P, Q, P arrow Q, not Q arrow not P, and not P or Q. The three last columns show the same four values: green T, red F, green T, green T.

The unsafe turn

Now turn it round without the nots: Q → P, "If the ground is wet, it rained." This is the converse.

PQP → QQ → P
TTTT
TFFT
FTTF
FFTT

The columns differ in the second and third rows. A sprinkler can wet the ground with no rain: that is the third row. So the converse is not equivalent. One row that differs is enough.

A truth table with columns P, Q, P arrow Q and Q arrow P. The second and third rows are circled in amber because the last two columns show different values there.

Careful

Wet ground does not prove rain. From "if P then Q" you may not conclude "if Q then P".

Try it at home

  1. Write an if-claim from home, such as "If the oven is on, the kitchen is warm". Write the key.
  2. Write its contrapositive in words and in letters.
  3. Write its converse. Think of a case where the converse fails.
  4. Say which of the two is the safe turn.

Words to know

  • equivalent - two claims with the same value in every row
  • contrapositive - P → Q turned into ¬Q → ¬P: always equivalent
  • converse - P → Q turned into Q → P: not equivalent

Big idea

P → Q, ¬Q → ¬P and ¬P ∨ Q have the same table, so they say the same thing. The converse Q → P does not.

Lesson page →

Checking Arguments by Table

The Row That Breaks It

A friend says: "If it rained, the grass is wet. The grass is wet. So it rained." It sounds fine. But a sprinkler could have wet the grass. How can we check an argument for sure, without guessing?

The test

In Level 1 we said an argument is valid when its premises cannot all be true while its conclusion is false. A truth table lists every way things could be, so it can check exactly that.

There are three steps. Write a row for every way the letters could be. In each row, work out every premise and the conclusion. Then look for a bad row: every premise true and the conclusion false.

No bad row means the argument is valid. One bad row means it is invalid, and that row is a counterexample.

Three panels side by side. Panel one says write every row. Panel two says work out the premises and the conclusion. Panel three says look for a row with the premises all true and the conclusion false.

Going forwards

Key: P = It rained. Q = The grass is wet. First argument:

P → Q
P
So Q

The premises are P → Q and P. The conclusion is Q. Only row 1 makes both premises true. There Q is true as well. No row is bad.

PQP → QBad row?
TTTno
TFFno
FTTno
FFTno

This is going forwards, and it is valid.

A truth table for P, Q and P arrow Q with four rows. Beside each row a note says why it is not bad: the conclusion is true, or a premise is false.

Going backwards

Now the argument from the hook. Same key.

P → Q
Q
So P

The premises are P → Q and Q. The conclusion is P. Look at row 3: P is false and Q is true. Then P → Q is true, Q is true, and the conclusion P is false.

PQP → QBad row?
TTTno
TFFno
FTTyes
FFTno

So the argument is invalid. The bad row is its counterexample: it did not rain, and the grass is wet anyway.

The same truth table with row three circled in amber. A note says the premise P arrow Q is true, the premise Q is true, and the conclusion P is false.

Careful

One true premise is not enough. A row is bad only when every premise is true and the conclusion is false. A row with a false premise never breaks an argument.

Try it at home

  1. Write this in letters: "If the shop is open, I can buy milk. I can buy milk. So the shop is open." Make a key.
  2. Draw its four rows in the fixed order and fill in P → Q.
  3. Look for a row with every premise true and the conclusion false. Circle it.
  4. Say in words what that row tells you.

Words to know

  • bad row - a row where every premise is true and the conclusion is false
  • counterexample - a bad row: a way things could be that breaks the argument
  • valid - no row of the table is bad
  • invalid - at least one row of the table is bad

Big idea

An argument is valid when no row of its table has every premise true and the conclusion false. One such row, a bad row, shows it is invalid.

Lesson page →

Either Way, the Same Result

You can get to school by bus or by bike. If you take the bus, you are late. If you take the bike, you are late. You will take one of the two. Will you be late?

Two roads, one place

Key: P = You take the bus. Q = You take the bike. R = You are late. The argument is:

P ∨ Q
P → R
Q → R
So R

The first line says one of the two roads is taken. The other lines say each road ends in R. This is an argument by cases: split into cases, and show that every case gives the same result.

A person thinks. Two amber boxes say you take the bus and you take the bike. An arrow from each leads to a green box that says you are late.

Eight rows

Three letters give 2 × 2 × 2 = 8 rows, in the fixed order. We add a column for each premise: P ∨ Q, P → R and Q → R. Then we look for a bad row.

P ∨ Q is false in rows 7 and 8, so they cannot be bad. P → R is false in rows 2 and 4. Q → R is false in rows 2 and 6. Rows 1, 3 and 5 are left: every premise is true there.

In rows 1, 3 and 5, R is true. So no row has every premise true and R false. The argument is valid.

A truth table with eight rows and columns P, Q, R, P or Q, P arrow R and Q arrow R. Rows one, three and five are circled in amber. A note says every premise is true there and R is true in each.

Crossing off, by table

In Level 2 we crossed off one choice: "P or Q. Not P. So Q." Now check it by table.

PQP ∨ Q¬PBad row?
TTTFno
TFTFno
FTTTno
FFFTno

Only row 3 makes both premises true. There Q is true. So crossing off is valid, and the table shows why.

Careful

Each case needs its own arrow. Take away Q → R and the argument is invalid: in the row P false, Q true, R false, P ∨ Q and P → R are true and R is false.

Try it at home

  1. Think of two ways to do something that end in the same result. Write the argument in letters, with a key.
  2. Draw the eight rows. P is TTTTFFFF, Q is TTFFTTFF and R is TFTFTFTF.
  3. Cross off the rows where P ∨ Q is false. Then cross off the rows where an arrow is false.
  4. Look at the rows left. Is R true in all of them?

Words to know

  • argument by cases - an argument that splits into cases and shows each case gives the same result
  • P ∨ Q - P or Q, with both allowed
  • bad row - every premise true and the conclusion false

Big idea

If one of two cases must happen, and each case leads to R, then R follows. The table confirms it: no row has every premise true and R false.

Lesson page →

Hunting for the Bad Row

A puzzle has five letters. Its table has 32 rows, and nobody wants to write them all. But we do not need every row. We need only one answer: can a bad row exist?

Build the bad row

A bad row has every premise true and the conclusion false. So build it directly. Write F for the conclusion and T for every premise. Then work out what each letter must be. This is the short table test.

If two steps force one letter to be both true and false, that is a clash. No bad row can exist, and the argument is valid. If everything fits, you have built a bad row. The argument is invalid, and your row is the counterexample.

A valid argument

Key: P = It is hot. Q = The shop is busy. R = The shop sells out.

P → Q
Q → R
So P → R

Step 1: make the conclusion false. P → R is false only when P is true and R is false. So P is T and R is F.

Step 2: make P → Q true. P is true, so Q must be true.

Step 3: make Q → R true. But Q is true and R is false, so Q → R comes out false. That is a clash.

No bad row can be built. The argument is valid.

Three boxes for the premises and the conclusion with the values they need. Letters P and R are set from the conclusion and Q from the first premise. A red note says Q arrow R comes out false, a clash.

An invalid argument

P ∨ Q
P → R
So R

Step 1: R is F. Step 2: P → R must be true while R is false, so P must be false. Step 3: P ∨ Q must be true while P is false, so Q must be true.

Nothing clashes. The row P false, Q true, R false works. Check it: P ∨ Q is true, P → R is true, R is false. It is a bad row, so the argument is invalid.

The same layout for a second argument. Letter R is set false, then P false, then Q true. A green note says there is no clash, so a bad row is found.

Careful

Sometimes a step has more than one choice. P ∨ Q is true in three ways. Try every choice before you say clash. The argument is valid only if every try clashes.

Try it at home

  1. Write this in letters: "If it rains, the match is off. The match is off. So it rained." Make a key.
  2. Set the conclusion to F and each premise to T.
  3. Work out what P and Q must be. Is there a clash?
  4. Say what you found: a bad row or a clash, and what that tells you.

Words to know

  • short table test - build the bad row directly instead of writing every row
  • clash - two steps that force one letter to be both true and false
  • counterexample - the bad row you build when there is no clash

Big idea

To test an argument quickly, try to make every premise true and the conclusion false. A clash means valid. No clash means you built a counterexample.

Lesson page →

What Tables Can't See

"All cats are mammals. Tom is a cat. So Tom is a mammal." Nobody doubts it. Yet a truth table calls this argument invalid. How can that be?

Giving the claims letters

Key: P = All cats are mammals. Q = Tom is a cat. R = Tom is a mammal. None of them has a not, an and, an or or an if, so each gets one letter. In letters the argument is:

P
Q
So R

Three claims in boxes: all cats are mammals, Tom is a cat, and Tom is a mammal. An arrow from each box leads to a round badge with the letter P, Q or R.

What the table says

Three letters give eight rows. A bad row has P true, Q true and R false. Row 2 is exactly that. Nothing in the table connects the three letters, so any mix of values is allowed.

The table finds a bad row. By the test, the argument is invalid.

A truth table for P, Q and R with eight rows. Row two, where P is true, Q is true and R is false, is circled in amber. A note says it is the bad row.

What the letters hide

But the argument is valid. If all cats are mammals and Tom is a cat, Tom must be a mammal. The reason is inside the claims: the word all and what it says about cats.

A letter hides the inside of a claim. The table sees only how not, and, or and if join the letters. So "invalid by table" means: not valid because of not, and, or and if alone. Another reason may still make it valid.

Logic can look inside all, some and none as well. That comes later.

A claim box says all cats are mammals, with the word all highlighted in amber. An arrow leads to a round badge with the letter P. A note says the letter hides the word all.

Careful

A bad row does not always mean a bad argument. First check whether the letters hide an all, a some or a none.

Try it at home

  1. Write: "No fish can fly. Nemo is a fish. So Nemo cannot fly." Give each claim a letter.
  2. Draw the eight rows and find the bad row.
  3. Read the three claims aloud. Which word makes the argument work even though the table cannot see it?

Words to know

  • hidden inside - what a letter keeps out of sight: all, some, none
  • invalid by table - no good because of not, and, or and if alone
  • all - every one of a kind: it says something about a whole group

Big idea

A truth table sees only not, and, or and if. When the reason for an argument is inside the claims, such as all, the table cannot see it.

Lesson page →

Always, Never, Sometimes

True in Every Row

Grandpa reads the weather forecast aloud: "Tomorrow it will rain or it won't." Nobody has ever caught him being wrong. Can a claim be right in every row of its table?

A claim that cannot fail

Let P = It will rain tomorrow. Grandpa's claim is P ∨ ¬P, read "P or not P". Let us fill its table. The question comes first: is the claim true in each row?

Row 1: P is true, so ¬P is false. An or-claim is true when at least one part is true, so P ∨ ¬P is true. Row 2: P is false, so ¬P is true. Again one part is true.

P¬PP ∨ ¬P
TFT
FTT

The last column is true in every row. A claim like that is an always-true claim (logicians say a tautology). It cannot be wrong, whatever the weather does.

Grandpa stands beside a large television screen that shows a cloud with rain on one side and a sun on the other, with the words "It will rain or it won't".

Another one

Take P → P, "if P then P". For example: "If it rains, it rains."

Row 1: P is true and the then-part is true, so the promise holds. Row 2: P is false. Earlier in this course we saw that an if-then with a false first part counts as true, because the promise was never tested. So P → P is true in both rows.

A table with columns P and P arrow P has two rows. Both rows have a green T in the last column, and each row is circled in amber.

Two more always-true claims are P → (P ∨ Q) and (P ∧ Q) → P. You can check them with four rows each.

Safe, but empty

An always-true claim is safe. It is also empty. It says nothing about the world.

A claim says something when it rules out some rows, some ways the world could be. "It will rain" rules out the row where it stays dry. "It will rain or it won't" rules out no row at all, so it fits every tomorrow.

Two panels. The left panel, "It will rain", has a green tick on the rain row and a red cross on the dry row. The right panel, "It will rain or it won't", has a green tick on both rows.

Be careful when a forecast or a promise is an always-true claim in disguise. "I will come on time or I will be late" cannot fail. It also promises nothing.

Careful

True is not the same as always true. "The shop is open" may be true today, but there is a row where it is false. An always-true claim is true in every row, not only in the real one.

Try it at home

  1. Listen for "or not" sentences in sport, weather or advice. Write down one you hear.
  2. Give it a key, write it as P ∨ ¬P, and make its two-row table.
  3. Write a claim about tomorrow. Count how many rows it rules out.

Words to know

  • always-true claim (tautology) - a claim that is true in every row of its table
  • row - one way the world could be
  • rules out - says that some rows cannot be the real one

Big idea

A claim that is true in every row can never be wrong, and for that reason it says nothing about the world.

Lesson page →

False in Every Row

Sam tells his teacher: "I did my homework, and I did not do my homework." The teacher frowns. Can a claim be wrong in every row?

Wrong in every row

Let P = I did my homework. Sam's claim is P ∧ ¬P, "P and not P". An and-claim needs both parts true. Can P and ¬P be true together?

P¬PP ∧ ¬P
TFF
FTF

In each row one of the two parts is false, so the and-claim is false. A claim that is false in every row is a contradiction. No world could make it true.

Sam stands in front of a teacher with a speech bubble that says "I did it and I did not do it", and a red cross badge sits beside the bubble.

The mirror of last lesson

Last lesson, P ∨ ¬P was true in every row. What is its opposite, ¬(P ∨ ¬P)? Not flips each row. So true everywhere becomes false everywhere.

PP ∨ ¬P¬(P ∨ ¬P)
TTF
FTF

The negation of an always-true claim is a contradiction. The negation of a contradiction is an always-true claim.

Two columns of boxes. The left column has two green T boxes, labelled "always true". A big arrow with the word not points to the right column, which has two red F boxes, labelled "always false".

Most claims are in between

Let P = The shop is open and Q = It has milk. Take P ∧ Q.

PQP ∧ Q
TTT
TFF
FTF
FFF

This claim is true in one row and false in three. A claim that is true in some rows and false in others is contingent (it could go either way). Most everyday claims are contingent.

Three bins in a row. The first bin, always true, holds the card "It will rain or it won't". The middle bin, contingent, holds "The shop is open". The last bin, always false, holds "It rains and it does not rain".

Careful

Contingent does not mean false. A contingent claim may be false in the real world today and true tomorrow. A contradiction is false in every row, whatever the world is like.

Try it at home

  1. Write three claims about your day. Mark each as always true, contingent or a contradiction.
  2. Take "It will rain or it won't" and put "not" in front of the whole claim. Say it aloud. Does it sound possible?
  3. Pick two claims from your day, give them P and Q, and make the four-row table of P ∧ Q.

Words to know

  • contradiction - a claim that is false in every row of its table
  • contingent - true in some rows and false in others
  • negation - the opposite of a claim: not P

Big idea

Always true, always false, or in between: the table shows which one a claim is.

Lesson page →

Can They All Be True?

A cake has gone missing. Three children each say something. Could all three be telling the truth? A table can answer that.

Stories that fit

Let P = Ali took the cake and Q = Bea took the cake. Cara says: "Ali or Bea took it", which is P ∨ Q. Ali says: "I didn't", which is ¬P.

Is there a row where both claims are true? Look for it.

PQP ∨ Q¬P
TTTF
TFTF
FTTT
FFFT

Row 3 makes both true: Ali did not take it and Bea did. A set of claims is consistent (they can live together) when at least one row makes all of them true.

Three children stand in a row. Cara says "Ali or Bea took it", Ali says "I did not", and Bea says "I did not".

Stories that clash

Now Bea says: "I didn't", which is ¬Q. Look at all three claims in one table. Is any row true all the way across?

A table with columns P, Q, P or Q, not P and not Q. Four rows. In every row at least one of the three claim cells is a red F, and a note says that no row has every claim true.

No row works. These claims are inconsistent: they can never all be true together.

Inconsistent tells you only this: at least one claim is false. It does not tell you which one. Cara may be wrong, or Ali, or Bea. The table cannot say who.

The method

To test a set of claims: give each claim a column, fill every row, and look for a row where all the columns are true.

If you find one, the set is consistent, and that row is a way the world could be. If you find none, it is inconsistent.

Careful

Consistent does not mean true. It means the claims could all be true together. Nobody has checked whether they are true in the real world.

Try it at home

  1. Ask two people what they think about one thing, such as a film. Write each answer as a claim.
  2. Give each claim a letter and write the key.
  3. Make the table and look for a row where all the claims are true.

Words to know

  • consistent - a set of claims is consistent when at least one row makes all of them true
  • inconsistent - no row makes all of them true
  • set of claims - a group of claims looked at together

Big idea

A set of claims is consistent when some row makes all of them true. If no row does, at least one of them is false.

Lesson page →

Assume the Opposite

Nina says: "If I find a way for the premises to be true and the conclusion false, the argument is broken." There is another way to say the same thing, and it uses the opposite.

The same test, said another way

In the last module a bad row was a row where every premise is true and the conclusion is false. If the conclusion is false, its opposite is true. So a bad row is a row where the premises and the opposite of the conclusion are all true.

An argument is valid exactly when the premises together with the opposite of the conclusion are inconsistent: no row makes them all true. In Level 2 we called this proof by impossibility: assume the opposite, and meet a clash.

Three boxes joined by arrows. The first says add the opposite of the conclusion to the premises. The second says look for a row where all are true. The third says no such row, so the argument is valid.

A valid argument

Take this argument:

P → Q
P
So Q

The opposite of Q is ¬Q. Do P → Q, P and ¬Q ever hold together? The columns for P → Q and ¬Q are below, and P is the first column.

PQP → Q¬Q
TTTF
TFFT
FTTF
FFTT

A row needs P true, so only rows 1 and 2. Row 1 has ¬Q false. Row 2 has P → Q false. No row works, so the argument is valid.

An invalid argument

Now take:

P → Q
Q
So P

The opposite of P is ¬P. Look for a row where P → Q, Q and ¬P are all true. Q must be true, so only rows 1 and 3. Row 1 has ¬P false. Row 3 works.

A table with columns P, Q, P arrow Q and not P. The third row, P false and Q true, is circled in amber, and a label says this is a row where everything holds.

Row 3 is the bad row: P false, Q true. It is a counterexample, so the argument is invalid.

When the premises clash

What if the premises can never all be true, for example "P" and "¬P"? Then no row has all premises true. So there is no bad row, whatever the conclusion is.

That argument is valid. Logicians say: from a contradiction, anything follows. It is valid, but it is never sound, because its premises are never all true.

Careful

Add the opposite of the conclusion, not of a premise. And a clash among the premises makes an argument valid, not good.

Try it at home

  1. Write "If it rains, the match stops. It rains. So the match stops." with a key.
  2. Add the opposite of the conclusion to the premises.
  3. Make the table and look for a row where all three are true.

Words to know

  • opposite of the conclusion - the conclusion with not put in front of it
  • valid - no row makes every premise true and the conclusion false
  • bad row - a row where the premises are true and the conclusion is false

Big idea

An argument is valid exactly when its premises and the opposite of its conclusion can never all be true together.

Lesson page →

From English to Letters

Writing English in Letters

Mia reads a sign at the swimming pool: "The slide is open, but the diving board is not." She wants to write it in letters. Where should she start?

Key first, then the main connective

Always begin with the key. Let P = The slide is open and Q = The diving board is open.

Next, ask which word ties the two halves together. That is the main connective (the last step, the one that rules the whole claim). Here it is "but". The sign is an and-claim.

Then write the parts. The first half is P. The second half says the board is not open, so it is ¬Q. Together: P ∧ ¬Q.

A pool sign reads "The slide is open, but the diving board is not". An arrow splits it at the word but into two halves, one marked with the badge P and the other with the badge not Q.

But, although, yet

In English, "but", "although" and "yet" join two claims that are both true. For a table they work like "and". All of them become ∧.

"Although it is late, Sam is awake." Let P = It is late and Q = Sam is awake. The formula is P ∧ Q.

Four word cards, and, but, although and yet, each with an arrow that points to the same sign, a large wedge for and.

Neither, and not both

"Neither the slide nor the board is open." It says that P is not true and Q is not true. The main connective is and, so the formula is ¬P ∧ ¬Q. Another way to say it: it is not true that at least one is open, ¬(P ∨ Q).

"The slide and the board are not both open." This says at least one is closed, so it is ¬(P ∧ Q). Compare the two on the table.

PQ¬P ∧ ¬Q¬(P ∧ Q)
TTFF
TFFT
FTFT
FFTT

A truth table with columns P, Q, not P and not Q, and not both. The second row is circled in amber: the slide is open and the board is closed, which makes not both true and neither false.

Old friends

Two words from earlier lessons keep their rules. "P only if Q" is P → Q. "P unless Q" is ¬Q → P.

Careful

"Neither P nor Q" is not ¬P ∨ ¬Q. That formula says "not both". If P is true and Q is false, it is true, but "neither" is false.

Try it at home

  1. Find a sign or a rule at home or in the street that has "but", "neither" or "not both" in it.
  2. Write a key, find the main connective, and write the formula.
  3. Imagine one thing that fits the sentence and one that does not. Check the formula agrees.

Words to know

  • key - a list that says what each letter means
  • main connective - the last step; the one that rules the whole claim
  • neither P nor Q - not P and not Q
  • not both - at least one is not true: not (P and Q)

Big idea

Write the key, find the main connective, then write the parts. But and although mean and; neither is not-and-not; not both is not of an and.

Lesson page →

What the Letters Leave Out

Sam says: "The window broke because the ball hit it." Both parts are true. Mia says: "The window broke because it is Tuesday." It really is Tuesday, so both her parts are true too. Yet her claim is false. Can a table tell the difference?

When the parts decide the whole

Look at the and-claim. Let P = The window broke and Q = The ball hit it. In the row where P and Q are both true, P ∧ Q is true. Always. The values of the parts are enough.

A sign is truth-functional if the values of the parts fix the value of the whole. The five signs ¬, ∧, ∨, → and ↔ are all like that. Each row of each table has one answer.

A machine with two inputs on the left, the values of P and Q, and one output on the right, the value of the whole. A note says the same inputs always give the same output.

Because has no table

Now take "because". Let R = It is Tuesday. Both claims below have two true parts, the same row.

ClaimPQ or RWhole
P because QTTtrue
P because RTTfalse

Same row, two different answers. A table could write only one of them. So "because" is not truth-functional, and it has no table. What matters is how the parts are linked, not just whether they are true.

Two panels with the same pair of true parts, the window broke and something else is true. The left panel links them with because and gets a green tick. The right panel links them with because and gets a red cross.

What the letters leave out

"Before" works the same way. "Ann ate before she swam" and "Ann swam before she ate" have the same two true parts. At most one whole is true.

"And then" has an order: "She opened the door and then she ran." Written P ∧ Q, it says only that both happened. P ∧ Q and Q ∧ P have the same table, so the order is lost.

"But" loses its surprise in the same way. Letters keep what a table can see. This is a fair price: we get checks we can trust.

Careful

Not truth-functional does not mean illogical. It means only that no table can say what the sign does.

Try it at home

  1. Find three sentences with "because" or "before" in a book or at home.
  2. For each, swap the two parts. Does the sentence still say the same thing?
  3. Write one sentence with "and" that would change its meaning if you swapped the parts.

Words to know

  • truth-functional - the values of the parts fix the value of the whole
  • because - a link that no table can fill: true parts, but the whole may be false
  • order lost - P ∧ Q and Q ∧ P have the same table

Big idea

Our five signs are truth-functional: the parts decide the whole. Words such as because and before are not, so letters cannot hold all of what a sentence means.

Lesson page →

The Same Tables in Machines

Dad's hall has two light switches, one downstairs and one upstairs. Either one can turn the light on or off. Nobody inside the wall is thinking. Could a table be built out of wires?

Logic as algebra

In 1854 George Boole published The Laws of Thought. He wrote logic like algebra, using 1 and 0. True became 1, and false became 0.

In programming, true and false values are still called booleans, after him.

A timeline with two cards. The first, 1854, shows Boole and logic written with 1 and 0. The second, 1937, shows Shannon and a circuit with a switch and a bulb.

Switches follow the tables

In 1937 Claude Shannon, in his master's thesis, showed that circuits of relays and switches can follow those same tables. A logic gate is a small circuit with one or two inputs and one output. 1 means on and 0 means off.

The AND gate is on only if both inputs are on: two switches in a row, and the current needs both. The OR gate is on if at least one input is on: two switches side by side. The NOT gate flips its input.

ABANDOR
1111
1001
0101
0000

Two circuits with a battery and a bulb. In the first, two switches sit one after the other, so both must be closed: AND. In the second, two switches sit side by side, so either one is enough: OR.

The hall light

Rule: each switch flips the light. With both switches down, the light is off. Let P = The downstairs switch is up and Q = The upstairs switch is up.

The light is on when exactly one switch is up. That is the only-one or from earlier: (P ∨ Q) ∧ ¬(P ∧ Q).

PQP ∨ Q¬(P ∧ Q)Light
TTTFF
TFTTT
FTTTT
FFFTF

A hall wall with two switches, one marked P and one marked Q, and a lit bulb above. The label says P is up and Q is down, so the light is on.

That is four gates: OR, AND, NOT and a last AND. Every computer is built from gates like these, in huge numbers.

Careful

A gate does not think. It only follows its table. Everything a computer does comes from many simple tables joined together.

Try it at home

  1. Find two switches at home that control one light, or one lamp with a plug and a switch.
  2. Write a key, then fill in a four-row table: which positions turn the light on?
  3. Say which gate each part of the circuit is like: in a row, side by side, or a flip.

Words to know

  • logic gate - a small circuit that turns inputs into one output by a table
  • AND, OR, NOT - three gates: both on, at least one on, flip
  • 1 and 0 - on and off; true and false

Big idea

Boole wrote logic as algebra in 1854. Shannon showed in 1937 that switches follow the same tables, so machines can do logic.

Lesson page →

A Whole Argument, Checked

Mr Khan, the football coach, says: "If it rains, the match is cancelled. If the match is cancelled, the team stays home. The team did not stay home. So it did not rain." Is he right? Is there a list of steps that checks any argument?

Steps 1 and 2: key and letters

Start with the key: P = It rains, Q = The match is cancelled, R = The team stays home. "The team did not stay home" is ¬R. Every sentence gets the same letter every time.

P → Q
Q → R
¬R
So ¬P

Four boxes in a chain, P to Q to R, with the values forced one after another. A red cross at the end shows that the third premise needs R to be false, which clashes.

Step 3: hunt for the bad row

A bad row makes every premise true and the conclusion false. Let us try to build one. The question comes first: what must each letter be?

The conclusion ¬P is false, so P is true. Premise 1, P → Q, is true with P true, so Q must be true. Premise 2, Q → R, is true with Q true, so R must be true. But premise 3, ¬R, needs R to be false. Clash.

No bad row can be built, so the argument is valid. It was enough to follow the forced values. No eight-row table was needed.

Steps 4 and 5: are the premises true?

Valid says only this: if the premises are true, the conclusion is true. We still have to check the facts. The two rules were posted on the school board, and the team did go to the pitch. All three premises are true.

A valid argument with true premises is sound, so we can trust "It did not rain". If one premise were false, the argument would still be valid, but we could not trust its conclusion.

A checklist of five numbered steps: write the key, turn the claims into letters, hunt for the bad row, say valid or not, and check the premises to say sound or not.

Careful

Valid does not mean true. A valid argument can have a false conclusion if one of its premises is false.

Try it at home

  1. Find a short argument in a letter, an advert or a talk. Write each claim in one line.
  2. Make a key and write the argument in letters.
  3. Try to build a bad row. Decide valid or not, then check the facts to decide sound or not.

Words to know

  • key - what each letter means
  • bad row - a row where every premise is true and the conclusion is false
  • valid - no bad row can be built
  • sound - valid, and all the premises are true

Big idea

To check an argument: key, letters, hunt for the bad row, then check the facts. Valid means no bad row. Sound means valid with true premises.

Lesson page →