2.4 Propositional Logic
Computational Thinking & Algorithms
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 (as shown in Figure 2.3)
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. For example, “The sun rises in the east” is a proposition. A proposition must have a clear meaning. It should not be confusing. Propositions are the basic units of logic. They are used to form logical expressions. Understanding propositions is important in logic. A proposition is usually represented by a capital letter, such as P, Q, or R. For example, if p represents the statement “The sky is blue”, then we write: