C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim...
-
Upload
russell-hubbard -
Category
Documents
-
view
214 -
download
0
Transcript of C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim...
![Page 1: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/1.jpg)
COURSE: DISCRETE STRUCTURECODE :ICS252Lecturer: Shamiel Hashim 1
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
Prepared by: amani Omer
![Page 2: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/2.jpg)
COURSE TEXT BOOK
Discrete Mathematics and its Application-6th Edition - By :Kennth Rosen-McGraw-Hill
Lecturer contact information Email:[email protected]
Office : BLD 11A -203
2
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 3: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/3.jpg)
DISCRETE STRUCTURES DEFINITION
Discrete structure deals with discrete objects. Discrete
objects are those which are separated from (not
connected) each other.
Examples:
Integers (whole numbers 5, 10, 15), rational numbers
(ones that can be expressed as the share of two integers
i.e. 10/5) are discrete object.3
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 4: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/4.jpg)
IMPORTANCE OF DISCRETE STRUCTURES
•It provides foundation objects for computer science.•It includes important material from such areas as set theory, logic, graph theory, Relation …etc. •It enables students to create and understand a proof •is essential in formal specification, in verification, in databases, and in cryptography. •The graph theory concepts are used in networks, operating systems, and compilers. •Set theory concepts are used in software engineering and in databases.•In engineering, It can be used to control multiproduct batch plants, production of new multifunctional and design of a new class of simulator. 4
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 5: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/5.jpg)
COURSE TOPICS :
Ch1: 1.6-1.7 Proof methods and strategy
Ch3 :3.4-3.5-3.7 Number theory
Ch4 :Recursive
Ch8:Relations
Ch12:Modeling computation
5
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 6: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/6.jpg)
Proof And Strategies
Chapter 1
6
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 7: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/7.jpg)
Introduction to Proof Sec 1.6
7
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 8: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/8.jpg)
INTRODUCTION TO PROOFS
Outlines
Proof Methods & types of proof
Proof Strategies
8
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 9: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/9.jpg)
PROOF METHODS
Proof : A proof is a valid argument that establishes the
truth of mathematical statement or theorem. There are
two types of proofs;
Formal Proof: In this type all steps are supplied
(complete) and rules for each step in the arguments are
given. Useful theorems can be long and hard to follow.
9
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 10: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/10.jpg)
PROOF METHODS Informal Proof: Proof of theorems designed for the human
consumption are always informal proofs. More than one rule of
inference may be used in each step. Steps may be skipped.
Rules of inference are not explicitly stated.
Proof Methods: The following are the proofs methods;
1) Direct Proof: It is a way of showing the truth of a given
statement by a straightforward combination of established
facts i.e for conditional statement p -> q is true by showing
that if p is true then q must also be true
10
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 11: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/11.jpg)
PROOF METHODS
Example: Sum of two even integers is an even number.
Proof: Let x and y are two even numbers. Since they are even therefore we can write
x= 2a , y = 2b for all integers a and b.
x + y = 2a + 2b = 2 (a + b)
From this it is clear that x + y has 2 as a factor and therefore is even.
Hence, sum of two even integers is an even number.
11
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 12: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/12.jpg)
PROOF METHODS
2) Indirect Proof: It is also known as proof by contradiction . It is a form of proof that establishes
the proof or validity of a proposition by showing that proposition is being false would involve a
contradiction.
A proposition must be either true or false and its falsity has been shown impossible, then
proposition must be true. Example1: prove that √2 is irrational using proof by contradiction . We start our proof by suppose that the negation of the proposition is true leads to
contradiction i.e. it were rational, it could be expressed as a fraction a/b , where a and b are integers,
a/b = √2, then a2 = 2b2. Therefore a2 must be even and so is a. let a=2c for some integer c , Now 2b2 = 4c2 Dividing both side by 2 give b2=2c2 by definition of even now b2 is even, and so is b. but we suppose that a/b is rational but 2 divides both a and b as they are
even , so our assumption a/b = √2, leads to contradiction that 2 divides both a and b
So a, b is odd –by assumption- and even, a contradiction. Therefore the initial assumption—that √2 can be expressed as a fraction—must be false that mean √2 is irrational. 12
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 13: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/13.jpg)
PROOF METHODSExample: Give an indirect proof to show that
For all integers n, (if 3n + 1 is even, then n is odd).
Solution: the first step in a proof by contradition is to assume the both p and not q are
true ie 3n+1 is even and n is not odd (even). Or We can write for all integers n,
3n + 1 is even then n is even. If n is even mean n is multiple of 2, therefore n
= 2a, for some integer integers a .
Then 3n + 1 = 3(2a) +1 = 6a + 1 ………………………. (1)
6a is even because 2(3a). But 6a + 1 is odd. Therefore 3n + 1 is odd from equation
(1) and By assuming n is even, we shown that 3n + 1 is odd which is an
contradiction (p and ¬pis true) to our assumption . Therefore if n is odd then 3n +1
is even, which is possible. It follows that the original statement (if 3n + 1 is even, then n is odd is true).
13
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 14: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/14.jpg)
PROOF METHODS3) Exhaustive Proof : It is also known as proof by cases. It is a special
type of proof by cases where each case involves checking a single
example. Example 1: Prove that (n + 1)3 > 3n , if n is a positive
integer with n ≤ 4. Solution: Proof by exhaustion need only to verify
for n=1,2,3,4
n=1, (n + 1)3 = (2)3 = 8 and 3n = 31 = 3; It follows 8 > 3;
n = 2, (n + 1)3 = (3)3 = 27 and 3n = 32 = 9; It follows 27 > 9;
n = 3, (n + 1)3 = (4)3 = 64 and 3n=33 = 27; It follows 64 > 27;
n = 4, (n + 1)3 = (5)3 =125 and 3n = 34 = 81; It follows 125>8114
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 15: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/15.jpg)
PROOF METHODS4) Proof by cases: A proof by cases must cover all cases that arises in
a theorem. Example : Prove that if n is an integer then n2 ≥ n
Solution: We can prove for every integer by considering three cases
when n=0, n ≥1 and n ≤ -1
Case (i)n=0, because 02=0 therefore n2≥ n holds.
Case (ii) n ≥1, multiply both sides of inequality by positive n, we get
n. n ≥ n.1, implies n2 ≥ n hold for n ≥1.
Case (iii) n ≤ -1, however n2 ≥ 0, implies n2 ≥n.
Hence n2≥n hold for all inequalities. 15
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 16: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/16.jpg)
PROOF METHODS4) Existence Proof: It is a proof a theorem with a statement involving the
existential qualifier It has two types;
a) Constructive Existence Proof: It proves the existence of a mathematical object
with certain properties by creating or providing a method to create this object.
Example :Show that there is a positive integer that can be written as the sum of
cubes of positive integers in two different ways;
Solution : After doing some computation we found that
1729 = 103+ 93 and also 1729 = 123+ 13
16
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
)(xxP
![Page 17: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/17.jpg)
PROOF METHODS
b)Non-constructive Existence Proof: It proves the
existence of a mathematical object with certain
properties, but does not provide a means of constructing
an example.
17
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 18: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/18.jpg)
PROOF METHODS
Rather we have shown that either the pair have the desired property and we do not know which of these pairs work.
18
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 19: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/19.jpg)
PROOF METHODS
Uniqueness Proofs: It has two fundamental properties;
a)Existence: We show that an element x with the desired property exists.
b)Uniqueness: We show that if y ≠ x, then y does not have the desired property (of X) .
Equivalently, we can show that if x and y both have the desired property, then x = y.
19
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 20: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/20.jpg)
PROOF METHODS
20
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 21: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/21.jpg)
PROOF STRATEGIESProof Strategies: Generally, if the statement is a conditional statement, you
should first try a direct proof; if this fails, you can try an indirect proof if
neither of these approaches works , you might try a proof by contradiction.
Forward and Backward Reasoning :To begin a direct proof of a conditional
statement, you start with the premises (content). Using these premises,
together with axioms and known theorems, you can construct a proof using a
sequence of steps that leads to the conclusion. This type of reasoning is
called forward reasoning (see example in direct proof). But forward
reasoning is often difficult to use to prove more complicated results. In such
cases it is helpful to use backward reasoning. 21
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 22: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/22.jpg)
PROOF STRATEGIES
Set to power 2
Multiply by 4
Extract first
Add -4xy to each side
Because (x -y)2 > 0 when x <> y, it follows that the final inequality is true. Since all these inequalities are equivalent, it follows that (x + y)/2 > Sqrt( xy) when x <> y:
22
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 23: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/23.jpg)
PROOF STRATEGIES
Proof Strategies
Looking for Counter examples : Counter examples show that certain
statements are false. When confronted with a conjecture, you might
first try to prove this conjecture, and if your attempts are unsuccessful,
you might try to find a counterexample.
Example 17:Show that the statement “ Every positive integer is the sum
of the square of three integers” is false by finding a counterexample.
23
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 24: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/24.jpg)
PROOF STRATEGIES
Solution :
We first look for a counterexample that “Every positive
integer is the sum of three squares of integers” is false, If
we find a particular integer that is not the sum of the
squares of three integers. To look for a counterexample,
we try successive positive integers as a sum of three
squares, we find that
24
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 25: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/25.jpg)
PROOF STRATEGIES
25
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 26: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/26.jpg)
PROOF STRATEGIES
26
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 27: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/27.jpg)
PROOF STRATEGIES
27
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 28: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/28.jpg)
PROOF STRATEGIES
Example 18: Can we tile the standard checkerboard using dominoes.
How many ways we have to fill it?
Solution: There are the following ways to tile the checkerboard.
1)Tile it by placing 32 dominoes horizontally.
2)Tile it by placing 32 dominoes vertically.
3)Tile it by placing some horizontally and some vertically dominoes.
This method is called constructive existence proof
28
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 29: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/29.jpg)
PROOF STRATEGIES
29
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12
![Page 30: C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester2011- 2012 Prepared by: amani Omer.](https://reader037.fdocuments.in/reader037/viewer/2022110212/56649de85503460f94ae268a/html5/thumbnails/30.jpg)
END 30
lectu
rer:S
ham
iel H
ash
im se
cond
sem
este
r20
11
-20
12