Finished Description of Auxiliary Sample method.

This commit is contained in:
Aaron Huber 2020-08-13 12:45:18 -04:00
parent fe1cd90a14
commit 44e314db13

View file

@ -56,5 +56,39 @@ Before proceeding to describe the approximation algorithm, let us intrduce notat
Let $\expresstree{\smb}$ be the set of all possible polynomial expressions equivalent to $\smb$. Call the input polynomial $\polytree$, and note that $\polytree \subseteq \expresstree{\smb}$ and need not be of the standard monomial basis. Refer to the expanded SOP form of $\poly$ as $\expandtree$, which is the SOP form of $\poly$ such that all coefficients $c_i$ are in the set $\{-1, 1\}$, thus relaxing the distinct monomial requirement of the standard monomial basis. Denote $\abstree$ as the resulting polynomial when all monomial coefficients of $\polytree$ are converted to positive coefficients, and then $\polytree$ itself is converted to the standard monomial basis.
\subsection{Monomial Sample Algorithm}
\subsubsection{Description}
\subsubsection{Psuedo Code}
\subsubsection{Correctness}
\subsubsection{Run-time Analysis}
\subsection{Sampling Algorithm}
Auxiliary algorithm \textit{Sample} performs the brunt of the work in \textit{Monomial Sample}. \textit{Sample} takes $\polytree$ as input and performs the equivalent of outputting a sample $\randvar_i$ such that $\randvar_i \sim Uniform(S)$, where $S$ represents the set of monomials in $\expandtree$. While one cannot compute $\expandtree$ in time less than $O(N^k)$, the algorithm uses a technique on $\polytree$ which produces a uniform sample from $\expandtree$.
\subsubsection{Description}
Auxiliary algorithm \textit{Sample} performs the brunt of the work in \textit{Monomial Sample}. \textit{Sample} takes $\polytree$ as input and performs the equivalent of outputting a sample $\randvar_i$ such that $\randvar_i \sim Uniform(S)$, where $S$ represents the multiset of monomials in $\expandtree$. While one cannot compute $\expandtree$ in time better than $O(N^k)$, the algorithm uses a technique on $\polytree$ which produces a uniform sample from $\expandtree$ without ever materializing $\expandtree$.
The input $\polytree$ can be seen as an expression tree, with leaf nodes being the variables of $\polytree$ and inner nodes being the polynomial operations of $+$ or $\times$. For clarity, consider when $\polytree = (x_1 + x_2)(x_1 - x_2) + x_2^2$. The expression tree for $\polytree$ would look like $+\left(\times\left(+\left(x_1, x_2\right), +\left(x_1, -x_2\right)\right), \times\left(y, y\right)\right)$.
\AH{A tree diagram would work much better, but to do that it appears that I need to spend time learning the tikz package, which I haven't had time for yet.}
\textit{Sample} first computes $\abstree(1,\ldots, 1)$ in $O(|\poly|)$ time. Note, that $\abstree(1,\ldots, 1)$ is indeed the sum of coefficients in $\abstree$, or equivalently the number of terms in $\expandtree$.
In one pass, \textit{Sample} recursively visits nodes, where it performs the following operations. Given a leaf node, \textit{Sample} stores the coefficient $c_i$ absolute value, denoted $|c_i|$. When \textit{Sample} stops at a $+$ node, it memoizes the probabilities proportional to the partial values of the subtree children of the parent $+$ node. For the case when \textit{Sample} encounters an inner $\times$ node, the partial values of both subtree children are multiplied.
For the running example, after the first pass, \textit{Sample} would have learned to sample the two children of the root $+$ node with $P\left(\times\left(+\left(x_1, x_2\right), +\left(x_1, -x_2\right)\right)\right) = \frac{4}{5}$ and $P\left(\times\left(x_2, x_2\right)\right) = \frac{1}{5}$. Similarly, the two inner $+$ nodes of the root's left child, call them $+_1$ and $+_2$, using $l$ for left child and $r$ for right child are $P_{+_1}(l) = P_{+_1}(r) = P_{+_2}(l) = P_{+_2}(r) = \frac{1}{2}$. Note that in this example, the sampling probabilities for the children of each inner $+$ node are equal to one another because both parents have the same number of children, and, in each case, the children of each parent $+$ node share the same $|c_i|$.
\textit{Sample} then uniformly selects a monomial from $\expandtree$ by the following recursive method. For each leaf node, the monomial is returned with a coefficient reduced to either $\{-1, 1\}$ depending on its sign. For a parent $+$ node, a subtree is chosen over the previously computed weighted sampling distribution. When a parent $\times$ node is visited, the monomials are combined into one monomial. The algorithm concludes outputting $sign(c_i)\cdot\prob^{d_i}$.
\subsubsection{Psuedo Code}
\subsubsection{Correctness}
\subsubsection{Run-time Analysis}
%Next, \textit{Sample} uses that information to compute a weighted sampling distribution over $\polytree$ that is the equivalent to sampling uniformly over $\expandtree$. In the recent example, setting $S_1 = +\left(x_1, x_2\right)$, $S_2 = +\left(x_1, -x_2\right)$, and $S_3 = \times\left(x_2, x_2\right)$, it is the case that $S_1(x_1) = 1$, $S_1(x_2) = 1$, $S_2(x_1) = 1$, $S_2(x_2) = 1$, and $S_3(x_2) = 1$, where we overload notation to also view $S_i$ as a function whose input is the set of variables, and whose output is the coefficient for the input variable of $S_i$. The weighted distribution for each monomial term $M$ in $\expandtree$ is then $\frac{S_i(x_j)}{\abstree(1,\ldots, 1)}$.
%
%Sample then uses that weighted distribution to sample
%
%When \textit{Sample} encounters a $+$ node, it \textit{chooses} one of the subtree children with probability proportional to the partial values of the subtree children. For the case that \textit{Sample} encounters a $\times$ node, both subtree partial values are multiplied