View as PDF

COMPUTING AND DIGITAL LITERACY

Boolean Logic

Difficulty level: Intermediate

Computing and Digital Literacy

This document was made by AI and there may be mistakes. If a question or answer looks wrong, use the Flag a mistake button to let Brett know so he can fix it.

Overview of the concept

This is how a computer or phone app decides what to do. It lets you in only if you are old enough and have a ticket, by combining simple yes or no checks. Every search filter, every login screen, and every app setting is built from these yes or no combinations.

Rule

Boolean logic: AND is true only when both parts are true. OR is true when at least one part is true. NOT flips a value: not True is False, and not False is True.

Write the two parts and their truth values first, then apply the rule. Only True and True gives True for AND. Only False or False gives False for OR.

Worked examples

Example 1

A game lets you in only if you are over 12 AND you have a ticket. You are 14, but you have no ticket. Are you in?

Solution

This is an AND question: AND comes out true only when both parts are true.

First check: over 12? You are 14, so True. Second check: have a ticket? No, so False.

True AND False is False, so you are not in. One false part is enough to fail an AND.

Example 2

What is NOT False AND True?

Solution

The one rule to remember first: NOT comes before AND, so work out the NOT part first.

NOT False is True, so the question becomes True AND True.

True AND True is True, because NOT is worked out first.

Practice questions

1

What is True AND False?

2

What is True OR False?

3

What is NOT True?

4

A club allows members OR guests. A guest arrives. Allowed?

5

p is True, q is True. What is p AND q?

6

p is False, q is False. What is p OR q?

7

What is NOT False AND False?

8

What is True OR False AND False?

9

A game lets you in if you are over 12 AND have a ticket, OR you are with an adult. You are 10, have no ticket, and are with an adult. Are you in?

10

What does AND need in order to be True?

ANSWER KEY

1. False

2. True

3. False

4. Yes

5. True

6. False

7. False

8. True

9. Yes

10. Both parts True