Added some comments

This commit is contained in:
Atri Rudra 2019-06-27 23:55:45 -04:00
parent 24cc338697
commit 636bf877ee
3 changed files with 29 additions and 11 deletions

View file

@ -8,6 +8,7 @@ We begin the analysis by showing that with high probability an estimate is appro
The first step is to show that the expectation of the estimate of a tuple t's membership across all worlds is $\numWorldsSum$.
\AR{While the analysis below is correct, the way it is stated it seems to `come out of the blue.' I would recommend that you re-structure the argument below as follows. First argue that $\expect{\sketch[i][\sketchHash[\wVec]]\cdot s_i[\wVec]}=v_t[\wVec]$. From this the claim below just follows by linearity of expectation but this result is a good thing for the reader to realize. Also instead of summing over $j\in [B],\wVec|h_i[\wVec]=j,\wVec'|h_i[\wVec']=j$ it would be better to just write it as sum over all $\wVec,\wVec'\in W\text{ s.t. }h_i[\wVec]=h_i[\wVec']$-- the latter is bit more compact and it is easier to comprehend as well.}
\begin{align}
&\expect{\estimate}\\
=&\expect{\estExpOne}\\
@ -29,6 +30,8 @@ The first step is to show that the expectation of the estimate of a tuple t's me
=& \estExp \label{eq:estExpect}
\end{align}
\AR{A general comment: The last display equation should have a period at the end. The idea is that display equations are considered part of a sentence and every sentence should end with a period.}
For the next step, we show that the variance of an estimate is small.$$\varParam{\estimate}$$
\begin{align}
@ -41,12 +44,13 @@ For the next step, we show that the variance of an estimate is small.$$\varParam
\sketchHashParam{\wVec_2} = \sketchHashParam{\wVecPrime_2}
}}\kMapParam{\wVec_1} \cdot \kMapParam{\wVec_2}\cdot\sketchPolarParam{\wVec_1}\cdot\sketchPolarParam{\wVec_2}\cdot\sketchPolarParam{\wVecPrime_1}\cdot\sketchPolarParam{\wVecPrime_2} }\label{eq:var-sum-w}
\end{align}
\AR{The $-\mu^2$ term is missing in the above.}
Note that four-wise independence is assumed across all four random variables of \eqref{eq:var-sum-w}. Zooming in on the inner products of the $\sketchPolar$ functions,
\begin{equation}
\polarProdEq \label{eq:polar-product}
\end{equation}
it can be seen that for $\wOne, \wOneP \in \pw$ and $\wTwo, \wTwoP \in \pw'$, all four random variables in \eqref{eq:polar-product} take their values from $\pw$, although we have iteration over two separate sets $\pw$. Thus, there are four possible sets of $\wVec$ variable combinations, namely:
it can be seen that for $\wOne, \wOneP \in \pw$ and $\wTwo, \wTwoP \in \pw'$, all four random variables in \eqref{eq:polar-product} take their values from $\pw$, although we have iteration over two separate sets $\pw$.\AR{I do not know what you mean by ``iteration"} Thus, there are four possible sets of $\wVec$ variable combinations, namely:
\begin{align*}
&\distPattern{1}:&\forElems{\cOne}&\\
&\distPattern{2}:&\forElems{\cTwo}& \textit{*} \\
@ -55,8 +59,9 @@ it can be seen that for $\wOne, \wOneP \in \pw$ and $\wTwo, \wTwoP \in \pw'$, al
&\distPattern{5}:&\forElems{\cFive}&
\end{align*}
$$\text{ }^*\textit{(and all variants of the respective pattern)}$$
\AR{Two comments on the notation above. You should define the sets exactly-- i.e. you should not put a $*$ on some of the definitions. Second, it is not immediately clear why the above cover all the cases, so you should argue that is the case. I think it is easier to argue this is you argue in terms of number of inequalities in the possible $\binom{4}{2}=6$ comparisons-- note you probably should not write down all the 6 comparisons since that would be cumbersome: just use it in your argument.}
We are interested in those particular cases whose expecation does not equal zero, since an expectation of zero will not add to the summation of \eqref{eq:var-sum-w}. In expectation we have that
We are interested in those particular cases whose expectation does not equal zero, since an expectation of zero will not add to the summation of \eqref{eq:var-sum-w}. In expectation we have that
\begin{align}
\forAllW{\distPattern{1}}&\rightarrow\expect{%\sum_{\substack{\elems \\
%\st \cOne}}
@ -74,6 +79,7 @@ We are interested in those particular cases whose expecation does not equal zero
%\st \cFive}}
\polarProdEq} = 0 \nonumber
\end{align}
\AR{You should argue why each of the equalities above. While we might decide to drop the arguments in the submitted paper when we are working things out, it is better to write down all the arguments. This is the best way to spot bugs in a proof. Otherwise, it is easy to introduce bugs by not checking for things that are ``obvious."}
Only equations \eqref{eq:polar-prod-all} and \eqref{eq:polar-prod-two-and-two} influence the $\var$ computation.
Considering $\distPattern{1}$ the variance results in
@ -87,14 +93,18 @@ For the distribution pattern $\cTwo$, we have three variants to consider.
&\vCase{2}:&\cTwoV{\wOne}{\wTwo}{\wOneP}{\wTwoP}\\
&\vCase{3}:&\cTwoV{\wOne}{\wTwoP}{\wOneP}{\wTwo}
\end{align*}
\AR{Again you should be defining sets and not variants. E.g. you could have defined the subsets $S_{21},S_{22},S_{23}$.}
When considered separately, the variants have the following $\var$.
\begin{align}
\cTwo&= \variantOne \label{eq:variantOne}\\
\cTwoV{\wOne}{\wTwo}{\wOneP}{\wTwoP}&=\variantTwo \label{eq:variantTwo}\\
\cTwoV{\wOne}{\wTwoP}{\wOneP}{\wTwo}&=\variantThree\label{eq:variantThree}
\end{align}
\AR{You should again argue each of the claimed equalities above. Actually in the second equality, the term $|h_i[\wVec]=h_i[\wVec']|$ should really be $|\{\wVec'|h_i[\wVec]=h_i[\wVec']\}|$. Also this change needs to be propagated.}
Note that at the start of the analysis of $\var$, the second term (expectation \eqref{eq:estExpect} squared) of the $\var$ calculation was not considered. This is because it is cancelled out by \eqref{eq:distPatOne} and \eqref{eq:variantOne}.
\AR{Also while I do like the use of macros, I think you have gone over-board in the other direction. It is good to create macros for symbols/variables names that you will use frequently but using macros for entire expressions is not a good idea. Among others, it makes it really hard for others to read it since they have to refer back to your macro definition each time they see it.}
Note that at the start of the analysis of $\var$, the second term (expectation \eqref{eq:estExpect} squared) of the $\var$ calculation was not considered. \AR{You should {\bf not} start with a {\em wrong} expression and then later on correct it. Start off with the correct expression in the first place: otherwise it just creates more confusion.} This is because it is canceled out by \eqref{eq:distPatOne} and \eqref{eq:variantOne}.
\begin{equation*}
\big(\estExp\big)^2 = \distPatOne + \variantOne
\end{equation*}
@ -105,12 +115,14 @@ With only \eqref{eq:variantTwo} and \eqref{eq:variantThree} remaining, we have
\variantTwo ~+ \\
\variantThree
\end{multline*}
\AR{The expectations are missing on the RHS. And this needs to be propagated.}
Converting terms into their space requirements yields
\begin{align}
&\variantTwo \Rightarrow\numWorldsP \cdot \frac{\numWorlds}{\sketchCols} - 1\label{eq:spaceOne}\\
&\variantThree \Rightarrow \numWorldsP \cdot \frac{\numWorldsP - 1}{\sketchCols}\label{eq:spaceTwo}
\end{align}
\AR{Again, argue why the above claims are true.}
\eqref{eq:spaceOne} and \eqref{eq:spaceTwo} further reduce to
\begin{equation}
\frac{2^{2N}(\prob + \prob^2)}{\sketchCols} - \numWorlds(\frac{\prob}{\sketchCols} + \prob)\label{eq:variance}
@ -127,6 +139,7 @@ Since the sketch has multiple trials, a probability of exceeding error bound $\e
\begin{equation*}
\cheby.
\end{equation*}
\AR{It would be better to state the deviation as say $\Delta$ instead of $\epsilon\mu$. Then derive the expression for $B$ in terms of $N,p,\Delta$. Then you can state as consequences what values of $B$ you get for the special cases of $\Delta=\epsilon\cdot 2^N$ and $\Delta=\epsilon\mu$.}
Substituting $\mu\epsilon$ for $k\sd$ and solving for $\sketchCols$ results in
\begin{align*}
&k\cdot\sdEq = \mu\epsilon\\

View file

@ -102,7 +102,7 @@
\newcommand{\SF}[1]{\todo[inline]{\textbf{Su says:$\,$} #1}}
\newcommand{\OK}[1]{\todo[inline]{\textbf{Oliver says:$\,$} #1}}
\newcommand{\AH}[1]{\todo[inline]{\textbf{Aaron says:$\,$} #1}}
\newcommand{\AR}[1]{\todo[inline]{\textbf{Atri says:$\,$} #1}}
\newcommand{\AR}[1]{\todo[inline, color=green]{\textbf{Atri says:$\,$} #1}}
%\newcommand{\comment}[1]{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -444,3 +444,6 @@
%%% mode: latex
%%% TeX-master: "attrprov"
%%% End:
%%%Adding stuff below so that long chain of display equatoons can be split across pages
\allowdisplaybreaks

View file

@ -2,20 +2,22 @@
\section{Notation}
\label{sec:notation}
The following notation is used to reason about the sketching of world membership for a given tuple. We denote the set of all possible worlds as $\pw$. A given sketch $\sketch$ can be viewed as an $\sketchRows \times \sketchCols$ matrix, i.e. a matrix with $\sketchRows$ rows and $\sketchCols$ columns. Each row of $\sketch$ is an estimation of the of $\kDom$ frequency for the given tuple represented by $\sketch$ across all possible worlds.
The following notation is used to reason about the sketching of world membership for a given tuple. We denote the set of all possible worlds as $\pw$. A given sketch $\sketch$ can be viewed as an $\sketchRows \times \sketchCols$ matrix, i.e. a matrix with $\sketchRows$ rows and $\sketchCols$ columns. Each row of $\sketch$ is an estimation of the of $\kDom$ frequency for the given tuple represented by $\sketch$ across all possible worlds. \AR{Nitpick: the claim in the last sentence is only true at initialization. If you add/mult the vector (via aggregates) then the claim is no longer true.}
\AR{In this section, the notations $\sketchHash{i}$ and $\sketchPolar{i}$ in this section are messed up.}
To facilitate binning the $\kDom$ values for a given world $\wVec$, each row has two pairwise independent hash functions $\sketchHash{i}:\pw \to [B]$ and $\sketchPolar{i}:\pw \to \{-1,1\}$, where all functions are independent of one another. Finally, the function $\kMap{t}$ defined as $\kMap{t} : \{0, 1\}^\numTup \rightarrow \kDom$ is used to determine the tuple's $\kDom$ annotation for a given world.
\AR{I do not like this notation. I prefer vectors being typeset in bold, i.e. $\mathbf{w}$. $\wVec$ is good for writing on the board but it is more standard to bold vectors in linear algebra. Also the $\kDom$ values are not binned by $\sketchHash{i}$ but the actual $\wVec$s are.}
\AH{Done.}
%\AR{I do not like this notation. I prefer vectors being typeset in bold, i.e. $\mathbf{w}$. $\wVec$ is good for writing on the board but it is more standard to bold vectors in linear algebra. Also the $\kDom$ values are not binned by $\sketchHash{i}$ but the actual $\wVec$s are.}
%\AH{Done.}
%for each $i, j \in \sketchRows \text{ s.t. } i \neq j, \sketchHash{i}$ is independent of $\sketchHash{j}$ and $\sketchPolar{i}$ is independent of $\sketchPolar{j}$. Thus each row can be viewed as an independent estimation.
\AR{While in general I'm a fan of using English to define things, one of the exceptions if when you are defining a function. It would be better to explicit state that $\sketchHash{i}:W\to [B]$ and $\sketchPolar{i}:W\to \{-1,1\}$. Of course for these definitions you need to define $W$ upfront.}
\AH{Done}
%\AR{While in general I'm a fan of using English to define things, one of the exceptions if when you are defining a function. It would be better to explicit state that $\sketchHash{i}:W\to [B]$ and $\sketchPolar{i}:W\to \{-1,1\}$. Of course for these definitions you need to define $W$ upfront.}
%\AH{Done}
When a world value $\wVec$'s $\kDom$ value is updated, it's $\kDom$ value is first retrieved via $\kMap{t}$ and then multiplied by the output of the $i^{th}$ row's polarity function $\sketchPolar{i}$. The resulting computation is then added to the current value contained in the bin mapping. Formally:
$$\sketch[\sketchHash{i}(\wVec)] ~+=~ \sketchPolar{i}(\wVec) \times \kMap{t}(\wVec)$$
When a world $\wVec$'s $\kDom$ value is updated, it's $\kDom$ value is first retrieved via $\kMap{t}$ and then multiplied by the output of the $i^{th}$ row's polarity function $\sketchPolar{i}$. The resulting computation is then added to the current value contained in the bin mapping. Formally:
$$\sketch[i][\sketchHash{i}(\wVec)] ~+=~ \sketchPolar{i}(\wVec) \times \kMap{t}(\wVec)$$
\AR{It would also be good to state what the value in $\sketch[i][j]$ is after the initialization with the function $v_t$ is done.}
When referring to Tuple Independent Databases (TIDB), a database $\relation$ contains $\numTup$ tuples, with $\numWorlds$ possible worlds $\pw$. $\pw$ is denoted as $\{0, 1\}^\numTup$, where a specific world $\wVec$ is defined as $\wVec \in \{0, 1\}^\numTup$.