chapter 1. fundamentals

38
Chapter 1. Fundamentals Weiqi Luo ( 骆骆骆 ) School of Software Sun Yat-Sen University Email [email protected] Office A309

Upload: danton

Post on 05-Feb-2016

45 views

Category:

Documents


1 download

DESCRIPTION

Chapter 1. Fundamentals. Weiqi Luo ( 骆伟祺 ) School of Software Sun Yat-Sen University Email : [email protected] Office : A309. Textbook: B. Kolman, R.C. Busby & S.C. Ross, Discrete Mathematical Structures (Sixth Edition), Higher Education Press, 2010.11. References: - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Chapter 1. Fundamentals

Chapter 1. Fundamentals

Weiqi Luo (骆伟祺 )School of Software

Sun Yat-Sen UniversityEmail : [email protected] Office : A309

Page 2: Chapter 1. Fundamentals

School of Software

Textbook: B. Kolman, R.C. Busby & S.C. Ross, Discrete Mathematical Structures

(Sixth Edition), Higher Education Press, 2010.11.

References: 1. 屈婉玲,耿素云,张立昂, 离散数学,清华大学出版社 2 K.H. Rosen, 离散数学及其应用(英文版)(第 6 版)机械工业出版社

2

Page 3: Chapter 1. Fundamentals

School of Software

1.1. Sets and Subsets 1.2. Operations on Sets 1.3. Sequences 1.4. Properties of Integers 1.5. Matrices 1.6. Mathematical Structures

3

Chapter one: Fundamentals

Page 4: Chapter 1. Fundamentals

School of Software

What is a set? A Set is any well-defined collection of objects called the elements or

members of the set.

Well-defined means that it is possible to describe if a given object belongs to the collection or not.

Describing a Set Way one: List the elements of the set between braces (finite elements)

e.g. the set of all positive integers that are less than 4 : {1, 2, 3}

Way two: Specify a property that the elements of the set have in common

e.g. R={x | x is a real number }

4

1.1. Sets and Subset

Property of the elements

Page 5: Chapter 1. Fundamentals

School of Software

The order of the Set {1, 2, 3}={1, 3, 2}={2, 3, 1}={2, 1,3 }={3, 1, 2}={3, 2, 1}

Repeated elements can be ignored {1, 2, 3, 1} = {1, 2, 3}

Several commonly used sets Please refer to Example 3 in Page 2.

5

1.1. Sets and Subset

Page 6: Chapter 1. Fundamentals

School of Software

The relationships between Element & Set

Usually, we use uppercase letters such as A, B and C to denote sets, and lowercase letters such as a, b, c, x, y and z to denote the elements of sets

Binary cases: for a given element x and set A

1: x belongs to A denoted by x ∈A

2: x does not belong to A denoted by x ∉ A Fuzzy Sets

The collections of rich people, young girls, so on and so forth

Note: The words rich, young, beautiful, cool, hot, fat, thin etc. are fuzzy (not well defined). Refer to Wikipedia for more details about Fuzzy mathematics: http://en.wikipedia.org/wiki/Fuzzy_mathematics

6

1.1. Sets and Subset

Page 7: Chapter 1. Fundamentals

School of Software

Subset If every element of A is also an element of B, namely, if whether x ∈A then x ∈ B, we say

that A is a subset of B, denoted by A ⊆ B . Otherwise, .

Venn diagrams

A ⊆ B

7

1.1. Sets and Subset

B A BA A B

Page 8: Chapter 1. Fundamentals

School of Software8

1.1. Sets and Subset

A B

A=B: A ⊆ B & B ⊆ AA

U

An universal set (U) is a set containing all objects forwhich the discussion is meaningful.

Page 9: Chapter 1. Fundamentals

School of Software

Example 10 Let A be a set and let B = {A, {A}}, then, since A and {A} are

elements of B, we have A ∈ B and {A} ∈B. It follows that

{A} ⊆ B and {{A}} ⊆ B. However, it is not true that A ⊆ B

Why?

9

1.1. Sets and Subset

Page 10: Chapter 1. Fundamentals

School of Software

The cardinality of a finite set A set A is called finite if it has n distinct elements, where n∈ N. In

this case, n is the cardinality of A and is denoted by |A|.

e.g. A={1,2,3,1} |A| = 3

B={a, b, c, d, e, a}, |B| = 5

|A| < |B|

A set that is not finite is called infinite, for instances, N, Z, Q, R as mentioned in Example 3. the cardinality of infinite?

Continuum hypothesis (the 1st Hilbert's Problems): http://en.wikipedia.org/wiki/Continuum_hypothesis

10

1.1. Sets and Subset

Page 11: Chapter 1. Fundamentals

School of Software

Power set of a set A

If A is a set, then the set of all subsets of A is called the power set of A and is denoted by P(A).

e.g. A={1,2,3}

Then P(A) consists of the following subsets of A: {}, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, and {1,2,3}

|P(A)| = 2^n, why? Assuming n = |A| ∈ N

1.1. Sets and Subset

11

Page 12: Chapter 1. Fundamentals

School of Software

Homework

ex.5, ex.13, ex.14, ex.23

12

1.1. Sets and Subset

Page 13: Chapter 1. Fundamentals

School of Software

Union If A and B are sets, we define their union as the set consisting of

all elements that belong to A or B and denote it by A U B.

A U B = { x | x ∈ A or x ∈ B }

1.2. Operations on Sets

13

A

U

B

Page 14: Chapter 1. Fundamentals

School of Software

Intersection

If A and B are sets, we define their intersection as the set consisting of all elements that belong to both A and B and denoted it by A ∩ B.

A ∩ B = { x | x ∈ A and x ∈ B }

1.2. Operations on Sets

14

U

A B

Page 15: Chapter 1. Fundamentals

School of Software

Complement of B with respect to A If A and B are two sets, we define the complement of B with

respect to A as the set of all elements that belong to A but not to B, and we denote it by A - B

A - B = { x | x ∈ A and x ∉ B }

1.2. Operations on Sets

15

U

AA B

Page 16: Chapter 1. Fundamentals

School of Software

Complement If U is a universal set containing A, then U-A is called the

complement of A and is denoted by

= {x | x ∉ A}

1.2. Operations on Sets

16

U

A

Page 17: Chapter 1. Fundamentals

School of Software

Symmetric difference If A and B are two sets, we define their symmetric difference as

the set of all elements that belong to A or to B, but not to both A and B, and we denote it by A B

A B = {x | (x ∈A and x ∉ B) or (x ∈B and x ∉ A) }

1.2. Operations on Sets

17

U

A B

Page 18: Chapter 1. Fundamentals

School of Software

Commutative Properties A U B = B U A ; A ∩ B = B ∩ A

Associative Properties

A U (B U C) = ( A U B ) U C

A ∩ (B ∩ C) = ( A ∩ B ) ∩ C

Distribution Properties

A ∩ (B U C) = ( A ∩ B ) U ( A ∩ C )

A U (B ∩ C) = ( A U B ) ∩ ( A U C )

18

1.2. Operations on Sets

Page 19: Chapter 1. Fundamentals

School of Software

Idempotent Properties

A U A =A ; A ∩ A = A

Properties of the complement

De Morgan’s Law

19

1.2. Operations on Sets

Page 20: Chapter 1. Fundamentals

School of Software

Properties of a Universal set A U U = U

A ∩ U = A

Properties of the empty set

A U = A

A ∩ =

20

1.2. Operations on Sets

Page 21: Chapter 1. Fundamentals

School of Software

How to proof above properties? e.g. Proof:

Proof: suppose x ∈ , then we have x ∉ A∩B, so

x ∈ or x ∈ , which means that x ∈ . Thus,

⊆ Conversely, suppose x ∈ , then we have x ∉ A or x ∉ B , so x ∉ A ∩ B,

which means that x ∈ .Thus

⊆ Therefore,

A common style of proof for statements about sets is to choose an element in one of the sets and see what we know about it.

21

1.2. Operations on Sets

Page 22: Chapter 1. Fundamentals

School of Software

Addition Principle Theorem 2: If A and B are finite sets, then

|A U B| = |A| + |B| - |A ∩ B |

22

1.2. Operations on Sets

U

A B

A ∩ B

Page 23: Chapter 1. Fundamentals

School of Software

Example 9 A computer company wants to hire 25 programmers to handle systems

programming jobs and 40 programmers for applications programming. Of those hired, 10 will be expected to perform jobs of both types. How many programmers must be hired? (at least? )

Solution:

A: the set of system programmers hired

B: the set of applications programmers hired, then

|A| = 25, |B| = 40, |A ∩ B| =10

|A U B| = |A| + |B| - |A ∩ B |

= 25 + 40 -10 =55

1.2. Operations on Sets

23

Page 24: Chapter 1. Fundamentals

School of Software

Generalized case for three sets Theorem 3: Let A, B and C be finite sets. Then

|A U B U C| = |A| + |B| + |C| - |A∩B| - |B∩C|-|A∩C| + |A∩B∩C|

24

1.2. Operations on Sets

A B

C

A∩B

B∩CA∩C

A∩B∩C

Page 25: Chapter 1. Fundamentals

School of Software

Homework

ex. 4, ex. 10, ex. 12, ex. 35

ex. 46, ex. 47

1.2. Operations on Sets

25

Page 26: Chapter 1. Fundamentals

School of Software

1.3. Sequences 1.4. Properties of Integers 1.5. Matrices

26

Page 27: Chapter 1. Fundamentals

School of Software

Mathematical structure (system)

Such a collection of objects with operations defined on them and the accompanying properties form a mathematical structure or system, for instance,

Example 1: The collection of sets with the operations of union, intersection and complement and their accompanying properties is a mathematical structure. Denoted by

(sets, U, ∩ , -)

1.6. Mathematical Structures

27

Page 28: Chapter 1. Fundamentals

School of Software

Binary operation An operation that combines two objects

Unary operation

An operation that requires only one object

Example: the structure (5x5 matrices, +, *, T)

the operations + and * are binary operations

the operation T is a unary operation

1.6. Mathematical Structures

28

Page 29: Chapter 1. Fundamentals

School of Software

Closure

A structure is closed with respect to an operation if that operation always produces another/same member of the collection of objects.

Example 3: The structure (5x5 matrices, +, *, T) is closed with respect to +, * and T. (why?)

Example 4: The structure (odd integers, +, *) is closed with respected to *, while it is not closed with respected to +. (why?)

1.6. Mathematical Structures

29

Page 30: Chapter 1. Fundamentals

School of Software

Commutative property If the order of the objects does not affect the outcome of a binary

operation, we say that the operation is commutative , namely

if x □ y = y □ x, where □ is some binary operation with commutative property.

Example 6

(a) Join and meet for Boolean matrices are commutative operations

A V B =B V A and A ^ B = B ^ A

(b) Ordinary matrix multiplication is not a commutative operation.

AB ≠ BA

1.6. Mathematical Structures

30

Page 31: Chapter 1. Fundamentals

School of Software

Associative property if □ is a binary operation, then □ is associative or has associative

property if

(x □ y) □ z = x □ (y □ z)

Example 7

Set union is an associative operation, since

(A U B) U C = A U (B U C) is always true

1.6. Mathematical Structures

31

Page 32: Chapter 1. Fundamentals

School of Software

Distributive property If a mathematical structure has tow binary operations, say □ and ∇ , a distributive property has the following pattern:

x □ (y ∇ z) = (x □ y) ∇ ( x □ z )

we say that □ distributes over ∇ Example 8 (b)

the structure (sets, U, ∩, -) has two distributive properties:

A U (B ∩ C) =(A U B) ∩ (A U C)

A ∩ (B U C) =(A ∩ B) U (A ∩ C)

1.6. Mathematical Structures

32

Page 33: Chapter 1. Fundamentals

School of Software

De Morgan’s law If the unary operation is ○ and the binary operation □ and ∇,

then De Morgan’s law are

(x □ y) ○ =x ○ ∇ y ○ , (x ∇ y) = x ○ □ y ○

Example 9

(a) Union, intersection and complement

(b) The structure (real numbers, +, *, sqrt) does not satisfy De

Morgan’s law (why?)

1.6. Mathematical Structures

33

Page 34: Chapter 1. Fundamentals

School of Software

Identify If a structure with a binary operation □ contain an element e,

satisfying that

x □ e = e □ x = x for all x in the collection

we call e an identify for the operation □

Example 10:

For (n-by-n matrices, +,*, T), In is the identify for matrix multiplication and the n-by-n zero matrix is the identify matrix addition.

1.6. Mathematical Structures

34

Page 35: Chapter 1. Fundamentals

School of Software

Theorem 1: If e is an identify for a binary operation □, then e is unique.

Proof:

Assume i is another object with identify property, then we have i □ e = e □ i = e; since e is also an identify for □, then we have i □ e = e □ i = i, therefore e = i, which means that there is at most one object with the identify property for □.

1.6. Mathematical Structures

35

Page 36: Chapter 1. Fundamentals

School of Software

Inverse If a binary operation □ has an identity e, we say y is a □-inverse of x

if x □y=y □x=e

Example 11:

(a) In the structure (3-by-3 matrices, +, *, T), each matrix A=[aij] has +-inverse(additive inverse), -A=[-aij]. (why ?)

(b) In the structure (integers, +, *), only the integers 1 and -1 have multiplicative inverses. (why?)

1.6. Mathematical Structures

36

Page 37: Chapter 1. Fundamentals

School of Software

Theorem 2: If □ is an associative operation and x has a □-inverse y, then y is unique.

Proof:

Assume there is another □-inverse for x, say z, then

(z □ x) □ y = e □ y = y, and z □ (x □ y) =z □ e =z

since □ us associative, (z □ x) □ y = z □ (x □ y) and so y=z, which means that y is unique.

1.6. Mathematical Structures

37

Page 38: Chapter 1. Fundamentals

School of Software

Homework

ex. 4, ex. 8, ex. 13, ex. 21, ex. 32

1.6. Mathematical Structures

38