Import of XigXag version 1.0 revision 2011.1214.
catseye
10 years ago
0 | 0 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
1 | <!-- encoding: UTF-8 --> | |
1 | 2 | <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> |
2 | 3 | <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> | |
20 | 23 | </head> |
21 | 24 | <body> |
22 | 25 | |
107 | 110 | be gentle. Anyway, you can just skip it if you don't dig proofs.)</p> |
108 | 111 | |
109 | 112 | <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 Ω(2<sup>n</sup>) (where Ω(X) denotes a | |
113 | and the magnitude of that growth is always Ω(2<sup>n</sup>) (where Ω(X) denotes a | |
111 | 114 | lower bound on the order of X.) And each of these will be split into several lemmas. |
112 | 115 | But first, we need a couple of more definitions, just to make sure we're not relying too much |
113 | 116 | on intuition.</p> |
122 | 125 | and for configurations of even length, is the gap between symbols which |
123 | 126 | has an equal number of symbols on either side of it.</p> |
124 | 127 | |
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> | |
126 | 129 | <ul> |
127 | 130 | <li>when <var>n</var> is even: <code><</code><sup><var>n</var>/2</sup><code>></code><sup><var>n</var>/2</sup> |
128 | 131 | </li> |
132 | 135 | </ul> |
133 | 136 | <p>In addition, this minimal expander of length <var>n</var> is unique (up to the symbol represented by <var>x</var>).</p> |
134 | 137 | |
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 | |
136 | 139 | than on its left. Therefore if some symbol left of centre is a <code>></code>, more |
137 | 140 | symbols will be copied into the next-configuration than if it were a <code><</code>. |
138 | 141 | So in a minimal expander, this symbol must be a <code><</code>. |
142 | 145 | (which only exists when <var>n</var> is odd) is inconsequential; since there are an equal |
143 | 146 | number of symbols on either side of it, changing it will not affect the expansion. <span class="qed">QED</span></p> |
144 | 147 | |
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 | |
146 | 149 | <var>s</var> contains at least one <code><</code>, |
147 | 150 | then the configuration <code><</code><var>s</var> also exhibits growth.</p> |
148 | 151 | |
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 | |
150 | 153 | of <var>s</var> has length <var>n</var> + <var>m</var> for some positive <var>m</var>. |
151 | 154 | Then the next-configuration of <code><</code><var>s</var> has length of at least <var>n</var> + <var>m</var> |
152 | 155 | because every symbol in <var>s</var> still has at least as many symbols on either |
157 | 160 | of <code><</code><var>s</var> has length of at least <var>n</var> + <var>m</var> + 1. |
158 | 161 | Therefore <code><</code><var>s</var> exhibits growth. <span class="qed">QED</span></p> |
159 | 162 | |
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 | |
161 | 164 | <var>s</var> contains at least one <code>></code>, |
162 | 165 | then the configuration <var>s</var><code>></code> also exhibits growth.</p> |
163 | 166 | |
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, | |
167 | 170 | then so does the minimal expander of length <var>n</var> + 1.</p> |
168 | 171 | |
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 | |
170 | 173 | minimal expander of length <var>n</var> + 1 by:</p> |
171 | 174 | |
172 | 175 | <ul> |
175 | 178 | <li>if it contains more <code>></code> symbols than <code><</code> symbols: |
176 | 179 | prefixing a <code><</code> to it (to obtain <code><</code><var>s</var>);</li> |
177 | 180 | <li>if it contains the same number of <code>></code> symbols as <code><</code> symbols: |
178 | either appending a <code>></code> to it or prefixing a <code><</code> to it. | |
181 | either appending a <code>></code> to it or prefixing a <code><</code> to it.</li> | |
179 | 182 | </ul> |
180 | 183 | |
181 | 184 | <p>These cases can easily be checked against Lemma 1. Further, from Lemmas 2a and 2b |
182 | 185 | we know that appending <code>></code> or prefixing <code><</code> to a configuration |
183 | 186 | that exhibits growth will produce a new configuration that also exhibits growth. Thus, |
184 | 187 | 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 | |
188 | 191 | exhibit growth.</p> |
189 | 192 | |
190 | <p><u>Proof</u>: By induction. Note that the Xigxag configuration | |
193 | <p><em>Proof</em>: By induction. Note that the Xigxag configuration | |
191 | 194 | <code><<<<>>>></code> |
192 | 195 | is a minimal expander of length 8 |
193 | 196 | (by Lemma 1.) Note also that it has a next-configuration of |
206 | 209 | expander expands the least of all configurations of its size.) Therefore all Xigxag configurations |
207 | 210 | of length 8 or greater exhibit growth, and the only Xigxag configurations that do |
208 | 211 | 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> ≥ 1, 4·2<sup><var>n</var>+1</sup> ≥ 6·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>. | |
212 | 215 | (The relevance of this will become apparent later.)</p> |
213 | 216 | |
214 | <p><u>Proof</u>: By induction. For <var>n</var> = 1, | |
215 | 4·2<sup><var>n</var>+1</sup> = 4·2<sup>2</sup> = 16 | |
216 | ≥ | |
217 | 6·2<sup><var>n</var>-1</sup> = 6·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. | |
218 | 221 | So the base case is proved.</p> |
219 | 222 | |
220 | <p>Now we wish to show 4·2<sup><var>n</var>+2</sup> ≥ 6·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>. | |
221 | 224 | Divide both sides by 2 to obtain |
222 | 2·2<sup><var>n</var>+2</sup> ≥ 6·2<sup><var>n</var>-1</sup>. | |
223 | But note that 2·2<sup><var>n</var>+2</sup> = 4·2<sup><var>n</var>+1</sup>, | |
224 | so the expression can be restated 4·2<sup><var>n</var>+1</sup> ≥ 6·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>. | |
225 | 228 | 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 Ω(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 | |
232 | 235 | length of the next-configuration of a given minimal expander of length <var>n</var>, where <var>n</var> is even.</p> |
233 | 236 | |
234 | 237 | <p>(Note that we haven't shown that the next-configuration of a minimal expander |
236 | 239 | because, from the definition of minimal expanders, we know that any next-configuration |
237 | 240 | of a minimal expander |
238 | 241 | 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 Ω-notation.)</p> | |
242 | also what lets us phrase the result in terms of a lower bound using Ω-notation.)</p> | |
240 | 243 | |
241 | 244 | <p>First, we find a recurrence formula. |
242 | 245 | From Lemma 1, observe that the left half of a minimal expander |
268 | 271 | 2nd ed., by Cormen, Leiserson, Rivest, and Stein.)</p> |
269 | 272 | |
270 | 273 | <ul> |
271 | <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> | |
272 | <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> | |
273 | <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> | |
274 | <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> | |
275 | <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> | |
276 | <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> | |
277 | <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> | |
278 | </ul> | |
279 | ||
280 | <p>So T(<var>n</var>) ≥ <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> ≥ (<var>c</var>(<var>c</var> - 1)/2)2<sup><var>n</var>-1</sup> | |
282 | for all <var>n</var> ≥ 1. First we examine T(1):</p> | |
283 | ||
284 | <ul> | |
285 | <li>T(<var>n</var>) ≥ <var>c</var>2<sup><var>n</var></sup></li> | |
286 | <li>T(1) ≥ <var>c</var>2<sup>1</sup></li> | |
287 | <li>8 ≥ 2·<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> | |
288 | 291 | </ul> |
289 | 292 | |
290 | 293 | <p>So let <var>c</var> = 4, and note that (<var>c</var>(<var>c</var> - 1)/2) = 6. |
291 | Indeed, 4·2<sup><var>n</var>+1</sup> ≥ 6·2<sup><var>n</var>-1</sup> is true for | |
292 | all <var>n</var> ≥ 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> | |
293 | 296 | |
294 | 297 | <p>Finally...</p> |
295 | 298 | |
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> | |
299 | 302 | |
300 | 303 | <p>In fact, it seems to me that there's an awful lot of wiggle room between |
301 | 4·2<sup><var>n</var>+1</sup> and 6·2<sup><var>n</var>-1</sup>, so I'll | |
302 | wager a guess that it's not ω(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 | |
303 | 306 | the bound I've given of 2<sup>n</sup> is not tight, and can be improved upon.)</p> |
304 | 307 | |
305 | 308 | <p>Also, I chose 8 as the base case of the induction to keep things simple. |