40
Discrete Mathematics: Sets, Sequences and Functions 1.1 Some Special Sets 1.2 Set Operations 1.3 Functions

Discrete Mathematics: Sets, Sequences and Functions

  • Upload
    willa

  • View
    89

  • Download
    1

Embed Size (px)

DESCRIPTION

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/what_is_dm.html http://en.wikipedia.org/wiki/Discrete_mathematics. Sets. - PowerPoint PPT Presentation

Citation preview

Page 1: Discrete Mathematics: Sets, Sequences and Functions

Discrete Mathematics: Sets, Sequences and Functions

1.1 Some Special Sets1.2 Set Operations

1.3 Functions

Page 3: Discrete Mathematics: Sets, Sequences and Functions

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

Page 4: Discrete Mathematics: Sets, Sequences and Functions

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)

Page 5: Discrete Mathematics: Sets, Sequences and Functions

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 ℝ

Page 6: Discrete Mathematics: Sets, Sequences and Functions

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”

Page 7: Discrete Mathematics: Sets, Sequences and Functions

Notation

• {n:n∈ℕ and n is even} = {0, 2, 4, 6, …}• {x:x∈ℝ and 1≤x<3}• {n∈ℕ: n is even}• {x∈ℝ: 1≤x<3}• {n2: n∈ℕ} = {m∈ℕ: m = n2 for some n∈ℕ} = {0, 1, 4, 9, 16, …}= {n2: n∈ℤ}

• {(-1)n: n∈ℕ} = {-1, 1}

Page 8: Discrete Mathematics: Sets, Sequences and Functions

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}

Page 9: Discrete Mathematics: Sets, Sequences and Functions

Definitions

• S is a subset of T (ST) if every element of S belongs to T

• Thus, S = T iff ST and TS

Page 10: Discrete Mathematics: Sets, Sequences and Functions

Examples

• ℙℕ, ℕℤ, ℤℚ, ℚℝ• ℙℕℤℚℝ• {n∈ℙ: n is prime and n≥3} {n∈ℙ: n is odd}

• SS ( instead of )

Page 11: Discrete Mathematics: Sets, Sequences and Functions

Notation

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

Page 12: Discrete Mathematics: Sets, Sequences and Functions

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 ±∞

Page 13: Discrete Mathematics: Sets, Sequences and Functions

Some Special Sets

• {n∈ℕ: 2<n<3}• {x∈ℝ: x2<0}• {r∈ℚ: r2=2}• {x∈ℝ: x2+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

Page 14: Discrete Mathematics: Sets, Sequences and Functions

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 ∅∉∅

Page 15: Discrete Mathematics: Sets, Sequences and Functions

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, c}, {a, b, c}} has 8 elements

• If S is a finite set with n elements, and if n≤3, then P(S) has 2n elements

Page 16: Discrete Mathematics: Sets, Sequences and Functions
Page 17: Discrete Mathematics: Sets, Sequences and Functions

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 Σ*

Page 18: Discrete Mathematics: Sets, Sequences and Functions

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)

Page 19: Discrete Mathematics: Sets, Sequences and Functions

Null

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

Page 20: Discrete Mathematics: Sets, Sequences and Functions

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}

Page 21: Discrete Mathematics: Sets, Sequences and Functions

Length

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

• length(aab); Σ={a, b}

• length(bab); Σ={a, b}

• length(abbAb); Σ={a, b, Ab}

• length(λ)

Page 22: Discrete Mathematics: Sets, Sequences and Functions

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 (A\B={x:x A and ∈x∉B} = {x A:∈ x∉B}

Page 23: Discrete Mathematics: Sets, Sequences and Functions

Set Operations

• Symmetric difference A⊕B={x:x A or ∈x B but not both}∈

• A⊕B=(A B)\(A∩B)=(A\B) (B\A)∪ ∪• Venn diagrams

Page 24: Discrete Mathematics: Sets, Sequences and Functions

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=AU• U is denoted by a box in Venn diagrams• Note that A\B=A∩Bc

• Ac∩Bc=(A B)∪ c

Page 25: Discrete Mathematics: Sets, Sequences and Functions

Commutative Laws

• A B = B A ∪ ∪• A∩B = B∩A

Page 26: Discrete Mathematics: Sets, Sequences and Functions

Associative Laws

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

• (A B)∩C ∪ ≟ A (B∩C)∪• (A∩B) C ∪ ≟ A∩(B C)∪

Page 27: Discrete Mathematics: Sets, Sequences and Functions

Distributive Laws

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

Page 28: Discrete Mathematics: Sets, Sequences and Functions

Idempotent Laws

• A A = A∪• A∩A = A

Page 29: Discrete Mathematics: Sets, Sequences and Functions

Identity Laws

• A∪∅ = A• A∩U = U

• A∩∅ = ∅• A U = A∪

Page 30: Discrete Mathematics: Sets, Sequences and Functions

Double Complementation

• (Ac)c = A

Page 31: Discrete Mathematics: Sets, Sequences and Functions

Other Laws

• A A∪ c = U

• A∩Ac = ∅

• Uc = ∅• ∅c = U

Page 32: Discrete Mathematics: Sets, Sequences and Functions

DeMorgan Laws

• (A B)∪ c = Ac∩Bc

• (A∩B)c = Ac B∪ c

Page 33: Discrete Mathematics: Sets, Sequences and Functions

Other Properties

• (A B)∩A∪ c B• (A⊕B)⊕C = A⊕(B⊕C)

Page 34: Discrete Mathematics: Sets, Sequences and Functions

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 S2

Page 35: Discrete Mathematics: Sets, Sequences and Functions

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 2S

Page 36: Discrete Mathematics: Sets, Sequences and Functions

Product Set

• Product set S1 x S2 x ∙∙∙ x Sn consists of all ordered n-tuples (s1, s2, …, sn)

Page 37: Discrete Mathematics: Sets, Sequences and Functions

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)

Page 38: Discrete Mathematics: Sets, Sequences and Functions

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)

Page 39: Discrete Mathematics: Sets, Sequences and Functions

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

Page 40: Discrete Mathematics: Sets, Sequences and Functions

Functions

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