Discrete Mathematics Sets Sequences and Functions 1 1

  • Slides: 40
Download presentation
Discrete Mathematics: Sets, Sequences and Functions 1. 1 Some Special Sets 1. 2 Set

Discrete Mathematics: Sets, Sequences and Functions 1. 1 Some Special Sets 1. 2 Set Operations 1. 3 Functions

Discrete Mathematics • http: //www. cs. tufts. edu/research/dmw/wha t_is_dm. html • http: //en. wikipedia.

Discrete Mathematics • http: //www. cs. tufts. edu/research/dmw/wha t_is_dm. html • http: //en. wikipedia. org/wiki/Discrete_mathe matics

Sets • In the past few decades, it has become traditional to use set

Sets • In the past few decades, it has become traditional to use set theory as the underlying basis for mathematics. • Set – a collection of objects • Must be unambiguous

Sets • Sets – A, B, S, X • Objects – a, b, s,

Sets • Sets – A, B, S, X • Objects – a, b, s, x • a is a member of S (a∈S) • a is not an element of S (a∉S)

Some Special Sets • Natural numbers ℕ = {0, 1, 2, 3, …} •

Some Special Sets • Natural numbers ℕ = {0, 1, 2, 3, …} • Positive integers ℙ = {1, 2, 3, …} • (some texts do not include 0 in ℕ) • Integers (Zahl) ℤ = {0, ± 1, ± 2, ± 3, …} • Rational numbers (ratios of integers) ℚ = {m/n: m∈ℤ, n∈ℤ} • Real numbers ℝ

Notation • Positive even numbers less than 12: {2, 4, 6, 8, 10} •

Notation • Positive even numbers less than 12: {2, 4, 6, 8, 10} • Primes less than 20: {2, 3, 5, 7, 11, 13, 17, 19} • { : } • The colon is read “such that”

Definitions • Two sets are equal if they contain the same elements. • Order

Definitions • Two sets are equal if they contain the same elements. • Order is irrelevant • No advantage or harm in repeating • {2, 4, 6, 8, 10} = {10, 8, 6, 4, 2} = {2, 8, 2, 6, 2, 10, 4, 2}

Definitions • S is a subset of T (S T) if every element of

Definitions • S is a subset of T (S T) if every element of S belongs to T • Thus, S = T iff S T and T S

Notation • T S means T S and T≠S • T is a proper

Notation • T S means T S and T≠S • T is a proper subset of S

Interval Notation • [a, b] = {x∈ℝ: a≤x≤b} • [a, b) = {x∈ℝ: a≤x<b}

Interval Notation • [a, b] = {x∈ℝ: a≤x≤b} • [a, b) = {x∈ℝ: a≤x<b} • (a, b] = {x∈ℝ: a<x≤b} • (a, b) = {x∈ℝ: a<x<b} • [a, b] = closed interval • (a, b) = open interval • Intervals can also be used with ±∞

Some Special Sets • • {n∈ℕ: 2<n<3} {x∈ℝ: x 2<0} {r∈ℚ: r 2=2} {x∈ℝ:

Some Special Sets • • {n∈ℕ: 2<n<3} {x∈ℝ: x 2<0} {r∈ℚ: r 2=2} {x∈ℝ: x 2+1=0} Empty sets are denoted by { } and ∅ Norwegian and Danish letter, not Greek Φ ∅ is a subset of every set S, because x∈∅ implies x∈S

Inception • Sets are objects, and can be members of other sets • Ex.

Inception • Sets are objects, and can be members of other sets • Ex. : {{1, 2}, {1, 3}, {2}, {3}} has 4 members • Thus, {∅} has one member, and ∅ and {∅} are different. • ∅∈{∅}, and ∅ {∅}, but ∅∉∅

Power Sets • The set of all subsets of a set S is called

Power Sets • The set of all subsets of a set S is called the power set of S • P(∅) = {∅} • If S={a, b} and a≠b, then P(S)={∅, {a}, {b}, {a, b}} has 4 elements • If S = {a, b, c}, then P(S) = {∅, {a}, {b}, {c}, {a, b}, {b, c}, {a, b, c}} has 8 elements • If S is a finite set with n elements, and if n≤ 3, then P(S) has 2 n elements

Languages • Alphabet = a finite nonempty set Σ whose members are symbols, or

Languages • Alphabet = a finite nonempty set Σ whose members are symbols, or letters of Σ, and which is subject to some minor restrictions • Word = a finite string of letters from Σ • Σ* = the set of all words using letters from Σ • Language = any subset of Σ*

Languages • Let Σ={a, b, c, . . . , z} • Any string

Languages • Let Σ={a, b, c, . . . , z} • Any string of letters from Σ belongs to Σ* • Σ* contains math, is, fun, aint, lieblich, amour, zzyzzoomph, etcetera, etc. (infinite) • We could define the American language L to be the subset of Σ* consisting of words in Webster’s New World Dictionary of the American Language. • Thus, L={a, aachen, aardvark, aardwolf, …, zymurgy} (finite)

Null • The empty word, or null word, is the string with no letters

Null • The empty word, or null word, is the string with no letters at all, and is denoted by λ

Restrictions on Σ • Σ cannot contain any letters that are themselves strings of

Restrictions on Σ • Σ cannot contain any letters that are themselves strings of letters in Σ • Σ={a, b, c} • Σ={a, b, c, ac} • Σ={a, b, ca} • Σ={a, b, Ab} • Σ={a, b, ac}

Length • length(w) is the number of letters from Σ in w • length(aab);

Length • length(w) is the number of letters from Σ in w • length(aab); Σ={a, b} • length(bab); Σ={a, b} • length(abb. Ab); Σ={a, b, Ab} • length(λ)

Set Operations • Union - A∪B = {x: x∈A or x∈B or both} •

Set Operations • Union - A∪B = {x: x∈A or x∈B or both} • Intersection - A∩B = {x: x∈A and x∈B} • Disjoint – no elements in common (A∩B= ∅) • Relative complement – set of objects in A and not in B (AB={x: x∈A and x∉B} = {x∈A: x∉B}

Set Operations • Symmetric difference A⊕B={x: x∈A or x∈B but not both} • A⊕B=(A∪B)(A∩B)=(AB)∪(BA)

Set Operations • Symmetric difference A⊕B={x: x∈A or x∈B but not both} • A⊕B=(A∪B)(A∩B)=(AB)∪(BA) • Venn diagrams

Universe • • Set U is the universe or universal set U can be

Universe • • Set U is the universe or universal set U can be ℕ, ℝ, or Σ* Only consider elements in U and subsets of U Absolute complement (or complement) of A, Ac=A U • U is denoted by a box in Venn diagrams • Note that AB=A∩Bc • Ac∩Bc=(A∪B)c

Commutative Laws • A∪B = B∪A • A∩B = B∩A

Commutative Laws • A∪B = B∪A • A∩B = B∩A

Distributive Laws • (A∪B)∩C = (A∪B)∩(A∪C) • (A∩B)∪C = (A∩B)∪(A∩C)

Distributive Laws • (A∪B)∩C = (A∪B)∩(A∪C) • (A∩B)∪C = (A∩B)∪(A∩C)

Idempotent Laws • A∪A = A • A∩A = A

Idempotent Laws • A∪A = A • A∩A = A

Double Complementation • (Ac)c = A

Double Complementation • (Ac)c = A

De. Morgan Laws • (A∪B)c = Ac∩Bc • (A∩B)c = Ac∪Bc

De. Morgan Laws • (A∪B)c = Ac∩Bc • (A∩B)c = Ac∪Bc

Other Properties • (A∪B)∩Ac B • (A⊕B)⊕C = A⊕(B⊕C)

Other Properties • (A∪B)∩Ac B • (A⊕B)⊕C = A⊕(B⊕C)

Product • • • Consider sets S and T, with s∈S and t∈T (s,

Product • • • Consider sets S and T, with s∈S and t∈T (s, t) is an ordered pair (order is important) Product – the set of all ordered pairs (s, t) S x T = {(s, t): s∈S and t∈T} If S = T, S x S can be written as S 2

Notation • For any finite set S, |S| indicates the number of elements in

Notation • For any finite set S, |S| indicates the number of elements in the set • |S x T| = |S| ∙ |T| • |P(S)| = 2|S| • P(S) can be written as 2 S

Product Set • Product set S 1 x S 2 x ∙∙∙ x Sn

Product Set • Product set S 1 x S 2 x ∙∙∙ x Sn consists of all ordered n-tuples (s 1, s 2, …, sn)

Functions • A function f assigns to some element x in some set S

Functions • A function f assigns to some element x in some set S a unique element in a set T. • f is defined on S with values in T • S – domain of f, Dom(f) • The element assigned to x is written f(x)

Functions • f is complete specified by Dom(f) and the formula or rule giving

Functions • f is complete specified by Dom(f) and the formula or rule giving f(x) for each x∈Dom(f) • f(x) is the image of x under f • Im(f) T is the image of f, or the set of all images f(x)

Functions • T is the codomain of f • Any set containing Im(f) can

Functions • T is the codomain of f • Any set containing Im(f) can be a codomain • f: S→T means “f is a function with domain s and codomain T” • Or: f maps S into T

Functions • Graph(f) = {(x, y)∈S x T: y = f(x)}

Functions • Graph(f) = {(x, y)∈S x T: y = f(x)}