0% found this document useful (0 votes)
16 views28 pages

Chapter 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views28 pages

Chapter 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 28

The Foundations:

Logic and Proof, Sets,


and Functions

1
Introduction
• Three important topics are covered: logic, sets,
and functions.
• The rules of logic specify the meaning of mathematical
statements.
For instance, these rules help us understand and reason with
statements such as
 "There exists an integer that is not the sum of two
squares," and
 "For every positive integer n the sum of the positive
integers not exceeding n is n(n + 1)/2."

2
Introduction (Cont.)
• Logic is the basis of all mathematical reasoning,
and it has practical applications to the design of
computing machines, to system specifications, to
artificial intelligence, to computer programming,
to programming languages, and to other areas of
computer science.

3
Logic
 The rules of logic give precise meaning to
mathematical statements.
 These rules are used to distinguish between
valid and invalid mathematical arguments.
 A major goal is to understand and how to
construct correct mathematical arguments.

4
Logic (Cont.)
 In addition to its importance in understanding
mathematical reasoning, logic has numerous
applications in computer science. These rules
are used in the design of computer circuits; the
construction of computer programs, the
verification of the correctness of programs, and
in many other ways.

5
Propositions
 A proposition is a declarative sentence that is
either true or false, but not both.
 Example 1:
 All the following declarative sentences are
propositions.
1. Cairo is the capital of Egypt.
2. Paris is the capital of the USA.
3. 1 + 1 = 2.
4. 2 + 2 = 3.
Propositions 1 and 3 are true, whereas 2 and 4 are false.
6
Propositions (Cont.)
 Example 2:
 All the following sentences are NOT propositions.
1. What time is it?
2. Read this carefully.
3. r + I = 2.
4. x+y=z.
Sentences 1 and 2 are not propositions because they are
not declarative sentences.
Sentences 3 and 4 are not propositions because they are
neither true nor false, since the variables in these
sentences have not been assigned values.
7
Propositions (Cont.)
 Letters are used to denote propositions: p, q, r,
s, . . . .
 The truth value of a proposition is true (T) if it
is a true proposition and false (F), if it is a false
proposition.
 The area of logic that deals with propositions is
called the propositional calculus or
propositional logic.

8
Propositions (Cont.)
 Definition 1
Let p be a proposition. The statement
"It is not the case that p“
is another proposition, called the negation of p.
The negation of p is denoted by p. The
proposition p is read "not p."

9
Propositions (Cont.)
 Example 3
Find the negation of the proposition
"Today is Friday.''
and express this in simple English.
Solution: The negation is
"It is not the case that today is Friday.“
This negation can he more simply expressed by
"Today is not Friday,"
or
"It is not Friday today.”
10
Propositions (Cont.)
 Truth Table for the Negation of a Proposition

p p
T F
F T

11
Propositions (Cont.)
 Definition 2
Let p and q be propositions. The proposition "p
and q," denoted p ˄ q, is the proposition that is
true when both p and q are true and is false
otherwise. The proposition p ˄ q is called the
conjunction of p and q.

12
Propositions (Cont.)
 Truth Table for the Conjunction of two
Propositions

p q p˄q
F F F
F T F
T F F
T T T

13
Propositions (Cont.)
 Example 4
Find the conjunction of the propositions p and q
where p is the proposition "Today is Friday" and
q is the proposition "It is raining today.“
Solution:
The conjunction of these propositions, p ˄ q, is the
proposition
"Today is Friday and it is raining today"
This proposition is true on rainy Fridays and is false on any
day that is not a Friday and on Fridays when it does not
rain. 14
Propositions (Cont.)
 Definition 3
Let p and q be propositions. The proposition "p or
q," denoted p ˅ q, is the proposition that is false
when both p and q are false and is true
otherwise. The proposition p ˅ q is called the
disjunction of p and q.

15
Propositions (Cont.)
 Truth Table for the Disjunction of two
Propositions

p q p˅q
F F F
F T T
T F T
T T T

"Students who have taken calculus or computer science can


take this class." 16
Propositions (Cont.)
 Example 5
What is the disjunction of the propositions p and q where p
and q are the same propositions as in Example 4?
Solution:
The disjunction of these propositions, p ˅ q, is the
proposition
"Today is Friday or it is raining today"
This proposition is true on any day that is either a Friday or
a rainy day (including rainy Fridays). It is only false on
days that are not Fridays when it also does not rain.
17
Propositions (Cont.)
 Definition 4
Let p and q be 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 and is
false otherwise.

18
Propositions (Cont.)
 Truth Table for the Exclusive Or of two
Propositions

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

19
Propositions (Cont.)
 Definition 5
 let p and q be propositions, the implication

(p->q) means “if p then q” or “q if p” is the


proposition that is
false when p is true and q is false
and true otherwise.
 p is called hypothesis or premise
 q is called conclusion or consequence

20
Propositions (Cont.)
• Truth Table for the Implication of two Propositions

p q p ->q
F F T
F T T
T F F
T T T

p → q is equivalent to ¬p ∨ q.
21
Propositions (Cont.)
• Ex: p (hypothesis)
If it is sunny today, then we will go to the beach
q (conclusion)

22
Propositions (Cont.)
• Solution:

p q p ->q
(rainy)F (not go)F T
(rainy)F (go)T T
(sunny)T (not go)F F
(sunny)T (go)T T

23
Propositions (Cont.)
• Ex2:
You are guaranteed an A provided a score 85% or above.

P q p ->q
(score<85 or less)F (grade<A)F T
(score=85 or greater)T (grade<A)F F
(score<85 or less)F (grade =A)T T
(score=85 or greater)T (grade =A)T T
24
Propositions (Cont.)
Examine the possible scenarios:
1.Suppose you score a 90% in the class, and your final grade is
an A (T,T)
2.Suppose you score a 90% in the class, and your final grade is
not A (T,F)
3.Suppose your score is 75% in the class and receive final
grade B (F,F)
4.If your score is 84% and end up with an A, (F,T)

p → q is equivalent to ¬p ∨ q.
25
Propositions (Cont.)

p → q is equivalent to ¬p ∨ q.
Try to prove the above statement using truth table method
Evaluate the following proposition statements:

26
Propositions (Cont.)
 Definition 6
Let p and q be propositions. The proposition "p
equivalent q," denoted p<->q, is the proposition
that is false when both p or q are false and is
true otherwise. It is also known as logical
biconditional

p <-> q is equivalent to (p ^ q) ∨ (¬ p ^ ¬
q) .
Try to prove the above rule
27
Propositions (Cont.)
• Truth Table for the Implication of two Propositions

p q p <->q
F F T
F T F
T F F
T T T

28

You might also like