<?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>Some stuff &#187; convergence speed</title>
	<atom:link href="http://blog.yhuang.org/?feed=rss2&#038;tag=convergence-speed" rel="self" type="application/rss+xml" />
	<link>https://blog.yhuang.org</link>
	<description>here.</description>
	<lastBuildDate>Wed, 27 Aug 2025 08:50:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>double log convergence</title>
		<link>https://blog.yhuang.org/?p=156</link>
		<comments>https://blog.yhuang.org/?p=156#comments</comments>
		<pubDate>Wed, 04 Feb 2009 05:22:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[2m]]></category>
		<category><![CDATA[complexity]]></category>
		<category><![CDATA[convergence speed]]></category>
		<category><![CDATA[integer]]></category>
		<category><![CDATA[integer math]]></category>
		<category><![CDATA[math log]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[show]]></category>
		<category><![CDATA[sqrt]]></category>
		<category><![CDATA[square root]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=156</guid>
		<description><![CDATA[Here is a problem on complexity, or alternatively, convergence. If an integer is reduced by the largest square less than it each time until it is terminated at zero, show that the number of steps taken is at most order . More precisely, let and be the minimum number of steps until . Prove that [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a problem on complexity, or alternatively, convergence.</p>
<p>If an integer \(n\) is reduced by the largest square less than it each time until it is terminated at zero, show that the number of steps taken is at most order \(\log \log n\).</p>
<p>More precisely, let \(f(n) = n &#8211; {\left\lfloor{\sqrt{n}}\right\rfloor}^2\) and \(g(n)=k\) be the minimum number of steps until \(f^k(n)=0\). Prove that there exists some fixed \(A\) such that \(g(n)< A \log \log n\) for all \(n\ge 3\).<br />
<span id="more-156"></span><br />
Why is the convergence speed double log? Well, it really has to do with the fact that the remainder \(f(n)\) is of order square root of \(n\), and that ultimately has to do with the fact that the gaps between successive integer squares grow linearly. Each time \(f\) is applied to some \(n\), the remainder after the removal of the largest square is no more than the gap value between that square and the next square.</p>
<p>The proof goes something like this. \(m^2 &#8211; (m-1)^2 = 2m &#8211; 1 < 2m\), so \(f(n) \le (\left\lfloor{\sqrt{n}}\right\rfloor + 1)^2 - {\left\lfloor{\sqrt{n}}\right\rfloor}^2 < 2({\left\lfloor{\sqrt{n}}\right\rfloor + 1}) \le 2\sqrt{n} + 2 \le 4\sqrt{n}\), where the last step is valid for \(n \ge 1\). After applying \(f\) some \(k\) times iteratively, we get \(f^k(n) < \underbrace{4\sqrt{\cdots 4\sqrt{4\sqrt{n}}}}_k = 16^{\frac{1}{2} + \frac{1}{4} + \cdots + 2^{-k}} n^{2^{-k}} < 16 n^{2^{-k}}\).</p>
<p>Now, if for some \(k\), \(16 n^{2^{-k}} < 17\), then certainly there must be some \(K \le k\) such that the integer \(f^K(n) \le 16\), in which case the total number of steps to terminate is no more than \(k+4\). (For the 4, see graph below for termination cases for \(n\le 16\).)</p>
<p>Next we solve \(16 n^{2^{-k}} < 17 \) (*) for \(k\) by taking log twice, and using the monotonicity of log:</p>
\(\log 16 + 2^{-k} \log n < \log 17\),<br />
<br />
\(- k\log 2 + \log \log n < \log(\log 17-\log 16)\),<br />
<br />
\(k > \frac{\log \log n}{\log 2} &#8211; \frac{\log(\log 17 &#8211; \log 16)}{\log 2}\).</p>
<p>Clearly, if \(k > \frac{\log \log n}{\log 2}\), then (*) is satisfied, so the total number of steps required to terminate is given by \(g(n) \le \frac{\log \log n}{\log 2} + 4 < 44 \log \log n\) for \(n\ge 3\), QED.</p>
<p><img align="bottom" alt="Input: digraph G {
rankdir=LR
node [shape = circle];
{0 [style = filled, color=lightgrey] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16}
3-&gt;2-&gt;1-&gt;0
8-&gt;4-&gt;0
5-&gt;1
6-&gt;2
7-&gt;3
9-&gt;0
10-&gt;1
11-&gt;2
12-&gt;3
13-&gt;4
14-&gt;5
15-&gt;6
16-&gt;0
}" src="wp-content/cache/0c99a5af1c19fe5b8ba1543f5ab5fed9.png" />
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=156</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
