From the course: Programming Foundations: Discrete Mathematics

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Conditional propositions

Conditional propositions

From the course: Programming Foundations: Discrete Mathematics

Start my 1-month free trial

Conditional propositions

- [Voiceover] Conditional statements, or conditional propositions, form the basis for all decision making in computer software. First, let's do a quick review of our logical operators. A compound proposition is created by connecting individual propositions using logical operators. AND is denoted with an upside down v symbol, such as p AND q. The truth value of a compound proposition using the AND operator is only true when both propositions are true. OR is denoted using a v symbol, such as p OR q. The truth value of a compound proposition using the OR operator is always true except when p and q are both false. If a statement has logical operators, the order of precedence is the NOT operator first, then AND, and finally OR. Now, back to conditional propositions. A conditional statement is read as 'if this, then that'. For example, if there is an accident on the highway, then I will be late for work. Conditional statements are written using an arrow, such as if p then q. p represents…

Contents