git @ Cat's Eye Technologies Xigxag / 41a1b26
Import of XigXag version 1.0 revision 2011.1214. catseye 10 years ago
1 changed file(s) with 77 addition(s) and 74 deletion(s). Raw diff Collapse all Expand all
00 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
1 <!-- encoding: UTF-8 -->
12 <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
23 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
4 <title>The Xigxag Automaton</title>
5
6 <style type="text/css">
7 code {
8 background: pink;
9 border: 1px solid;
10 padding-right: 1px;
11 margin-left: 1px;
12 }
13 span.qed {
14 color: white;
15 background: black;
16 padding: 0px;
17 }
18 </style>
19
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <title>The Xigxag Automaton</title>
6 <!-- begin html doc dynamic markup -->
7 <script type="text/javascript" src="/contrib/jquery-1.6.4.min.js"></script>
8 <script type="text/javascript" src="/scripts/documentation.js"></script>
9 <!-- end html doc dynamic markup -->
10 <style type="text/css">
11 code {
12 background: pink;
13 border: 1px solid;
14 padding-right: 1px;
15 margin-left: 1px;
16 }
17 span.qed {
18 color: white;
19 background: black;
20 padding: 0px;
21 }
22 </style>
2023 </head>
2124 <body>
2225
107110 be gentle. Anyway, you can just skip it if you don't dig proofs.)</p>
108111
109112 <p>To show this, I'm going to split the theorem into two parts: Xigxag has growth almost everywhere,
110 and the magnitude of that growth is always &Omega;(2<sup>n</sup>) (where &Omega;(X) denotes a
113 and the magnitude of that growth is always Ω(2<sup>n</sup>) (where Ω(X) denotes a
111114 lower bound on the order of X.) And each of these will be split into several lemmas.
112115 But first, we need a couple of more definitions, just to make sure we're not relying too much
113116 on intuition.</p>
122125 and for configurations of even length, is the gap between symbols which
123126 has an equal number of symbols on either side of it.</p>
124127
125 <p><u>Lemma 1</u>. A minimal expander of length <var>n</var> is given by:</p>
128 <p><em>Lemma 1</em>. A minimal expander of length <var>n</var> is given by:</p>
126129 <ul>
127130 <li>when <var>n</var> is even: <code>&lt;</code><sup><var>n</var>/2</sup><code>&gt;</code><sup><var>n</var>/2</sup>
128131 </li>
132135 </ul>
133136 <p>In addition, this minimal expander of length <var>n</var> is unique (up to the symbol represented by <var>x</var>).</p>
134137
135 <p><u>Proof</u>: For any symbol left of centre, there will be more symbols on its right
138 <p><em>Proof</em>: For any symbol left of centre, there will be more symbols on its right
136139 than on its left. Therefore if some symbol left of centre is a <code>&gt;</code>, more
137140 symbols will be copied into the next-configuration than if it were a <code>&lt;</code>.
138141 So in a minimal expander, this symbol must be a <code>&lt;</code>.
142145 (which only exists when <var>n</var> is odd) is inconsequential; since there are an equal
143146 number of symbols on either side of it, changing it will not affect the expansion. <span class="qed">QED</span></p>
144147
145 <p><u>Lemma 2a</u>. If some configuration <var>s</var> exhibits growth and
148 <p><em>Lemma 2a</em>. If some configuration <var>s</var> exhibits growth and
146149 <var>s</var> contains at least one <code>&lt;</code>,
147150 then the configuration <code>&lt;</code><var>s</var> also exhibits growth.</p>
148151
149 <p><u>Proof</u>: Say <var>s</var> has length <var>n</var> and the next-configuration
152 <p><em>Proof</em>: Say <var>s</var> has length <var>n</var> and the next-configuration
150153 of <var>s</var> has length <var>n</var> + <var>m</var> for some positive <var>m</var>.
151154 Then the next-configuration of <code>&lt;</code><var>s</var> has length of at least <var>n</var> + <var>m</var>
152155 because every symbol in <var>s</var> still has at least as many symbols on either
157160 of <code>&lt;</code><var>s</var> has length of at least <var>n</var> + <var>m</var> + 1.
158161 Therefore <code>&lt;</code><var>s</var> exhibits growth. <span class="qed">QED</span></p>
159162
160 <p><u>Lemma 2b</u>. If some configuration <var>s</var> exhibits growth and
163 <p><em>Lemma 2b</em>. If some configuration <var>s</var> exhibits growth and
161164 <var>s</var> contains at least one <code>&gt;</code>,
162165 then the configuration <var>s</var><code>&gt;</code> also exhibits growth.</p>
163166
164 <p><u>Proof</u>: Mirror-image of argument for Lemma 2a. <span class="qed">QED</span>
165
166 <p><u>Lemma 3</u>. If some minimal expander of length <var>n</var> exhibits growth,
167 <p><em>Proof</em>: Mirror-image of argument for Lemma 2a. <span class="qed">QED</span></p>
168
169 <p><em>Lemma 3</em>. If some minimal expander of length <var>n</var> exhibits growth,
167170 then so does the minimal expander of length <var>n</var> + 1.</p>
168171
169 <p><u>Proof</u>: Given the minimal expander <var>s</var> of length <var>n</var>, we can form a
172 <p><em>Proof</em>: Given the minimal expander <var>s</var> of length <var>n</var>, we can form a
170173 minimal expander of length <var>n</var> + 1 by:</p>
171174
172175 <ul>
175178 <li>if it contains more <code>&gt;</code> symbols than <code>&lt;</code> symbols:
176179 prefixing a <code>&lt;</code> to it (to obtain <code>&lt;</code><var>s</var>);</li>
177180 <li>if it contains the same number of <code>&gt;</code> symbols as <code>&lt;</code> symbols:
178 either appending a <code>&gt;</code> to it or prefixing a <code>&lt;</code> to it.
181 either appending a <code>&gt;</code> to it or prefixing a <code>&lt;</code> to it.</li>
179182 </ul>
180183
181184 <p>These cases can easily be checked against Lemma 1. Further, from Lemmas 2a and 2b
182185 we know that appending <code>&gt;</code> or prefixing <code>&lt;</code> to a configuration
183186 that exhibits growth will produce a new configuration that also exhibits growth. Thus,
184187 if some minimal expander of length <var>n</var> exhibits growth,
185 then so does the minimal expander of length <var>n</var> + 1. <span class="qed">QED</a></p>
186
187 <p><u>Lemma 4</u>. All but a finite number of initial Xigxag configurations
188 then so does the minimal expander of length <var>n</var> + 1. <span class="qed">QED</span></p>
189
190 <p><em>Lemma 4</em>. All but a finite number of initial Xigxag configurations
188191 exhibit growth.</p>
189192
190 <p><u>Proof</u>: By induction. Note that the Xigxag configuration
193 <p><em>Proof</em>: By induction. Note that the Xigxag configuration
191194 <code>&lt;&lt;&lt;&lt;&gt;&gt;&gt;&gt;</code>
192195 is a minimal expander of length 8
193196 (by Lemma 1.) Note also that it has a next-configuration of
206209 expander expands the least of all configurations of its size.) Therefore all Xigxag configurations
207210 of length 8 or greater exhibit growth, and the only Xigxag configurations that do
208211 not exhibit growth must have length less than 8. There are clearly only a finite number
209 of such configurations. <span class="qed">QED</a></p>
210
211 <p><u>Lemma 5</u>. For all integers <var>n</var> &ge; 1, 4&middot;2<sup><var>n</var>+1</sup> &ge; 6&middot;2<sup><var>n</var>-1</sup>.
212 of such configurations. <span class="qed">QED</span></p>
213
214 <p><em>Lemma 5</em>. For all integers <var>n</var> ≥ 1, 4·2<sup><var>n</var>+1</sup> ≥ 6·2<sup><var>n</var>-1</sup>.
212215 (The relevance of this will become apparent later.)</p>
213216
214 <p><u>Proof</u>: By induction. For <var>n</var> = 1,
215 4&middot;2<sup><var>n</var>+1</sup> = 4&middot;2<sup>2</sup> = 16
216 &ge;
217 6&middot;2<sup><var>n</var>-1</sup> = 6&middot;2<sup>1</sup> = 12.
217 <p><em>Proof</em>: By induction. For <var>n</var> = 1,
218 4·2<sup><var>n</var>+1</sup> = 4·2<sup>2</sup> = 16
219
220 6·2<sup><var>n</var>-1</sup> = 6·2<sup>1</sup> = 12.
218221 So the base case is proved.</p>
219222
220 <p>Now we wish to show 4&middot;2<sup><var>n</var>+2</sup> &ge; 6&middot;2<sup><var>n</var></sup>.
223 <p>Now we wish to show 4·2<sup><var>n</var>+2</sup> ≥ 6·2<sup><var>n</var></sup>.
221224 Divide both sides by 2 to obtain
222 2&middot;2<sup><var>n</var>+2</sup> &ge; 6&middot;2<sup><var>n</var>-1</sup>.
223 But note that 2&middot;2<sup><var>n</var>+2</sup> = 4&middot;2<sup><var>n</var>+1</sup>,
224 so the expression can be restated 4&middot;2<sup><var>n</var>+1</sup> &ge; 6&middot;2<sup><var>n</var>-1</sup>.
225 2·2<sup><var>n</var>+2</sup> ≥ 6·2<sup><var>n</var>-1</sup>.
226 But note that 2·2<sup><var>n</var>+2</sup> = 4·2<sup><var>n</var>+1</sup>,
227 so the expression can be restated 4·2<sup><var>n</var>+1</sup> ≥ 6·2<sup><var>n</var>-1</sup>.
225228 But this is exactly our inductive hypothesis! So the inductive step is proved,
226 proving the lemma. <span class="qed">QED</a></p>
227
228 <p><u>Lemma 6</u>. The length of the next-configuration of a
229 minimal expander of length <var>n</var> is &Omega;(2<sup>n</sup>).</p>
230
231 <p><u>Proof</u>: Let's tackle this by finding a closed-form expression T(<var>n</var>) for the
229 proving the lemma. <span class="qed">QED</span></p>
230
231 <p><em>Lemma 6</em>. The length of the next-configuration of a
232 minimal expander of length <var>n</var> is Ω(2<sup>n</sup>).</p>
233
234 <p><em>Proof</em>: Let's tackle this by finding a closed-form expression T(<var>n</var>) for the
232235 length of the next-configuration of a given minimal expander of length <var>n</var>, where <var>n</var> is even.</p>
233236
234237 <p>(Note that we haven't shown that the next-configuration of a minimal expander
236239 because, from the definition of minimal expanders, we know that any next-configuration
237240 of a minimal expander
238241 will have at least as much expansion as a minimal expander would. That's
239 also what lets us phrase the result in terms of a lower bound using &Omega;-notation.)</p>
242 also what lets us phrase the result in terms of a lower bound using Ω-notation.)</p>
240243
241244 <p>First, we find a recurrence formula.
242245 From Lemma 1, observe that the left half of a minimal expander
268271 2nd ed., by Cormen, Leiserson, Rivest, and Stein.)</p>
269272
270273 <ul>
271 <li><var>c</var>2<sup><var>n</var>+1</sup> &ge; (<var>c</var>2<sup><var>n</var></sup>)<sup>2</sup>/4 - <var>c</var>2<sup><var>n</var></sup>/2</li>
272 <li><var>c</var>2<sup><var>n</var>+1</sup> &ge; <var>c</var><sup>2</sup>2<sup>2<var>n</var></sup>/4 - <var>c</var>2<sup><var>n</var></sup>/2</li>
273 <li><var>c</var>2<sup><var>n</var>+1</sup> &ge; (<var>c</var><sup>2</sup>/4)2<sup>2<var>n</var>-2</sup> - (<var>c</var>/2)2<sup><var>n</var>-1</sup></li>
274 <li><var>c</var>2<sup><var>n</var>+1</sup> &ge; (<var>c</var><sup>2</sup>/4)2&middot;2<sup><var>n</var>-1</sup> - (<var>c</var>/2)2<sup><var>n</var>-1</sup></li>
275 <li><var>c</var>2<sup><var>n</var>+1</sup> &ge; ((<var>c</var><sup>2</sup>/4)2 - (<var>c</var>/2))2<sup><var>n</var>-1</sup></li>
276 <li><var>c</var>2<sup><var>n</var>+1</sup> &ge; (<var>c</var><sup>2</sup>/2 - <var>c</var>/2)2<sup><var>n</var>-1</sup></li>
277 <li><var>c</var>2<sup><var>n</var>+1</sup> &ge; (<var>c</var>(<var>c</var> - 1)/2)2<sup><var>n</var>-1</sup></li>
278 </ul>
279
280 <p>So T(<var>n</var>) &ge; <var>c</var>2<sup><var>n</var></sup> holds <em>provided</em> we
281 can find some <var>c</var> that satisfies both T(1) = 8 and <var>c</var>2<sup><var>n</var>+1</sup> &ge; (<var>c</var>(<var>c</var> - 1)/2)2<sup><var>n</var>-1</sup>
282 for all <var>n</var> &ge; 1. First we examine T(1):</p>
283
284 <ul>
285 <li>T(<var>n</var>) &ge; <var>c</var>2<sup><var>n</var></sup></li>
286 <li>T(1) &ge; <var>c</var>2<sup>1</sup></li>
287 <li>8 &ge; 2&middot;<var>c</var></li>
274 <li><var>c</var>2<sup><var>n</var>+1</sup> ≥ (<var>c</var>2<sup><var>n</var></sup>)<sup>2</sup>/4 - <var>c</var>2<sup><var>n</var></sup>/2</li>
275 <li><var>c</var>2<sup><var>n</var>+1</sup> ≥ <var>c</var><sup>2</sup>2<sup>2<var>n</var></sup>/4 - <var>c</var>2<sup><var>n</var></sup>/2</li>
276 <li><var>c</var>2<sup><var>n</var>+1</sup> ≥ (<var>c</var><sup>2</sup>/4)2<sup>2<var>n</var>-2</sup> - (<var>c</var>/2)2<sup><var>n</var>-1</sup></li>
277 <li><var>c</var>2<sup><var>n</var>+1</sup> ≥ (<var>c</var><sup>2</sup>/4)2·2<sup><var>n</var>-1</sup> - (<var>c</var>/2)2<sup><var>n</var>-1</sup></li>
278 <li><var>c</var>2<sup><var>n</var>+1</sup> ≥ ((<var>c</var><sup>2</sup>/4)2 - (<var>c</var>/2))2<sup><var>n</var>-1</sup></li>
279 <li><var>c</var>2<sup><var>n</var>+1</sup> ≥ (<var>c</var><sup>2</sup>/2 - <var>c</var>/2)2<sup><var>n</var>-1</sup></li>
280 <li><var>c</var>2<sup><var>n</var>+1</sup> ≥ (<var>c</var>(<var>c</var> - 1)/2)2<sup><var>n</var>-1</sup></li>
281 </ul>
282
283 <p>So T(<var>n</var>) ≥ <var>c</var>2<sup><var>n</var></sup> holds <em>provided</em> we
284 can find some <var>c</var> that satisfies both T(1) = 8 and <var>c</var>2<sup><var>n</var>+1</sup> ≥ (<var>c</var>(<var>c</var> - 1)/2)2<sup><var>n</var>-1</sup>
285 for all <var>n</var> ≥ 1. First we examine T(1):</p>
286
287 <ul>
288 <li>T(<var>n</var>) ≥ <var>c</var>2<sup><var>n</var></sup></li>
289 <li>T(1) ≥ <var>c</var>2<sup>1</sup></li>
290 <li>8 ≥ 2·<var>c</var></li>
288291 </ul>
289292
290293 <p>So let <var>c</var> = 4, and note that (<var>c</var>(<var>c</var> - 1)/2) = 6.
291 Indeed, 4&middot;2<sup><var>n</var>+1</sup> &ge; 6&middot;2<sup><var>n</var>-1</sup> is true for
292 all <var>n</var> &ge; 1 by Lemma 5. So the closed form holds. <span class="qed">QED</a></p>
294 Indeed, 4·2<sup><var>n</var>+1</sup> ≥ 6·2<sup><var>n</var>-1</sup> is true for
295 all <var>n</var> ≥ 1 by Lemma 5. So the closed form holds. <span class="qed">QED</span></p>
293296
294297 <p>Finally...</p>
295298
296 <p><u>Theorem</u>. Xigxag has exponential growth almost everywhere.</p>
297
298 <p><u>Proof</u>: Lemma 4 and Lemma 6. <span class="qed">QED</a></p>
299 <p><em>Theorem</em>. Xigxag has exponential growth almost everywhere.</p>
300
301 <p><em>Proof</em>: Lemma 4 and Lemma 6. <span class="qed">QED</span></p>
299302
300303 <p>In fact, it seems to me that there's an awful lot of wiggle room between
301 4&middot;2<sup><var>n</var>+1</sup> and 6&middot;2<sup><var>n</var>-1</sup>, so I'll
302 wager a guess that it's not &omega;(2<sup>n</sup>) (that is, that
304 4·2<sup><var>n</var>+1</sup> and 6·2<sup><var>n</var>-1</sup>, so I'll
305 wager a guess that it's not ω(2<sup>n</sup>) (that is, that
303306 the bound I've given of 2<sup>n</sup> is not tight, and can be improved upon.)</p>
304307
305308 <p>Also, I chose 8 as the base case of the induction to keep things simple.