Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

Lecture 01

Uploaded by

numl-s24-34590
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lecture 01

Uploaded by

numl-s24-34590
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 40

Discrete Structure

Week # 1

NUML Rawalpindi
Department of Computer Science

Mehak Sheikh
mehak.sheikh@numl.edu.pk

1
Directory

Instructor: Ms Mehak Sheikh (Lecturer)



Office: (Department of Computer Science, Room 301)
– Office Hours:

IMPORTANT: Please do not leave your messages to the last


minute or expect a response time of less than 24h.

2
Quizzes and Assignments

• Quiz- 3 quizzes
–2x before mid term, 1x after mid term
–+/- 20 minutes each
–Closed books/notes
– Announced (Depends)

• Assignment- 3 assignments
–2x before mid term
–1x after mid term

Projects
1. Each group contains maximum 3 students
for project/mega assignment
2. Each group will get 5-10 minutes for
presentation
3.Each student will get individual
grades.
Attendance

Attend lectures properly


talk to friends or class mates if you are away
If you are not attending classes properly, It may effect your Final
Exam

75% Attendance Mandatory..!!


(Conventional)
No favors..!! (For
Everyone)
Assessment/ Grading Criteria

S. Assessment Items %age


No.
1 Assignments+ Class Participation / Class Discussion 10

2 Quizzes 10

3 Mid Exam (after 7 weeks) 25

4 Final examination (after 14 weeks) 50

5 Presentation 5

Total 100
Course Learning Outcomes

After completion of this course students will be Domai Taxono


able to: n my
Level
1. Apply the elements of propositional logic C 3
statements and logical operations

2. Solve basic problems demonstrating the C 2


understanding of fundamental for sets,
functions, relations and counting principles

3. Apply some properties to graphs, trees and C 3


related discrete structures, and be able to
discover their relationship with practical
examples

7
The Course-Required attitude 
Avoid these........
Why Discrete Structure

1. It develops your mathematical thinking


2. Improves your problem solving ability
3. Discrete Structures is important to
survive in the subjects like : compiler
design, databases, computer security
operating systems etc.

10
Discrete vs Continues
Discrete means with gaps Continues
means within a flow

11
Recommended Text Book
Discrete Mathematics with Applications (second edition) by
Susanna S. Epp

12
LECTURE # 1

COURSE OBJECTIVES
Express statements with the precision of formal logic
•Analyze arguments to test their validity
•Apply the basic properties and operations related to sets, relations
and functions
•Define terms recursively
•Discuss Loop invariants
•Illustrate the basic definitions of graph theory and properties of
graphs
•Relate each major topic in Discrete Mathematics to an
application area in computing

13
RECOMMENDED BOOKS

1. Discrete Mathematics with


Applications (latest edition) by
Susanna S. Epp
2. Discrete Mathematics and Its
Applications (latest edition) by
Kenneth H. Rosen
3. Discrete Mathematics by Ross
and Wright

14
MAIN TOPICS

1. Logic.
2. Sets and Operations on sets.
3. Relations and Their Properties.
4. Functions.
5. Sequences and Series.
6. Recurrence Relations.
7. Loop Invariants.
8. Graphs and Trees.

15
What is Discrete Mathematics?

Discrete Mathematics concerns


processes that consist of a sequence
of individual steps.
This distinguishes it from calculus,
which studies continuously changing
processes.

16
LOGIC

Logic is the study of the principles


and methods that distinguishes
between a valid and an invalid
argument.

SIMPLE STATEMENT

A statement is a declarative sentence


that is either true or false but not
both.
A statement is also referred to as a
proposition. So statement or
Proposition means same.
17
If a proposition is true, we say that it
has a truth value of "true”.
If a proposition is false, its truth
value is "false".

The truth values “true” and “false”


are, respectively, denoted by the
letters T and F.

18
EXAMPLES OF STATEMENTS
OR PROPOSITIONS:
1.Grass is green.
Grass is green is a statement
(or proposition) because the
sentence is true and its truth value
is T.( Because everyone knows
that grass is green)
2. 4 + 2 = 6
4 + 2 = 6 is also a statement
and its truth value is T.(Because
4+2 is 6)
3. 4+2=7
4 + 2 = 7 is also a statement
and its truth value is F. ( Because
19
we know that 4+2 is 6 not 7).
4. There are four fingers in a hand.
There are four fingers in a hand is
also a statement and its truth value
is True.
5. Washington, D.C, is the capital of
the United States of America.
The above statement is also a
proposition and its truth value is T.
6. Karachi is the capital of Pakistan. It
is also a statement and its truth
value is F.
7. Arif Alwi is the president of
America.
The above sentence is a statement
and its Truth value is false.
REMARK: Every sentence is not a 20
statement.
EXAMPLES OF SENTENCES
WHICH ARE NOT
PROPOSITIONS:
Consider the following sentences
• Close the door.
• x is greater than 2.
• He is very rich
• What time is it ?
• Read this carefully.
• x + z = 10

21
REMARK:
If sentence is a question or
command , or it is vague or
nonsensical, that is, it cannot be
classified as true or false then it is
not a statement
The statements which involve
variable and there are some
information about the variable which
make the role of variable clear then
the sentence becomes statement.
For example in the last
sentence if we say that x=3 and z=7
then this become a statement and its
truth value is T and if we say x=8
and z=4 then the sentence has its 22
truth value as F.
RULE
If the sentence is preceded by other
sentences that makes the variable
reference clear, then the sentence is a
statement.

23
EXAMPLES
x = 1 is a sentence which gives us
the information about the variable
which is in the following sentence.

x > 2 now using the value above we


can see that our sentence takes the
form 1 > 2 now we can talk about its
truth value . So
x > 2 is a statement with truth-value
Similarly,
FALSE.
Bill Gates is an American
He is very rich.
He is very rich is a statement with
24
truth-value TRUE.
UNDERSTANDING
STATEMENTS
1. x + 2 is positive.
The above sentence is not a
statement. We can say that the
truth value of the statement is
vague
2. May I come in?
The above sentence is
permission and hence we can't
talk about its truth values so it is
also not a statement.
3. Logic is interesting.
Logic is interesting is a
statement because logic is 25

interesting and its truth value is


4.It is hot today.
It is hot today is also a
statement because it has a truth
value.
5.-1 > 0
It is also a statement with
truth value F
•x + y = 12
It is not a statement.

26
COMPOUND STATEMENT
Simple statements could be used to
build a compound statement.
EXAMPLES
1. “3 + 2 = 5” and “Lahore is a city in
Pakistan”

2. “The grass is green” or “ It is


hot today”
3. “Discrete Mathematics is not
difficult to me”
Here the original statement is
Discrete Mathematics is difficult
to me and we form the new
statement by using not.
27
AND, OR, NOT are called LOGICAL
CONNECTIVES.

SYMBOLIC REPRESENTATION

Statements are symbolically


represented by letters such as p, q,
r,...
EXAMPLES
p = “Islamabad is the capital of
Pakistan”
q = “17 is divisible by 3”

28
LOGICAL CONNECTIVES
CONNECTI ME SYM CALL
VE ANI BOL ED
NGS
Negation not ~ Tilde

Conjunction and  Hat

Disjunction or  Vel

Conditional if…  Arrow


then

Biconditional if  Double
and arrow
only 29

if
EXAMPLES
p = “Islamabad is the capital of
Pakistan”
q = “17 is divisible by 3”
p  q = “Islamabad is the capital of
Pakistan and 17 is divisible by 3”
p  q = “Islamabad is the capital of
Pakistan or 17 is divisible by 3”
~p = “It is not the case that Islamabad
is the capital of Pakistan” or simply
“Islamabad is not the capital of
Pakistan”

30
TRANSLATING FROM ENGLISH
TO SYMBOLS
Let p = “It is hot”, and q = “ It is
sunny”

SENTENCE SYMBOLIC
FORM
1. It is not hot. ~p
2. It is hot and sunny. p q
3. It is hot or sunny. pq
4. It is not hot but sunny.
~ p q
5. It is neither hot nor sunny.
~p~q 31
EXAMPLE
Let h = “Zia is healthy”
w = “Zia is wealthy”
s = “Zia is wise”
Translate the compound statements to
symbolic form:

1. Zia is healthy and wealthy but not wise.


(h  w)  (~s)
2. Zia is not wealthy but he is healthy and
wise.
~w  (h  s)
3. Zia is neither healthy, wealthy nor wise.
~h  ~w  ~s

32
TRANSLATING FROM SYMBOLS TO
ENGLISH
Let m = “Ali is good in
Mathematics”
c = “Ali is a Computer
Science student”
Translate the following statement
forms into plain English:
1. ~ c
Ali is not a Computer Science
student.
2. c m
Ali is a Computer Science student
or good in Maths.
3. m  ~ c
Ali is good in Maths but not a
Computer Science student. 33
TRUTH TABLE

A convenient method for analyzing a


compound statement is to make a
truth table for it.
A truth table specifies the truth
value of a compound proposition for
all possible truth values of its
constituent propositions.
The truth values “true” and “false”
are respectively denoted by the letters
T and F.

34
NEGATION (~)
If p is a statement variable, then
negation of p, “not p”, is denoted
as “~p”. It has opposite truth value
from p i.e., if p is true, ~p is false;
if p is false, ~p is true.
EXAMPLES
1. “Ali is not a Computer Science
student” then its negation is “Ali is
a computer Science student”
2. “I like my course of Discrete
mathematics ”then its negation is
“I don't like my DM course”
3. “2 + 3 is equal to 5” then its
negation is “2 + 3 is not equal to
35
5”
TRUTH TABLE FOR
~p

p ~p
T F
F T

36
CONJUNCTION ()
If p and q are statements, then the
conjunction of p and q is “p and q”,
denoted as “p  q”.
It is true when, and only when, both p
and q are true. If either p or q is false,
or if both are false, pq is false.

p q pq
T T T
T F F
F T F
F F F

37
DISJUNCTION () or INCLUSIVE OR

If p and q are statements, then the


disjunction of p and q is “p or q”,
denoted as “p  q”
It is true when at least one of p or q is
true and is false only when both p and
q are false.

38
Disjunction or Inclusive Or

p q pq
T T T
T F T
F T T
F F F

39
SUMMARY

1. What is a statement?
2. How a compound statement is
formed.
3. Logical connectives (negation,
conjunction, disjunction).
4. How to construct a truth table
for a statement form.

40

You might also like