2019-07-15 11:59:08 -04:00
% -*- root: main.tex -*-
\section { Exact Results}
\label { sec:exact}
2019-07-16 10:42:17 -04:00
We turn to computing the exact values of
\begin { equation}
\sum \limits _ { \wVec \in \pw } \sketchJParam { \sketchHashParam { \wVec } } \sketchPolarParam { \wVec } =
\sum \limits _ { \wVec \in \pw } \kMapParam { \wVec } \sketchPolarParam { \wVec }
\sum _ { \substack { \wVecPrime \in \pw \st \\
\sketchHashParam { \wVec } = \sketchHashParam { \wVecPrime } } } \sketchPolarParam { \wVecPrime } \label { eq:exact-results} .
\end { equation}
Starting with the latter term $ \gIJ = \sum \limits _ { \wVecPrime \in \pw } \sketchPolarParam { \wVecPrime } $ , by the definition of the image of $ \sketchPolar $ and the property of associativity in addition, we can break the sum into
2019-07-15 11:59:08 -04:00
\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*}
2019-07-16 10:42:17 -04:00
Setting the terms to $ T _ 1 = \sum \limits _ { \substack { \wVecPrime \in \pw \st \\
\sketchPolarParam { \wVecPrime } = 0} } 1$ and $ T_ 2 = \sum \limits _ { \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 matrix multiplication that the number of solutions are $ | \kDom |^ { \numTup - rank(\matrixH ')} $ , where $ \kDom $ is the set being considered. This gives us an exact calculation for both terms,
2019-07-15 11:59:08 -04:00
\begin { align*}
2019-07-16 10:42:17 -04:00
T_ 1 = |\{ \wVec \st \matrixH ' \cdot \wVec = \buck ^ { (0)} \} |\rightarrow T_ 1 \in \{ 0, 2^ { \numTup - rank(\matrixH ')} \} ,\\
T_ 2 = |\{ \wVec \st \matrixH ' \cdot \wVec = \buck ^ { (1)} \} |\rightarrow T_ 2 \in \{ 0, 2^ { \numTup - rank(\matrixH ')} \} ,
2019-07-15 11:59:08 -04:00
\end { align*}
2019-07-16 10:42:17 -04:00
where the notation $ \jpbit { y } $ denotes the polarity bit $ \lenB $ value of the $ \buck $ bucket identifier, specifically $ \buck ( b ) $ , such that $ \buck ( b ) \in \{ 0 , 1 \} $ .
2019-07-15 11:59:08 -04:00
\subsection { Algorithm for $ \gIJ $ }
\begin { algorithmic}
2019-07-19 10:41:14 -04:00
\ForAll { $ \wVec \in \pw $ }
\If { $ \sketchHashParam { \wVec } = \buck $ }
\If { $ \sketchPolarParam { \wVec } = 1 $ }
\State $ \gIJ + = 1 $
2019-07-15 11:59:08 -04:00
\Else
2019-07-19 10:41:14 -04:00
\State $ \gIJ - = 1 $
2019-07-15 11:59:08 -04:00
\EndIf
2019-07-19 10:41:14 -04:00
\EndIf
\EndFor .
2019-07-15 15:37:20 -04:00
\end { algorithmic}
2019-07-19 10:41:14 -04:00
%Non-general algorithm
%\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
% \State $\gIJ = 0$
%\EndIf.
%\end{algorithmic}
2019-07-16 10:42:17 -04:00
For examining the first term of equation \eqref { eq:exact-results} , we fix $ \kMap { t } $ to be defined as
2019-07-15 15:37:20 -04:00
\begin { equation*}
\kMapParam { \wVec } = \begin { cases}
1,& \text { if } w_ t = 1\\
0, & \text { otherwise} .
\end { cases}
\end { equation*}
2019-07-16 10:42:17 -04:00
%Therefore, by definition we have
%\begin{equation*}
%\sum_{\wVec \in \pw}\sketchJParam{\sketchHashParam{\wVec}} = \sum_{\wVec \in \pw}\kMapParam{\wVec}\sketchPolarParam{\wVec},
%\end{equation*}
Using the same argument as in $ \gIJ $ yields
2019-07-15 15:37:20 -04:00
\begin { equation*}
\sum _ { \wVec \in \pw \st \sketchPolarParam { \wVec } = 0} \kMapParam { \wVec } - \sum _ { \wVec \in \pw \st \sketchPolarParam { \wVec } = 1} \kMapParam { \wVec } .
\end { equation*}
2019-07-16 10:42:17 -04:00
Setting $ T _ 3 = \sum \limits _ { \wVec \in \pw \st \sketchPolarParam { \wVec } = 0 } \kMapParam { \wVec } $ , $ T _ 4 = \sum \limits _ { \wVec \in \pw \st \sketchPolarParam { \wVec } = 1 } \kMapParam { \wVec } $ gives an exact calculation for each term given a fixed $ \buck $ :
2019-07-15 15:37:20 -04:00
\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*}
2019-07-16 10:42:17 -04:00
\subsection { Algorithm for Initialization}
\begin { algorithmic}
2019-07-19 10:41:14 -04:00
\ForAll { $ \wVec \in \pw \st \kMapParam { \wVec } = 1 $ }
\State $ \sketchJParam { \sketchHashParam { \wVec } } = \sketchPolarParam { \wVec } $
2019-07-16 10:42:17 -04:00
\EndFor .
2019-07-19 10:41:14 -04:00
\end { algorithmic}
%Non-generic Algorithm
%\begin{algorithmic}
%\ForAll{$\wVec \st \kMapParam{\wVec} = 1$}
% \State $\buck = \matrixH' \cdot \wVec$
% \If{$\buck(\lenB) = 0$}
% \State $\sketchIj += 1$
% \Else
% \State$\sketchIj -= 1$
% \EndIf
%\EndFor.
%\end{algorithmic}