SSK3003 DISCRETE STRUCTURES

Slides:



Advertisements
Similar presentations
1 Logic Logic in general is a subfield of philosophy and its development is credited to ancient Greeks. Symbolic or mathematical logic is used in AI. In.
Advertisements

CS128 – Discrete Mathematics for Computer Science
Chapter 1 The Logic of Compound Statements. Section 1.2 – 1.3 (Modus Tollens) Conditional and Valid & Invalid Arguments.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
1 Chapter 7 Propositional and Predicate Logic. 2 Chapter 7 Contents (1) l What is Logic? l Logical Operators l Translating between English and Logic l.
From Chapter 4 Formal Specification using Z David Lightfoot
1 Math 306 Foundations of Mathematics I Math 306 Foundations of Mathematics I Goals of this class Introduction to important mathematical concepts Development.
CS 4700: Foundations of Artificial Intelligence
Introduction to Logic Logical Form: general rules
CSE115/ENGR160 Discrete Mathematics 01/17/12 Ming-Hsuan Yang UC Merced 1.
First Order Logic. Propositional Logic A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but not.
Mathematical Induction Assume that we are given an infinite supply of stamps of two different denominations, 3 cents and and 5 cents. Prove using mathematical.
Adapted from Discrete Math
The Foundations: Logic and Proofs
Discrete Mathematics Goals of a Discrete Mathematics Learn how to think mathematically 1. Mathematical Reasoning Foundation for discussions of methods.
Intro to Discrete Structures
1.1 Sets and Logic Set – a collection of objects. Set brackets {} are used to enclose the elements of a set. Example: {1, 2, 5, 9} Elements – objects inside.
Discrete Maths 2. Propositional Logic Objective
MATERI II PROPOSISI. 2 Tautology and Contradiction Definition A tautology is a statement form that is always true. A statement whose form is a tautology.
Discrete Mathematics and Its Applications
Mathematical Structures A collection of objects with operations defined on them and the accompanying properties form a mathematical structure or system.
1 Chapter 7 Propositional and Predicate Logic. 2 Chapter 7 Contents (1) l What is Logic? l Logical Operators l Translating between English and Logic l.
Review I Rosen , 3.1 Know your definitions!
March 3, 2015Applied Discrete Mathematics Week 5: Mathematical Reasoning 1Arguments Just like a rule of inference, an argument consists of one or more.
COS 150 Discrete Structures Assoc. Prof. Svetla Boytcheva Fall semester 2014.
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
Fundamentals of Logic 1. What is a valid argument or proof? 2. Study system of logic 3. In proving theorems or solving problems, creativity and insight.
Propositional Logic. Propositions Any statement that is either True (T) or False (F) is a proposition Propositional variables: a variable that can assume.
1 Introduction to Abstract Mathematics Expressions (Propositional formulas or forms) Instructor: Hayk Melikya
Propositional Logic ITCS 2175 (Rosen Section 1.1, 1.2)
CS6133 Software Specification and Verification
Chapter 2 Logic 2.1 Statements 2.2 The Negation of a Statement 2.3 The Disjunction and Conjunction of Statements 2.4 The Implication 2.5 More on Implications.
Chapter 1: The Foundations: Logic and Proofs
Chapter 2 Fundamentals of Logic 1. What is a valid argument or proof?
Chapter 7. Propositional and Predicate Logic Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
Mathematics for Comter I Lecture 2: Logic (1) Basic definitions Logical operators Translating English sentences.
CS104:Discrete Structures Chapter 2: Proof Techniques.
ARTIFICIAL INTELLIGENCE Lecture 2 Propositional Calculus.
Outline Logic Propositional Logic Well formed formula Truth table
رياضيات متقطعة لعلوم الحاسب MATH 226. Text books: (Discrete Mathematics and its applications) Kenneth H. Rosen, seventh Edition, 2012, McGraw- Hill.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Logic and Truth Tables Winter 2012 COMP 1380 Discrete Structures I Computing Science Thompson Rivers University.
CS104 The Foundations: Logic and Proof 1. 2 What is Discrete Structure?  Discrete Objects  Separated from each other (Opposite of continuous)  e.g.,
Discrete Math by R.S. Chang, Dept. CSIE, NDHU1 Fundamentals of Logic 1. What is a valid argument or proof? 2. Study system of logic 3. In proving theorems.
Chapter 1. Chapter Summary  Propositional Logic  The Language of Propositions (1.1)  Logical Equivalences (1.3)  Predicate Logic  The Language of.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
Module Code MA0003NI: Computing mathematics Lecture for Week Autumn.
Chapter 1 Logic and proofs
Chapter 1 Propositional Logic
Logic.
Chapter 7. Propositional and Predicate Logic
2. The Logic of Compound Statements Summary
Lecture 1 – Formal Logic.
Discrete Mathematics Logic.
Niu Kun Discrete Mathematics Chapter 1 The Foundations: Logic and Proof, Sets, and Functions Niu Kun 离散数学.
COMP 1380 Discrete Structures I Thompson Rivers University
MATH 245 Spring 2009 This is mathematics for computer science
(CSC 102) Discrete Structures Lecture 2.
Information Technology Department
CS201: Data Structures and Discrete Mathematics I
Applied Discrete Mathematics Week 1: Logic
Back to “Serious” Topics…
Computer Security: Art and Science, 2nd Edition
Discrete Mathematics Logic.
Chapter 7. Propositional and Predicate Logic
Foundations of Discrete Mathematics
COMP 1380 Discrete Structures I Thompson Rivers University
Discrete Structures Prepositional Logic 2
CS201: Data Structures and Discrete Mathematics I
Presentation transcript:

SSK3003 DISCRETE STRUCTURES Prof. Madya Dr.Ali Mamat Department of Computer Science

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

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

CH.1: The Logic of Compound Statements Learning Outcomes Evaluate logical statements Determine two statements are equivalent Determine the validity of arguments

Contents Logical form and logical equivalence Conditional Statements Valid and invalid arguments Application: Digital logic circuits

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)

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

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 ).

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 )

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

Truth Table

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

Well-Formed Formulas

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

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

Precedence ∧ ¬ highest v , ↔ lowest Avoid confusion - use ‘(‘ and ‘)’: P ∧ Q v X (P ∧ Q) v X

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

Evaluate The Truth Value Given a compound statement, how do we compute the truth value?

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

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.

Some Useful Logical Equivalences

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

Suppose someone gives you Use of Equivalences Simplification Suppose someone gives you ~P v (AB) 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

Simplification ~P v (AB) v ~(C v D  H) v P v X↔Y ~P v P v (AB) v ~(C v D  H) v X↔Y T v (AB) v ~(C v D  H) v X↔Y T The statement is a tautology – always true…

Evaluate Logical Equivalences

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.

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

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.

Conditional and its contrapositive q p → q ¬q → ¬p T F

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 )

Recall Learning Outcomes Evaluate logical statements Determine two statements are equivalent Determine the validity of arguments

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.

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.

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.

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.

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.

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

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

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.

List of Rule of Inferences

Recap Introduction to logic Propositions (statement) Logical Operators wffs Truth table Logical equivalences Tautologies Conditional statements Bi-conditional statements Valid argument Rule of inferences