0% found this document useful (0 votes)
5 views

Discrete Structure 1

Uploaded by

hamzaumairkhan30
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Discrete Structure 1

Uploaded by

hamzaumairkhan30
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 41

Discrete Structures

Lecture # 1

PMAS – Arid Agriculture University, Rawalpindi

Do not worry about your difficulties in Mathematics. I can assure you,


mine are still greater!
-Albert Einstein-
Outline
What is DS and when can it be used?

Why study DS?

Topics

Grading

Today’s Lecture
Discrete Structures
Study of Discrete (individually separate and distinct) Objects
Consisting of Distinct Objects

Problems Solved Using Discrete Structures


• How many ways are there to choose a valid password?

• What’s the probability of winning a lottery?

• How to encrypt a message?

• What is the shortest path b/w two cities?

• How to sort a list of integers? OR How many steps are needed to sort a list
using a given method?
• How to prove that an algorithm works correctly?

• How can you identify a spam message?

• How can we prove our algorithm is more efficient than another?

• ….
Why Study Discrete Structures???
Ability to understand and create mathematical
arguments
Gateway to more advanced courses
• Algorithms
• Database theory
• Automata theory
• Compiler theory
• Computer security
• Operating system
Topics we’ll study
Logic and Proofs

Mathematical Induction
Sequences and Recursion
Set Theory (used in software engineering and databases)

Functions

Relations

Counting and Probability (used in artificial intelligence, machine learning,


and networking)

Graph theory (used in networks, operating systems, and compilers)

Trees
Course organization
• Class Schedule
• Lecture # 1: Check the Timetable 
• Lecture # 2: Check the Timetable 

• Class will be conducted using Slides

• Text Book
• Susana Epp, Discrete Mathematics with its
Applications, (4th Edition)
• Kenneth H. Rosen, Discrete Mathematics and Its
Applications, 4th Edition
Grading

 Two One Hour Mid Tests (30%)

 Final Exam (40%)

 Assignments (04)/Quizzes (04) (16%)

 Project (10%)

 Class Participation (4%)


Other Info

 Cooperation Policy

 Feedback

 Bonus Points
Today’s Lecture
 Integers:
• Arithmetic Properties
• Powers
• Divisibility
• Primes of Composite Numbers
 Rational Numbers
• Equivalent fractions
• Operating with fractions
• Decimals
 Irrational Numbers
 Real Numbers
• Square roots
• N-th roots
• Logarithms
• Inequalities
 Oder of Operations
Numbers
 N= {1,2,3, . . .} The set of Natural Numbers

 Z= {. . . , -2,-1,0,1,2, . . .} The set of Integers

 Q= { | p є Z, and q ≠ 0} The set of rational

𝓡
numbers
 , the set of real number. e.g. Real Space

Q
Z Irrational Numbers
N
Integers
 Simple rule of Addition

• For an integer a,

• 0+a = a+0=a

• a+(-a)=0, and (-a)+a=0

• -a is the additive inverse of a.

We use “Minus a” rather than “Negative a”


Integers
 Rules of Addition

 Commutativity

• If a and b are integers, then

• a+b=b+a

 Associativity

• If a , b and c are integers, then

• (a + b) + c = a + (b + c)
Integers
 Rules of Addition

• If a + b = 0, then b = -a and a = -b

• Proof
a + b =0
Add –a to both sides
-a + a + b=0 – a
0+b=0–a
b=-a
As desired.

Similarly we can find ---- a = - b


Integers
 Rules of Addition
• If a , b are positive integers, then a + b is also
positive integer.
• If a , b are negative integers, then a + b is also
negative integer.

• If we have the relationship b/w three integers.


• a+b=c
Then we can drive other relationships b/w them.
a=c–b b=c–a
 Example: Solve for x.
x+3=5
x=5–3
x=2
Integers
 Rules of Addition

• Cancellation rule for addition

• If a + b = a + c, then b = c

Exercise:

Prove that if a + b = a, then b = 0?


Integers
 Rules of Multiplication

 Commutativity
• If a and b are integers, then
• a*b=b*a

 Associativity
• If a , b and c are integers, then
• (a * b) * c = a * (b * c)

• For any integer a


• 1 * a = a and 0 * a = 0
Integers
 Rules of Multiplication

 Distributivity

• a * (b + c) = a * b + a * c
• (b + c) * a = b * a + c * a

Using all these properties

• -1 * a = -a
• -(a * b) = (-a) * (b) or -(a * b) = a * (-b)
• (-a ) * (-b) = a * b
Integers
 Powers
 An exponent is used to indicate repeated
multiplication.
 Tells how many times the base is used as a
factor.
• a * a = a2
• a * a * a = a3

In general if n is a positive integer,


• an = a * a * a … a (product is taken n
times)
We say an is the n-th power of a.
If m , n are positive integers, then
• am+n = am * an
Integers
 Powers

• (am)n = am * n

Some important formulas

• (a + b)2 = a2 + b2 +2ab

• (a - b)2 = a2 + b2 - 2ab

• (a + b) (a - b) = a2 – b2
Integers
 Even and Odd integers
 An even integer is an integer which can be
written in the form 2n for some integer n
• 2=2*1
• 4=2*2
• 6=2*3
 An odd integer is an integer that differs from an even
integer by 1.
 It can be written in the form 2m ± 1 for some integer
m.
• 1 = (2 * 1) - 1
• 3 = (2 * 2) - 1
• 7 = (2 * 3) + 1
Integers
 Theorem

• Let a , b be integers,
• If a is even and b is also even, then a + b is
also even
• If a is even and b is odd, then a + b is odd
• If a is odd and b is even, then a + b is odd
• If a is odd and b is also odd, then a + b is also
even
 Exercise.

• Let’s prove the Second statement ??


Integers
 Divisibility

 Given two integers a and b, with a ≠ 0, we say


that a divides b, or that b is divisible by a if
there is an integer c, such that b = a * c.

 Remember that every integer is divisible by 1


because we can always write

• n=1*n

 Also, every positive integer is divisible by itself.


Rational Numbers
 By a rational numbers, we mean a fraction as ,
where m and n are integers, n ≠ 0.
• m is called numerator
• n is called denominator

 Improper fraction

• m larger than or equal to n

 Proper fraction
• m smaller than n
Rational Numbers
 Equivalent Fractions

 Two fractions that represent the same value.

• =
How can we know whether two fractions are
equivalent?

 Rule for cross-Multiplication


• Let m ,n ,r ,s be integers and assume that n
≠ 0 and s ≠ 0. Then
• = , iff m * s = r * n
Rational Numbers
 Simplifying Fractions
 We can simplify four special fractions forms
 Fractions that have the same numerator and
denominator.

 Fractions that have a denominator of 1.

 Fractions that have a numerator of 0.

 Fractions that have a denominator of 0


• (=Infinity=Undefined Value)
Rational Numbers
 Simplifying Fractions

 Cancellation Rule for Fractions

 Let a be a non-zero integer. Let m , n be


integers, and n ≠ 0, then

 Proof: By applying the rule for cross-


multiplication and using the associativity and
commutativity laws.
Rational Numbers
 Simplifying Fractions

 A fraction is in simplest form when the


numerator and denominator have no common
factors (or divisors) other than 1.

 Theorem:

 “Any positive rational number has an


expression as a fraction in the lowest
form.”
Rational Numbers
 Operating with Fractions

 Addition (or Subtraction) with same


denominator.

• or

 With different denominator:

• or

 Follows the same basic rules as addition of


integers (commutativity and association)
Rational Numbers
 Multiplication:

 Let

• Then for any positive integer k, such that

 Follows the same basic rules as


multiplication of integers.
Rational Numbers
 Division:

 If a is a rational number and a ≠ 0, then there


exists a rational number, denoted by

• such that

 Note that if then

 is called the multiplicative inverse of a.


Rational Numbers
 Decimals:

 Finite decimals (and periodic) give us


examples of rational numbers.

• ...
Irrational Numbers

 A number that cannot be expressed as fraction of for


any integers p and q.

 Have decimal expressions that neither


terminate nor become periodic

• …

• ...
Irrational Numbers

 Is an irrational number?

• No!

• Because

 Is an irrational number?

• No or Yes??? In both cases HOW?


Real Numbers

 Integers, Rational and Irrational Numbers are


part of a larger system.

 Real Numbers can be described as all the


numbers that consist of a decimal expansion,
possibly infinite.
Real Numbers
 Properties of Real Numbers:
 Addition:
• a+b=b+a
• a + (b + c) = (a + b) + c
• For all () real numbers a, b, and c.

 Multiplication
• a*b=b*a
• a * (b * c) = (a * b) * c
• real numbers a, b , c.

 Also
• a * (b + c) = a * b + a * c
• (b + c) * a = b * a + c * a
Real Numbers
 Absolute Value

 The non-negative values of a real number


without regard to it sign.

• for a positive a.

• for a negative a
(in which case –a is positive).
Real Numbers
 Square Roots
 If a > 0, then there exists () a number b such
that (s.t).

 N-th Roots
 There exists a unique real number r such
that

It is called the n-th root of a, and is
denoted by
• or
Real Numbers
Logarithms
 Can be seen as the reverse operation of the
exponentiation.
 The logarithm of a number is the exponent to
which another fixed value, the Base must be
raised to produce that number.
• , because 104=10000

• , because 24=16

• , because 3-1=
Logarithms
 Properties of Logarithms:
 Product:

 Quotient:

 Power:

 Change of Base:
Inequalities
Symbol Meaning Example
> Greater Than (X + 3) > 2 ,
for any X
< Less Than (7X) < 28 ,
X= {…, -2, -1, 0 , 1 , 2 , 3}

≥ Greater Than or Equal 5 ≥ (X – 1),


X= {…, -2, -1, 0, 1, …, 5 ,6}

≤ Less Than or Equal (2Y + 1) ≤ 7 ,


Y= {…, -2, -1, 0, 1, 2, 3}

 Let a, b, c be real numbers,

• If a > b and b > c then a > c. (Transitivity)


• If a > b and c > 0 then a*c > b*c.
• If a > b and c < 0 then a*c < b*c.

You might also like