100
Discrete Mathematics and Its Applications Lecture 2: Basic Structures: Sequence, Cardinality, and Matrix MING GAO DaSE@ ECNU (for course related communications) [email protected] Apr. 3, 2020

Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

  • Upload
    others

  • View
    13

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Discrete Mathematics and Its ApplicationsLecture 2: Basic Structures: Sequence, Cardinality, and Matrix

MING GAO

DaSE@ ECNU(for course related communications)

[email protected]

Apr. 3, 2020

Page 2: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Outline

1 Sequences and Summations

2 Summations

3 Cardinality of Set

4 Matrix

5 Matrix derivatives

6 Take-aways

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 2 / 45

Page 3: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Sequence

Definition

A sequence is a function from a subset of the set of integers (usuallyeither the set 0, 1, 2, · · · or the set 1, 2, 3, · · · ) to a set S . Weuse the notation an to denote the image of integer n. We call an aterm of the sequence.

Some useful sequences

nth Term First 10 Terms

n2 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, · · ·n3 1, 8, 27, 64, 125, 216, 343, 512, 729, 1000, · · ·n4 1, 16, 81, 256, 625, 1296, 2401, 4096, 6561, 10000, · · ·2n 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, · · ·3n 3, 9, 27, 81, 243, 729, 2187, 6561, 19683, 59049, · · ·n! 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, · · ·

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 3 / 45

Page 4: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Sequence

Definition

A sequence is a function from a subset of the set of integers (usuallyeither the set 0, 1, 2, · · · or the set 1, 2, 3, · · · ) to a set S . Weuse the notation an to denote the image of integer n. We call an aterm of the sequence.

Some useful sequences

nth Term First 10 Terms

n2 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, · · ·n3 1, 8, 27, 64, 125, 216, 343, 512, 729, 1000, · · ·n4 1, 16, 81, 256, 625, 1296, 2401, 4096, 6561, 10000, · · ·2n 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, · · ·3n 3, 9, 27, 81, 243, 729, 2187, 6561, 19683, 59049, · · ·n! 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, · · ·

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 3 / 45

Page 5: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Progression

Geometric progression

A geometric progression is a sequence of form a, ar , ar2, · · · , arn, · · ·where initial term a and common ratio r are real numbers.

Arithmetic progression

An arithmetic progression is a sequence of form a, a + d , a +2d , · · · , a + nd , · · · where initial term a and common difference dare real numbers.

Examples

The sequences bn is a form of bn = (−1)n. The list of termsb0, b1, b2, b3, · · · begins with 1,−1, 1,−1, · · · .The sequences sn is a form of sn = −1 + 4n. The list ofterms s0, s1, s2, s3, · · · begins with −1, 3, 7, 11, · · · .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 4 / 45

Page 6: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Progression

Geometric progression

A geometric progression is a sequence of form a, ar , ar2, · · · , arn, · · ·where initial term a and common ratio r are real numbers.

Arithmetic progression

An arithmetic progression is a sequence of form a, a + d , a +2d , · · · , a + nd , · · · where initial term a and common difference dare real numbers.

Examples

The sequences bn is a form of bn = (−1)n. The list of termsb0, b1, b2, b3, · · · begins with 1,−1, 1,−1, · · · .The sequences sn is a form of sn = −1 + 4n. The list ofterms s0, s1, s2, s3, · · · begins with −1, 3, 7, 11, · · · .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 4 / 45

Page 7: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Progression

Geometric progression

A geometric progression is a sequence of form a, ar , ar2, · · · , arn, · · ·where initial term a and common ratio r are real numbers.

Arithmetic progression

An arithmetic progression is a sequence of form a, a + d , a +2d , · · · , a + nd , · · · where initial term a and common difference dare real numbers.

Examples

The sequences bn is a form of bn = (−1)n. The list of termsb0, b1, b2, b3, · · · begins with 1,−1, 1,−1, · · · .The sequences sn is a form of sn = −1 + 4n. The list ofterms s0, s1, s2, s3, · · · begins with −1, 3, 7, 11, · · · .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 4 / 45

Page 8: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Recurrence relation

Definition

A recurrence relation for the sequence an is an equation that ex-presses an in terms of one or more of the previous terms of thesequence, namely, a0, a1, · · · , an−1, for all integers n with n ≥ n0,where n0 is a nonnegative integer. A sequence is called a solution ofa recurrence relation if its terms satisfy the recurrence relation.

Example

Let an be a sequence that satisfies the recurrence relationan = an−1 + 3 for n = 1, 2, 3, · · · , and suppose that a0 = 2.What are a1, a2, and a3?

Let an be a sequence that satisfies the recurrence relationan = an−1 − an−2 for n = 2, 3, 4, · · · , and suppose that a0 = 3and a1 = 5. What are a2 and a3?

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 5 / 45

Page 9: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Recurrence relation

Definition

A recurrence relation for the sequence an is an equation that ex-presses an in terms of one or more of the previous terms of thesequence, namely, a0, a1, · · · , an−1, for all integers n with n ≥ n0,where n0 is a nonnegative integer. A sequence is called a solution ofa recurrence relation if its terms satisfy the recurrence relation.

Example

Let an be a sequence that satisfies the recurrence relationan = an−1 + 3 for n = 1, 2, 3, · · · , and suppose that a0 = 2.What are a1, a2, and a3?

Let an be a sequence that satisfies the recurrence relationan = an−1 − an−2 for n = 2, 3, 4, · · · , and suppose that a0 = 3and a1 = 5. What are a2 and a3?

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 5 / 45

Page 10: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Recurrence relation Cont’d

Fibonacci sequence

Fibonacci sequence, f0, f1, f2, · · · , is defined by initial conditions f0 =0, f1 = 1, and recurrence relation fn = fn−1 + fn−2 for n = 2, 3, 4, · · ·

Example

Determine whether sequence an, where an = 3n for every nonneg-ative integer n, is a solution of recurrence relation an = 2an−1−an−2for n = 2, 3, 4, · · · Answer the same question where an = 2n andwhere an = 5.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 6 / 45

Page 11: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Recurrence relation Cont’d

Fibonacci sequence

Fibonacci sequence, f0, f1, f2, · · · , is defined by initial conditions f0 =0, f1 = 1, and recurrence relation fn = fn−1 + fn−2 for n = 2, 3, 4, · · ·

Example

Determine whether sequence an, where an = 3n for every nonneg-ative integer n, is a solution of recurrence relation an = 2an−1−an−2for n = 2, 3, 4, · · · Answer the same question where an = 2n andwhere an = 5.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 6 / 45

Page 12: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

The Fibonacci sequence

Source:

https://en.wikipedia.org/wiki/

File:Fibonacci.jpg

In 1202, Leonardo Bonacci (known as Fibonacci)asked the following question.

“[A]ssuming that: a newly born pair of rabbits, onemale, one female, are put in a field; rabbits are ableto mate at the age of one month so that at the endof its second month a female can produce another pairof rabbits; rabbits never die and a mating pair alwaysproduces one new pair (one male, one female) everymonth from the second month on.”

“The puzzle that Fibonacci posed was: how many pairs

will there be in one year?”

From https://en.wikipedia.org/wiki/Fibonacci number

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 7 / 45

Page 13: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Let’s try to solve Fibonacci’s question.

Let ♠ denote a newly born rabit pair, and ♥ denote a mature rabit pair.Month Rabits

1 ♠ 12 ♥ 13 ♥ ♠ 24 ♥ ♥ ♠ 35 ♥ ♥ ♥ ♠ ♠ 56 ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ 87 ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ ♠ ♠ 13

How many rabit pairs do we have at the beginning of the 8th month?

Surely all 13 rabit pairs we have in the 7th month remain there and are allmature. So, the question is how many newly born rabbit pairs that we have.

The number of newly born rabbit pairs equals the number of mature rabbitpairs we have. This is also equal to the number of rabit pairs that we havein the 6th month: 8.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 8 / 45

Page 14: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Let’s try to solve Fibonacci’s question.Let ♠ denote a newly born rabit pair, and ♥ denote a mature rabit pair.

Month Rabits

1 ♠ 1

2 ♥ 13 ♥ ♠ 24 ♥ ♥ ♠ 35 ♥ ♥ ♥ ♠ ♠ 56 ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ 87 ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ ♠ ♠ 13

How many rabit pairs do we have at the beginning of the 8th month?

Surely all 13 rabit pairs we have in the 7th month remain there and are allmature. So, the question is how many newly born rabbit pairs that we have.

The number of newly born rabbit pairs equals the number of mature rabbitpairs we have. This is also equal to the number of rabit pairs that we havein the 6th month: 8.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 8 / 45

Page 15: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Let’s try to solve Fibonacci’s question.Let ♠ denote a newly born rabit pair, and ♥ denote a mature rabit pair.

Month Rabits

1 ♠ 12 ♥ 1

3 ♥ ♠ 24 ♥ ♥ ♠ 35 ♥ ♥ ♥ ♠ ♠ 56 ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ 87 ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ ♠ ♠ 13

How many rabit pairs do we have at the beginning of the 8th month?

Surely all 13 rabit pairs we have in the 7th month remain there and are allmature. So, the question is how many newly born rabbit pairs that we have.

The number of newly born rabbit pairs equals the number of mature rabbitpairs we have. This is also equal to the number of rabit pairs that we havein the 6th month: 8.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 8 / 45

Page 16: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Let’s try to solve Fibonacci’s question.Let ♠ denote a newly born rabit pair, and ♥ denote a mature rabit pair.

Month Rabits

1 ♠ 12 ♥ 13 ♥

♠ 24 ♥ ♥ ♠ 35 ♥ ♥ ♥ ♠ ♠ 56 ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ 87 ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ ♠ ♠ 13

How many rabit pairs do we have at the beginning of the 8th month?

Surely all 13 rabit pairs we have in the 7th month remain there and are allmature. So, the question is how many newly born rabbit pairs that we have.

The number of newly born rabbit pairs equals the number of mature rabbitpairs we have. This is also equal to the number of rabit pairs that we havein the 6th month: 8.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 8 / 45

Page 17: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Let’s try to solve Fibonacci’s question.Let ♠ denote a newly born rabit pair, and ♥ denote a mature rabit pair.

Month Rabits

1 ♠ 12 ♥ 13 ♥ ♠ 2

4 ♥ ♥ ♠ 35 ♥ ♥ ♥ ♠ ♠ 56 ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ 87 ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ ♠ ♠ 13

How many rabit pairs do we have at the beginning of the 8th month?

Surely all 13 rabit pairs we have in the 7th month remain there and are allmature. So, the question is how many newly born rabbit pairs that we have.

The number of newly born rabbit pairs equals the number of mature rabbitpairs we have. This is also equal to the number of rabit pairs that we havein the 6th month: 8.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 8 / 45

Page 18: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Let’s try to solve Fibonacci’s question.Let ♠ denote a newly born rabit pair, and ♥ denote a mature rabit pair.

Month Rabits

1 ♠ 12 ♥ 13 ♥ ♠ 24 ♥ ♥

♠ 35 ♥ ♥ ♥ ♠ ♠ 56 ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ 87 ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ ♠ ♠ 13

How many rabit pairs do we have at the beginning of the 8th month?

Surely all 13 rabit pairs we have in the 7th month remain there and are allmature. So, the question is how many newly born rabbit pairs that we have.

The number of newly born rabbit pairs equals the number of mature rabbitpairs we have. This is also equal to the number of rabit pairs that we havein the 6th month: 8.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 8 / 45

Page 19: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Let’s try to solve Fibonacci’s question.Let ♠ denote a newly born rabit pair, and ♥ denote a mature rabit pair.

Month Rabits

1 ♠ 12 ♥ 13 ♥ ♠ 24 ♥ ♥ ♠ 3

5 ♥ ♥ ♥ ♠ ♠ 56 ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ 87 ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ ♠ ♠ 13

How many rabit pairs do we have at the beginning of the 8th month?

Surely all 13 rabit pairs we have in the 7th month remain there and are allmature. So, the question is how many newly born rabbit pairs that we have.

The number of newly born rabbit pairs equals the number of mature rabbitpairs we have. This is also equal to the number of rabit pairs that we havein the 6th month: 8.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 8 / 45

Page 20: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Let’s try to solve Fibonacci’s question.Let ♠ denote a newly born rabit pair, and ♥ denote a mature rabit pair.

Month Rabits

1 ♠ 12 ♥ 13 ♥ ♠ 24 ♥ ♥ ♠ 35 ♥ ♥ ♥

♠ ♠ 56 ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ 87 ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ ♠ ♠ 13

How many rabit pairs do we have at the beginning of the 8th month?

Surely all 13 rabit pairs we have in the 7th month remain there and are allmature. So, the question is how many newly born rabbit pairs that we have.

The number of newly born rabbit pairs equals the number of mature rabbitpairs we have. This is also equal to the number of rabit pairs that we havein the 6th month: 8.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 8 / 45

Page 21: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Let’s try to solve Fibonacci’s question.Let ♠ denote a newly born rabit pair, and ♥ denote a mature rabit pair.

Month Rabits

1 ♠ 12 ♥ 13 ♥ ♠ 24 ♥ ♥ ♠ 35 ♥ ♥ ♥ ♠ ♠ 5

6 ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ 87 ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ ♠ ♠ 13

How many rabit pairs do we have at the beginning of the 8th month?

Surely all 13 rabit pairs we have in the 7th month remain there and are allmature. So, the question is how many newly born rabbit pairs that we have.

The number of newly born rabbit pairs equals the number of mature rabbitpairs we have. This is also equal to the number of rabit pairs that we havein the 6th month: 8.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 8 / 45

Page 22: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Let’s try to solve Fibonacci’s question.Let ♠ denote a newly born rabit pair, and ♥ denote a mature rabit pair.

Month Rabits

1 ♠ 12 ♥ 13 ♥ ♠ 24 ♥ ♥ ♠ 35 ♥ ♥ ♥ ♠ ♠ 56 ♥ ♥ ♥ ♥ ♥

♠ ♠ ♠ 87 ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ ♠ ♠ 13

How many rabit pairs do we have at the beginning of the 8th month?

Surely all 13 rabit pairs we have in the 7th month remain there and are allmature. So, the question is how many newly born rabbit pairs that we have.

The number of newly born rabbit pairs equals the number of mature rabbitpairs we have. This is also equal to the number of rabit pairs that we havein the 6th month: 8.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 8 / 45

Page 23: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Let’s try to solve Fibonacci’s question.Let ♠ denote a newly born rabit pair, and ♥ denote a mature rabit pair.

Month Rabits

1 ♠ 12 ♥ 13 ♥ ♠ 24 ♥ ♥ ♠ 35 ♥ ♥ ♥ ♠ ♠ 56 ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ 8

7 ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ ♠ ♠ 13

How many rabit pairs do we have at the beginning of the 8th month?

Surely all 13 rabit pairs we have in the 7th month remain there and are allmature. So, the question is how many newly born rabbit pairs that we have.

The number of newly born rabbit pairs equals the number of mature rabbitpairs we have. This is also equal to the number of rabit pairs that we havein the 6th month: 8.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 8 / 45

Page 24: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Let’s try to solve Fibonacci’s question.Let ♠ denote a newly born rabit pair, and ♥ denote a mature rabit pair.

Month Rabits

1 ♠ 12 ♥ 13 ♥ ♠ 24 ♥ ♥ ♠ 35 ♥ ♥ ♥ ♠ ♠ 56 ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ 87 ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥

♠ ♠ ♠ ♠ ♠ 13

How many rabit pairs do we have at the beginning of the 8th month?

Surely all 13 rabit pairs we have in the 7th month remain there and are allmature. So, the question is how many newly born rabbit pairs that we have.

The number of newly born rabbit pairs equals the number of mature rabbitpairs we have. This is also equal to the number of rabit pairs that we havein the 6th month: 8.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 8 / 45

Page 25: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Let’s try to solve Fibonacci’s question.Let ♠ denote a newly born rabit pair, and ♥ denote a mature rabit pair.

Month Rabits

1 ♠ 12 ♥ 13 ♥ ♠ 24 ♥ ♥ ♠ 35 ♥ ♥ ♥ ♠ ♠ 56 ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ 87 ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ ♠ ♠ 13

How many rabit pairs do we have at the beginning of the 8th month?

Surely all 13 rabit pairs we have in the 7th month remain there and are allmature. So, the question is how many newly born rabbit pairs that we have.

The number of newly born rabbit pairs equals the number of mature rabbitpairs we have. This is also equal to the number of rabit pairs that we havein the 6th month: 8.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 8 / 45

Page 26: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Let’s try to solve Fibonacci’s question.Let ♠ denote a newly born rabit pair, and ♥ denote a mature rabit pair.

Month Rabits

1 ♠ 12 ♥ 13 ♥ ♠ 24 ♥ ♥ ♠ 35 ♥ ♥ ♥ ♠ ♠ 56 ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ 87 ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ ♠ ♠ 13

How many rabit pairs do we have at the beginning of the 8th month?

Surely all 13 rabit pairs we have in the 7th month remain there and are allmature. So, the question is how many newly born rabbit pairs that we have.

The number of newly born rabbit pairs equals the number of mature rabbitpairs we have. This is also equal to the number of rabit pairs that we havein the 6th month: 8.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 8 / 45

Page 27: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Let’s try to solve Fibonacci’s question.Let ♠ denote a newly born rabit pair, and ♥ denote a mature rabit pair.

Month Rabits

1 ♠ 12 ♥ 13 ♥ ♠ 24 ♥ ♥ ♠ 35 ♥ ♥ ♥ ♠ ♠ 56 ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ 87 ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ ♠ ♠ 13

How many rabit pairs do we have at the beginning of the 8th month?

Surely all 13 rabit pairs we have in the 7th month remain there and are allmature. So, the question is how many newly born rabbit pairs that we have.

The number of newly born rabbit pairs equals the number of mature rabbitpairs we have. This is also equal to the number of rabit pairs that we havein the 6th month: 8.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 8 / 45

Page 28: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Let’s try to solve Fibonacci’s question.Let ♠ denote a newly born rabit pair, and ♥ denote a mature rabit pair.

Month Rabits

1 ♠ 12 ♥ 13 ♥ ♠ 24 ♥ ♥ ♠ 35 ♥ ♥ ♥ ♠ ♠ 56 ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ 87 ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ ♠ ♠ 13

How many rabit pairs do we have at the beginning of the 8th month?

Surely all 13 rabit pairs we have in the 7th month remain there and are allmature. So, the question is how many newly born rabbit pairs that we have.

The number of newly born rabbit pairs equals the number of mature rabbitpairs we have.

This is also equal to the number of rabit pairs that we havein the 6th month: 8.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 8 / 45

Page 29: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Let’s try to solve Fibonacci’s question.Let ♠ denote a newly born rabit pair, and ♥ denote a mature rabit pair.

Month Rabits

1 ♠ 12 ♥ 13 ♥ ♠ 24 ♥ ♥ ♠ 35 ♥ ♥ ♥ ♠ ♠ 56 ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ 87 ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♠ ♠ ♠ ♠ ♠ 13

How many rabit pairs do we have at the beginning of the 8th month?

Surely all 13 rabit pairs we have in the 7th month remain there and are allmature. So, the question is how many newly born rabbit pairs that we have.

The number of newly born rabbit pairs equals the number of mature rabbitpairs we have. This is also equal to the number of rabit pairs that we havein the 6th month: 8.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 8 / 45

Page 30: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Thus, we will have 13+8 rabit pairs at the beginning of the 8th month.

If we write down the sequence, we get the Fibonacci sequence:

1, 1, 2, 3, 5, 8, 13, 21, . . .

Again, what’s the next number in this sequence? How can you compute it?21+13 = 34 is the answer. You take the last two numbers and add themup to get the next number. Why?

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 9 / 45

Page 31: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Thus, we will have 13+8 rabit pairs at the beginning of the 8th month.If we write down the sequence, we get the Fibonacci sequence:

1, 1, 2, 3, 5, 8, 13, 21, . . .

Again, what’s the next number in this sequence? How can you compute it?21+13 = 34 is the answer. You take the last two numbers and add themup to get the next number. Why?

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 9 / 45

Page 32: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Thus, we will have 13+8 rabit pairs at the beginning of the 8th month.If we write down the sequence, we get the Fibonacci sequence:

1, 1, 2, 3, 5, 8, 13, 21, . . .

Again, what’s the next number in this sequence? How can you compute it?

21+13 = 34 is the answer. You take the last two numbers and add themup to get the next number. Why?

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 9 / 45

Page 33: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Thus, we will have 13+8 rabit pairs at the beginning of the 8th month.If we write down the sequence, we get the Fibonacci sequence:

1, 1, 2, 3, 5, 8, 13, 21, . . .

Again, what’s the next number in this sequence? How can you compute it?21+13 = 34 is the answer.

You take the last two numbers and add themup to get the next number. Why?

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 9 / 45

Page 34: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Thus, we will have 13+8 rabit pairs at the beginning of the 8th month.If we write down the sequence, we get the Fibonacci sequence:

1, 1, 2, 3, 5, 8, 13, 21, . . .

Again, what’s the next number in this sequence? How can you compute it?21+13 = 34 is the answer. You take the last two numbers and add themup to get the next number. Why?

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 9 / 45

Page 35: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

To be precise, let Fn be the n-th number in the Fibonacci sequence. (Thatis, F1 = 1,F2 = 1,F3 = 2,F4 = 3 and so on.) We can define the(n + 1)-th number as

Fn+1 = Fn + Fn−1,

for n = 2, 3, . . ..

Is this enough to completely specify the sequence?No, because we do not know how to start. To get the Fibonacci sequence,we need to specify two starting values: F1 = 1 and F2 = 1 as well.Now, you can see that the equation and these special values uniquelydetermine the sequence. It is also convenient to define F0 = 0 so that theequation works for n = 1.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 10 / 45

Page 36: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

To be precise, let Fn be the n-th number in the Fibonacci sequence. (Thatis, F1 = 1,F2 = 1,F3 = 2,F4 = 3 and so on.) We can define the(n + 1)-th number as

Fn+1 = Fn + Fn−1,

for n = 2, 3, . . .. Is this enough to completely specify the sequence?

No, because we do not know how to start. To get the Fibonacci sequence,we need to specify two starting values: F1 = 1 and F2 = 1 as well.Now, you can see that the equation and these special values uniquelydetermine the sequence. It is also convenient to define F0 = 0 so that theequation works for n = 1.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 10 / 45

Page 37: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

To be precise, let Fn be the n-th number in the Fibonacci sequence. (Thatis, F1 = 1,F2 = 1,F3 = 2,F4 = 3 and so on.) We can define the(n + 1)-th number as

Fn+1 = Fn + Fn−1,

for n = 2, 3, . . .. Is this enough to completely specify the sequence?No, because we do not know how to start. To get the Fibonacci sequence,we need to specify two starting values: F1 = 1 and F2 = 1 as well.Now, you can see that the equation and these special values uniquelydetermine the sequence. It is also convenient to define F0 = 0 so that theequation works for n = 1.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 10 / 45

Page 38: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

A recurrence

The equationFn+1 = Fn + Fn−1

and the initial values F0 = 0 and F1 = 1 specify all values of the Fibonaccisequence. With these two initial values, you can use the equation to findthe value of any number in the sequence.This definition is called a recurrence. Instead of defining the value ofeach number in the sequence explicitly, we do so by using the values ofother numbers in the sequence.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 11 / 45

Page 39: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Tilings with 1x1 and 2x1 tiles

You have a walk way of length n units. The width of the walk way is 1unit. You have unlimited supplies of 1x1 tiles and 2x1 tiles. Every tile ofthe same size is indistinguishable. In how many ways can you tile the walkway?Let’s consider small cases.

When n = 1, there are 1 way.

When n = 2, there are 2 ways.

When n = 3, there are 3 ways.

When n = 4, there are 5 ways.

Let’s define Jn to be the number of ways you can tile a walk way of lengthn. From the example above, we know that J1 = 1 and J2 = 2.Can you find a formula for general Jn?

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 12 / 45

Page 40: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Figuring out the recurrence for Jn

To figure out the general formula for Jn, we can think about the firstchoice we can make when tiling a walk way of length n. There are twochoices:

(1) We can start placing a 1x1 tile at the beginning, or

(2) We can start placing a 2x1 tile at the beginning.

In each of the cases, let’s think about how many ways we can tile the restof the walk way, provided that the first step is made.

Note that if we start by placing a 1x1 tile, we are left with a walk way oflength n − 1. From the definition of Jn, we know that there are Jn−1 waysto tile the rest of the walk way of length n− 1. Using similar reasoning, weknow that if we start with a 2x1 tile, there are Jn−2 ways to tile the rest ofthe walk way.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 13 / 45

Page 41: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

The recurrence for Jn

From the discussion, we have that

Jn = Jn−1 + Jn−2,

where J1 = 1 and J2 = 2.

Note that this is exactly the same recurrence as the Fibonacci sequence,but with different initial values. In fact, we have that

Jn = Fn+1.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 14 / 45

Page 42: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Compound interest

Problem

Suppose that a person deposits 10, 000 in a savings account at abank yielding 11% per year with interest compounded annually. Howmuch will be in the account after 30 years?

Solution

Let Pn denote the amount in the account after n years. We seethat sequence Pn satisfies the recurrence relation

Pn = Pn−1 + 0.11Pn−1 = (1.11)Pn−1.

We can find a formula for Pn:

P1 = (1.11)P0 P2 = (1.11)P1 = (1.11)2P0

· · · Pn = (1.11)Pn−1 = · · · = (1.11)nP0.

Therefore, P30 = (1.11)3010, 000 = 228, 922.97.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 15 / 45

Page 43: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Sequences and Summations

Compound interest

Problem

Suppose that a person deposits 10, 000 in a savings account at abank yielding 11% per year with interest compounded annually. Howmuch will be in the account after 30 years?

Solution

Let Pn denote the amount in the account after n years. We seethat sequence Pn satisfies the recurrence relation

Pn = Pn−1 + 0.11Pn−1 = (1.11)Pn−1.

We can find a formula for Pn:

P1 = (1.11)P0 P2 = (1.11)P1 = (1.11)2P0

· · · Pn = (1.11)Pn−1 = · · · = (1.11)nP0.

Therefore, P30 = (1.11)3010, 000 = 228, 922.97.MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 15 / 45

Page 44: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Summations

Summations

Summation notations

n∑j=m

aj ,n∑

i=m

ai ,∑

m≤k≤nak ,

∑j∈I

aj ,

where I = k ∈ Z : m ≤ k ≤ n.

Some useful summation formulae

sum form sum form∑nk=0 ark arn+1−a

r−1 (r 6= 1)∑n

k=0 k n(n+1)2∑n

k=0 k2 n(n+1)(2n+1)6

∑nk=0 k3 n2(n+1)2

4∑∞k=0 xk , |x | < 1 1

1−x∑∞

k=0 kxk−1, |x | < 1 1(1−x)2

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 16 / 45

Page 45: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Summations

Summations

Summation notations

n∑j=m

aj ,n∑

i=m

ai ,∑

m≤k≤nak ,

∑j∈I

aj ,

where I = k ∈ Z : m ≤ k ≤ n.

Some useful summation formulae

sum form sum form∑nk=0 ark arn+1−a

r−1 (r 6= 1)∑n

k=0 k n(n+1)2∑n

k=0 k2 n(n+1)(2n+1)6

∑nk=0 k3 n2(n+1)2

4∑∞k=0 xk , |x | < 1 1

1−x∑∞

k=0 kxk−1, |x | < 1 1(1−x)2

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 16 / 45

Page 46: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Summations

Remark

Requires calculus

Let x be a real number with |x | < 1. Find

∞∑n=0

xn.

Solution

Let a = 1 and r = x we see that∑n

k=0 xk = xk+1−1x−1 . Because

|x | < 1, it follows that

∞∑k=0

xn = limk→∞

xk+1 − 1

x − 1=

0− 1

x − 1=

1

1− x.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 17 / 45

Page 47: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

Cardinality

Definition

Sets A and B have the same cardinality if and only if there is a one-to-one correspondence from A to B. When A and B have the samecardinality, we write |A| = |B|.

Definition

If there is a one-to-one function from A to B, the cardinality of A isless than or the same as the cardinality of B and we write |A| ≤ |B|.Moreover, when |A| ≤ |B| and A and B have different cardinality, wesay that the cardinality of A is less than the cardinality of B and wewrite |A| < |B|.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 18 / 45

Page 48: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

Cardinality

Definition

Sets A and B have the same cardinality if and only if there is a one-to-one correspondence from A to B. When A and B have the samecardinality, we write |A| = |B|.

Definition

If there is a one-to-one function from A to B, the cardinality of A isless than or the same as the cardinality of B and we write |A| ≤ |B|.Moreover, when |A| ≤ |B| and A and B have different cardinality, wesay that the cardinality of A is less than the cardinality of B and wewrite |A| < |B|.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 18 / 45

Page 49: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

Countable sets

Definition

A set that is either finite or has the same cardinality as Z+ is calledcountable. If an infinite set S is countable, then |S | = ℵ0.

Example

Show that the set of odd positive integers is a countable set.

Solution

In terms of the same cardinality, we will exhibit a one-to-onecorrespondence between this set and Z+. Consider function

f (n) = 2n − 1 : Z+ → 2k + 1 : k is an integer

One-to-one: f (n) = f (m)⇒ 2n − 1 = 2m − 1⇒ n = m.Onto: suppose that t is an odd positive integer. Then t is 1 lessthan 2k, where k is a natural number. Hence t = 2k − 1 = f (k).

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 19 / 45

Page 50: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

Countable sets

Definition

A set that is either finite or has the same cardinality as Z+ is calledcountable. If an infinite set S is countable, then |S | = ℵ0.

Example

Show that the set of odd positive integers is a countable set.

Solution

In terms of the same cardinality, we will exhibit a one-to-onecorrespondence between this set and Z+. Consider function

f (n) = 2n − 1 : Z+ → 2k + 1 : k is an integer

One-to-one: f (n) = f (m)⇒ 2n − 1 = 2m − 1⇒ n = m.Onto: suppose that t is an odd positive integer. Then t is 1 lessthan 2k, where k is a natural number. Hence t = 2k − 1 = f (k).

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 19 / 45

Page 51: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

Countable sets

Definition

A set that is either finite or has the same cardinality as Z+ is calledcountable. If an infinite set S is countable, then |S | = ℵ0.

Example

Show that the set of odd positive integers is a countable set.

Solution

In terms of the same cardinality, we will exhibit a one-to-onecorrespondence between this set and Z+. Consider function

f (n) = 2n − 1 : Z+ → 2k + 1 : k is an integer

One-to-one: f (n) = f (m)⇒ 2n − 1 = 2m − 1⇒ n = m.

Onto: suppose that t is an odd positive integer. Then t is 1 lessthan 2k, where k is a natural number. Hence t = 2k − 1 = f (k).

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 19 / 45

Page 52: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

Countable sets

Definition

A set that is either finite or has the same cardinality as Z+ is calledcountable. If an infinite set S is countable, then |S | = ℵ0.

Example

Show that the set of odd positive integers is a countable set.

Solution

In terms of the same cardinality, we will exhibit a one-to-onecorrespondence between this set and Z+. Consider function

f (n) = 2n − 1 : Z+ → 2k + 1 : k is an integer

One-to-one: f (n) = f (m)⇒ 2n − 1 = 2m − 1⇒ n = m.Onto: suppose that t is an odd positive integer. Then t is 1 lessthan 2k, where k is a natural number. Hence t = 2k − 1 = f (k).

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 19 / 45

Page 53: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

Hilberts Grand Hotel

Grand Hotel with ℵ0 rooms

How can we accommodatea new guest arriving at thefully occupied Grand Ho-tel without removing any ofthe current guests?

Solution

Because the rooms of the Grand Hotel are countable, we can list them asRoom 1, Room 2, Room 3, and so on. When a new guest arrives, wemove the guest in Room 1 to Room 2, the guest in Room 2 to Room 3,and in general, the guest in Room n to Room n + 1, for all positiveintegers n. This frees up Room 1, which we assign to the new guest, andall the current guests still have rooms.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 20 / 45

Page 54: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

Hilberts Grand Hotel

Grand Hotel with ℵ0 rooms

How can we accommodatea new guest arriving at thefully occupied Grand Ho-tel without removing any ofthe current guests?

Solution

Because the rooms of the Grand Hotel are countable, we can list them asRoom 1, Room 2, Room 3, and so on. When a new guest arrives, wemove the guest in Room 1 to Room 2, the guest in Room 2 to Room 3,and in general, the guest in Room n to Room n + 1, for all positiveintegers n. This frees up Room 1, which we assign to the new guest, andall the current guests still have rooms.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 20 / 45

Page 55: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

Countable sets

Integer set

Show that the set of all integers is countable.

Solution

f (n) =

n/2, n is an even number;−(n − 1)/2, otherwise.

Positive rational numbers

Show that all positive rationalnumbers is countable.

Solution

A rational numbers can belisted in p/q first withp + q = 2, then p + q = 3, · · ·

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 21 / 45

Page 56: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

Countable sets

Integer set

Show that the set of all integers is countable.

Solution

f (n) =

n/2, n is an even number;−(n − 1)/2, otherwise.

Positive rational numbers

Show that all positive rationalnumbers is countable.

Solution

A rational numbers can belisted in p/q first withp + q = 2, then p + q = 3, · · ·

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 21 / 45

Page 57: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

An uncountable set

Real numbers

Show that the set of real numbers is an uncountable set.

Solution

We suppose that the set of real numbers is countable and arrive ata contradiction.Then, ∀x ∈ (0, 1) would also be countable (because any subset of acountable set is also countable).Under this assumption, ∀x ∈ (0, 1) can be listed in some order, say,r1, r2, r3, · · · Let the decimal representation of these real numbers be

r1 = 0.d11d12d13d14 · · ·r2 = 0.d21d22d23d24 · · ·r3 = 0.d31d32d33d34 · · ·· · ·

where dij ∈ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 22 / 45

Page 58: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

An uncountable set

Real numbers

Show that the set of real numbers is an uncountable set.

Solution

We suppose that the set of real numbers is countable and arrive ata contradiction.

Then, ∀x ∈ (0, 1) would also be countable (because any subset of acountable set is also countable).Under this assumption, ∀x ∈ (0, 1) can be listed in some order, say,r1, r2, r3, · · · Let the decimal representation of these real numbers be

r1 = 0.d11d12d13d14 · · ·r2 = 0.d21d22d23d24 · · ·r3 = 0.d31d32d33d34 · · ·· · ·

where dij ∈ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 22 / 45

Page 59: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

An uncountable set

Real numbers

Show that the set of real numbers is an uncountable set.

Solution

We suppose that the set of real numbers is countable and arrive ata contradiction.Then, ∀x ∈ (0, 1) would also be countable (because any subset of acountable set is also countable).Under this assumption, ∀x ∈ (0, 1) can be listed in some order, say,r1, r2, r3, · · · Let the decimal representation of these real numbers be

r1 = 0.d11d12d13d14 · · ·r2 = 0.d21d22d23d24 · · ·r3 = 0.d31d32d33d34 · · ·· · ·

where dij ∈ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 22 / 45

Page 60: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

An uncountable set Cont’d

Solution

For example, if r1 = 0.23794 · · · , we have d11 = 2, d12 = 3, etc.)

Then, form a new real number r = 0.d1d2d3d4 · · · , where the decimaldigits are determined by the following rule:

di =

4, if dii 6= 4;5, otherwise.

For example, let r1 = 0.23794 · · · , r2 = 0.44590 · · · , r3 =0.09118 · · · , r4 = 0.80553 · · · , etc. Then we have r =0.d1d2d3d4 · · · = 0.4544 · · · , where d1 = 4 since d11 6= 4, d2 = 5since d22 = 4, d3 = 4 since d33 6= 4, d4 = 4 since d44 6= 4, etc.Every real number has a unique decimal expansion. Therefore, r isnot equal to any of r1, r2, · · · because the decimal expansion of rdiffers from the decimal expansion of ri in the i-th place to the rightof the decimal point, for each i .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 23 / 45

Page 61: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

An uncountable set Cont’d

Solution

For example, if r1 = 0.23794 · · · , we have d11 = 2, d12 = 3, etc.)Then, form a new real number r = 0.d1d2d3d4 · · · , where the decimaldigits are determined by the following rule:

di =

4, if dii 6= 4;5, otherwise.

For example, let r1 = 0.23794 · · · , r2 = 0.44590 · · · , r3 =0.09118 · · · , r4 = 0.80553 · · · , etc. Then we have r =0.d1d2d3d4 · · · = 0.4544 · · · , where d1 = 4 since d11 6= 4, d2 = 5since d22 = 4, d3 = 4 since d33 6= 4, d4 = 4 since d44 6= 4, etc.

Every real number has a unique decimal expansion. Therefore, r isnot equal to any of r1, r2, · · · because the decimal expansion of rdiffers from the decimal expansion of ri in the i-th place to the rightof the decimal point, for each i .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 23 / 45

Page 62: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

An uncountable set Cont’d

Solution

For example, if r1 = 0.23794 · · · , we have d11 = 2, d12 = 3, etc.)Then, form a new real number r = 0.d1d2d3d4 · · · , where the decimaldigits are determined by the following rule:

di =

4, if dii 6= 4;5, otherwise.

For example, let r1 = 0.23794 · · · , r2 = 0.44590 · · · , r3 =0.09118 · · · , r4 = 0.80553 · · · , etc. Then we have r =0.d1d2d3d4 · · · = 0.4544 · · · , where d1 = 4 since d11 6= 4, d2 = 5since d22 = 4, d3 = 4 since d33 6= 4, d4 = 4 since d44 6= 4, etc.Every real number has a unique decimal expansion. Therefore, r isnot equal to any of r1, r2, · · · because the decimal expansion of rdiffers from the decimal expansion of ri in the i-th place to the rightof the decimal point, for each i .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 23 / 45

Page 63: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

Results about cardinality

Theorem

If A and B are countable sets, then A ∪ B is also countable.

Proof.

Without loss of generality, we can assume that A and B aredisjoint. (If they are not, we can replace B by B − A, becauseA ∩ (B − A) = ∅ and A ∪ (B − A) = A ∪ B.)

C1: A and B are both finite;

C2: A is infinite and B is finite;

C3: A and B are both countably infinite.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 24 / 45

Page 64: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

Results about cardinality

Theorem

If A and B are countable sets, then A ∪ B is also countable.

Proof.

Without loss of generality, we can assume that A and B aredisjoint. (If they are not, we can replace B by B − A, becauseA ∩ (B − A) = ∅ and A ∪ (B − A) = A ∪ B.)

C1: A and B are both finite;

C2: A is infinite and B is finite;

C3: A and B are both countably infinite.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 24 / 45

Page 65: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

Results about cardinality

Theorem

If A and B are countable sets, then A ∪ B is also countable.

Proof.

Without loss of generality, we can assume that A and B aredisjoint. (If they are not, we can replace B by B − A, becauseA ∩ (B − A) = ∅ and A ∪ (B − A) = A ∪ B.)

C1: A and B are both finite;

C2: A is infinite and B is finite;

C3: A and B are both countably infinite.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 24 / 45

Page 66: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

SCHRODER-BERNSTEIN theorem and the continuumhypothesis

Theorem

If A and B are sets with |A| ≤ |B| and |B| ≤ |A|, then |A| = |B|,i.e., if there are one-to-one functions f from A to B and g from Bto A, then there is a one-to-one correspondence between A and B.

Hypothesis

Show that the power set of Z+ and R have the same cardinality, i.e.,|P(Z+)| = |R| = c .Furthermore, |P(Z+)| = |R| can be expressed as 2ℵ0 = c .

Cantor theorem

The cardinality of a set is always less than the cardinality of its powerset, i.e., |Z+| < |P(Z+)|.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 25 / 45

Page 67: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

SCHRODER-BERNSTEIN theorem and the continuumhypothesis

Theorem

If A and B are sets with |A| ≤ |B| and |B| ≤ |A|, then |A| = |B|,i.e., if there are one-to-one functions f from A to B and g from Bto A, then there is a one-to-one correspondence between A and B.

Hypothesis

Show that the power set of Z+ and R have the same cardinality, i.e.,|P(Z+)| = |R| = c .Furthermore, |P(Z+)| = |R| can be expressed as 2ℵ0 = c .

Cantor theorem

The cardinality of a set is always less than the cardinality of its powerset, i.e., |Z+| < |P(Z+)|.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 25 / 45

Page 68: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Cardinality of Set

SCHRODER-BERNSTEIN theorem and the continuumhypothesis

Theorem

If A and B are sets with |A| ≤ |B| and |B| ≤ |A|, then |A| = |B|,i.e., if there are one-to-one functions f from A to B and g from Bto A, then there is a one-to-one correspondence between A and B.

Hypothesis

Show that the power set of Z+ and R have the same cardinality, i.e.,|P(Z+)| = |R| = c .Furthermore, |P(Z+)| = |R| can be expressed as 2ℵ0 = c .

Cantor theorem

The cardinality of a set is always less than the cardinality of its powerset, i.e., |Z+| < |P(Z+)|.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 25 / 45

Page 69: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix

Linear equations and matrix

Linear equations

The subject of algebra arose from studying equations.

If x1, x2, · · · , xn are variables and a1, a2, · · · , an and c are constant,then the equation a1x1 + a2x2 + · · ·+ anxn = c is said to be a linearequation, where ai are the coefficient.

More generally, a linear system consisting of m equations in nunknowns will look like:

a11x1 + a12x2 + · · ·+ a1nxn = c1

a21x1 + a22x2 + · · ·+ a2nxn = c2

· · ·am1x1 + am2x2 + · · ·+ amnxn = cm

The main problem is to find the solution set of a linear system(Gaussian reduction). While that is not the focus of this course

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 26 / 45

Page 70: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix

Vector

An n-tuple (pair, triple, quadruple, ...) of scalars can be written as ahorizontal row or vertical column. A column is called a vector. For

example x =

x1x2· · ·xn

and xT = [x1, x2, · · · , xn]

Operations

Addition: x + y = [x1 + y1, x2 + y2, · · · , xn + yn]

x + y = y + x

cx = [cx1, cx2, · · · , cxn] and 0x =−→0

x + (y + z) = (x + y) + z

Manipulation: xT y =∑n

i=1 xiyixT y = yT x(x + y)T z = xT z + yT z

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 27 / 45

Page 71: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix

Vector

An n-tuple (pair, triple, quadruple, ...) of scalars can be written as ahorizontal row or vertical column. A column is called a vector. For

example x =

x1x2· · ·xn

and xT = [x1, x2, · · · , xn]

Operations

Addition: x + y = [x1 + y1, x2 + y2, · · · , xn + yn]

x + y = y + x

cx = [cx1, cx2, · · · , cxn] and 0x =−→0

x + (y + z) = (x + y) + z

Manipulation: xT y =∑n

i=1 xiyixT y = yT x(x + y)T z = xT z + yT z

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 27 / 45

Page 72: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix

Examples of vector

Examples

Entity: an entity can be modeled as a vector x = [x1, x2, · · · , xn],where n denotes the number of features and xi denotes the value ofthe i−th feature. For example, patients, email, student, and user, etc.

Set: given a universal set, a subset of the universal set can be modelas a binary vector x = [0, 1, 1, · · · , 0]T , where the dimension of X isthe size of universal set and xi = 1 means that the i−th item exists inthe set. For example, document VS. words, vertex VS. neighbors,string VS. n-gram, user VS. products, etc.

Distribution: given a discrete sample space Ω, PMF can be modeledas a vector p = [p1, p2, · · · , pn], where n is the cardinality of Ω,0 ≤ pi ≤ 1 and

∑ni=1 pi = 1. For example, document VS. topics,

Markov chain VS. states, tweet VS. polarity, entity VS. classes, etc.

Latent vector: matrix factorization, topic modeling, and wordembedding, etc.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 28 / 45

Page 73: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix

Examples of vector

Examples

Entity: an entity can be modeled as a vector x = [x1, x2, · · · , xn],where n denotes the number of features and xi denotes the value ofthe i−th feature. For example, patients, email, student, and user, etc.

Set: given a universal set, a subset of the universal set can be modelas a binary vector x = [0, 1, 1, · · · , 0]T , where the dimension of X isthe size of universal set and xi = 1 means that the i−th item exists inthe set. For example, document VS. words, vertex VS. neighbors,string VS. n-gram, user VS. products, etc.

Distribution: given a discrete sample space Ω, PMF can be modeledas a vector p = [p1, p2, · · · , pn], where n is the cardinality of Ω,0 ≤ pi ≤ 1 and

∑ni=1 pi = 1. For example, document VS. topics,

Markov chain VS. states, tweet VS. polarity, entity VS. classes, etc.

Latent vector: matrix factorization, topic modeling, and wordembedding, etc.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 28 / 45

Page 74: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix

Examples of vector

Examples

Entity: an entity can be modeled as a vector x = [x1, x2, · · · , xn],where n denotes the number of features and xi denotes the value ofthe i−th feature. For example, patients, email, student, and user, etc.

Set: given a universal set, a subset of the universal set can be modelas a binary vector x = [0, 1, 1, · · · , 0]T , where the dimension of X isthe size of universal set and xi = 1 means that the i−th item exists inthe set. For example, document VS. words, vertex VS. neighbors,string VS. n-gram, user VS. products, etc.

Distribution: given a discrete sample space Ω, PMF can be modeledas a vector p = [p1, p2, · · · , pn], where n is the cardinality of Ω,0 ≤ pi ≤ 1 and

∑ni=1 pi = 1. For example, document VS. topics,

Markov chain VS. states, tweet VS. polarity, entity VS. classes, etc.

Latent vector: matrix factorization, topic modeling, and wordembedding, etc.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 28 / 45

Page 75: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix

Examples of vector

Examples

Entity: an entity can be modeled as a vector x = [x1, x2, · · · , xn],where n denotes the number of features and xi denotes the value ofthe i−th feature. For example, patients, email, student, and user, etc.

Set: given a universal set, a subset of the universal set can be modelas a binary vector x = [0, 1, 1, · · · , 0]T , where the dimension of X isthe size of universal set and xi = 1 means that the i−th item exists inthe set. For example, document VS. words, vertex VS. neighbors,string VS. n-gram, user VS. products, etc.

Distribution: given a discrete sample space Ω, PMF can be modeledas a vector p = [p1, p2, · · · , pn], where n is the cardinality of Ω,0 ≤ pi ≤ 1 and

∑ni=1 pi = 1. For example, document VS. topics,

Markov chain VS. states, tweet VS. polarity, entity VS. classes, etc.

Latent vector: matrix factorization, topic modeling, and wordembedding, etc.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 28 / 45

Page 76: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix

How far from two vectors

Distance

Distance is a numerical description of how far apart vectors are. Given twovectors x and y , there are many ways to measure distance of two vectors.

Distance in Euclidean space: the Minkowski distance of order p(p-norm distance) is defined as

1-norm distance (Manhattan distance):∑n

i=1 |xi − yi |2-norm distance (Euclidean distance):

(∑ni=1(xi − yi )

2)1/2

p-norm distance:(∑n

i=1(xi − yi )p)1/p

Infinity norm distance:

limp→∞(∑n

i=1(xi − yi )p)1/p

= maxxi − yi |i = 1, 2, · · · , nMahalanobis distance: it is defined as a dissimilarity between tworandom vectors X and Y of the same distribution with covariancematrix S : D(X ,Y ) =

((X − Y )TS−1(X − Y )

)1/2. If S = I , the

Mahalanobis distance reduces to the Euclidean distance

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 29 / 45

Page 77: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix

Matrix

Definition

An m× n matrix A = (aij) (1 ≤ i ≤ m, 1 ≤ j ≤ n) is a rectangular array ofmn scalars in m rows and n columns, such as

A =

a11 a12 · · · a1na21 a22 · · · a2n· · · · · · · · · · · ·am1 am2 · · · amn

The i-th row of A is the 1× n matrix [ai1, ai2, · · · , ain]. The j−th column

of A is the m × 1 matrix

a1ja2j· · ·amj

.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 30 / 45

Page 78: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix

Matrix

Concepts

Boldface uppercase letters will be used to represent matrices;

The set of all m × n matrices with real entries will be denoted byRm×n;

A is called the identity matrix if

aij =

1, if i = j ;0, otherwise.

If m = n, A is called a square matrix;

AT = (aji )(∈ Rn×m) is a n ×m matrix;

If A is a n × n square matrix, Trace(A) =∑n

i aii = Trace(AT );

AIn = ImA = A;

A square matrix A is called symmetric if A = AT , i.e., aij = aji for ∀iand ∀j .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 31 / 45

Page 79: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix

Examples of matrix

Homogeneous graph

Vertex can be Web page, user, protein,road, route, etc. Edge can be directed,undirected, weighted or labeled.

Heterogeneous graph

Vertex can be user-Web page,user-product, user-service, user-paper,etc.

Signed graph

user friend and enemy networks, likeand dislike networks, etc.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 32 / 45

Page 80: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix

Examples of matrix Cont.

Image processing

color, texture and shape, etc

Feature representation

Many applications can be modeled inthis manner, such as search engine,email classification, disease diagnosis,churn predication, anomaly detection,etc.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 33 / 45

Page 81: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix

Operations of matrix

Operations

Addition: Let A = [aij ] and B = [bij ] be m × n matrices,A + B = (aij + bij)

A + cB = (aij + cbij), especially A− B = (aij − bij), where c is a scalarA + B = B + AA + (B + C ) = (A + B) + C

Manipulation: If A is an n×m matrix and B is an m× p matrix, thenAB = (

∑mk=1 aikbkj)

Not commutative: AB 6= BADistributive over matrix addition: (A + B)C = AC + BCScalar multiplication is compatible with matrix multiplication:λAB = (λA)B = A(λB)(AB)T = BTAT

Trace(AB) = Trace(BA) andTrace(ABCD) = Trace(BCDA) = Trace(CDAB) = Trace(DABC ). Ingeneral, Trace(ABC ) 6= Trace(ACB)

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 34 / 45

Page 82: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix

Power of matrices

Definition

Let A be an n × n matrix, we have

A0 = In,Ak = AA · · ·A︸ ︷︷ ︸

k times

Definition of diagonalizable

A square matrix A is said to be diagonalizable if it is similar to a diagonalmatrix, i.e., there exists an invertible matrix P and a diagonal matrix Dsuch that A = PDP−1.

Why useful? If A is diagonalizable, then Ak = PDkP−1 for k > 0.

How to find diagonal matrix? If v1, · · · , vn are linearly independenteigenvectors of A and λi are their corresponding eignevalues, thenA = PDP−1, where P = [v1 · · · vn] and D = Diag(λ1, · · · , λn).

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 35 / 45

Page 83: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix

Power of matrices

Definition

Let A be an n × n matrix, we have

A0 = In,Ak = AA · · ·A︸ ︷︷ ︸

k times

Definition of diagonalizable

A square matrix A is said to be diagonalizable if it is similar to a diagonalmatrix, i.e., there exists an invertible matrix P and a diagonal matrix Dsuch that A = PDP−1.

Why useful? If A is diagonalizable, then Ak = PDkP−1 for k > 0.

How to find diagonal matrix? If v1, · · · , vn are linearly independenteigenvectors of A and λi are their corresponding eignevalues, thenA = PDP−1, where P = [v1 · · · vn] and D = Diag(λ1, · · · , λn).

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 35 / 45

Page 84: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix

Matrix inverseDefinition

Suppose two n × n matrices A and B have the property that AB =BA = In. Then we say A is an inverse of B (and B is an inverse ofA). Matrix A is invertible if A has inverse.

Properties

Suppose A ∈ Rn×n and A has an inverse B. Then B is unique.

A ∈ Rn×n is nonsingular (i.e., has rank n), if and only if there exists amatrix B ∈ Rn×n such that BA = In.

If A is nonsingular, then the system Ax = b has the unique solutionx = A−1b.

(A|In)→ (In|B) (row reduce), then B is the inverse of A.

(A|b)→ (In|c) (row reduce), where the components of c are certainlinear combinations of the components of b. The coefficients in theselinear combinations give us the entries of A−1.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 36 / 45

Page 85: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix derivatives

Matrix derivatives

Type scalar vector matrix

scalar ∂y∂x

∂y∂x

∂Y∂x

vector ∂y∂x

∂y∂x

matrix ∂y∂X

Derivatives by scalar

Assume that x , y , a ∈ R, x ∈ Rn×1, X ,Y ,A ∈ Rn×m, and y, a ∈Rm×1. Let a, a and A be constant scalar, vector and matrix.

∂y∂x and ∂a

∂x = 0

∂y∂x =

∂y1∂x· · ·∂ym∂x

and ∂a∂x = 0 (vector)

∂Y∂x =

∂y11∂x · · · ∂y1m

∂x· · · · · · · · ·∂yn1∂x · · · ∂ynm

∂x

and ∂A∂x = 0 (matrix)

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 37 / 45

Page 86: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix derivatives

Matrix derivatives

Type scalar vector matrix

scalar ∂y∂x

∂y∂x

∂Y∂x

vector ∂y∂x

∂y∂x

matrix ∂y∂X

Derivatives by scalar

Assume that x , y , a ∈ R, x ∈ Rn×1, X ,Y ,A ∈ Rn×m, and y, a ∈Rm×1. Let a, a and A be constant scalar, vector and matrix.

∂y∂x and ∂a

∂x = 0

∂y∂x =

∂y1∂x· · ·∂ym∂x

and ∂a∂x = 0 (vector)

∂Y∂x =

∂y11∂x · · · ∂y1m

∂x· · · · · · · · ·∂yn1∂x · · · ∂ynm

∂x

and ∂A∂x = 0 (matrix)

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 37 / 45

Page 87: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix derivatives

Matrix derivatives Cont.

Derivatives by vector

∂y∂x =

∂y∂x1· · ·∂y∂xn

T

and ∂a∂x = 0T (vector)

∂y∂x =

∂y1∂x1

· · · ∂y1∂xn

· · · · · · · · ·∂ym∂x1

· · · ∂ym∂xn

, ∂a∂x = 0 (matr.) and ∂x

∂x = I (matr.)

Derivatives by matrix

∂y∂X =

∂y∂x11

· · · ∂y∂xn1

· · · · · · · · ·∂y∂x1m

· · · ∂y∂xnm

and ∂a∂X = 0T (matrix)

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 38 / 45

Page 88: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix derivatives

Matrix derivatives Cont.

Derivatives by vector

∂y∂x =

∂y∂x1· · ·∂y∂xn

T

and ∂a∂x = 0T (vector)

∂y∂x =

∂y1∂x1

· · · ∂y1∂xn

· · · · · · · · ·∂ym∂x1

· · · ∂ym∂xn

, ∂a∂x = 0 (matr.) and ∂x

∂x = I (matr.)

Derivatives by matrix

∂y∂X =

∂y∂x11

· · · ∂y∂xn1

· · · · · · · · ·∂y∂x1m

· · · ∂y∂xnm

and ∂a∂X = 0T (matrix)

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 38 / 45

Page 89: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix derivatives

Common properties of matrix derivatives

Properties

c1 ∂aT x∂x = ∂xT a

∂x = aT

c2 ∂xT x∂x = 2xT

c3 ∂(xT a)2

∂x = 2xTaaT

c4 ∂Ax∂x = A and ∂xTA

∂x = AT

c5 ∂xTAx∂x = xT (A + AT )

Proof c2. Let s = xTx =∑n

i=1 x2i . Then, ∂s

∂xi= 2xi . So, ∂xT x

∂x =

2xT .c3. Let s = xTa. Then ∂s2

∂xi= 2s ∂s

∂xi= 2sai . Thus, ∂(xT a)2

∂x =

2xTaaT .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 39 / 45

Page 90: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix derivatives

Properties of matrix derivatives cont.Properties for scalar by scaler

ss1 ∂(u+v)∂x = ∂u

∂x + ∂v∂x

ss2 ∂uv∂x = u ∂v

∂x + v ∂u∂x (product rule)

ss3 ∂g(u)∂x = ∂g(u)

∂u∂u∂x (chain rule)

ss4 ∂f (g(u))∂x = ∂f (g)

∂g∂g(u)∂u

∂u∂x (chain rule)

Properties for vector by scaler

vs1 ∂(au+v)∂x = a ∂u

∂x + ∂v∂x , where a is not a function of x .

vs2 ∂Au∂x = A∂u

∂x where A is not a function of x .

vs3 ∂uT

∂x =(∂u∂x )T

vs4 ∂g(u)∂x = ∂g(u)

∂u∂u∂x (chain rule)

vs5 ∂f (g(u))∂x = ∂f (g)

∂g∂g(u)∂u

∂u∂x (chain rule)

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 40 / 45

Page 91: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix derivatives

Properties of matrix derivatives cont.Properties for scalar by scaler

ss1 ∂(u+v)∂x = ∂u

∂x + ∂v∂x

ss2 ∂uv∂x = u ∂v

∂x + v ∂u∂x (product rule)

ss3 ∂g(u)∂x = ∂g(u)

∂u∂u∂x (chain rule)

ss4 ∂f (g(u))∂x = ∂f (g)

∂g∂g(u)∂u

∂u∂x (chain rule)

Properties for vector by scaler

vs1 ∂(au+v)∂x = a ∂u

∂x + ∂v∂x , where a is not a function of x .

vs2 ∂Au∂x = A∂u

∂x where A is not a function of x .

vs3 ∂uT

∂x =(∂u∂x )T

vs4 ∂g(u)∂x = ∂g(u)

∂u∂u∂x (chain rule)

vs5 ∂f (g(u))∂x = ∂f (g)

∂g∂g(u)∂u

∂u∂x (chain rule)

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 40 / 45

Page 92: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix derivatives

Properties of matrix derivatives cont.Properties for matrix by scaler

ms1 ∂aU∂x = a∂U

∂x , where a is not a function of x .

ms2 ∂AUB∂x = A∂U

∂x B where A and B are not a function of x .

ms3 ∂(U+V )∂x = ∂U

∂x + ∂V∂x

ms4 ∂UV∂x = U ∂V

∂x + ∂U∂x V (product rule)

Properties for scalar by vector

sv1 ∂(au+v)∂x = a∂u

∂x + ∂v∂x , where a is not a function of x .

sv2 ∂uv∂x = u ∂v

∂x + v ∂u∂x (product rule)

sv3 ∂f (g(u))∂x = ∂f (g)

∂g∂g(u)∂u

∂u∂x (chain rule)

sv4 ∂uT v∂x = uT ∂v

∂x + vT ∂u∂x (product rule)

sv5 ∂uTAv∂x = uTA∂v

∂x + vTAT ∂u∂x , where A is not a function of x

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 41 / 45

Page 93: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix derivatives

Properties of matrix derivatives cont.Properties for matrix by scaler

ms1 ∂aU∂x = a∂U

∂x , where a is not a function of x .

ms2 ∂AUB∂x = A∂U

∂x B where A and B are not a function of x .

ms3 ∂(U+V )∂x = ∂U

∂x + ∂V∂x

ms4 ∂UV∂x = U ∂V

∂x + ∂U∂x V (product rule)

Properties for scalar by vector

sv1 ∂(au+v)∂x = a∂u

∂x + ∂v∂x , where a is not a function of x .

sv2 ∂uv∂x = u ∂v

∂x + v ∂u∂x (product rule)

sv3 ∂f (g(u))∂x = ∂f (g)

∂g∂g(u)∂u

∂u∂x (chain rule)

sv4 ∂uT v∂x = uT ∂v

∂x + vT ∂u∂x (product rule)

sv5 ∂uTAv∂x = uTA∂v

∂x + vTAT ∂u∂x , where A is not a function of x

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 41 / 45

Page 94: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix derivatives

Properties of matrix derivatives cont.

Properties for scalar by matrix

sm1 ∂au∂X = a ∂u

∂X , where a is not a function of x .

sm2 ∂(u+v)∂X = ∂u

∂X + ∂v∂X

sm3 ∂uv∂X = u ∂v

∂X + v ∂u∂X (product rule)

sm4 ∂f (g(u))∂X = ∂f (g)

∂g∂g(u)∂u

∂u∂X (chain rule)

Properties for vector by vector

vv1 ∂(au+v)∂x = a∂u

∂x + ∂v∂x , where a is not a function of x .

vv2 ∂Au∂x = A∂u

∂x , where A is not a function of x.

vv3 ∂f (g(u))∂x = ∂f (g)

∂g∂g(u)∂u

∂u∂x (chain rule)

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 42 / 45

Page 95: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix derivatives

Properties of matrix derivatives cont.

Properties for scalar by matrix

sm1 ∂au∂X = a ∂u

∂X , where a is not a function of x .

sm2 ∂(u+v)∂X = ∂u

∂X + ∂v∂X

sm3 ∂uv∂X = u ∂v

∂X + v ∂u∂X (product rule)

sm4 ∂f (g(u))∂X = ∂f (g)

∂g∂g(u)∂u

∂u∂X (chain rule)

Properties for vector by vector

vv1 ∂(au+v)∂x = a∂u

∂x + ∂v∂x , where a is not a function of x .

vv2 ∂Au∂x = A∂u

∂x , where A is not a function of x.

vv3 ∂f (g(u))∂x = ∂f (g)

∂g∂g(u)∂u

∂u∂x (chain rule)

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 42 / 45

Page 96: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix derivatives

Zero-one matrices

Definition

A matrix all of whose entries are either 0 or 1 is called a zero-onematrix.

Operations

∧: Let A = [aij ] and B = [bij ] be m × n zero-one matrices,A ∧ B = [aij ∧ bij ], i.e.,

(A ∧ B)ij =

1, if aij = bij = 1;0, otherwise.

∨: Let A = [aij ] and B = [bij ] be m × n zero-one matrices,A ∨ B = [aij ∨ bij ], i.e.,

(A ∨ B)ij =

1, if aij = 1 or bij = 1;0, otherwise.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 43 / 45

Page 97: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix derivatives

Zero-one matrices

Definition

A matrix all of whose entries are either 0 or 1 is called a zero-onematrix.

Operations

∧: Let A = [aij ] and B = [bij ] be m × n zero-one matrices,A ∧ B = [aij ∧ bij ], i.e.,

(A ∧ B)ij =

1, if aij = bij = 1;0, otherwise.

∨: Let A = [aij ] and B = [bij ] be m × n zero-one matrices,A ∨ B = [aij ∨ bij ], i.e.,

(A ∨ B)ij =

1, if aij = 1 or bij = 1;0, otherwise.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 43 / 45

Page 98: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix derivatives

Boolean product

Definition

If A is an n×m zero-one matrix and B is an m× p zero-one matrix,then A

⊙B = [cij ] =

∨mk=1(aik ∧ bkj).

Example

A =

1 00 11 0

,B =

(1 1 00 1 1

)Solution

A⊙

B = (1 ∧ 1) ∨ (0 ∧ 0) (1 ∧ 1) ∨ (0 ∧ 1) (1 ∧ 0) ∨ (0 ∧ 1)(0 ∧ 1) ∨ (1 ∧ 0) (0 ∧ 1) ∨ (1 ∧ 1) (0 ∧ 0) ∨ (1 ∧ 1)(1 ∧ 1) ∨ (0 ∧ 0) (1 ∧ 1) ∨ (0 ∧ 1) (1 ∧ 0) ∨ (0 ∧ 1)

=

1 1 00 1 11 1 0

.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 44 / 45

Page 99: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Matrix derivatives

Boolean product

Definition

If A is an n×m zero-one matrix and B is an m× p zero-one matrix,then A

⊙B = [cij ] =

∨mk=1(aik ∧ bkj).

Example

A =

1 00 11 0

,B =

(1 1 00 1 1

)Solution

A⊙

B = (1 ∧ 1) ∨ (0 ∧ 0) (1 ∧ 1) ∨ (0 ∧ 1) (1 ∧ 0) ∨ (0 ∧ 1)(0 ∧ 1) ∨ (1 ∧ 0) (0 ∧ 1) ∨ (1 ∧ 1) (0 ∧ 0) ∨ (1 ∧ 1)(1 ∧ 1) ∨ (0 ∧ 0) (1 ∧ 1) ∨ (0 ∧ 1) (1 ∧ 0) ∨ (0 ∧ 1)

=

1 1 00 1 11 1 0

.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 44 / 45

Page 100: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/mgao/teaching/DM_2020_Spring/slides/2_sets26.pdf · Outline 1 Sequences and Summations 2 Summations 3 Cardinality of Set

Take-aways

Take-aways

Conclusions

Sequence and summations

Cardinality of set

Matrix

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Apr. 3, 2020 45 / 45