proof format updates using gfm

This commit is contained in:
Trance-0
2025-08-29 15:51:24 -05:00
parent 3fd0a59837
commit 7bc7206604
11 changed files with 195 additions and 52 deletions

View File

@@ -82,7 +82,8 @@ Let's try $R=S$.
Claim: The comparative ratio is $2$.
Proof:
<details>
<summary>Proof</summary>
Case 1: The optimal offline solution takes the elevator, then $T+E\leq S$.
@@ -96,13 +97,14 @@ We wait for $R$ times and then take the stairs. In worst case, we wait for $R$ t
Competitive ratio = $\frac{2R}{R}=2$.
QED
</details>
Let's try $R=S-E$ instead.
Claim: The comparative ratio is $max\{1,2-\frac{E}{S}\}$.
Proof:
<details>
<summary>Proof</summary>
Case 1: The optimal offline solution takes the elevator, then $T+E\leq S$.
@@ -116,7 +118,7 @@ We wait for $R=S-E$ times and then take the stairs.
Competitive ratio = $\frac{S-E+S}{S}=2-\frac{E}{S}$.
QED
</details>
What if we wait less time? Let's try $R=S-E-\epsilon$ for some $\epsilon>0$
@@ -162,7 +164,8 @@ Cache: $D A C$, the evict $D$ for $B$. 1 miss.
Claim: LRU is $k+1$-competitive.
Proof:
<details>
<summary>Proof</summary>
Split the sequence into subsequences such that each subsequence contains $k+1$ distinct blocks.
@@ -174,7 +177,7 @@ The optimal offline solution: In each subsequence, must have at least $1$ miss.
So the competitive ratio is at most $k+1$.
QED
</details>
Using similar analysis, we can show that LRU is $k$ competitive.
@@ -184,8 +187,6 @@ Split the sequence into subsequences such that each subsequence LRU has $k$ miss
Argue that OPT has at least $1$ miss in each subsequence.
QED
#### Many sensible algorithms are $k$-competitive
**Lower Bound**: No deterministic online algorithm is better than $k$-competitive.
@@ -196,7 +197,8 @@ QED
Say $c=2$. LRU cache has twice as much as cache. LRU is $2$-competitive.
Proof:
<details>
<summary>Proof</summary>
LRU has cache of size $2k$.
@@ -210,7 +212,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}}$._
QED
</details>
### Conclusion
@@ -273,7 +275,8 @@ Claim: RAND is $k$-competitive.
2. There exists $k$ pages each of which is in the cache with probability $1-\frac{1}{k}$
3. All other pages are in the cache with probability $0$.
Proof:
<details>
<summary>Proof</summary>
By induction.
@@ -297,11 +300,12 @@ 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.
QED
</details>
MRU is $k$-competitive.
Proof:
<details>
<summary>Proof</summary>
Case 1: Access MRU page.
@@ -317,4 +321,4 @@ Let's define the random variable $X$ as the number of misses of RAND MRU.
$E[X]\leq 1+\frac{1}{k}$.
QED
</details>