Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
datovky
ds2-notes
Commits
f261b9c3
Commit
f261b9c3
authored
Aug 30, 2021
by
Filip Stedronsky
Browse files
SOLE: high-level interpretation as encoding boxes
parent
f8a6a966
Changes
6
Hide whitespace changes
Inline
Side-by-side
fs-succinct/Makefile
View file @
f261b9c3
TOP
=
..
PICS
=
sole
PICS
=
sole sole_boxes sole_hilevel
include
../Makerules
sole.pdf
::
succinct_common.asy
sole_boxes.pdf
::
succinct_common.asy
sole_hilevel.pdf
::
succinct_common.asy
fs-succinct/sole.asy
View file @
f261b9c3
import s
ole
_common;
import s
uccinct
_common;
blocks(0 ... concat(array(6,"B"), new string[] {"...", "B", "EOF"}));
thruarrows(0,0,6);
thruarrows(0,7,2);
...
...
fs-succinct/sole_boxes.asy
0 → 100644
View file @
f261b9c3
import succinct_common;
void fillbox(int col, pen pen) {
path p = (
(col*blockwidth, -rowheight-blockheight)
-- ((col+2)*blockwidth, -rowheight-blockheight)
-- ((col+2)*blockwidth, -2*rowheight)
-- ((col+1)*blockwidth, -2*rowheight)
-- ((col+1)*blockwidth, -3*rowheight)
-- ((col-1)*blockwidth, -3*rowheight)
-- ((col-1)*blockwidth, -2*rowheight-blockheight)
-- ((col)*blockwidth, -2*rowheight-blockheight)
-- cycle
);
fill(p, pen);
draw(p, thick);
}
fillbox(2, 0.5*white);
fillbox(4, 0.75*white);
fillbox(6, 0.5*white);
//blocks(0 ... concat(array(8,"B"), new string[] {"..."}));
//thruarrows(0,0,6);
blocks(1 ... concat(array(8, "B+1"), array(1, "...")) );
mixarrows(1,0,8);
blocks(2, "B", "B+3", "B-3", "B+6", "B-6", "B+9", "B-9", "...");
thruarrow(2, 0);
mixarrows(2, 1, 6);
blocks(3 ... concat(array(7,"B"), array(1, "...")));
fs-succinct/sole_hilevel.asy
0 → 100644
View file @
f261b9c3
import succinct_common;
real mixgrid = 2.5;
int nmixers = 3;
for (int i = 0; i < nmixers; ++i) {
real x = mixgrid * i;
draw((x, 1.25) -- (x, 0.5), e_arrow);
label((x, 1.25), "$(B+1)^2$", N);
mixer(x, 0);
draw((x, -0.5) -- (x, -1.25), e_arrow);
label((x, -1.25), "$B^2$", S);
}
string[] alphas = {"B+3", "B+6", "B+9", "B+12"};
for (int i = 0; i < nmixers+1; ++i) {
carry_arrow((mixgrid * (i-1), 0), (mixgrid*i, 0), alphas[i]);
}
fs-succinct/succinct.tex
View file @
f261b9c3
...
...
@@ -198,12 +198,39 @@ B^2 + 2B + 1 &\le B^2 + 3B - 9i^2 - 9i\cr
B
&
\ge
9
i
^
2
+
9
i
+
1
\cr
}$$
We know
$
B
\ge
4
n
^
2
$
and
$
i
\le
{
n
+
1
\over
2
}$
. By plugging
$
i
=
{
n
+
1
\over
2
}$
and doing some algebraic manipulation, we can verify that the inequality holds.
and
$
B
=
4
n
^
2
$
and doing some algebraic manipulation, we can verify that the
inequality holds. For smaller
$
i
$
the right-hand side decreases so it holds
for those too.
For the second pass, this is trivial, as
$
(
B
+
i
)(
B
-
i
)
=
B
^
2
-
i
^
2
\le
B
^
2
$
.
\section
{
Succinct representation of arbitrary-alphabet strings
}
\subsection
{
A reinterpretation of the SOLE encoding
}
There is another way of looking at the SOLE encoding from the previous section.
We can group the alphabet translations into ``encoding boxes'' that take input
from the alphabet
$
(
B
+
1
)
^
2
$
, output the alphabet
$
B
^
2
$
and the part of the
information that did not fit into the output is passed as a
``carry''
\foot
{
Sometimes the alternative term
{
\it
spill
}
is used instead.
}
to
the next encoding box (similarly to how carrying works when doing addition).
See fig.
\figref
{
sole
_
boxes
}
.
\figure
[sole_boxes]
{
sole
_
boxes.pdf
}{}{
SOLE interpreted as a chain of encoding boxes
}
The start and end of the encoding are irregular, but we will ignore that for now.
An important property of these boxes is that outgoing carry does not depend on incoming
carry (unlike in addition). This allows for local decoding and modification. Otherwise
a single input change could affect the whole output. Now we can describe this scheme
in a more abstract, high-level way (fig.
\figref
{
sole
_
hilevel
}
).
\figure
[sole_hilevel]
{
sole
_
hilevel.pdf
}{}{
SOLE high-level block diagram
}
In our case, the input alphabet size is always
$
(
B
+
1
)
^
2
$
, the output alphabet size
is
$
B
^
2
$
and the carry alphabet sizes form the sequence
$
B
+
3
i
$
. Given that the output
alphabet is smaller than the input alphabet, it makes sense that the carry alphabet
has to increase in size to accomodate the accumulating information that did not fit
into the output. The final carry is then used to output some extra blocks at the end.
\endchapter
fs-succinct/s
ole
_common.asy
→
fs-succinct/s
uccinct
_common.asy
View file @
f261b9c3
...
...
@@ -55,4 +55,14 @@ void passlabel(int row, string lbl) {
label("{\it " + lbl + "}", (-1, -row*rowheight-blockheight - arrowheight/2), W);
}
void mixer(real x, real y, real r=0.5) {
draw((x-r,y-r) -- (x+r,y-r)--(x+r, y+r) -- (x-r, y+r) -- cycle, halfthick);
draw( (x,y+r) {S} .. {E} (x+r,y), 0.5*white);
draw( (x,y+r) -- (x,y-r), 0.5*white);
draw( (x-r,y) {E} .. {S} (x,y-r), 0.5*white);
}
void carry_arrow(pair mix1, pair mix2, string alphabet) {
draw(mix1 + (0.5,0) -- mix2 - (0.5, 0), e_arrow);
label((mix1+mix2)/2, "$"+alphabet+"$", N);
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment