update notations and fix typos

This commit is contained in:
Zheyuan Wu
2025-02-25 20:41:35 -06:00
parent 419ea07352
commit 27bff83685
71 changed files with 920 additions and 430 deletions

View File

@@ -96,7 +96,7 @@ We wait for $R$ times and then take the stairs. In worst case, we wait for $R$ t
Competitive ratio = $\frac{2R}{R}=2$.
EOP
QED
Let's try $R=S-E$ instead.
@@ -116,7 +116,7 @@ We wait for $R=S-E$ times and then take the stairs.
Competitive ratio = $\frac{S-E+S}{S}=2-\frac{E}{S}$.
EOP
QED
What if we wait less time? Let's try $R=S-E-\epsilon$ for some $\epsilon>0$
@@ -174,7 +174,7 @@ The optimal offline solution: In each subsequence, must have at least $1$ miss.
So the competitive ratio is at most $k+1$.
EOP
QED
Using similar analysis, we can show that LRU is $k$ competitive.
@@ -184,7 +184,7 @@ Split the sequence into subsequences such that each subsequence LRU has $k$ miss
Argue that OPT has at least $1$ miss in each subsequence.
EOP
QED
#### Many sensible algorithms are $k$-competitive
@@ -210,7 +210,7 @@ So competitive ratio is at most $\frac{ck}{(c-1)k}=\frac{c}{c-1}$.
_Actual competitive ratio is $\sim \frac{c}{c-1+\frac{1}{k}}$._
EOP
QED
### Conclusion
@@ -297,7 +297,7 @@ Let $P$ be a page in the cache with probability $1-\frac{1}{k}$.
With probability $\frac{1}{k}$, $P$ is not in the cache and RAND evicts $P'$ in the cache and brings $P$ to the cache.
EOP
QED
MRU is $k$-competitive.
@@ -317,4 +317,4 @@ Let's define the random variable $X$ as the number of misses of RAND MRU.
$E[X]\leq 1+\frac{1}{k}$.
EOP
QED

View File

@@ -161,7 +161,7 @@ $ISET(G,k)$ returns true if $G$ contains an independent set of size $\geq k$, a
Algorithm? NO! We think that this is a hard problem.
A lot of people have tried and could not find a poly-time solution
A lot of pQEDle have tried and could not find a poly-time solution
### Example: Vertex Cover (VC)

View File

@@ -154,7 +154,7 @@ This is a valid assignment since:
- We pick either $v_i$ or $\overline{v_i}$
- For each clause, at least one literal is true
EOP
QED
Claim 2: If $\Psi$ is satisfiable, then Subset Sum has a solution.
@@ -174,7 +174,7 @@ Say $t=\sum$ elements we picked from $S$.
- If $q_j=2$, then $z_j\in S'$
- If $q_j=3$, then $y_j\in S'$
EOP
QED
### Example 2: 3 Color
@@ -228,13 +228,13 @@ For each dangler color is connected to blue, all literals cannot be blue.
...
EOP
QED
Direction 2: If $G$ is 3-colorable, then $\Psi$ is satisfiable.
Proof:
EOP
QED
### Example 3:Hamiltonian cycle problem (HAMCYCLE)

View File

@@ -153,7 +153,7 @@ Summing over all vertices, the total number of crossing edges is at least $\frac
So the total number of non-crossing edges is at most $\frac{|E|}{2}$.
EOP
QED
#### Set cover
@@ -264,7 +264,7 @@ So $n(1-\frac{1}{k})^{|C|-1}=1$, $|C|\leq 1+k\ln n$.
So the size of the set cover found is at most $(1+\ln n)k$.
EOP
QED
So the greedy set cover is not too bad...
@@ -350,4 +350,4 @@ $$
So the approximation ratio for greedy set cover is $H_d$.
EOP
QED

View File

@@ -296,7 +296,7 @@ If $c'\geq 8c$, then $T(n)\leq c'n\log n+1$.
$E[T(n)]\leq c'n\log n+1=O(n\log n)$
EOP
QED
A more elegant proof:
@@ -345,5 +345,5 @@ E[X]&=\sum_{i=0}^{n-2}\sum_{j=i+1}^{n-1}\frac{2}{j-i+1}\\
$$
EOP
QED