Chapter 2 · Computational Thinking & Algorithms
2.4Propositional Logic
Propositions are statements that are true or false. Learn simple and compound propositions and the connectives AND, OR, NOT.
Written and checked by Muhammad Raheel(opens in a new tab)
Full Stack Developer · AI Engineer · Reviewed 21 Oct 2026 · 2 min read
On this page
Propositional logic is the first, simplest kind of logic you meet in computer science. It works with sentences that are either true or false, nothing in between.
The book's Figure 2.3, "Propositional Logic Statements", shows four of them: "2 + 3=5" is True, "The sky is blue" is True, "1 > 3" is False and "Today is Sunday" is False.
Proposition
So a question is not a proposition, and an order is not one either. The book's example of a proposition is "The sun rises in the east". A proposition must also have a clear meaning, so that it is not confusing.
Propositions are the building blocks of logic. We join them to make logical expressions. To keep writing short, we name each proposition with a capital letter such as P, Q or R. For example, P = "The sky is blue".
Simple and Compound Propositions
A simple proposition holds one idea only, like "It is raining". You cannot split it into smaller statements.
A compound proposition joins two or more simple ones. "It is raining and it is cold" is made of "It is raining" plus "it is cold", joined by the word "and". Compound propositions let us say bigger, more complex things. Both types matter in propositional logic.
Logical connectives: AND, OR, NOT
The joining words have a name.
| Connective | When the result is true (book's Figure 2.4) |
|---|---|
| AND | True if both A and B are true. |
| OR | True if A or B is true (or both). |
| NOT | True if A is false. |
AND needs both sides to be true. OR needs at least one side to be true. NOT flips a statement: true becomes false, and false becomes true. Programs use these words all the time to make decisions.
Practice this topic
Short questions
1.What is a proposition?2 marks
Answer
From the book: "A proposition is a statement that is either true or false. It cannot be both true and false at the same time." For example, "The sun rises in the east" is a proposition.
2.What is propositional logic?2 marks
Answer
From the book: "Propositional logic is a basic form of logic used in computer science. It deals with statements that can be true or false. These statements are called propositions."
3.Are questions and commands propositions? Give the book's example of a proposition.2 marks
Answer
No. From the book: "Questions and commands are not propositions." A proposition "is a statement that is either true or false". The book's example: "The sun rises in the east" is a proposition.
4.How is a proposition represented? Give an example.2 marks
Answer
From the book: "A proposition is usually represented by a capital letter, such as P, Q, or R." For example, for the statement "The sky is blue" we write: P = "The sky is blue".
5.Differentiate between simple and compound propositions with examples.3 marks
Answer
From the book: "A simple proposition contains only one statement. It cannot be broken into smaller parts. For example, "It is raining" is a simple proposition. A compound proposition is formed by combining two or more simple propositions. Logical connectives are used to join them. For example, "It is raining and it is cold" is a compound proposition."
6.What are logical connectives? Name them.2 marks
Answer
From the book: "Logical connectives are words used to connect propositions." The book names three: AND, OR, NOT. "These connectives help form compound propositions."
7.When is each of AND, OR and NOT used?3 marks
Answer
From the book: "AND is used when both statements must be true. OR is used when at least one statement is true. NOT is used to reverse the truth of a statement." Figure 2.4 says: A and B is "True if both A and B are true.", A or B is "True if A or B is true (or both).", Not A is "True if A is false."
Long questions
1.Explain propositional logic. Discuss simple and compound propositions with examples.8 marks
Answer
Cover the opening paragraph and the first two sub-headings, using the book's text:
- Propositional logic (verbatim): "Propositional logic is a basic form of logic used in computer science. It deals with statements that can be true or false. These statements are called propositions." Figure 2.3: Propositional Logic Statements: "2 + 3=5" True, "The sky is blue" True, "1 > 3" False, "Today is Sunday" False. DO YOU KNOW?: "Propositional logic is the simplest type of logic, but it forms the base of all computer reasoning!"
- Proposition: "A proposition is a statement that is either true or false. It cannot be both true and false at the same time. Questions and commands are not propositions." Example: "The sun rises in the east". "Propositions are the basic units of logic. They are used to form logical expressions." Representation: "usually represented by a capital letter, such as P, Q, or R", for example P = "The sky is blue".
- Simple proposition: "A simple proposition contains only one statement. It cannot be broken into smaller parts." Example: "It is raining".
- Compound proposition: "A compound proposition is formed by combining two or more simple propositions. Logical connectives are used to join them." Example: "It is raining and it is cold". "Compound propositions can express complex ideas. They are common in logical reasoning. Both types are important in propositional logic."
Aim for 200-300 words.
2.What are logical connectives? Explain AND, OR and NOT with the help of Figure 2.4.6 marks
Answer
Cover the sub-heading "Logical connectives: AND, OR, NOT", using the book's text:
- Definition (verbatim): "Logical connectives are words used to connect propositions."
- AND: "AND is used when both statements must be true." Figure 2.4: "A and B", "True if both A and B are true." (only the overlap of the two circles is shaded).
- OR: "OR is used when at least one statement is true." Figure 2.4: "A or B", "True if A or B is true (or both)." (both circles are shaded).
- NOT: "NOT is used to reverse the truth of a statement." Figure 2.4: "Not A", "True if A is false."
- Uses: "These connectives help form compound propositions. They are commonly used in computer programs. Logical connectives help in decision-making (as shown in Figure 2.4). They make logical expressions clear. Understanding them is essential in logic."
- Example of a compound proposition made with a connective: "It is raining and it is cold".
Aim for 150-250 words.
In this chapter
- 2.1Introduction to Computational Thinking
- 2.2Problem Solving Using Computational Thinking
- 2.3Logic as a Knowledge Representation Framework
- 2.4Propositional LogicYou are here
- 2.5Truth Tables
- 2.6Propositional Equivalence
- 2.7Propositional Satisfiability
- 2.8Predicate Logic
- 2.9Quantifiers in Predicate Logic
- 2.10Applying Predicate Logic to Real-World Problems
- 2.11Logic-Based Reasoning and Inference