<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>mathemagicio.us &#187; Complexity</title>
	<atom:link href="http://mathemagicio.us/tag/complexity/feed/" rel="self" type="application/rss+xml" />
	<link>http://mathemagicio.us</link>
	<description>Ramblings and musings about math, science and truth</description>
	<lastBuildDate>Wed, 14 Oct 2009 01:02:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Twenty questions, in the degenerate case when 20 = lg(n)</title>
		<link>http://mathemagicio.us/2009/08/03/twenty-questions-in-the-degenerate-case-when-20-lgn/</link>
		<comments>http://mathemagicio.us/2009/08/03/twenty-questions-in-the-degenerate-case-when-20-lgn/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 03:40:35 +0000</pubDate>
		<dc:creator>Mark Przepiora</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Complexity]]></category>
		<category><![CDATA[CS]]></category>
		<category><![CDATA[Math]]></category>

		<guid isPermaLink="false">http://mathemagicio.us/?p=554</guid>
		<description><![CDATA[A new post at Computational Complexity asks the following question:
(Problem 1.) You are trying to determine a secret integer x between 1 and n inclusive, using only queries of the form &#8220;is x = a (mod b)?&#8221; for integers a and b of your choosing. How many queries are required to determine x in the [...]]]></description>
			<content:encoded><![CDATA[<p>A new <a href="http://blog.computationalcomplexity.org/2009/08/find-number-again.html">post at Computational Complexity</a> asks the following question:</p>
<p style="padding-left: 30px; ">(Problem 1.) You are trying to determine a secret integer <em>x</em> between 1 and <em>n </em>inclusive, using only queries of the form &#8220;is x = <em>a</em> (mod <em>b</em>)?&#8221; for integers <em>a</em> and <em>b</em> of your choosing. How many queries are required to determine <em>x</em> in the worst case?</p>
<p>And more restrictively,</p>
<p style="padding-left: 30px; ">(Problem 2.) Same as above but you are only allowed to make queries where <em>b</em> is prime.</p>
<p>The comments section seems to reveal at least a partial solution, but these are fun problems, so at least give them a shot before reading the solution there (or here.) If you&#8217;d like the solution spoiled anyway, read on!<span id="more-554"></span></p>
<p>First let&#8217;s talk about a problem that has a more intuitive solution. Namely, the same problem of finding an integer between 1 and <em>n</em>, but where we are allowed to ask questions of the form &#8220;is x <em>≤</em> a?&#8221; for our choice of integers <em>a</em>.</p>
<p>Computer scientists in the audience should recognize the solution: first, find out about the midpoint. That is, whether <em>x</em> ≤ <em>n</em>/2. Whatever the answer is, we split the search space in half! That is, we originally knew that <em>x</em> must be one of <em>n</em> values. After the first query, we know that <em>x</em> must be one of <em>n</em>/2 values: either 1 ≤ x ≤ n/2 or n/2 &lt; x ≤ n. Either way, we can simply repeat the process again! After the second query, we know it must be one of <em>n</em>/4 values. And so on. For example, for 1 ≤ <em>x</em> ≤ 8, the following sequence of questions would reveal that the answer is <em>x</em> = 3.</p>
<p style="text-align: center; "><img class="aligncenter size-medium wp-image-555" title="Binary search" src="http://mathemagicio.us/wp-content/uploads/2009/08/binary-search-300x285.gif" alt="Binary search" width="240" height="228" /></p>
<p>It should be easy to convince yourself of the fact that you can only make these divisions lg(<em>n</em>) (that&#8217;s log-base-2*) times before you determine <em>x</em>.</p>
<p>Furthermore, this is the best we can do: any algorithm that finds <em>x</em> using only true/false queries requires at least lg(<em>n</em>) queries in the worst case. Why? Essentially, because this is how many bits there are in the binary expansion of <em>x</em>. Take <em>n</em> = 8 for example. If you could determine any 1 ≤ <em>x ≤ 8</em> using only two queries in the worst case, then any such <em>x</em> could be written uniquely using only 2 bits, which is impossible.</p>
<p>But let&#8217;s go back to Problem 1. Notice that the above argument applies for <em>any</em> algorithm that may only make queries about <em>x</em> whose answers are boolean. So we may immediately say that <em>at least</em> lg(<em>n</em>) queries are required by any algorithm that solves it.</p>
<p>However, is the answer again <em>exactly</em> lg(<em>n</em>)? Our binary search problem had the &#8220;nice&#8221; property that no matter what the answer to our previous query was, we could always construct <em>another</em> query that cut the search space in half <em>again</em>. Any boolean query may be thought of as a filter that eliminates a certain portion of the search space (which here is simply the set {1, 2, &#8230;, n}.) But not all queries may have this nice property. For example, if we were only allowed to ask questions of the form &#8220;is <em>x</em> = <em>a</em>?&#8221; then we would need to ask <em>n &#8211; 1</em> questions in the worst case—because no matter in what order we guess numbers, our first <em>n &#8211; 1</em> guesses could be wrong.</p>
<p>It turns out that the queries in Problem 1 do indeed have this nice property. The algorithm works like so:</p>
<ol>
<li>Ask whether <em>x</em> = 0 (mod 2). Doing so cuts the search space in half.</li>
<li>If the answer above was Yes, then ask whether <em>x</em> = 0 (mod 4). Since the previous answer was Yes, it must be the case that either <em>x</em> = 0 (mod 4) or <em>x</em> = 2 (mod 4), and the answer to this query again cuts the search space in half.</li>
<li>If the answer above was No, then ask whether <em>x</em> = 1 (mod 4). From the same reasoning as above, we again cut the search space in half.</li>
<li>Repeat the process using mod 8, 16, 32, etc., crafting the appropriate query.</li>
</ol>
<p>It shouldn&#8217;t be too hard to find the correct question to ask in each case. As an example,</p>
<p style="text-align: center; "><img class="aligncenter size-medium wp-image-557" title="Problem 1 solution example" src="http://mathemagicio.us/wp-content/uploads/2009/08/amodb-300x285.png" alt="Problem 1 solution example" width="240" height="228" /></p>
<p style="text-align: center;">
<p>This process can always be completed in lg(<em>n</em>) queries, which is the answer to Problem 1.</p>
<p>Note, however, that we always use a modulus of the form <img src='/wp-content/plugins/latexrender/pictures/fe401f62231ac24e3399751a415a4eaa_1.0pt.png' title='2^k' alt='2^k'  style="vertical-align:-1.0pt;" >, so this solution doesn&#8217;t help us solve Problem 2, where the modulus must always be prime! Don&#8217;t panic; I will discuss a solution to this problem in my next blog post.</p>
<p>* Here I&#8217;m assuming that <em>n</em> is a power of 2 to make the formula simpler, but if it isn&#8217;t then the correct answer is simply the <em>ceiling</em> of lg(<em>n</em>). That is, round lg(<em>n</em>) up. In fact, whenever I write lg(<em>n</em>) you can assume this is what I mean.</p>
]]></content:encoded>
			<wfw:commentRss>http://mathemagicio.us/2009/08/03/twenty-questions-in-the-degenerate-case-when-20-lgn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Who says computer scientists don&#8217;t know how to have fun?</title>
		<link>http://mathemagicio.us/2009/07/30/who-says-computer-scientists-dont-know-how-to-have-fun/</link>
		<comments>http://mathemagicio.us/2009/07/30/who-says-computer-scientists-dont-know-how-to-have-fun/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 02:23:02 +0000</pubDate>
		<dc:creator>Mark Przepiora</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Complexity]]></category>
		<category><![CDATA[CS]]></category>
		<category><![CDATA[Science!]]></category>

		<guid isPermaLink="false">http://mathemagicio.us/?p=541</guid>
		<description><![CDATA[Who says computer scientists don&#8217;t know how to have fun? As a counterexample, consider a new post over at Gödel&#8217;s Lost Letter that was obviously the result of some Wednesday-night festivities and intoxication.
I think, in a sense, we are the accelerators. As we smash ideas together sometimes we discover the further structure of our fundamental particles—our complexity classes.
Duuuuude.
]]></description>
			<content:encoded><![CDATA[<p>Who says computer scientists don&#8217;t know how to have fun? As a counterexample, consider a new <a href="http://rjlipton.wordpress.com/2009/07/30/complexity-classes-meet-particle-physics/">post</a> over at Gödel&#8217;s Lost Letter that was obviously the result of some Wednesday-night festivities and intoxication.</p>
<blockquote><p>I think, in a sense, we are the accelerators. As we smash ideas together sometimes we discover the further structure of our fundamental particles—our complexity classes.</p></blockquote>
<p><em>Duuuuude</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mathemagicio.us/2009/07/30/who-says-computer-scientists-dont-know-how-to-have-fun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8230;fool me ε times, shame on my constant-depth circuit</title>
		<link>http://mathemagicio.us/2009/02/20/fool-me-%ce%b5-times-shame-on-my-constant-depth-circuit/</link>
		<comments>http://mathemagicio.us/2009/02/20/fool-me-%ce%b5-times-shame-on-my-constant-depth-circuit/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 07:32:28 +0000</pubDate>
		<dc:creator>Mark Przepiora</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Complexity]]></category>
		<category><![CDATA[CS]]></category>

		<guid isPermaLink="false">http://mathemagicio.us/?p=315</guid>
		<description><![CDATA[Virtually everyone with a CS blog (see Scott Aaronson, Luca Trevisan, and the Complexity Blog) has for the past several weeks been going on about Mark Braverman&#8217;s recent proof of the Linial-Nisan conjecture. I don&#8217;t have too much to add to the discussion, being a neophyte to much of this stuff, but I did attend a talk [...]]]></description>
			<content:encoded><![CDATA[<p>Virtually everyone with a CS blog (see <a href="http://scottaaronson.com/blog/?p=381">Scott Aaronson</a>, <a href="http://lucatrevisan.wordpress.com/2009/01/23/bounded-independence-ac0-and-random-3sat/">Luca Trevisan</a>, and the <a href="http://weblog.fortnow.com/2009/01/fooling-constant-depth-circuits.html">Complexity Blog</a>) has for the past several weeks been going on about <a href="http://www.cs.toronto.edu/~mbraverm/">Mark Braverman</a>&#8217;s recent <a href="http://www.cs.toronto.edu/~mbraverm/FoolAC0v6.pdf">proof</a> of the Linial-Nisan conjecture. I don&#8217;t have too much to add to the discussion, being a neophyte to much of this stuff, but I did attend a talk Braverman gave at the University of Calgary today, in which he outlined his proof (which is remarkably short, for a proof of a conjecture that took nearly 20 years to solve.) Braverman illustrated his arguments with pictures, which really helped me get a handle on his techniques.<span id="more-315"></span></p>
<p>The content of the theorem relates to what strength of pseudo-randomness is &#8220;good enough&#8221; to fool circuits of a significantly limited size and depth into thinking the pseudo-randomness is truly random. As an analogy, the D in HD video is becoming ever and ever more H (currently we&#8217;re up to a resolution of <a href="http://en.wikipedia.org/wiki/UHDV">7680&#215;4320</a>) but our brains have a finite capacity and our eyes aren&#8217;t perfect lenses. Increase the resolution high enough, and eventually we won&#8217;t be able to tell the difference between the HD video signal and a &#8220;true&#8221; view of the world. Similarly, we&#8217;d like to know whether certain limited models of computation can tell apart real randomness from approximate randomness.</p>
<p>The Linial-Nisan conjecture restricts us to logical circuits used to compute answers to decision problems/boolean functions F<sup>1</sup> made up of AND, OR and NOT gates<sup>2</sup>, where the number of gates is allowed to be polynomial in size<sup>3</sup>  but the <em>depth</em> of the circuit must remain constant across all instances.</p>
<p>This class of circuits is called <a href="http://qwiki.stanford.edu/wiki/Complexity_Zoo:A#ac0">AC</a><sup><a href="http://qwiki.stanford.edu/wiki/Complexity_Zoo:A#ac0">0</a></sup>, and these conditions are more restrictive than they first seem. You might point out that any boolean function whatsoever can be computed by a depth-2 circuit (for example, in <a href="http://en.wikipedia.org/wiki/Disjunctive_normal_form">disjunctive normal form</a>.) And that&#8217;s true, but the number of gates then required might be superpolynomial in size. For example, even doing something as relatively simple as computing the parity of <em>n</em> bits cannot be done in AC<sup>0</sup>—you either need to increase the depth of the circuit as the problem grows in size, or have access to more complicated gates, or use more than a polynomial number of gates.</p>
<p>The question, then, is what kind of probability distributions over {0,1}<sup>n</sup> look identical to the uniform distribution to AC<sup>0</sup> circuits. In particular, the Linial-Nisan conjecture asks about distributions that <em>are</em> uniform when you restrict them to any k &lt; n bits, but are no longer uniform as a whole. For example, consider <img src='/wp-content/plugins/latexrender/pictures/6bd54b513b6790b82dc14d99c9e13e6d_3.33333pt.png' title='x_1,\ldots,x_{n-1}' alt='x_1,\ldots,x_{n-1}'  style="vertical-align:-3.33333pt;" > chosen uniformly, and <img src='/wp-content/plugins/latexrender/pictures/dd1f6010b56d72b28e5eca4433fb298b_3.33333pt.png' title='x_n = x_1 \oplus x_2 \oplus \cdots \oplus x_{n-1}' alt='x_n = x_1 \oplus x_2 \oplus \cdots \oplus x_{n-1}'  style="vertical-align:-3.33333pt;" >. The last variable is determined entirely by the others so the n bits as a whole aren&#8217;t uniformly random, but if you pick any <em>k = n-1</em> bits at a time you <em>do</em> get a uniform distribution. Do such distributions look uniform to AC<sup>0</sup> circuits? And if so, how small can <em>k</em> be? (Imagine a distribution half of whose bits are determined by the others. Can such a fundamentally non-random distribution be detected by an AC<sup>0</sup> circuit?)</p>
<p>Mark Braverman proved that <em>k</em> can be very low indeed. It need only be polylogarithmic (for example, of order <img src='/wp-content/plugins/latexrender/pictures/fc373df650005868942ae3a19309d27c_3.5pt.png' title='(\lg m)^4' alt='(\lg m)^4'  style="vertical-align:-3.5pt;" > for depth-2 circuits, in <em>m</em> being the number of gates.) In general, the exponent is quadratic in the depth to which we restrict ourselves. Asymptotically, this is tiny! And many suspect this bound is still too high, as <img src='/wp-content/plugins/latexrender/pictures/f6e82c6c82b4fa3ba24f495e5a6dec3d_3.5pt.png' title='k=(\lg m)^2' alt='k=(\lg m)^2'  style="vertical-align:-3.5pt;" > suffices for depth-2 circuits, leading to the suspicion that the tight bound is <img src='/wp-content/plugins/latexrender/pictures/8af064fe70d458134ed03c135c906236_3.5pt.png' title='k=(\lg m)^{O(d)}' alt='k=(\lg m)^{O(d)}'  style="vertical-align:-3.5pt;" >.</p>
<p>How does Braverman prove this result? He constructs low-degree polynomials that sufficiently approximate and &#8220;sandwich&#8221; the function <em>F</em> in question (think of the squeeze theorem from your Calculus 1 days), which was previously known to be sufficient to prove the result.</p>
<p>The first kind of approximating polynomials are due to Linial, Manser and Nisan way back in 1993. These LMN polynomials are created by taking the canonical, polynomial expansion of the function (for example, by interpolation) and simply chopping off the high-order terms. Such polynomials approximate <em>F</em> very well on average, but may not be equal to <em>F</em> at many, if any points. In other words, there is a small <img src='/wp-content/plugins/latexrender/pictures/998200580551054a6a2f1461037d915d_1.0pt.png' title='\ell^2' alt='\ell^2'  style="vertical-align:-1.0pt;" > distance between them.</p>
<div id="attachment_369" class="wp-caption aligncenter" style="width: 210px"><img class="size-full wp-image-369" title="lmn-approx" src="http://mathemagicio.us/wp-content/uploads/2009/02/lmn-approx.png" alt="lmn-approx" width="200" height="145" /><p class="wp-caption-text">LMN approximation (red) to a boolean function F (black)</p></div>
<p>The second kind of approximation is due to Razborov and Smolensky. This time, the approximating polynomial agrees with the function <em>F</em> on most inputs, but it may behave wildly wherever it doesn&#8217;t.</p>
<div id="attachment_372" class="wp-caption aligncenter" style="width: 210px"><img class="size-full wp-image-372" title="rs-approx" src="http://mathemagicio.us/wp-content/uploads/2009/02/rs-approx.png" alt="Razborov-Smolensky approximation (blue) of the same function" width="200" height="145" /><p class="wp-caption-text">Razborov-Smolensky approximation (blue) of the same function</p></div>
<p>(In fact, the jumpiness in the blue graph can be far more wild than the picture suggests, making it an awful approximation at these points.) At any rate, neither of these approximations behave quite the way we want them to. What we&#8217;d like is a low-degree approximation of <em>F</em> that agrees with it on most inputs (as in the blue approximation) and doesn&#8217;t stray too far away when it doesn&#8217;t (as in the red approximation.)</p>
<p>What Braverman discovered is that although the blue approximation can be very, <strong>very</strong> wrong at some points, this error can be checked in AC<sup>0</sup>! In particular, there&#8217;s a AC<sup>0</sup> function ε that takes on the value 1 whenever the blue approximation disagrees with <em>F</em> (and possibly at some other points that give false positives, but not too many.) This function ε tells us when we need to correct the blue approximation. Then, Braverman applies the red, wavy approximation to ε and takes its negation, giving us a low-degree polynomial which (nearly) vanishes whenever the blue approximation is inaccurate.</p>
<div id="attachment_381" class="wp-caption aligncenter" style="width: 190px"><img class="size-full wp-image-381" title="epsilon" src="http://mathemagicio.us/wp-content/uploads/2009/02/epsilon.png" alt="Approximation of 1-ε" width="180" height="190" /><p class="wp-caption-text">Approximation of 1-ε (orange)</p></div>
<p>Then he just multiplies the blue and orange functions together to create a new approximation! Doing this kills the blue guy whenever he misbehaves, resulting in a polynomial that approximates <em>F</em> in the nice ways we wanted, and which is still of low-enough degree to be usable.</p>
<p>That&#8217;s pretty much all there is to it! All that&#8217;s left to do is to fill in the gaps with some algebraic magic, and the claim is proved. Not bad at all.</p>
<p><sup>1</sup> For example, is <em>x</em> prime? Or, does the input graph have a vertex of degree <em>5</em>?<br />
<sup>2</sup> We allow the AND and OR gates to take any number of inputs, rather than only two.<br />
<sup>3</sup> For example, the circuit that computes the answer for inputs of size <em>n</em> could have <em>n</em><sup>13</sup> gates.</p>
]]></content:encoded>
			<wfw:commentRss>http://mathemagicio.us/2009/02/20/fool-me-%ce%b5-times-shame-on-my-constant-depth-circuit/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
