<?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; sqrt</title>
	<atom:link href="http://blog.yhuang.org/?feed=rss2&#038;tag=sqrt" 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>
		<item>
		<title>triangular pursuit</title>
		<link>https://blog.yhuang.org/?p=123</link>
		<comments>https://blog.yhuang.org/?p=123#comments</comments>
		<pubDate>Fri, 03 Oct 2008 13:01:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[boundary conditions]]></category>
		<category><![CDATA[delta]]></category>
		<category><![CDATA[edge length]]></category>
		<category><![CDATA[equilateral]]></category>
		<category><![CDATA[equilateral triangle abc]]></category>
		<category><![CDATA[incenter]]></category>
		<category><![CDATA[math math]]></category>
		<category><![CDATA[speed]]></category>
		<category><![CDATA[sqrt]]></category>
		<category><![CDATA[theta]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=123</guid>
		<description><![CDATA[Here&#8217;s a problem posed to me by a friend: Consider an equilateral triangle ABC with edge length 1. At each vertex is an object that is capable of movement at exactly speed 1. Beginning at time 0, each of the three objects moves toward its initial adjacent neighbor object, as in a game of pursuit. [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a problem posed to me by a friend:</p>
<p>Consider an equilateral triangle ABC with edge length 1. At each vertex is an object that is capable of movement at exactly speed 1. Beginning at time 0, each of the three objects moves toward its initial adjacent neighbor object, as in a game of pursuit. Of course, by symmetry, the objects will meet at the incenter of ABC. The question: how far will they have traveled?<br />
<span id="more-123"></span><br />
<img src="wp-content/uploads/images/triangle.png" align="right" /> The paths followed by the objects at first seem non-trivial, but in fact turn out to be nice. We will come back to this, but for the problem, the exact paths are irrelevant. We just need to find the amount of time it takes the objects to meet. The key part of the solution is to realize that, due to symmetry, the three objects always define an equilateral triangle at any time. Furthermore, their direction of motion is always along the edges of such a triangle, at speed v=1.</p>
<p>What we have is then a shrinking and rotating equilateral triangle that eventually decays to a point. Let us characterize this process.</p>
<p>At time \(t\), let \(s(t)\) be the length traveled by one of the objects. Let \(l(t)\) be the edge length of the triangle. Let \(A(t)\) be the area of the triangle. Then we have several relationships:</p>
<ul>
<li>\(\frac{ds}{dt}=1\)</li>
<li>\(A(t)=\frac{\sqrt{3}}{4} l(t)^2\), and \(\frac{dA}{dt} = \frac{\sqrt{3}}{2} l(t) \frac{dl}{dt}\)</li>
<li>By geometry, \(A(t+\Delta t) &#8211; A(t) = -3 (l(t) &#8211; \frac{ds}{dt} \Delta t) \frac{\sqrt{3}}{4} \frac{ds}{dt} \Delta t + o({\Delta t}^2)\), thus \(\frac{dA}{dt} = -3 \frac{\sqrt{3}}{4} l(t)\)</li>
</ul>
<p>Combining: \(-\frac{3}{4}\sqrt{3} l(t) = \frac{\sqrt{3}}{2} l(t) \frac{dl}{dt}\)<br />
\(\frac{dl}{dt} = -\frac{3}{2}\). Integrating with boundary conditions, we get \(-\frac{3}{2}t_f = -1\), \(t_f = \frac{2}{3}\), and since speed is 1, \(s(t_f) = t_f = \frac{2}{3}\). This is how far the object travels.</p>
<p>Finally, since the process is self-similar at every step along the path, the path of the object must be a <a href="http://en.wikipedia.org/wiki/Logarithmic_spiral">logarithmic spiral</a>. Furthermore, since the linear speed on the path is constant, the angular speed must be exponentially increasing (in angle) toward the center of the spiral.</p>
<p><img src="wp-content/uploads/images/spiral.png" align="right" /> To solve for this spiral explicitly, we have \(\frac{dr}{dt}=\frac{dr}{d\theta} \frac{d\theta}{dt} = \frac{\sqrt{3}}{3} \frac{dl}{dt} = -\frac{\sqrt{3}}{2}\).<br />
\(\frac{dr}{d\theta} = -k \exp(-k \theta)\), so \(\frac{d\theta}{dt} = \frac{\sqrt{3}}{2k} \exp (k\theta)\), and \(\theta(t) = -\frac{1}{k} \ln(-\frac{\sqrt{3}}{2}t + C)\). Plugging into \(r(\theta) = \exp(-k\theta)\) and applying the boundary condition \(r(\theta_0) = \frac{\sqrt{3}}{3}\), we get \(r(t) = -\frac{\sqrt{3}}{2}t + \frac{\sqrt{3}}{3}\).<br />
Next, \(\int_{\theta_0}^\infty r(\theta) d\theta = \frac{\sqrt{3}}{3k} = \frac{2}{3}\), so \(k=\frac{\sqrt{3}}{2}\) and \(\theta(t) = -\frac{2\sqrt{3}}{3} \ln(-\frac{\sqrt{3}}{2}t + \frac{\sqrt{3}}{3})\).</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=123</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
