-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
646 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
+++ | ||
title = "A Library of Languages" | ||
author = ["Houjun Liu"] | ||
draft = false | ||
+++ | ||
|
||
## PERFECT-MATCHING {#perfect-matching} | ||
|
||
Given a bipartite graph \\(G = \qty(U,V,E)\\), is there a perfect matching (a one to one correspondence between \\(U\\) and \\(V\\) nodes)? | ||
|
||
This is in both [NP]({{< relref "KBhnon_polynomial_time.md" >}}) and [coNP]({{< relref "KBhconp.md" >}}) | ||
|
||
But, [PERFECT-MATCHING](#perfect-matching) is in \\(P\\) | ||
|
||
|
||
### NP trivial {#np-trivial} | ||
|
||
I hand you the matching | ||
|
||
|
||
### Not Hall's Theorem {#not-hall-s-theorem} | ||
|
||
**Sufficient**: Suppose \\(S \subseteq U\\), consider \\(N\qty(S) \subseteq V\\), the [neighborhood]({{< relref "KBhstructure_learning.md#local-graph-search" >}}) of \\(S\\) is \\(|N(s)|< |S|\\), then there is no perfect matching. | ||
|
||
Sketch: suppose for contradiction there _is_ a matching, but there would be not enough space to assign everyone in \\(S\\) a deduplicated match. | ||
|
||
|
||
### Hall's Theorem {#hall-s-theorem} | ||
|
||
**Necessary**: if \\(G = \qty(U, V, E)\\) has no perfect matching, then such an \\(S\\) from [Not Hall's Theorem](#not-hall-s-theorem) must exist. | ||
|
||
|
||
## PRIMES {#primes} | ||
|
||
"very prime has a succinct certificate" | ||
|
||
\begin{equation} | ||
\text{PRIMES} : \qty {A \mid A\text{ is prime}} | ||
\end{equation} | ||
|
||
The certificate? | ||
|
||
\begin{equation} | ||
A \text{ prime} \Leftrightarrow \exists 1 < b < A : B, B^{2}, \dots, B^{A\*2} \not \cong \ \text{mod}\ A | ||
\end{equation} | ||
|
||
So \\(\text{PRIMES} \in \text{NP}\\) | ||
|
||
|
||
## FACTORING {#factoring} | ||
|
||
\begin{equation} | ||
\text{FACTORING} = \qty {X, A, B \mid \text{X has a prime factor $\in [A,B]$}} | ||
\end{equation} | ||
|
||
\\(\text{FACTORING} \in NP\\) certificate: just give the prime factor | ||
|
||
\\(\text{FACTORING} \in \text{coNP}\\) certificate: give the prime factorization of \\(X\\); verifier check that these numbers do multiply to \\(x\\), check that none of these numbers are in \\([A,B]\\) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
+++ | ||
title = "interpolation" | ||
author = ["Houjun Liu"] | ||
draft = false | ||
+++ | ||
|
||
[nyquist limit]({{< relref "KBhsu_engr76_apr302024.md#lossless-sampling" >}}) is great and all, but I really don't want to wait for all \\(T\\) to be able to sample all the necessary terms to solve for every \\(a\_{j},b\_{j}\\) before we can reconstruct our signal. | ||
|
||
So, even if we got our sequence of \\(\frac{1}{2B}\\) length of points, we need an alternative way to reconstruct the signal as we go. | ||
|
||
One way to reconstruction via interpolation is just to connect the dots; however, this is bad because it creates sharp corners. | ||
|
||
|
||
## In General {#in-general} | ||
|
||
Suppose you have a sampling period length \\(T\_{s}\\): | ||
|
||
\begin{equation} | ||
\hat{x}(t) = \sum\_{m=0}^{\infty} X\qty(mT\_{s}) F\qty( \frac{t-mT\_{s}}{T\_{s}}) = x(0) F \qty(\frac{t}{T\_{s}}) + x(T\_{s}) f\qty(\frac{t-T\_{s}}{T\_{s}}) + \dots | ||
\end{equation} | ||
|
||
where \\(F(t)\\) is some interpolation function such that: | ||
|
||
\begin{equation} | ||
\begin{cases} | ||
F(0) = 1 \\\\ | ||
F(k) = 0, k \in \mathbb{Z} \backslash \\{0\\} | ||
\end{cases} | ||
\end{equation} | ||
|
||
Notice the above is a [convolution]({{< relref "KBhconvolution.md" >}}) between \\(X\\) and \\(F\\), where \\(y\\) is fixed as a multiple \\(m\\) around \\(mT\_{s}\\) and the convolution is centered at \\(\frac{t}{T\_{s}}\\). | ||
|
||
However, because we are finite valued, we just slide a window around and skip around. | ||
|
||
|
||
### Consider now \\(\hat{x}\\) at \\(kT\_{s}\\) {#consider-now-hat-x-at-kt-s} | ||
|
||
\begin{align} | ||
\hat{x}(kT\_{s}) &= \sum\_{m=0}^{\infty} X(mT\_{s}) F \qty(\frac{kT\_{s}- mT\_{s}}{T\_{s}}) \\\\ | ||
&= \sum\_{m=0}^{\infty} X(mT\_{s}) F \qty(k-m) | ||
\end{align} | ||
|
||
now, recall that \\(F\\) is \\(0\\) for all non-zero integers, so each term will only be preserved once, precisely at \\(m = k\\). Meaning: | ||
|
||
\begin{align} | ||
\hat{x}(kT\_{s}) &= \sum\_{m=0}^{\infty} X(mT\_{s}) F \qty(k-m) \\\\ | ||
&= X(kT\_{s}) 1 \\\\ | ||
&= X(kT\_{s}) | ||
\end{align} | ||
|
||
so this is why we need \\(F(k) = 0, k \in \mathbb{Z} \backslash \\{0\\}\\) | ||
|
||
|
||
## Zero-Hold Interpolation {#zero-hold-interpolation} | ||
|
||
Choose \\(F\\) such that: | ||
|
||
\begin{equation} | ||
F = \begin{cases} | ||
1, \text{if}\ |x| < \frac{1}{2} \\\\ | ||
0 | ||
\end{cases} | ||
\end{equation} | ||
|
||
|
||
## Infinite-Degree Polynomial Interpolation {#infinite-degree-polynomial-interpolation} | ||
|
||
\begin{equation} | ||
F(t) = (1-t) (1+t) \qty(1- \frac{t}{2}) \qty(1+ \frac{t}{2}) \dots = \text{sinc}(t) = \frac{\sin(\pi t)}{\pi t} | ||
\end{equation} | ||
|
||
This is the BEST interpolation; this is because it will be stretched such that every zero crossing matches eat \\(mT\_{s}\\), meaning we will recover a sum of sinusoids. | ||
|
||
This gives a **smooth signal**; and if sampling was done correctly with the [nyquist limit]({{< relref "KBhsu_engr76_apr302024.md#lossless-sampling" >}}), interpolating with [sinc interpolation](#infinite-degree-polynomial-interpolation) will give you your original signal. | ||
|
||
|
||
### Shannon's Nyquist Theorem {#shannon-s-nyquist-theorem} | ||
|
||
Let \\(X\\) be a [Finite-Bandwidth Signal]({{< relref "KBhsu_engr76_apr252024.md#finite-bandwidth-signal" >}}) where \\([0, B]\\) Hz. | ||
|
||
if: | ||
|
||
\begin{equation} | ||
\hat{X}(t) = \sum\_{m=0}^{\infty} X(mTs) \text{sinc} \qty( \frac{t-mTs}{Ts}) | ||
\end{equation} | ||
|
||
where: | ||
|
||
\begin{equation} | ||
\text{sinc}(t) = \frac{\sin \qty(\pi t)}{\pi t} | ||
\end{equation} | ||
|
||
- if \\(Ts < \frac{1}{2B}\\), that is, \\(fs > 2B\\), then \\(\hat{X}(t) = X(t)\\) (this is a STRICT inequality!) | ||
- otherwise, if \\(Ts > \frac{1}{2B}\\), then \\(\hat{X}(t) \neq X(t)\\), yet \\(\hat{X}(mTs) = X(mTs)\\), and \\(\hat{X}\\) will be bandwidth limited to \\([0, \frac{fs}{2}]\\). | ||
|
||
This second case is callled "aliasing", or "strocoscopic effect". | ||
|
||
--- | ||
|
||
Alternate way of presenting the same info: | ||
|
||
\begin{equation} | ||
\hat{X}(t) = \sum\_{m=0}^{\infty} X(mTs) \text{sinc} \qty( \frac{t-mT\_{s}}{T\_{s}}) | ||
\end{equation} | ||
|
||
Let \\(X(t)\\), as before, be a continuous-time, bandwidth limited, signal with [Bandwidth]({{< relref "KBhsu_engr76_apr252024.md#bandwidth" >}}) \\(B\\); let \\(\hat{X}(t)\\) be the reconstruction of this signal with samples taken apart by \\(T\_{s} < \frac{1}{2B}\\); then \\(\hat{X}(t) = X(t)\\). Otherwise, if \\(T\_{s} > \frac{1}{2B}\\), then the reconstruction \\(\hat{X}(t) \neq X(t)\\), but the samples at \\(mT\_{s}\\) will still match (that is, \\(X(m T\_{s}) = \hat{X}(m T\_{s})\\)) and \\(\hat{X}(t)\\) will be a [Baseband Signal]({{< relref "KBhsu_engr76_may022024.md#passband-signal" >}}) whose spectrum is limited by \\([0, \frac{\frac{1}{T\_{s}}}{2}] = [0, \frac{F\_{s}}{2}]\\). This second case is callled "aliasing", or "strocoscopic effect". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
+++ | ||
title = "NP intersect coNP" | ||
author = ["Houjun Liu"] | ||
draft = false | ||
+++ | ||
|
||
\\(\text{NP} \cap \text{coNP}: \forall x \in \qty {0,1}^{\*}, \exists\\) short, efficiently checkable proof of BOTH \\(x\\) presence/absence in \\(L\\) | ||
|
||
|
||
## some examples {#some-examples} | ||
|
||
- in P: [PERFECT-MATCHING]({{< relref "KBha_library_of_languages.md#perfect-matching" >}}) | ||
- in P: [PRIMES]({{< relref "KBha_library_of_languages.md#primes" >}}) | ||
- **we don't know if this is in \\(P\\)**: [FACTORING]({{< relref "KBha_library_of_languages.md#factoring" >}}) | ||
... if it was, much of cryptography will break |
Oops, something went wrong.