Discrete Math Final Review

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/104

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

105 Terms

1
New cards

Multiplicative Inverse of a

ā

2
New cards

How to find Inverse

1) Use Euclids and stop at 1

2) Rewrite in terms of 1

3) Take a’s coefficient mod m (if negative, +m)

3
New cards

Chinese Remainder Theorem

x = a1M11+ a2M22 + a3M33 mod M

4
New cards

What is M?

m1*m2*m3

5
New cards

What is Mi?

other m’s multiplied

6
New cards

What is M̅i?

Mi mod mi

7
New cards

Fermat’s Little Theorem

ap = a mod p

8
New cards

Induction

1) Basis Step: Prove p(b) is true
2) IH: p(k) is true for arbitrary k ≥ b
3) Inductive Step: Prove p(k) => p(k+1) is true

9
New cards

Well Ordering Principle

Every nonempty set of natural numbers has a smallest element.

10
New cards

Strong Induction

1) Basis Step: Prove p(b) is true

2) Strong IH: p(j) is true for b ≤ j ≤ k
3) Inductive Step: Prove p(b) ∧ p(b+1) ∧ … ∧ p(k) => p(k+1) is true

11
New cards

Recursive Definition

1) Basis Definition: f(0), the first element. Ex: a0 = 0
2) Recursive Definition: defines f(n). Ex: an = an-1 + 1

12
New cards

Structural Induction

1) Basis Step: Prove the property is true for the basis element of the recursive definition.
2) IH: Assume the property holds for RHS of recursive def.

3) Inductive Step: Prove the property for an

13
New cards

Σ

Alphabet

14
New cards

String

Sequence of characters from Σ

15
New cards

Σ*

Finite String; can be defined recursively

16
New cards

ℓ(w) where w is a string

Length of string w

17
New cards

λ

Empty string “ ”, ℓ(λ) = 0, always an element of Σ*

18
New cards

Product Rule

A procedure contains 2 tasks. n1 ways to do 1st task, n2 ways to do 2nd task; total ways: n1 * n2

19
New cards

Subtraction Rule

Task can be done in n1 or n2 non-disjoint ways, total ways: n1 + n2 - # of ways in common

20
New cards

Sum Rule

Task can be done in n1 or n2 disjoint ways, total ways: n1 + n2

21
New cards

Division Rule

n ways to do a task, each equivalent to d ways, total ways: n/d

22
New cards

Pigeonhole Principle

Place n objects into k boxes, 1 box has at least ⌈n/k⌉

23
New cards

Permutations

Set of ordered arrangements of all elements of a set; n! permutations for n elements

24
New cards

r-permutations

Ordered arrangement of only r ≤ n elements of a set of size n.

25
New cards

P(n, r)

n!/(n-r)!

26
New cards

r-combination

Unordered selection of r elements from a set of size n.

27
New cards

C(n,r)

n!/(n-r)!r!

28
New cards

Binomial Theorem

(x+y)n = Σ r = 0 to n, C(n,r) * xn-ryr

29
New cards

Permutation with Indistinguishable Objects

n!/(n1!*n2!*…*nk!) where n1 … nk are separate indistinguishable objects

30
New cards

Stars and Bars

N desired → N stars, k types → k - 1 bars

31
New cards

Stars and Bars formula

(bars+stars)!/(bars!stars!)

32
New cards

Linear Recurrence Form

an = c1an-1 + c2an-2 + … + ckan-k

33
New cards

Characteristic Equation

rk = c1rk-1 + c2rk-2

34
New cards

General Solution for Unique Roots

an = α1(root1)n + α2(root2)n

35
New cards

Master’s Theorem for the form T(n) = aT(n/b) + cnd

1) logba = d → Θ(ndlogn)

2) logba > d → Θ(nlogba)

or 3) logba < d → Θ(nd)

36
New cards

Inclusion-Exclusion

1) | A ∪ B | = |A| + |B| - |A ∩ B|
2) | A ∪ B ∪ C | = |A| + |B| + |C| - |A ∩ B| - |A ∩ C| - |B ∩ C| + |A ∩ B ∩ C|

37
New cards

Derangement

A permutation where no element is left in its starting position.

38
New cards

Relation R

From set A → set B, a subset of A x B. Every element in A can map as to many elements in B.

39
New cards

Matrix Representation of Relation

row = A’s elements, col = B’s elements. If a pair exists, place a 1. Otherwise, 0.

40
New cards

Reflexive R: A → A

∀a ∈ A((a,a) ∈ R); every element is related to itself. Matrix diagonal = 1.

41
New cards

Symmetric R: A → A

∀a, b∈ A((a,b) ∈ R <=> (b,a) ∈ R); if a relates to b, then b relates to a. Mij = Mji

42
New cards

Asymmetric R: A → A

∀a, b∈ A((a,b) ∈ R ∧ (b,a) ∈ R => a = b); if a and b mutually relate, then a = b. If Mij = 1, then Mji = 0 if i ≠ j

43
New cards

Transitive R: A → A

∀a, b, c ∈ A((a,b) ∈ R ∧ (b,c) ∈ R => (a,c) ∈ R); if a relates to b and b relates to c, then a relates to c.

44
New cards

Composition of Relations R1: A → B and R2: B → C

R2 ∘ R1 relates A to C such that ∀x ∈ A, y ∈ B, z ∈ C ((x,y) ∈ R1 ∧ (y,z) ∈ R2 <=> (x,z) ∈ R2 ∘ R1)

45
New cards

Reflexive Relation Graph Representation

A loop

46
New cards

Symmetric Relation Graph Representation

Every edge has an anti-parallel edge

47
New cards

Asymmetric Relation Graph Representation

Anti-parallel edges DNE

48
New cards

Transitive Relation Graph Representation

If a path can be followed from point a to c, then an arrow directly from a to c is present.

49
New cards

Closure of a Relation with Respect to Property P

Add the least amount of elements to the current relation to satisfy P (reflexive, symm, anti-symm, transitive)

50
New cards

Equivalence Relation

Reflexive, transitive, and symmetric. a ~ b

51
New cards

Partial Ordering

Reflexible, transitive, and anti-symmetric. a ≤ b (curvy ≤)

52
New cards

Set Partition

Collection of disjoint subsets A1, A2, … An ⊆ S where
1) Ai ≠ Ø ∀i; all subsets are nonempty
2) Ai ∩ Aj = Ø; all subsets are disjoint from each other
3) A1 ∪ A2 ∪ … ∪ An = S; union all subsets to get the set

53
New cards

Graph G = (V, E)

V: set of vertices, E: set of edges

54
New cards

{}

Undirected edges

55
New cards

()

Directed edges

56
New cards

Multiedge

The same edge repeats

57
New cards

Simple Graph

A graph with NO loops or multiedges

58
New cards

Multigraph

Every graph that’s NOT a simple graph.

59
New cards

Incident

The edge {u, v} is incident to u and v

60
New cards

Adjacent

u and v are adjacent if {u, v} ∈ E

61
New cards

Neighborhood

The set of all vertices adjacent, N(a): neighborhood of a

62
New cards

Simple Graph Degree

deg(v) = size of neighborhood

63
New cards

Multigraph Degree

deg(v) = the # of edge incident. for each loop, +2

64
New cards

Handshaking Lemma for Undirect Graphs

Sum of the degree of all vertices = 2|E|

65
New cards

Directed Graph

Each edge has an orientation. (a,b) ≠ (b,a)

66
New cards

In-degree

Number of edges ending at v, deg-(v)

67
New cards

Out-degree

Number of edges starting at v, deg+(v)

68
New cards

Total Degree of v for a Directed Graph

deg-(v) + deg+(v)

69
New cards

Handshaking Lemma for Directed Graph

|E| = sum of in-degree = sum of out-degree

70
New cards

General Solution for Identical Roots

an = α1(root1)n + nα2(root2)n

71
New cards

Complete Graph Kn

Simple undirected graph with an edge between every 2 vertices.

72
New cards

Cycle on Vertices Cn

A cycle from the starting vertex that also ends there.

73
New cards

|E| for Complete Graph

n(n-1)/2 where n = number of vertices

74
New cards

|E| for Cycle

n where n = number of vertices

75
New cards

Bipartite Graph

Vertices can partition into 2 disjoint sets, V1 and V2

76
New cards

No odd cycles =>

Graph is bipartite

77
New cards

Complete Bipartite Km,n

|V1| = m, |V2| = n, with all possible edges between V1 and V2

78
New cards

|E| for Complete Bipartite

m * n where m = |V1| and n = |V2|

79
New cards

Subgraph of G = (V,E)

H = (W,F) where W ⊆ V and F ⊆ E

80
New cards

Induced Subgraph

H = (W,F) such that W ⊆ V and F has all edges between vertices in W

81
New cards

Proper Subgraph

H ⊂ G, they are never equal.

82
New cards

Adjacency List

For each vertex, list their adjacent vertices.

83
New cards

Size of Adjacency List

|V| + 2|E|

84
New cards

Adjacency Matrix

Vertices in row and column. 1 f the vertices are adjacent. 0 otherwise.

85
New cards

Size of Adjacency Matrix

|V|2

86
New cards

Undirected Adjacency Matrix Characteristic

Symmetric

87
New cards

Directed Adjacency Matrix Characteristic

Not symmetric

88
New cards

Tree

Connected undirected graph with no simple cycles

89
New cards

Rooted Tree

1 vertex is designed as the root

90
New cards

m-ary Tree

Every internal vertex has at most m children

91
New cards

Full m-ary Tree

Every internal vertex has exactly m children

92
New cards

Tree of n vertices =>

n-1 edges

93
New cards

If A graph has n vertices and |E| ≥ n =>

The graph has a cycle

94
New cards

Level of vertex v

The number of edges from the root to v

95
New cards

Balanced m-ary Tree

Every leaf’s level = h or h-1

96
New cards

For a height h m-ary tree, how many leaves at most?

mh leaves

97
New cards

For a height h m-ary tree, what is the relationship between h, m, and ℓ?

h ≥ ⌈logm

98
New cards

For a height h FULL m-ary tree, what is the relationship between h, m, and ℓ?

h = ⌈logm

99
New cards

Spanning Tree

Subgraph tree with all vertices from the original graph.

100
New cards

Pre-order Tree Traversal

Print as you visit