CSI 2101 - final

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/43

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

44 Terms

1
New cards

S = xd+xd-1+…+x0 evaluated

S = (xd+1 - 1)/(x-1)

2
New cards

S = 1x + 2x + … + nx evaluated

S = an3 + bn2 + cn + d

3
New cards

order of growth

1 < logn < sqrt(n) < n < n * logn < n2 < n3 < 2n < 3n < n!

4
New cards

Big-Oh

a function f is big-oh of another function of g if there exists a constant C>0 such that g is greater than f for any sufficiently large input. with limits, the limit of x approaching infinity of f/g should be less than infinity

5
New cards

big-oh facts

the big-oh of any n within a logarithmic function (eg log(n5)) is logn

6
New cards

big-theta

a function f is big-theta of g if f is O(g) and g is O(f). with limits, the limit of x approaching infinity of f/g is between 0 and infinity

7
New cards

big-theta facts

the log of any polynomial in n is big theta of logn. logn is big theta of ln n

8
New cards

little-oh

a function f is little-oh of another function g if for EVERY constant c>0, f< c*g. with limits, the limit as x approaches infinity of f/g is 0

9
New cards

little-oh facts

  • if f is o(g) it’s also O(g)

  • na is o(nb) if a<b

  • Bn is o(Cn) if 0<B<C

  • for all a,b > 0, log(n)a is o(nb)

  • for a>0 and B>1, na is o(Bx)

10
New cards

unfolding recurrences

expand a recurrence and spot the pattern. if f(n-1) is the inner term, the steps it takes to get from f(n-1) in the function to f(1) is n-1. if f(n//2) is the inner term, the steps it takes to get from f(n/2) in the function to f(1) is logn

11
New cards

homogenous linear function

you can turn a recurrence of form f(n) = Af(n-1) + Bf(n-2) into an equation of the form f(n) = s*xn + t*xn by transforming the recurrence into x2= Ax + B and solving for x using the quadratic formula and solving for s and t with f(0) and f(1)

12
New cards

injective

for a function f:X→Y, it’s injective if every element in X has a distinct Y. This means |Y|>=|X|

13
New cards

surjective

a function f: X → Y is surjective if every element in Y is mapped by some x. surjective implies |X|>=|Y|

14
New cards

bijective

a function is bijective if it is both surjective and injective. it implies |X|=|Y|

15
New cards

the division rule

if f:X→Y is k-to-1 then |Y|=|X|/k

16
New cards

generalized pigeonhole principle

for every pair of sets where |X|>k*|Y|, for any function f:X→Y, there exists k+1 elements mapped to the same value of Y

17
New cards

calculating the number of k-sized subsets of S where order doesn’t matter

(1,2)=(2,1) use (n k) = n!/(k!(n-k)!)

18
New cards

degrees and edges relationship

the sum of all degrees of vertices is equal to twice the amount of edges

19
New cards

bipartite graph

a graph whose vertices can be partitioned into two groups such that each edge has a vertex in each partition

20
New cards

facts about bipartite graphs

  • the sum of degree in each partition is equal

  • cannot have a cycle of odd length

  • a graph whose edges are the unions of two matchings is bipartite

21
New cards

matching

a subset of edges such that no edges share a vertex

22
New cards

perfect matching

a matching that covers all vertices. can only exist if theres an even number of matchings

23
New cards

hall’s theorem

there exists a perfect matching in a bipartite graph only if for every subset of vertices the number of neighbours of those vertices is greater than the number of vertices

24
New cards

stable matching

a matching of a ranked graph with no rogue couples

25
New cards

gale-shapley algorithm

for a complete ranked bipartite graph where the partitions, M and W, have an equal number of vertices, each element in M proposes to the most preferable element in W that has not rejected M. When an element in W receives two proposals, it rejects the one from the least desirable M. This creates a stable matching

26
New cards

Gale Shapley Facts

  • for every m,w, if w rejects m then they are not part of ANY stable matching

  • elements of W will end in a couplle with an m that is more or equally as desirable as its first proposal

27
New cards

connected

a graph is connected if there is a path between every vertex

28
New cards

connected component

a subgraph where all vertices are connected to a given vertex

29
New cards

forest

a graph with no cycles

30
New cards

tree

a connected forest

31
New cards

forest facts

  • every forest has |V|-|E| connected components

  • in a tree, |V|=|E|+1

  • every connected graph has a spanning tree

32
New cards

digraph

a directed graph where edge (u,v) does not equal edge (v,u)

33
New cards

topological sort

the ordering of all vertices in a digraph so that for evefy edge (u,v) u comes before v in the order

34
New cards

topological sort facts

  • if there is a cycle a topological sort isn’t possible

  • a sink is at the end of a top sort, a vertex with no outgoing edges

35
New cards

DAG

acyclic digraph

36
New cards

parallel scheduling

a type of topological sort that denotes the latest each vertex could occur

37
New cards

parallel scheduling facts

for every dag, if the longest path has length L then the longest the parallel scheduling can be is L+1

38
New cards

antichain

a subset with no edges

39
New cards

antichain facts

a dag of n vertices has a path of length >=L or an antichain of size >= n/L

40
New cards

vertex disjoint

a collection of paths is vertex disjoint if each vertex in the collection only appears oncein any path of the collection.

41
New cards

switching network

a network where for every pairing of source and sink there exists a vertex-disjoint collection of paths from each source to sink

42
New cards

how to build up a benes network

splits the vertices you’re connecting edges to into two groups, top and bottom. your first two sources will connect to the same vertices, the topmost vertex in top group and the bottom group. continue the pattern for the next two sources. to connect your sinks, do the same but with incoming edges instead of outgoing.

43
New cards

1+2+3+4+…+n

(n(n+1))/2

44
New cards

log rules

log(a/b)= log(a)-log(b)