I use this blog to store the notes I have collected throughout my time learning computer science. Feel free to browse and comment
Given $$ a_{n+1} - 1.5a_n = 0$$
Rearrange equation so $$ a_{n+1} = 1.5a_n$$
then we can see that $$ a_{n+2} = 1.5a_{n+1} = 1.5 * 1.5 * a_{n}$$
so the unique solution is $$ a_{n} = 1.5^n * a_0 $$
Given an equation such as $$ a_n = 2a_{n-1} + 3a_{n} \quad a_0 = 1 \quad a_1 = 2 $$
Substitute $$ a_n = cr^n $$
so the equation becomes $$ cr^n = 2cr^{n-1} + 3cr^{n-2} $$
the key part is to divide both sides by $$ cr^{n - lowest exponent} $$
in this case its 2, it becomes $$ r^2 - 2r - 3 = 0 $$
move terms to one side rearrange and find the root $$ (r+1)(r-3) = 0 $$
with r = -1 and r = 3, general equation for second order homogenous solution is $$ a_n=A3^n+B(-1)^n $$
solve for A and B by using initial information $$ a_1 = 1 \quad a_0 = 0 $$
we get
The solution is thus
g(n) of is
g(n) of is
g(n) of is
Formula for (fraction, n) and (negative, n) follows the form
for (negative, n) this simplies to
Coefficient extraction is used to solve recurrence relations, and find combinatoric sums , amongsts other things.
There are several rules we can follow
graph is a collection of vertices, V, and edges E.
if G is a connected graph. G has a Euler circuit if the circuit traverses every edge of the graph exactly once.
it’s a Euler trail if it’s open and traverse every edge once.
be a connected graph or multigraph, G has a Eulerian circuit IFF every vertex of G has even degree.
Corollary be a connected graph or multigraph. G has an Eulerian Trail IFF G has exactly two vertices of odd degree.
This is a path/cycle (so no repeat vertice) that traverses all the vertices exactly once in the graph.
finding a hamilton path is NP complete, meaning there is no known algorithm that can find the solution in an appropriate amount of time.
Necessary and Sufficient p is true IFF q is true. Acing the test is necessary and sufficient for getting 100% on a test.
Necessary But Not Sufficient Steering well is necessary for driving well, but not sufficient , because you need to follow traffic rules, not hit pedestrians, etc.
/ and /
This is a sufficient condition for a graph to admit a Hamilton cycle.
/ This is another sufficient condition for having a HP
given a bipartite graph organize by set V1 and set V2 . There needs to be |V1| = |v2| for there to be a hamilton cycle
Proof - For each edge [a, b] in graph G, the edge countributes a count of 1 to deg(a) and deg(b) respectively.
consequently, for each edge, it contributes 2 to the sum of total degrees. Thus 2|E| accounts for deg(v), for all v in vertices.
This is a graph where each vertex shares the same degrees. if deg(v) = k for all vertices v, then the graph is call k-regular.
if G is a k-regular graph, then
If two graphs G1, and G2 are isomorphic, then there is a function f that is bijective, and f maps an edge E1 to E2.
one can transform G1 into G2 by relabelling the vertice of G1 with the labels of vertices of G2 (AKA preserving adjacencies)
Planar graph is a graph that can be drawn without intersecting edges. Each planar graph have planar embedding which are different variations of planar graph
Kuratowsk Theorem says a graph is a planar IFF if it does not contain a subgraph of subdivision
Faces are regions in a planar graph. we can think of faces as regions closed off by a cycle within the graph. note not every cycle of G forms a face
states $$ faces = 2 + edges - vertices $$
two binary sequences of w and w’ have distance 1 if they differ in a single position.
Hypercubes have strings as vertices, and edges if two strings differ by distance 1
The distance between two vertices is the shortest path between the two
two binary sequence w, and w’ of length n, the hamming distance is the number of positions in the string where they are different.
Define a w to be a minimal walk from x - y, so it is also the shortest.
theres two cases for w . A.) either w has a repeated vertex, or B.) it does not.
for case
the key is to note that the maximum edges a graph can have is given by the complete graph of vertices v. ie. (v, 2) edges.
then its a matter of rearranging the formula of (v,2) to get v(v-1)/2
We should remember the property Sum of all degrees = 2 * total edges of a graph.
a k+1 regular graph would also have the properties of a k regular graph. so if k regular graph has a k walk, the k+1 graph would also have it.
in a induction proof, when we have establish a base case, an induction hypothesis, and we are proofing for n+1, it may be sufficient to just draw a graph n abstractly, namely, we dont care about whether its bipartite, complete, or whatever.