Docsity

Discrete Mathematics for IT: Logic, Propositions, and Truth Tables, Exams of Mathematics

Partial preview of the text

Download Discrete Mathematics for IT: Logic, Propositions, and Truth Tables and more Exams Mathematics in PDF only on Docsity!

ICT

Discrete Mathematics for IT

Lecture 3 – Logic, Propositions, Truth Tables, Logical Equivalence, Laws of Logic, Problems involving Logical Reasoning Slides adopted from: P. Grossman, “Discrete Mathematics or Computing”, 3 rd edition, Palgrave Macmillan, 2009.

  • Logic in computing
  • Proposition
  • Connectives and Truth tables
  • Compound propositions
  • Logical equivalence
  • Laws of logic

Learning Outcomes

Propositions

  • A proposition is a statement that is either true or false. Whichever of these (true or false) is the case is called the truth value of the proposition.
  • Fundamental objects – ▪ Numbers in arithmetic ▪ Propositions in logic

Propositions - Examples

Some English sentences that are propositions: ▪ ‘Canberra is the capital of Australia.’ ▪ ‘There are 8 days in a week.’ ▪ ‘Every even number greater than 2 can be expressed as the sum of two prime numbers.’

Connectives and truth tables Consider this statement:

  • ‘If Brian and Angela are not both happy, then either Brian is not happy or Angela is not happy.’
  • Carefully understanding this statement it will be clear that the above statement will be true.

Continued:

  • The sentence about Brian and Angela is an example of a compound proposition. It is built up from the atomic propositions.
  • ‘Brian is happy’ and ‘Angela is happy’ using the words and , or , not and if-then.
  • These words are known as connectives.

Continued: The connectives if-then and if-and-only-if are also known as implies and is-equivalent-to respectively.

Truth Table – Logical and The connective and can be formally defined by stating the truth value of the proposition p ᴧ q for each possible combination of the truth values of the propositions p and q :

Truth Table – Logical not

Truth Table – if-then Suppose your lecturer makes the following claim: ‘If you pass this subject, then you will progress to the next year of your course.’

Compound propositions A compound proposition is a proposition that involves the assembly of multiple statements. Example:

  • Express the proposition ▪ ‘Either my program runs and it contains no bugs, or my program contains bugs’ in symbolic form.
  • Solution
    • Let p denote the statement: ‘My program runs.’
    • Let q denote the statement: ‘My program contains bugs.’
  • Then the proposition can be written in symbolic form as follows:

Compound propositions - Example Construct the truth table for the expression:

Compound propositions - Example An expression that is always true, regardless of the truth values of the variables it contains, is called a tautology.

Continued: ‘It is raining and windy, and it is not raining.’ An expression that is always false, regardless of the truth values of the variables it contains, is called a contradiction.