0% found this document useful (0 votes)
96 views

D421 Key Concepts

D421 Key Concepts

Uploaded by

dhubb13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views

D421 Key Concepts

D421 Key Concepts

Uploaded by

dhubb13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

D421 Key Concepts Functions and Relations

Table of contents:
 Sets
 Higher Set Operations
 Overview of Functions
 Functions- Composition and Applications
 Binary Relations and Directed Graphs
 Order Relations
 N-ary Relations

Sets

 Set A is a subset of B, denoted A ⊆ B if every element in A is also in B. Every set


is a subset of itself. The empty set is a subset of every set.
 Set A is a proper subset of set B if it is a subset of B and is not equal to B. It is
denoted A⊂ B
 The cardinality of a set is the number of elements in the set.
 The power set of a set A is denoted P(A), and it is the set of all subsets of A,
including the empty set and A itself.
 The cardinality of the power set of a set of size n is 2n
 The complement of the set A is A = {x∈ U | x∉ A}.
 The union of two sets A and B is A∪B = {x∈ A or x∈ B}.
 The intersection of two sets A and B is A∩B = {x∈ A and x∈ B}.
 The union and intersection operations are commutative. That is, A∪B=B∪A and
A∩B=B∩A
 The difference between two sets A and B is A - B = {x∈ A and x∉ B}.
 The symmetric difference between two sets A and B is A⊕B = (A - B) ∪ (B - A)
 The difference operator is not commutative. That is, A - B ≠ B – A
Set Identities

Back to Table of contents


Higher Set Operations

 An ordered pair (a,b), is pair of elements listed in a way that the order matters,
that is (x,y) ≠ (y,x)when x≠y
 The Cartesian product of sets A and B is A×B = {(a,b)|a∈ A, b∈ B}.
 |A×B| = |A|×|B|
 A×B×C= {(a,b,c)| a∈ A b∈ B, c∈ C}. The elements in this set are called ordered
triples.
 A1×A2... ×An = {a1∈ A1, a2∈ A2, ..., an∈ An}. The elements in this set are called n-
tuples.
 A string is a sequence of characters where order matters.
o the set of characters used in a string are called the alphabet
o the number of characters in a string is called the length of the string.
 A binary string consists of two characters: zeros and ones. That is, the alphabet
is {0,1}. Each character in a binary string is called a bit. Binary strings can be of
different lengths and are called n- bit strings if they are of length n.
 The empty string λ is a string of length 0.
 Concatenation- joining strings together to make a new string.
 Two sets are disjoint if A ∩ B = ∅
 Pairwise disjoint sets -each pair in a sequence of sets is disjoint.
 A partition of a non-empty set A is a collection of nonempty sets whose union is
all of A and each pair in the collection is pairwise disjoint.

Back to Table of contents


Overview of Functions
 A function is a set of ordered pairs whose first coordinate has only one second
coordinate. In set notation it can be expressed as: {(x,y)| x∈ X, y∈ Y such that for
each there is only one y∈ Y}.
 Function notation is expressed as f: X → Y, read as f maps x to y or f(x) = y
o X is called the domain = the set of all possible inputs
o Y is called the target set or the codomain= the set a function maps into
o The range is the subset of the target set (codomain) and consists of all
mapped points: range of f = {y| (x,y)∈ f}.
 Two functions f, g are equivalent if f(x) = g(x) for every x in their shared domain.
 The floor function 𝑓(𝑥)=⌊𝑥⌋ assigns real numbers to the largest integer at or
below it.
 The ceiling function 𝑓(𝑥)=⌈𝑥⌉ assigns real numbers to the smallest integer at
or above it.
 A function f: X → Y is injective or one-to-one if x 1 ≠ x 2 implies that f( x 1) ≠ f( x 2).
Alternately, f is injective if f( x 1) = f( x 2) implies x 1 = x 2
 A function f: X → Y is surjective or onto if the range of f is equal to the target Y.
That is, for every y ∈ Y, there is an x ∈ X such that f(x) = y.
 A function is bijective if it is both injective and surjective. A bijective function is
called a bijection. A bijection is also called a one-to-one correspondence.
 A function f: X → Y is invertible if there exists a function g with domain Y and
range X with the property f(x) = y ⇔ g(y) = x.
 Only bijective functions have inverses.
 The inverse of 𝑓 is obtained by exchanging the first and second entries in each
pair in 𝑓. The inverse of 𝑓 is denoted by f −1.
 The inverse of a bijective function 𝑓:𝑋→𝑌 is a function f −1:𝑌→𝑋 that maps y
back to the x such that 𝑓(𝑥)=𝑦. That is, if (𝑥,𝑦)∈𝑓 then (𝑦,𝑥)∈ f −1.
 The domain of 𝑓 is the range of f −1 and the range of 𝑓 is the domain of f −1.
 To algebraically solve for an inverse, use the following algorithm:
o Replace 𝑓(𝑥) with 𝑦
o Interchange 𝑥 and 𝑦
o Solve for 𝑦.
o Replace 𝑦 with f −1(𝑥)

Back to Table of contents


Functions- Composition and Applications
 Composition is the process of applying a function to the result of another
function.
 The composition of 𝑔 with 𝑓 is denoted 𝑔∘𝑓.
 If 𝑓:𝑋→𝑌,𝑔:𝑌→𝑍, then (𝑔∘𝑓): 𝑋→ 𝑍 is the composition of 𝑓 and 𝑔 where
(𝑔∘𝑓)(𝑥)=𝑔(𝑓(𝑥))
 Generally, (𝑔∘𝑓)(𝑥)≠(𝑓∘𝑔)(𝑥)
 The identity function 𝑓:𝑋→𝑋 maps x values to themselves. That is, 𝑓(𝑥) = 𝑥
for all 𝑥∈𝑋
 Composition is associative, so the order in which one composes the functions
does not matter.
The exponential function denoted exp b: 𝑅 →𝑅+ is defined as exp b x=b . More
x

commonly, it is written as 𝑓(𝑥)=b x or 𝑦=b x .

 The inverse function to the exponential is the logarithmic function.


 The log function is denoted log b:𝑅+→𝑅 expressed as log b x= y , where 𝑏 > 0, 𝑏 ≠
1
 The relationship between the exponential function and the logarithmic function
can be expressed as y=b x ⇔ log b y=x .
 A function is strictly increasing on an interval if 𝑓(𝑥) > 𝑓(𝑦) whenever 𝑥 > 𝑦
for all 𝑥, 𝑦 in the interval.
 A function is strictly decreasing on an interval if 𝑓(𝑥) < 𝑓(𝑦) whenever 𝑥 > 𝑦
for all 𝑥, 𝑦 in the interval.
 The exponential and the logarithmic function are both strictly increasing
functions.

Back to Table of contents


Binary Relations and Directed Graphs
 Binary Relation- is a subset R of the product of two sets. Given sets A and B,
for a ∈ A and b ∈ B, (a, b) ∈ R is denoted aRb. The set A is called the domain of
the binary relation
 Properties of Relations
o The relation R is reflexive if for every x ∈ A, xRx.
o The relation R is anti-reflexive if for every x ∈ A, it is not true that xRx.
Alternately, R is anti-reflexive if there exists an x ∈ A for which xRx is not
true
o The relation R is transitive if for every x, y, z ∈ A, xRy and yRz imply that
xRz.
o The relation R is symmetric if for every x, y ∈ A, xRy implies that yRx.
o The relation R is anti-symmetric if for every x, y ∈ A, xRy and yRx imply
that x = y. Alternatively, R is anti-symmetric if for every x,y ∈ A, x ≠ y
implies that xRy is not true or that yRx it is not true.
 Directed graph (digraph) – a set of vertices together with a set of directed
edges of which is associated with an ordered pair of vertices.
 Degree – the number of edges incident with v
o In degree (digraph) – the number of edges with v as their terminal vertex
o Out degree (digraph) – the number of edges with v as their initial vertex
 Self-loop – an edge connecting a vertex with itself.
 Walk – a walk from u to v in an undirected graph is a sequence of alternative
vertices and edges that starts and ends with a vertex.
o Length of a walk – the number of edges in the walk
o Open walk – a walk in which the first and last vertices are not the same.
o Closed walk – a walk in which the first and last vertices are the same.
 Trail – an open walk in which no edge occurs more than once.
 Circuit – a closed walk in which no edge occurs more than once.
 Path – a trail in which no vertex occurs more than once.
 Cycle – a circuit of length at least 1 in which no vertex occurs more than once
(except the first and last vertices which are the same)

Back to Table of contents


Order Relations
 A relation, R, on a set A is a partial order relation if it is transitive, reflexive, and
anti-symmetric. Specifically, aRb is notated by a ⪯ b and is read "a is at most b."
 The domain of a partially ordered set (poset) is denoted by (A, ⪯).
 Comparable elements of a poset are two elements, x and y, such that x ⪯ y or
y ⪯ x. Otherwise, x and y are incomparable.
 A total order is a partial order relation where every two elements in the domain
are comparable.
 A maximal element is a vertex where on a directed graph, the only arrows out of
them are to themselves or none.
 A minimal element is a vertex where on a directed graph, the only arrows into
them are from themselves or none.
 In a Hasse diagram, each element is shown by a labeled point. However, unlike
digraphs, Hasse diagrams have very few edges - only lines depicting relative
precedence of the elements. In Hasse diagrams, self-loops are removed, and the
transitive and reflexive properties are assumed.
 To create a Hasse diagram, use the following rules:
o If x ⪯ y, then make the x element appear lower in the diagram than y.
o If x ⪯ y and there is no z where x ⪯ z or z ⪯ y, then draw a segment
connecting x and y.
 Relations with strict order have transitive and anti-symmetry properties, but they
are not reflexive.
 The symbol used to show a strict order relation is ≺. The domain is denoted by
(A, ≺).
 Directed acyclic graphs (DAG) are directed graphs with no positive length
cycles.
 A DAG can be used to represent a strict order.
Back to Table of contents
N-ary Relations
 An equivalence relation has all three of the following properties: symmetry,
reflexive, and transitive. An equivalence relation, R, is denoted as a ~ b for aRb.
 An equivalence relation is easy to spot when shown as a directed graph: each
vertex has a self- loop.
 An equivalence class is denoted by [a] and is defined to be the set of all x ∈ A
such that a ~ x, given A is the domain of an equivalence relation and a is also an
element of A.
 According to the structure of equivalence relations theorem, two equivalence
classes are either identical or completely different (disjoint).
 The set of all distinct equivalence classes of set A is called a partition of the set
A.
 Pairwise disjoint sets have no intersection of any of the sets.
 A relation on multiple sets, say A1 , A2 , A3 , ..., An is a subset of A1 x A2 x A3 x ... x
An . Each element of the relation is an n-tuple in which a particular element, say
the jth entry in the n-tuple is Aj .
 A relational database stores a large collection of records as relations.
 An attribute describes the type of data found in each entry of an n-tuple.
 A query to a relational database is just a request for a particular piece or pieces
of data.
 A key is an attribute (or set of attributes) which provides a unique identity for
each n-tuple in the database.
 The projection operation is denoted by Project [list of attributes]. This operation
yields a list which is a subset of the attributes in an n-tuple (deleting all other
attributes before the output is displayed). Also, the final step of the operation is to
merge any duplicate instances of the subset output.

Back to Table of contents

You might also like