paper-BagRelationalPDBsAreHard/exact.tex

55 lines
2.9 KiB
TeX

% -*- root: main.tex -*-
\section{Exact Results}
\label{sec:exact}
We turn to computing the exact values of $\sum\limits_{\wVec \in \pw } \sketchJParam{\sketchHashParam{\wVec}} \cdot \sketchPolarParam{\wVecPrime}.$ Starting with the term $\gIJ = \sum\limits_{\wVecPrime \in \pw}\sketchPolarParam{\wVecPrime}$, by the definition of $\sketchPolar$ and the property of associativity in addition, we can break the sum into
\begin{equation*}
\gIJ = \sum_{\substack{\wVecPrime \in \pw \st\\
\sketchPolarParam{\wVecPrime} = 0}} 1 + \sum_{\substack{\wVecPrime \in \pw \st\\
\sketchPolarParam{\wVecPrime} = 1}} -1.
\end{equation*}
Setting the terms to $T_1 = \sum_{\substack{\wVecPrime \in \pw \st\\
\sketchPolarParam{\wVecPrime} = 0}} 1$ and $T_2 = \sum_{\substack{\wVecPrime \in \pw \st\\
\sketchPolarParam{\wVecPrime} = 1}} -1$ and fixing $\buck$ to a specific value, gives a system of linear equations for each term. It is a known result for a consistent multiplication that the number of solutions are $| \kDom |^{\numTup - rank(\matrixH')}$. This gives us an exact calculation for both terms,
\begin{align*}
T_1 \in \{0, 2^{\numTup - rank(\matrixH')}\},\\
T_1 \in \{0, 2^{\numTup - rank(\matrixH')}\}.
\end{align*}
\subsection{Algorithm for $\gIJ$}
\begin{algorithmic}
\If {$\matrixH' \cdot \wVec = j^{(0)}$ is consistent}
\If {$\matrixH' \cdot \wVec = j^{(1)}$ is consistent}
\State $\gIJ = 0$
\Else
\State $\gIJ = 2^{\numTup - computeRank(\matrixH')}$
\EndIf
\ElsIf{$\matrixH' \cdot \wVec = \buck^{(1)}$ is consistent}
\State $\gIJ = 2^{\numTup - computeRank(\matrixH')}$
\Else
$\gIJ = 0$
\EndIf.
\end{algorithmic}
For examining the first term of equation \eqref{eq:allWorlds-est}, we fix $\kMap{t}$ to be defined as
\begin{equation*}
\kMapParam{\wVec} = \begin{cases}
1,&\text{if } w_t = 1\\
0, &\text{otherwise}.
\end{cases}
\end{equation*}
Therefore, by definition we have
\begin{equation*}
\sum_{\wVec \in \pw}\sketchJParam{\sketchHashParam{\wVec}} = \sum_{\wVec \in \pw}\kMapParam{\wVec}\sketchPolarParam{\wVec},
\end{equation*}
and using the same argument as in $\gIJ$ yields
\begin{equation*}
\sum_{\wVec \in \pw \st \sketchPolarParam{\wVec} = 0}\kMapParam{\wVec} - \sum_{\wVec \in \pw \st \sketchPolarParam{\wVec} = 1}\kMapParam{\wVec}.
\end{equation*}
Setting $T_3 = \sum_{\wVec \in \pw \st \sketchPolarParam{\wVec} = 0}\kMapParam{\wVec}$, $T_4 = \sum_{\wVec \in \pw \st \sketchPolarParam{\wVec} = 1}\kMapParam{\wVec}$,
\begin{equation*}
T_3 = | \{\wVec \st \matrixH \cdot \wVec = \buck^{(0)}, \kMapParam{\wVec} = 1\}\rightarrow T_3 \in [0, 2^{\numTup - rank(\matrixH')}]
\end{equation*}
\begin{equation*}
T_4 = | \{\wVec \st \matrixH \cdot \wVec = \buck^{(1)}, \kMapParam{\wVec} = 1\}\rightarrow T_4 \in [0, 2^{\numTup - rank(\matrixH') - 1}]
\end{equation*}
\AH{Next: define the algorithm for initialization of $\sketchJParam{\sketchHashParam{\wVec}}$}