midterm Flashcards
counting two disjoint events A and B
add the possibilities of A with B
disjoint events A and B
A or B are possible
counting possibilities of A and B, where the ordering matters
multiply the possibilities A by possibilities of B
How many ways are there to order n elements? =
Permutations of n elements
=> n!
How many ways are there to choose an ordered set of k elements from a set of n possible elements?
Permutations of k elements with n choices
=> n! / (n - k)!
permutation <-> combination
ordering matters <-> ordering doesn’t matter
How many subsets of size k does a set with n elements have?
= possible subsets
n over k = n! / k!(n - k)!
edge e incident on u and v =>
between u and v
simple undirected graph
at most one edge between every pair of vertices
at most one edge in each direction
a vertex cannot have edges to itself
cannot have more edges than there are other vertices
degree in undirected graph
num of neighbours
degree sequence
degrees in decreasing order
complete graph
undirected simple graph in which there is an edge between every pair of vertices
denoted by Kn
Handshaking lemma
The number of vertices with an odd degree in an undirected graph is even.
number of possible bijections between 2 isomorphic graphs
n!
How do we prove if two graphs are not isomorphic?
If the size of vertex sets, edge sets, or the degree sequence are not the same, we know with certainty that the two graphs are not isomorphic.
Every (undirected) graph with minimum degree at least 2 contains a
cycle
Connectivity in undirected graph G is an equivalence relation, which means it is:
Reflexive: ∀u ∈ V (G), u is connected to itself.
Symmetric: ∀u, v ∈ V (G), u is connected to v =⇒ v is connected to u.
Transitive: ∀u, v, w ∈ V (G), u is connected to v and v is connected to w⇒u is connected to w.
connected component
a maximal connected subgraph, that is a subgraph that is not strictly contained in another connected subgraph of G
forest
(possibly disconnected) undirected graph with no cycles
tree
an undirected connected graph with no cycles
spanning subgraph
a subgraph obtained only by edge deletions, i.e. the vertex set is the entire vertex set of G
S the set of deleted edges
=> denoted by G\S
theorem spanning forest
Every graph G has a spanning subgraph that is a forest. If G is connected then this spanning subgraph is a tree, called a spanning subtree.
induced subgraph
if there is an edge in G between u,v ∈ V′, then it should also be included in any induced subgraph
What can we say about the structure of induced subgraphs of Kn?
What is a subgraph of Kn that is not induced?
Any induced subgraph of ( K_n ) for ( k ) vertices will be a complete graph, denoted as ( K_k ). This is because all edges connecting the selected vertices are present in ( K_n )
A non-induced subgraph can be formed by selecting vertices but omitting some edges
theorem average degree
Every graph with average degree at least 2k, for a positive integer k, has an induced subgraph with minimum degree at least k + 1.
What is the space complexity of the adjacency-list of a graph with n vertices and m edges?
Array Adj has size n and each list Adj[v] has size deg(v). So the total number of elements in the list is therefore 2m (by handshaking lemma), and space complexity is O(m + n)
What is the time-complexity of checking if (u,v) ∈ E?
To check if v is a neighbour of u, we have to scan the list Adj(u), which takes O(deg(u)) time.