You are on page 1of 18

Discrete Structures

LECTURE # 1
The Course
Course Code: CS1-C Morning
Course Title: Discrete structures
Instructor: MUHAMMAD AWAIS
Semester : 1st
Duration: 16 Weeks
Grading
Following is the division of marks:

Assignments and Quizzes 20


Project 10
Mid-Term Exam 30
Final Exams. 40

◦ Marks division might change during the semester


Introduction to Discrete Structures
•Continuous Mathematics − It is based upon continuous number line or the
real numbers. It is characterized by the fact that between any two numbers,
there are almost always an infinite set of numbers. For example,
Height of students in your class: you cannot gave a particular value.
Discrete Mathematics − It involves distinct values; i.e. between any two
points, there are a countable number of points. For example,
Number of students in your class : you will gave a particular value like 20
30 40 etc.
Discrete vs Continuous
Examples of Discrete data
•No of candies in a packet.
•No of suitcases lost by an
airline.

Examples of Continuous data


•Time in a race
•Distance traveled by a car
Discrete Structure?
Discrete Objects
Separated from each other (Opposite of continuous)
e.g., integers, people, house,
Continuous objects: e.g., real number
Discrete Structures
The abstract mathematical structures used to represent
discrete objects and relationships between the objects
e.g. sets, relations, graphs
Why do we use discrete structure
•Information is stored and manipulated by computers in a discrete
fashion. 0101101...
•As a student in computer science major, you need to know the basic
language and conceptual foundation for all of the computer science,
i.e., Discrete Structures!
•Discrete structure concepts are also widely used throughout math,
science, engineering, economics, biology, etc., ...
•Get training for rational thought!
Uses of discrete structure
Networking
Database
Image Processing
Programming Languages
Compilers & Interpreters
Software Engineering
Artificial Intelligence
Computer Architecture
LOGIC THEORY
Propositional Logic
Proposition: A proposition is a declarative statement ( a statement that
declares a fact) that is either TRUE or FALSE, but not both.
 The area of logic that deals with propositions is called propositional
logic.
Propositions Not Propositions
1. Riyadh is the capital 1. How many students in
of saudi Arabia this class?
2. Every cow has 4 legs. 2. Bring me coffee!
3. 3 + 2 = 32 3. X + 2 = 3
4. 4 + 3 = 7 4. Y + Z = X
Propositional Logic Applications
•We are using propositional logic as a foundation for formal proofs.
• Propositional logic is also the key to writing good code...you can’t do
any kind of conditional (if) statement without understanding the
condition you’re testing.
• All the logical connectives that we are going to
discuss are also found in hardware and are called
“gates.”
Propositional Logic Negation
• We use letters to denote propositional variables
• Truth value of true proposition is denoted by T
• Truth value of false proposition is denoted by F
• Negation: Suppose p is a proposition. The negation of p is written
¬p and has meaning: “It is not the case that p.”
The proposition ¬p is read “NOT p”
Example: p: “Today is Friday”
p: “Today is NOT Friday” P
¬p
Truth table for negation: F T
T F
Compound Propositions
When two propositions are combined to form a new proposition
Then it is called compound proposition
For Example
Conjunction (AND)
Disjunction (OR)
Today is Friday and it is not raining today.
Propositional Logic Conjunction
•Conjunction corresponds to English “and.”
•Conjunction: Let p and q be two propositions. The conjunction of p and
q, denoted by p ∧ q, is the proposition “p and q”. The p ∧ q is true
when
both p and q are true, otherwise false.
•Example: p: “Today is Friday”
q: “It is raining today” p q p∧q
p ∧ q: “Today is Friday and it is raining today” F F F
F T F
•Truth table for conjunction: T F F
T T T
Propositional Logic Disjunction
•Disjunction corresponds to English “or”
•Disjunction: Let p and q be two propositions. The disjunction of p and
q, denoted by p ∨ q, is the proposition “p or q”. The p ∨ q is false when
both p and q are false, otherwise true.
•Example: p: “Today is Friday”
q: “It is raining today”
p q p∨q
p ∨ q : “Today is Friday or it is raining today”
F F F
•Truth table for disjunction: F T T
T F T
T T T
Propositional Logic Exclusive Or
•Exclusive Or: Let p and q be two propositions. The exclusive or of p and
q, denoted by p ⊕ q, is the proposition that is true when exactly one of
p and q is true, otherwise false.
•Truth table for Exclusive Or: p q p⊕q

•It is also called XOR F F F


F T T
T F T
T T F
Composite Statements
Statements and operators can be combined in any way to form new
Statements.

P q ¬p ¬q
¬p ∨¬p
T T F F F
T F F T T
F T T F T
F F T T T
Lecture Summary
•Introduction to the course
•Propositions
•Compound Propositions
•Logical connectives/operators
•Truth Tables

You might also like