Download presentation
Presentation is loading. Please wait.
1
SSK3003 DISCRETE STRUCTURES
Prof. Madya Dr.Ali Mamat Department of Computer Science
2
INTRODUCTION Discrete mathematics (structures) is the study of mathematical structures (objects) that are fundamentally discrete rather than continuous (vary smoothly) Continuous objects are studied in calculus. The term discrete means separate, distinct. Discrete structures include integers, sets, functions, relations, graphs and trees. Topics in discrete mathematics include: Logic Set theory Number theory Proof Techniques (Mathematic Induction) Counting Functions and relations
3
INTRODUCTION (cont.) Recursions Graphs and trees33
Discrete mathematics has become popular in recent years because of its application to computer science. Logic has applications to automated theorem proving (logic programming) and software development. Set theory → software engineering, databases Relations → to databases Proof techniques → analysis of algorithms Number theory → cryptography Graphs and trees → data structures
4
CH.1: The Logic of Compound Statements
Learning Outcomes Evaluate logical statements Determine two statements are equivalent Determine the validity of arguments
5
Contents Logical form and logical equivalence Conditional Statements
Valid and invalid arguments Application: Digital logic circuits
6
1.1 Logical form and logical equivalence
Logics are formal languages for formalizing reasoning, in particular for representing information such that conclusion can be drawn. A logic involves: A language with a syntax for specifying what is a legal expression in the language; syntax defines well formed sentences in the language Semantics for associating elements of the language with elements of some subject matter. Semantics defines the meaning of sentences (link to the domain); i.e., semantics defines the truth of a sentence with respect to each possible domain (world). E.g likes(Anas, Azura) Inference rules for manipulating sentences in the language (e.g modus ponens)
7
Propositional Logic A statement (or Proposition) is a sentence that is either true or false but not both. “Two plus two equals four” is a statement “He is a university student” is not a statement. Which one is a statement? √ 2 > 1 1 + 1 = 1 What time is it? Read this sentence carefully. x + y > 0
8
Compound Statements A statement can be atomic or compound.
Atomic Statement Peter hates Lewis : p It is raining outside: q √ 2 > 1: r Peter stays at home : t Compound statements are formed from existing statements using logical operators, i.e. ¬ (not), ∧ (and), ∨ (or), → (imply or if then), ↔ (equivalent if and only if ).
9
Compound Statements Example Peter hates Lewis and it is raining outside. : p ∧ q If it is raining outside then Peter stays at home : q → t If Peter doesn't hate Lewis then It is raining or √ 2 > 1 : ¬p → (q ∨ r )
10
Truth Table A truth table displays the relationships among the truth values of statements. In constructing such truth tables, we write “0” (F) for false and “1” (T) for true. p q pvq p∧q T F
11
Truth Table
12
Well-Formed Formulas Statements and compound statements must follow syntax. Statements that follows syntax are called well-formed formulas (wffs) or formula. A wff is defined as follows: Atomic formula is a wff If p and q are wffs then ¬p, p∨q, p∧q, p→q, p↔q are wffs
13
Well-Formed Formulas
14
Type of formula A statement/proposition: true or false
Atomic: P, Q, X, Y, … Unit Formula: P, ~P, Conjunctive: P ∧ Q, P ∧ ¬Q, … Disjunctive: P v Q, P v (P∧ X),… Conditional: P Q Biconditional: P ↔ Q
15
Determining truth of a formula
Atomic formulae: given Compound formulae: via meaning of the connectives Suppose: P is true Q is false How about: (P v Q) Truth tables
16
Precedence ∧ ¬ highest v , ↔ lowest
Avoid confusion - use ‘(‘ and ‘)’: P ∧ Q v X (P ∧ Q) v X
17
Parenthesizing Parenthesize & build truth tables
Similar to arithmetics: 3*5+7 = (3*5)+7 but NOT 3*(5+7) A ∧ B v C = (A ∧ B) v C but NOT A ∧ (B v C) So start with sub-formulae with highest-precedence connectives and work your way out
18
Evaluate The Truth Value
Given a compound statement, how do we compute the truth value?
19
Translating English Sentence
English (even every other human languages) is ambiguous. E.g. words such as present, “sumbang” Example “If you are under 4 feet tall and you are younger than 16 years old then you cannot ride the roller coaster." You can ride the roller coaster : p You are under 4 feet tall : q You are younger than 16 years old : r (q ∧ r ) → ¬p
20
Logical Equivalences Denition : The propositions p and q are called logically equivalent if they have identical truth values, denoted by p ≡ q. One way to determine if two propositions are logically equivalent is to use truth table. The truth table can also be used to show that two propositions are not equivalent.
21
Some Useful Logical Equivalences
22
Logical equivalence (cont.)
Name p v ¬p ≡ T0 p ∧ ¬p ≡ F0 Inverse laws or negation laws p v (p ∧ q) ≡ p p ∧ (p v q) ≡ p Absorption laws T0 is a tautology F0 is a contradiction
23
Suppose someone gives you
Use of Equivalences Simplification Suppose someone gives you ~P v (AB) v ~(C v D H) v P v X↔Y and asks you to compute it for all possible input values You can either immediately draw a truth table with 28 = 256 rows Or you can simplify it first
24
Simplification ~P v (AB) v ~(C v D H) v P v X↔Y
~P v P v (AB) v ~(C v D H) v X↔Y T v (AB) v ~(C v D H) v X↔Y T The statement is a tautology – always true…
25
Evaluate Logical Equivalences
26
Tautology Definition : A tautology (denoted by T0) is a statement that is always true regardless of the truth values of the individual statements. A contradiction (denoted by F0) is a statement that is always false regardless of the truth values of the individual statements. A contingency is a statement that is sometimes true and sometimes false.
27
Equivalence & Tautology
Suppose A and B are logically equivalent Consider proposition (A ≡ B) What can we say about it? It is a tautology! Why? A B A ≡ B A ↔ B F F T T T T T T
28
1.2 Conditional Statement
Conditional statement (or implication), p → q, is only false when q is false and p is true. E.g. If you show up for work Monday morning, then you’ll get the job. Related Implications The variable p is called the hypothesis (antecedent) and q the conclusion (or consequent). Caution ! : Only the contrapositive form is logically equivalent to conditional statement. The converse and the inverse are equivalent.
29
Conditional and its contrapositive
q p → q ¬q → ¬p T F
30
Bi-conditional The biconditional of p and q is “p if and only if q” and is denoted p ↔ q. It is true if both p and q have the same truth values and is false if p and q have opposite truth values. p ↔ q is equivalent to p → q ∧ q → p: p → q p is a sufficient condition for q q is a necessary condition for p. (if q does not occur then p does not occur too, i,e. ¬q → ¬p )
31
Recall Learning Outcomes Evaluate logical statements
Determine two statements are equivalent Determine the validity of arguments
32
Questions 1. What is an argument?
2. What is a premise and a conclusion? 3. When is an argument valid? 4. How to determine whether an argument is valid.
33
Argument An argument is a sequence of statements. All the statements before the final one are called premises (or assumption or hypothesis). The final statement is called the conclusion. An argument is valid whenever the truth of all its premises implies the truth of its conclusion. How to show a conclusion q logically follows from the premises Basically, we show that the argument is tautology.
34
Valid Argument Example Show that the argument where premises are p v (q v r ) and ¬r , and the conclusion is p v q, is valid.
35
Valid Argument Example Show that the argument where premises are p v (q v r ) and ¬r , and the conclusion is p v q, is valid.
36
Valid Argument Example Show that the argument where premises are p v (q v r ) and ¬r , and the conclusion is p v q, is valid.
37
Valid argument p q r q v r p v (q v r ) ¬r p v q pv(qvr) ^¬ r → (pv q)
T T T T F T T F T F T T F F F T T F T F F F T F F F
38
Logical Implication From the previous table: p1 : pv(qvr) p2: ¬r q1: q
p1 ^ p2 → q1 is a tautology. If p, q are arbitrary statements such that p → q, then we says p logically implies q, denoted as p q
39
Rule of Inferences Although the truth table method always works, however, it is not convenient. Since the appropriate truth table must have 2n lines where n is the number of atomic propositions. Another way to show an argument is valid is to construct a formal proof. To do the formal proof we use rules of inference. A rule of inference is a form of argument that is valid. In rules of inference, premise(s) are written in lines and the conclusion is on the last line preceded with the symbol which denotes “therefore". For example the following rule is called Modus Ponens. In words, if p and p → q are true then q is true.
40
List of Rule of Inferences
41
Recap Introduction to logic Propositions (statement) Logical Operators
wffs Truth table Logical equivalences Tautologies Conditional statements Bi-conditional statements Valid argument Rule of inferences
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.