Sei sulla pagina 1di 81

Discrete Mathematics

Discrete Mathematics
Topics
Orientation (UM VMG,CEE PEO, Grading

System)
 Logic, Sets, Proofs, and Functions
 Propositions
 Conditional Propositions & Logical
Equivalence
 Quantifiers
 Proofs
 Resolution of Proofs
 Mathematical Induction
 Integers, and Matrices
 Sets
 Sequences and Strings
 Number Systems
 Relations and Equivalence
 Matrices
 Functions
Discrete Mathematics

This course deals with logic, sets,


growth of functions, theory of
numbers, counting techniques, trees
and graph theory.

3
Logic, Sets, Proofs, and Functions

4
Logic

- Is the study of reasoning


- Whether it is correct
- Focuses on the relationship among
statements as opposed to the
content of any particular statement
- We denote the propositional
variables by lower case letters (a,
b,
Theetc)connectives connect the
-
propositional variables.

5
Logic
Example

- All Mathematicians wear sandals.


- (T)
Anyone who wears sandals is an
algebraist. (T)
- Therefore, all mathematicians are
algebraists (T)

6
Logic
Problems

- The only positive integers that


divide 7 are 1 and 7 itself.
- Earth is the only planet in the
universe that has life.
- Buy two tickets to the “Hello
Grades, Goodbye” this coming
Wednesday.

7
Proposition

- is a collection of declarative
statements that has either a truth
value "true” or a truth value
- "false"
It consists of propositional
variables and connectives
- We denote the propositional
variables by lower case letters (a,
b,
Theetc)connectives connect the
-
propositional variables.

8
Cont’d

Let p and q be propositions

The conjunction of p and q, denoted p


^ q,
Is the proposition
p and q
The disjunction of p and q, denoted p
v q,
Is the proposition
p or q
9
Cont’d
Example
"Man is Mortal", it returns truth
value “TRUE”
"12 + 9 = 3 – 2", it returns truth
value “FALSE”

Not a proposition
"A is less than 2".

10
Cont’d

Logical Operators or Connectives

1.Negation/Not 
2.Or ˅
3.And ˄
4.Exclusive Or (XOR) 
5.Implication/If-then 
6.Biconditional/If and only if 

11
Compound
Propositions

Producing new propositions


from existing propositions.

12
Compound Propositions
Negation of a proposition
Let p be a proposition. The
negation of p, denoted by

p (also denoted by ~p), is the


statement

“It is not the case that


p”.
The proposition  p is read as “not
p”. The truth values of the
Truth Table (NOT)

• Symbol: 

p p

true false

false true

14
Example
s
1. Find the negation of the following
proposition

p : Today is Friday.
The negation is
 p : It is not the case that today
is Friday.

This negation can be more simply


expressed by

 p : Today is not Friday. 15


Examples

2. Write the negation of


“6 is negative”.
The negation is
“It is not the case that 6
is negative”. or “6 is
nonnegative”.

16
Conjunction
(AND)

Definition
Let p and q be propositions. The
conjunction of p and q, denoted
by p˄q, is the proposition “p and
q”.
The conjunction p˄q is true when p
and q and both true and is false
otherwise.

17
Truth Table (AND)

• Binary Operator, Symbol:


˄
p q p˄ q

true true true

true false false

false true false

false false false

18
Examples

1. Find the conjunction of the


propositions
p and q, where
p : Today is Friday.
q : It is raining today.
The conjunction is
p˄q : Today is Friday and it is
raining today.
19
Disjunction
(OR)

Definition
Let p and q be propositions. The
disjunction of p and q, denoted
by p˅q, is the proposition “p or
q”.
The disjunction p˅q is false when
both p and q are false and is true
otherwise.
20
Truth Table
(OR)

• Binary Operator, Symbol: 

p q p q
true true true
true false true
false true true
false false false

21
Examples

1. Find the disjunction of the


propositions p and q,

where
p : Today is Friday.
q : It is raining today.
The disjunction is
p˅q : Today is Friday or it is
raining today.
22
Exclusive OR (XOR)

Definition
Let p and q be propositions. The
exclusive or of p and q, denoted
by pq, is the proposition
“pq”.
The exclusive or, p  q, is true
when exactly one of p and q is
true and is false otherwise.

23
Truth Table
(XOR)

• Binary Operator, Symbol:



p q pq
true true false
true false true
false true true
false false false

24
Examples

1. Find the exclusive or of the


propositions p and q,
where
p : Atif will pass the course
CPE122.
q : Atif will fail the course
CPE122.
The exclusive or is
pq : Atif will pass or fail the
course CPE122. 25
Composite
Statements
Statements and operators can be
combined in any way to form new
statements.
p q p q (p)(q)
true true false false false
true false false true true
false true true false true
false false true true true
26
Translating English to Logic

I didnotbuy a lottery ticket this


week or I bought a lottery ticket
and won the million dollar on Friday.
Let p and q be two propositions
p: I bought a lottery
ticket this week. q: I
won the million dollar
on Friday.

In logic form 27
Conditional Statements
Implication
Definition: Let p and q be propositions. The
conditional statement pq, is the
proposition “If p, then q”.
The conditional statement p  q is
false when
p is true and q is false and is
true otherwise.

where p is called hypothesis, antecedent or


premise.
q is called conclusion or
consequence
28
Implication (if -
then)

• Binary Operator, Symbol:



P Q P Q
true true true
true false false
false true true
false false true

29
Conditional Statements

Biconditional
Statements
Definition: Let p and q be
propositions.
The biconditional statement p  q,
is proposition “p if and only if q”.
The biconditional (bi-implication)
statement p  q is true

when p and q have same truth values


and is false otherwise. 30
Biconditional (if and
only if)

• Binary Operator, Symbol:



P Q P Q
true true true
true false false
false true false
false false true

31
Composite Statements

• Statements and operators can be


combined in any way to form new
statements.
P Q P Q (P) (Q)
true true false false false
true false false true true
false true true false true
false false true true true

32
Equivalent Statements

P Q (PQ) (PQ) (P)(Q) (PQ)(P)(Q)

true true true fals false true


e
true fals fals true true true
e e
fals true fals true true true
e
•Two statements e called logically equivalent if
are
and fals fals
only if fals
(iff) they true true truthtrue
have identical tables
• e statements
The e e (P Q) and ( P)( Q) are
logically equivalent, because (P  Q)( P)(
Q) is always true.
33
Logical
Equivalence
Definition
Two proposition form are called
logically equivalent if and only
if they have identical truth
values for each possible
substitution of propositions for
their proposition variable.

The logical equivalence of


proposition forms P and Q is
written
34
Equivalence of Two
Compound Propositions P
and Q
1. Construct the truth table for P.
2. Construct the truth table for Q
using the same proposition
variables for identical
component propositions.
3. Check each combination of truth
values of the proposition
variables to see whether the
truth value of P is the same as
the truth value of Q.
35
Equivalence
Check
a. If in each row the truth value
of P is the same as the truth
value of Q, then P and Q are
logically equivalent.

b. If in some row P has a different


truth value from Q, then P and
Q are not logically equivalent.

36
Example

• Prove that ¬ (¬p)≡ p

Solution
p ¬p ¬ (¬p)
T F T
F T F

As you can see the corresponding


truth values of p and ¬ (¬p)
are same, hence equivalence is
justified. 37
Example
Show that the proposition forms
¬(pq) and ¬ p  ¬ q are NOT logically
equivalent.
p q ¬p ¬q (pq) ¬(pq) ¬p¬q
T T F F T F F
T F F T F T F
F T T F F T F
F F T T F T T
Here the corresponding truth values
differ and hence equivalence does
not hold 38
De Morgan’s
laws

The complement of the union of two


sets is the intersection of their
complements and the complement of
the intersection of two sets is
the union of their complements.

39
De Morgan’s
laws
De Morgan’s laws state that:
The negation of an and proposition
is logically equivalent to the or
proposition in which each
component is negated.

The negation of an or proposition


is logically equivalent to the
and proposition in which each
component is negated.

40
Symbolically (De Morgan’s Laws)

1. ¬(pq) ≡ ¬p¬q

2. ¬(pq) ≡ ¬p¬q

41
Applying De-Morgan’s Law
Question: Negate the following compound
Propositions

1.John is six feet tall and he weighs at


least 200
pounds.

2.The bus was late or Tom’s watch was


slow.

42
Solutio
n

a) John is not six feet tall or he


weighs less than 200 pounds.

b) The bus was not late and Tom’s


watch was not slow.

43
Laws of Logic Note T = 1 & F = 0

Logical Equivalence
Name Equivalence
p ^ T ≡ p Identity Laws
p v F ≡ p
p v T ≡ T Domination Laws
p ^ F ≡ F
p ^ p ≡ p
p v p ≡ p Idempotent Laws

¬(¬p)=p Double Negation Law


p ^ q ≡ q ^ p Commutative Law
p v q ≡ p v q
p ^ (q ^ r) ≡ (p ^ q) ^ r Associative Law
p v (q v r) ≡ (p v q) v r
44
Laws of Logic Note T = 1 & F = 0

Logical Equivalence
Name Equivalence
p ^ (q v r) ≡ (p ^ q) v (p Distributive Law
^ r)
p v (q ^ r) ≡ (p v q) ^ (p
v r)
¬(p ^ q) ≡ ¬p v ¬q De Morgan’s Law
¬(p v q) ≡ ¬p ^ ¬q
p ^ (p v q) ≡ p Absorption Law
p v (p ^ q) ≡ p
p v ¬p ≡ T Negation Laws
p ^ ¬p ≡ F

45
Laws of Logic Note T = 1 & F = 0

Logical Equivalence involving Implications


p → q ≡ ¬p v q
p → q ≡ ¬q → ¬p
p v q ≡ ¬p → q
p ^ q ≡ ¬(p → ¬q)
¬(p → q) ≡ p ^ ¬q
(p → q) ^ (p → r) ≡ p → (q ^ r)
(p → r) ^ (q → r) ≡ (p v q)→ r
(p → q) v (p → r) ≡ p → (q ^ r)
(p → r) v (q → r) ≡ (p ^ q)→ r

46
Laws of Logic Note T = 1 & F = 0

Logical Equivalence involving Biconditionals


p ↔ q ≡ (p → q) ^ (q → p)
p ↔ q ≡ ¬ p ↔ ¬q
p ↔ q ≡ (p ^ q) v (¬p ^ ¬q)
¬(p ↔ q) ≡ p ↔ ¬q

47
Exercise

Using laws of logic, show that


⌐(⌐p  q) (p  q) ≡ p.
Solution
Take ⌐(⌐p  q) (p  q)
≡ (⌐(⌐p)  ⌐q) (p  q), (by De Morgan’s laws)
≡ (p  ⌐q) (p  q), (by double negative law)
≡ p (⌐q  q), (by distributive law)

48
contd…

≡ p (q  ⌐q), (by the commutative law)

≡ p  0, (by the negation law)

≡ p, (by the identity law)

Skill in simplifying proposition forms is useful in


constructing logically efficient computer programs
and in designing digital circuits.

49
Problems

1. 𝑆ℎ𝑜𝑤 𝑡ℎ𝑎𝑡 𝑡ℎ𝑒 𝑛𝑒𝑔𝑎𝑡𝑖𝑜𝑛 𝑜𝑓 𝑝 → 𝑞 𝑖𝑠


𝑙𝑜𝑔𝑖𝑐𝑎𝑙𝑙𝑦 𝑒𝑞𝑢𝑖𝑣𝑎𝑙𝑒𝑛𝑡 𝑡𝑜 𝑝 ⌐q

2. 𝑃𝑟𝑜𝑣𝑒 𝑡ℎ𝑎𝑡 𝑝 ↔ 𝑞 ≡ ( 𝑝 → 𝑞)(𝑞 → 𝑝)


3. 𝑃𝑟𝑜𝑣𝑒 𝑡ℎ𝑎𝑡 𝑝 ↔ 𝑞 ≡ ( 𝑝 → 𝑞)(𝑞 → 𝑝)

50
Quantifiers
a formula constructor that produces new formulas
from old ones.

𝐿𝑒𝑡 𝑃 𝑥 𝑏𝑒 𝑎 𝑠𝑡𝑎𝑡𝑒𝑚𝑒𝑛𝑡 𝑖𝑛𝑣𝑜𝑙𝑣𝑖𝑛𝑔 𝑡ℎ𝑒 𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒


𝑥 𝑎𝑛𝑑 𝑙𝑒𝑡 𝐷 𝑏𝑒 𝑎 𝑠𝑒𝑡.
𝑃 = 𝑝𝑟𝑜𝑝𝑜𝑟𝑡𝑖𝑜𝑛𝑎𝑙 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 𝑤𝑖𝑡ℎ 𝑟𝑒𝑠𝑝𝑒𝑐𝑡 𝑡𝑜 𝐷
𝑖𝑓 𝑓𝑜𝑟 𝑒𝑎𝑐ℎ 𝑥 𝑖𝑛 𝐷,
𝑃 𝑥 = 𝑝𝑟𝑜𝑝𝑜𝑠𝑖𝑡𝑖𝑜𝑛
𝐷 = 𝑑𝑜𝑚𝑎𝑖𝑛 𝑜𝑓 𝑑𝑖𝑠𝑐𝑜𝑢𝑟𝑠𝑒 𝑜𝑓 𝑃.

𝑁𝑜𝑡𝑒: 𝑝𝑟𝑜𝑝𝑜𝑟𝑡𝑖𝑜𝑛𝑎𝑙 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 𝑃(𝑛𝑒𝑖𝑡ℎ𝑒𝑟 𝑡𝑟𝑢𝑒 𝑛𝑜𝑟 𝑓𝑎𝑙𝑠𝑒)

51
Quantifiers
Example 1

𝐿𝑒𝑡 𝑃 𝑛 𝑏𝑒 𝑡ℎ𝑒 𝑠𝑡𝑎𝑡𝑒𝑚𝑒𝑛𝑡


𝑛 𝑖 𝑎𝑛 𝑜𝑑𝑑 𝑖𝑛𝑡𝑒𝑔𝑒𝑟

𝑙𝑒𝑡 𝐷 = 𝑠𝑒𝑡 𝑜𝑓 𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒 𝑖𝑛𝑡𝑒𝑔𝑒𝑟𝑠


𝑛 = 𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒 𝑖𝑛𝑡𝑒𝑔𝑒𝑟 𝑖𝑛 𝐷

52
Quantifiers

Example 2
𝑛2 + 2𝑛 𝑖𝑠 𝑎𝑛 𝑜𝑑𝑑 𝑖𝑛𝑡𝑒𝑔𝑒𝑟 (𝐷 = 𝑠𝑒𝑡 𝑜𝑓 𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒 𝑖𝑛𝑡𝑒𝑔𝑒𝑟)
Example 3
𝑥 2 − 𝑥 − 6 = 0 (𝐷 = 𝑠𝑒𝑡 𝑜𝑓 𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒 𝑖𝑛𝑡𝑒𝑔𝑒𝑟)

53
Quantifiers
Universally Quantified Statement (∀→ "𝑓𝑜𝑟 𝑒𝑣𝑒𝑟𝑦")

∀→ 𝑢𝑛𝑖𝑣𝑒𝑟𝑠𝑎𝑙 𝑞𝑢𝑎𝑛𝑡𝑖𝑓𝑖𝑒𝑟
𝑓𝑜𝑟 𝑒𝑣𝑒𝑟𝑦 𝑥, 𝑃(𝑥)

∀𝑥𝑃(𝑥)

𝑖𝑠 𝑡𝑟𝑢𝑒 𝑖𝑓 𝑃 𝑥 𝑖𝑠 𝑡𝑟𝑢𝑒 𝑓𝑜𝑟 𝑒𝑣𝑒𝑟𝑦 𝑥 𝑖𝑛 𝐷

𝑖𝑠 𝑓𝑎𝑙𝑠𝑒 𝑖𝑓 𝑃 𝑥 𝑖𝑠 𝑓𝑎𝑙𝑠𝑒 𝑓𝑜𝑟 𝑎𝑡𝑙𝑒𝑎𝑠𝑡 𝑜𝑛𝑒 𝑥 𝑖𝑛 𝐷

54
Quantifiers
Existentially Quantified Statement (∃→ "𝑓𝑜𝑟 𝑠𝑜𝑚𝑒")

∃→ 𝑒𝑥𝑖𝑠𝑡𝑒𝑛𝑡𝑖𝑎𝑙 𝑞𝑢𝑎𝑛𝑡𝑖𝑓𝑖𝑒𝑟
𝑓𝑜𝑟 𝑠𝑜𝑚𝑒 𝑥, 𝑃(𝑥)

∃𝑥𝑃(𝑥)

𝑖𝑠 𝑡𝑟𝑢𝑒 𝑖𝑓 𝑃 𝑥 𝑖𝑠 𝑡𝑟𝑢𝑒 𝑓𝑜𝑟 𝑎𝑡𝑙𝑒𝑎𝑠𝑡 𝑜𝑛𝑒 𝑥 𝑖𝑛 𝐷

𝑖𝑠 𝑓𝑎𝑙𝑠𝑒 𝑖𝑓 𝑃 𝑥 𝑖𝑠 𝑓𝑎𝑙𝑠𝑒 𝑓𝑜𝑟 𝑒𝑣𝑒𝑟𝑦 𝑥 𝑖𝑛 𝐷

55
Quantifiers

Other terms

∀ 𝑚𝑎𝑦 𝑏𝑒 𝑟𝑒𝑎𝑑 for every, for all, 𝑜𝑟 for any


𝑓𝑜𝑟 𝑒𝑣𝑒𝑟𝑦 𝑥, 𝑃 𝑥
are
𝑓𝑜𝑟 𝑎𝑙𝑙 𝑥, 𝑃 𝑥
and
𝑓𝑜𝑟 𝑎𝑛𝑦 𝑥, 𝑃 𝑥

56
Quantifiers

Other terms

∃𝑚𝑎𝑦 𝑏𝑒 𝑟𝑒𝑎𝑑 for some, for at least one, 𝑜𝑟 there exists


𝑓𝑜𝑟 𝑠𝑜𝑚𝑒 𝑥, 𝑃 𝑥
are
𝑓𝑜𝑟 𝑎𝑡 𝑙𝑒𝑎𝑠𝑡 𝑜𝑛𝑒 𝑥, 𝑃 𝑥
and
𝑡ℎ𝑒𝑟𝑒 𝑒𝑥𝑖𝑠𝑡 𝑥 𝑠𝑢𝑐ℎ 𝑡ℎ𝑎𝑡, 𝑃 𝑥

57
Quantifiers

Example 1
𝑓𝑜𝑟 𝑒𝑣𝑒𝑟𝑦 𝑟𝑒𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑥, 𝑖𝑓 𝑥 > 1, 𝑡ℎ𝑒𝑛 𝑥 + 1 > 1

Example 2
𝑓𝑜𝑟 𝑒𝑣𝑒𝑟𝑦 𝑟𝑒𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑥, 𝑖𝑓 𝑥 > 1, 𝑡ℎ𝑒𝑛 𝑥 + 1 > 1

58
Proofs
− 𝑎𝑛 𝑎𝑟𝑔𝑢𝑚𝑒𝑛𝑡 𝑡ℎ𝑎𝑡 𝑒𝑠𝑡𝑎𝑏𝑙𝑖𝑠ℎ𝑒𝑠
𝑡ℎ𝑒 𝑡𝑟𝑢𝑡ℎ 𝑜𝑓 𝑎 𝑡ℎ𝑒𝑜𝑟𝑒𝑚
Resolution of Proofs
− 𝑡ℎ𝑒 ℎ𝑦𝑝𝑜𝑡ℎ𝑒𝑠𝑒𝑠 𝑎𝑛𝑑 𝑡ℎ𝑒 𝑐𝑜𝑛𝑐𝑙𝑢𝑠𝑖𝑜𝑛
𝑎𝑟𝑒 𝑤𝑟𝑖𝑡𝑡𝑒𝑛 𝑎𝑠 𝑐𝑙𝑎𝑢𝑠𝑒
− 𝑎 𝑐𝑙𝑎𝑢𝑠𝑒 𝑐𝑜𝑛𝑠𝑖𝑠𝑡𝑠 𝑜𝑓 𝑡𝑒𝑟𝑚𝑠 𝑠𝑒𝑝𝑎𝑟𝑎𝑡𝑒𝑑 𝑏𝑦
𝑜𝑟 ′ 𝑠, 𝑤ℎ𝑒𝑟𝑒 𝑒𝑎𝑐ℎ 𝑡𝑒𝑟𝑚 𝑖𝑠 𝑎 𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒 𝑜𝑟 𝑡ℎ𝑒
𝑛𝑒𝑔𝑎𝑡𝑖𝑜𝑛 𝑜𝑓 𝑎 𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒.
59
Resolution of Proofs

1. 𝐼𝑓 𝑝 ∨𝑞 𝑎𝑛𝑑 ¬𝑝 ∨ 𝑟 𝑎𝑟𝑒 𝑏𝑜𝑡ℎ 𝑡𝑟𝑢𝑒, 𝑡ℎ𝑒𝑛 𝑞 ∨𝑟


𝑖𝑠 𝑡𝑟𝑢𝑒 (1.5.1)
𝑃𝑟𝑜𝑣𝑒 𝑡ℎ𝑒 𝑓𝑜𝑙𝑙𝑜𝑤𝑖𝑛𝑔 𝑢𝑠𝑖𝑛𝑔 𝑟𝑒𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛
1.1 𝑎 ∨𝑏
1.2 ¬ 𝑎 ∨𝑐
1.3 ¬ 𝑐 ∨𝑑
∴ 𝑏 ∨𝑑

𝑆𝑝𝑒𝑐𝑖𝑎𝑙 𝑐𝑎𝑠𝑒𝑠:
𝐼𝑓 𝑝 ∨𝑞 𝑎𝑛𝑑 ¬𝑝 𝑎𝑟𝑒 𝑡𝑟𝑢𝑒, 𝑡ℎ𝑒𝑛 𝑞 𝑖𝑠 𝑡𝑟𝑢𝑒
(1.5.2)
𝐼𝑓 𝑝 and ¬𝑝 ∨r 𝑎𝑟𝑒 𝑡𝑟𝑢𝑒, 𝑡ℎ𝑒𝑛 𝑟 𝑖𝑠 𝑡𝑟𝑢𝑒
60
Mathematical Induction
𝑖𝑠 𝑎 𝑡𝑒𝑐ℎ𝑛𝑖𝑞𝑢𝑒 𝑓𝑜𝑟 𝑝𝑟𝑜𝑣𝑖𝑛𝑔 𝑎 𝑠𝑡𝑎𝑡𝑒𝑚𝑒𝑛𝑡
− −𝑎 𝑡ℎ𝑒𝑜𝑟𝑒𝑚, 𝑜𝑟 𝑎 𝑓𝑜𝑟𝑚𝑢𝑙𝑎
− −𝑡ℎ𝑎𝑡 𝑖𝑠 𝑎𝑠𝑠𝑒𝑟𝑡𝑒𝑑 𝑎𝑏𝑜𝑢𝑡 𝑒𝑣𝑒𝑟𝑦 𝑛𝑎𝑡𝑢𝑟𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟. 𝐵𝑦 "𝑒𝑣𝑒𝑟𝑦", 𝑜𝑟 "𝑎𝑙𝑙,
" 𝑛𝑎𝑡𝑢𝑟𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟𝑠, 𝑤𝑒 𝑚𝑒𝑎𝑛 𝑎𝑛𝑦 𝑜𝑛𝑒 𝑡ℎ𝑎𝑡 𝑤𝑒 𝑛𝑎𝑚𝑒.
𝐸𝑥𝑎𝑚𝑝𝑙𝑒
𝑆𝑛 = 1 + 2 + 3 + ⋯ + 𝑛
𝑎𝑛𝑑 𝑎𝑙𝑠𝑜
𝑛(𝑛+1)
𝑆𝑛 = 𝑓𝑜𝑟 𝑛 = 1,2, …
2
𝑤ℎ𝑒𝑟𝑒
1(1+1) 1 2
𝑆1 = = =1
2 2
2(2 + 1) 2 3
𝑆2 = = =3
2 2
3(3+1) 3 4
𝑆3 = = =6
2 2
61
Mathematical Induction
𝑖𝑠 𝑎 𝑡𝑒𝑐ℎ𝑛𝑖𝑞𝑢𝑒 𝑓𝑜𝑟 𝑝𝑟𝑜𝑣𝑖𝑛𝑔 𝑎 𝑠𝑡𝑎𝑡𝑒𝑚𝑒𝑛𝑡
− −𝑎 𝑡ℎ𝑒𝑜𝑟𝑒𝑚, 𝑜𝑟 𝑎 𝑓𝑜𝑟𝑚𝑢𝑙𝑎
− −𝑡ℎ𝑎𝑡 𝑖𝑠 𝑎𝑠𝑠𝑒𝑟𝑡𝑒𝑑 𝑎𝑏𝑜𝑢𝑡 𝑒𝑣𝑒𝑟𝑦 𝑛𝑎𝑡𝑢𝑟𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟. 𝐵𝑦 "𝑒𝑣𝑒𝑟𝑦", 𝑜𝑟 "𝑎𝑙𝑙,
" 𝑛𝑎𝑡𝑢𝑟𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟𝑠, 𝑤𝑒 𝑚𝑒𝑎𝑛 𝑎𝑛𝑦 𝑜𝑛𝑒 𝑡ℎ𝑎𝑡 𝑤𝑒 𝑛𝑎𝑚𝑒.
𝐸𝑥𝑎𝑚𝑝𝑙𝑒
𝑆𝑛 = 1 + 2 + 3 + ⋯ + 𝑛
𝑎𝑛𝑑 𝑎𝑙𝑠𝑜
𝑛(𝑛+1)
𝑆𝑛 = 𝑓𝑜𝑟 𝑛 = 1,2, …
2
𝑤ℎ𝑒𝑟𝑒
𝑆𝑛 = 𝑑𝑒𝑛𝑜𝑡𝑒𝑑 𝑎𝑠 𝑠𝑢𝑚 𝑜𝑓 𝑡ℎ𝑒 𝑓𝑖𝑟𝑠𝑡 𝑛 𝑝𝑜𝑠𝑡𝑖𝑣𝑒 𝑖𝑛𝑡𝑒𝑔𝑒𝑟
1(1+1) 1 2
𝑆1 = = =1
2 2
2(2 + 1) 2 3
𝑆2 = = =3
2 2
3(3+1) 3 4
𝑆3 = = =6
2 2 62
Integers, and Matrices

63
Sets
𝑖𝑠 𝑠𝑖𝑚𝑝𝑙𝑦 𝑎𝑛𝑦 𝑐𝑜𝑙𝑙𝑒𝑐𝑡𝑖𝑜𝑛 𝑜𝑓 𝑜𝑏𝑗𝑒𝑐𝑡𝑠.

Example: 𝐴 = 1,2,3,4

elements

𝑖𝑡 ℎ𝑎𝑠 4 𝑒𝑙𝑒𝑚𝑒𝑡𝑠 𝑠𝑢𝑐ℎ 𝑎𝑠 1,2,3,4

64
Sets
if a set is a large finite set or an infinite
set, we can describe it by listing property
necessary for membership.

Example: B = 𝑥 𝑥 𝑖𝑠 𝑎 𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒, 𝑒𝑣𝑒𝑛 𝑖𝑛𝑡𝑒𝑔𝑒𝑟}

Can be read as “B equals the set of all x such


that x is a positive, even integer”

Note: Property appears after the vertical bar

If x is finite set, we let

65
Sequence and String
is a list in which order is taken into
account.
𝑆1 , 𝑆2 , 𝑆3 , … , 𝑆𝑛 , …

Example: List of fares


1.00, 1.50, 2.00, 2.50, 3.00, …
Let 𝑆1 is the sequence and 𝑛 is the index of the
sequence
Example 2: Ordered List
2, 4, 6, …, 2n, …
So, 𝑆1 = 2, 𝑆2 = 4, 𝑆3 = 6, 𝑆𝑛 = 2𝑛

66
Sequence and String
Example 3: Define a sequence {𝑡𝑛 } by the rule

𝑡𝑛 = 𝑛2 − 1, 𝑛 ≥ 1.
Ans. First five terms are 0, 3, 8, 15, 24.

Exercise 1: Find 55th term

Exercise 2: If x is the sequence defined by

1
𝑥𝑛 = , −1 ≤ 𝑛 ≤ 4, .
2𝑛

67
Sequence and String
Sum (or Sigma) Notation

෍ 𝑎𝑖 = 𝑎𝑚 + 𝑎𝑚+1 + ⋯ + 𝑎𝑛
𝑖=𝑚

n = upper limit
m = lower limit
i = index

68
Sequence and String
Example: Let a be the sequence defined by
𝑎𝑛 = 2𝑛, 𝑛 ≥ 1. 𝑇ℎ𝑒𝑛

෍ 𝑎𝑖 = 𝑎1 + 𝑎2 + 𝑎3 = 2 + 4 + 6 = 12
𝑖=𝑖

69
Sequence and String
String – a finite sequence

A string over X is a finite sequence of elements


from X.

Example 1: 𝐿𝑒𝑡 𝑋 = {𝑎, 𝑏, 𝑐}

We obtain a string over X. This string is written


baac.

Note: order is taken into account

String baac is different from the string acab. 70


Sequence and String
String
Repetitions in a string can be specified by
superscripts.

Example 2: 𝑏𝑏𝑎𝑎𝑎𝑐 = 𝑏 2 𝑎3 𝑐

Strings with no elements is called a null string


and is denoted ℷ

Example 3: 𝐿𝑒𝑡 𝑋 = {𝑎, 𝑏}. Some elements in X are


Ans. ℷ, a, b, ab

71
Sequence and String
Length of a String 𝜶 is a number of elements in 𝜶.
The length of 𝜶 is denoted |𝜶|.

Example 4: If 𝜶 = aabab and 𝛽= 𝑎3 𝑏 4 𝑎32

|𝜶| =
5
|𝛽| =
39

72
Sequence and String
If 𝛼 and 𝛽 are two strings, the string consisting
of 𝛼 followed by 𝛽, written 𝛼𝛽 is called
concatenation of 𝛼 and 𝛽.

Example 5: If 𝛼 = aab and 𝛽 = cabd, then

Ans. 𝛼𝛽 = aabcabd
𝛽𝛼 = cabdaab

73
Number System
A bit is a binary digit, that is, a 0 or a 1.
- It is used in a digital computer’s data and
instructed when encoded.

Decimal( base 10) – represent integers with 10


symbols
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
100’s place(102 ) 10’s place(101 )
1000’s place(103 ) 1’s place(100 )

3 8 5 4
Symbol 3 Symbol 0
Symbol 2 Symbol 1

74
Number System

Binary( base 2) – represent integers we need only


(0’s & 1’s)

6’s place(25 ) 3’s place(22 )


5’s place(24 ) 2’s place(21 )
4’s place(23 ) 1’s place(20 )

1 0 1 1 0 1
Symbol 5 Symbol 0
Symbol 4 Symbol 1
Symbol 3 Symbol 2

75
Number System

Octal( base 8) – represent integers with 10


symbols
0, 1, 2, 3, 4,8’s
5, place(8
6, 7,1 )8, 9

128’s place(82 ) 1’s place(80 )

2 4 8
Symbol 2 Symbol 0

Symbol 1

76
Number System

Octal( base 8) – represent integers with 10


symbols
0, 1, 2, 3, 4, 5,place(16
16’s 6, 7, 18,
) 9, A, B, C, D,
E, F
256’s place(162 ) 1’s place(160 )

B F 4
Symbol 2 Symbol 0

Symbol 1

77
Relations and
Equivalence
Relation – can be thought of as a table that
lists the relationship of element to other
elements

Student
Course
Bill CPE 122
Mary CPE 112
Bill CPE 122
Beth CPE 112
Beth CPE 122
Dave CPE 112

78
Relations and
Equivalence
Equivalence Relations – is a binary relation that
is reflexive, symmetric and transitive.

The relation "is equal to" is the canonical


example of an equivalence relation, where for any
objects a, b, and c:

• a = a (reflexive property),
• if a = b then b = a (symmetric property), and
• if a = b and b = c then a = c (transitive
property).

79
Matrices of Relation &
Function
Matrix– is a convenient way to represent a
relation R from X to Y.

The relation "is equal to" is the canonical


example of an equivalence relation, where for any
objects a, b, and c:

• a = a (reflexive property),
• if a = b then b = a (symmetric property), and
• if a = b and b = c then a = c (transitive
property).

Function is a special kind of relation.


80
The End
Please subscribe to my YouTube
channel
Jay Al Gallenero (HAHAHA!)

Potrebbero piacerti anche