Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
ds2-notes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
datovky
ds2-notes
Commits
9882fc7d
Commit
9882fc7d
authored
4 years ago
by
Parth Mittal
Browse files
Options
Downloads
Patches
Plain Diff
fixed typos, added another todo
parent
16df9964
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
streaming/streaming.tex
+9
-4
9 additions, 4 deletions
streaming/streaming.tex
with
9 additions
and
4 deletions
streaming/streaming.tex
+
9
−
4
View file @
9882fc7d
...
...
@@ -106,7 +106,7 @@ can be easily combined.
\:\em
{
Init
}
:
$
C
[
1
\ldots
t
][
1
\ldots
k
]
\=
0
$
, where
$
k
\=
\lceil
2
/
\varepsilon
\rceil
$
and
$
t
\=
\lceil
\log
(
1
/
\delta
)
\rceil
$
.
\:
: Choose
$
t
$
independent hash functions
$
h
_
1
,
\ldots
h
_
t :
[
n
]
\to
[
k
]
$
, each
\:
: Choose
$
t
$
independent hash functions
$
h
_
1
,
\ldots
,
h
_
t :
[
n
]
\to
[
k
]
$
, each
from a 2-independent family.
\:\em
{
Process
}
(
$
x
$
):
\:
:For
$
i
\in
[
t
]
$
:
$
C
[
i
][
h
_
i
(
x
)]
\=
C
[
i
][
h
_
i
(
x
)]
+
1
$
.
...
...
@@ -114,7 +114,7 @@ can be easily combined.
\endalgo
Note that the algorithm needs
$
\O
(
tk
\log
m
)
$
bits to store the table
$
C
$
, and
$
\O
(
t
\log
n
)
$
bits to store the hash functions
$
h
_
1
,
\ldots
h
_
t
$
, and hence
$
\O
(
t
\log
n
)
$
bits to store the hash functions
$
h
_
1
,
\ldots
,
h
_
t
$
, and hence
uses
$
\O
(
1
/
\varepsilon
\cdot
\log
(
1
/
\delta
)
\cdot
\log
m
+
\log
(
1
/
\delta
)
\cdot
\log
n
)
$
bits. It remains to show that it computes
a good estimate.
...
...
@@ -298,7 +298,7 @@ Recall that $\E[Y_r] = d / 2^r$, so the terms in the first sum can be bounded
using Chebyshev's inequality. The second sum is equal to the probability of
the event
$
[
t
\geq
s
]
$
, that is, the event
$
Y
_{
s
-
1
}
\geq
c
/
\varepsilon
^
2
$
(since
$
z
$
is only increased when
$
B
$
becomes larger than this threshold).
We will
simply
use Markov's inequality to bound this event.
We will use Markov's inequality to bound
the probability of
this event.
Putting it all together, we have:
$$
\eqalign
{
...
...
@@ -327,7 +327,12 @@ The counter $z$ requires only $\O(\log \log n)$ bits, and $B$ has
$
\O
(
1
/
\varepsilon
^
2
)
$
entries, each of which needs
$
\O
(
\log
n
)
$
bits.
Finally, the hash function
$
h
$
needs
$
\O
(
\log
n
)
$
bits, so the total space
used is dominated by
$
B
$
, and the algorithm uses
$
\O
(
\log
n
/
\varepsilon
^
2
)
$
space.
space. As before, if we use the median trick, the space used increases to
$
\O
(
\log\delta
\cdot
\log
n
/
\varepsilon
^
2
)
$
.
(TODO: include the version of this algorithm where we save space by storing
$
(
g
(
a
)
,
{
\tt
tz
}
(
h
(
a
)))
$
instead of
$
(
a,
{
\tt
tz
}
(
h
(
a
)))
$
in
$
B
$
for some
hash function
$
g
$
as an exercise?)
\endchapter
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment