<?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; math log</title>
	<atom:link href="http://blog.yhuang.org/?feed=rss2&#038;tag=math-log" 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>wire matching problem</title>
		<link>https://blog.yhuang.org/?p=179</link>
		<comments>https://blog.yhuang.org/?p=179#comments</comments>
		<pubDate>Thu, 02 Apr 2009 21:13:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[binom]]></category>
		<category><![CDATA[binomial]]></category>
		<category><![CDATA[math 1]]></category>
		<category><![CDATA[math log]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[ohm meter]]></category>
		<category><![CDATA[pair]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[wire]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=179</guid>
		<description><![CDATA[Here&#8217;s an interesting and, shall I say, practical problem brought up at group meeting today: If you have say, n identical looking wires strung across a long distance between point A and point B, and your job is to label all wires with just an ohm-meter (to measure continuity, i.e. short circuit or open circuit), [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an interesting and, shall I say, practical problem brought up at group meeting today: If you have say, n identical looking wires strung across a long distance between point A and point B, and your job is to label all wires with just an ohm-meter (to measure continuity, i.e. short circuit or open circuit), how many trips between A and B does it take?</p>
<p>Indeed, the only way to use an ohm-meter for this purpose is by tying wires together.  Clearly the number of trips shouldn&#8217;t be larger than \(\log n\) or so, simply by tying various halves of the set of wires at one end and going to the other end to measure. But there are other kinds of coding that do better.<br />
<span id="more-179"></span></p>
<p>First, some examples.</p>
<p>Clearly, \(n=2\) is impossible to label.</p>
<p>For \(n=\binom{k}{2}\) for some \(k\) (call these binomial numbers), the number of trips between A and B is no larger than 2. Here is how. At point A, partition the \(n\) wires into groups \(P_1,P_2,P_3,&#8230;,P_k\) of \(1,2,3,&#8230;,k\) wires each and tie the wires in each group together. Go to point B and recover the partition set memberships by measuring continuity between pairs of wires. (Thus A has communicated set membership to B.) Now based on this side information, repartition the wires at B into groups \(Q_1,Q_2,Q_3,&#8230;,Q_k\) again of \(1,2,3,&#8230;,k\) wires each, but do this by taking 1 wire each from \(P_1,P_2,&#8230;,P_k\) to form \(Q_k\), take 1 wire each from \(P_2,P_3,&#8230;,P_k\) to form \(Q_{k-1}\), and so on. Go back to point A, undo all the original ties, and recover the new partitions. The membership pair \((P_i,Q_j)\) uniquely identifies a wire so all wires are fully labeled at both A and B. This establishes the main ideas of this class of partitioning solutions. It is also easy to see that at least 2 trips need to be made for any \(n>1\) since sets of the same size and wires within one set cannot be distinguishable without other information.</p>
<p>For \(n\) that are sums of unique binomial numbers (call these doubly binomial numbers), a two-phase procedure can label the wires in no more than 3 trips. The first phase is to partition the wires into clusters of unique binomial number sizes \(b_1,b_2,&#8230;,b_l\). Go to point B and identify the clusters by the unique sizes of the continuity sets. Then follow the previous technique to identify the wires within each cluster. And, you can generalize this by further nesting so you get 4 trips for \(n\) that are sums of unique doubly binomial numbers i.e. triply binomial numbers, 5 trips for quadruply binomial numbers, etc.</p>
<p>In essence, this is a generalization of binary partitioning to partitioning into many sets, and more sophisticated partition based codes can probably be found for all \(n\) on a case-by-case basis, however, these are not always optimal. For one, the multi-phase procedure is arbitrary and probably inefficient. And other kinds of coding that wipes away received information in the wire configuration in order to send new information (even if some information remains undecoded, e.g. sets of the same size yet to be distinguished) lose efficiency.</p>
<p>The better solution that solves the problem in the optimal 2 trips (A to B to A) uses clever feedback in the coding. The idea is based on the fact that if you chain all wire segments together in series (like Christmas lights), then the location of any single break in the chain can be determined by measuring continuity from one terminus. Here it is:</p>
<p>So suppose \(n\) is odd. At point A, arbitrarily label 1 wire to be &#8220;the left terminus&#8221; or node 0. Tie the remaining wires into \((n-1)/2\) pairs. Go to point B. By the coding at A, the single wire and collection of wire pairs can be distinguished. So node 0 at B is established. Then arbitrarily choose a pair and a node in the pair, and connect it to node 0. This becomes node 1, the remaining node of the pair becomes node 2. Choose another pair and a node in the pair and connect it to node 2, this becomes node 3 and the other of the pair node 4, and so on, until all wire segments are connected in series. This configuration becomes the feedback information. Go back to point A. Now we use the feedback to search for all nodes from 1 to \(n-1\). This is easy to do: just make a cut at any connection at A and measure continuity between node 0 and all other nodes. Say there are some s nodes that read short circuit and the rest open circuit. Then immediately it is known that the cut is between nodes \(s\) and \(s+1\). This can be repeated at all cuts so all nodes are labeled.</p>
<p>Suppose \(n>2\) is even. Then arbitrarily choose two wires to be the termini. Connect the remaining into pairs. Go to B and identify the two single wires. Choose one to be the left terminus, i.e. node 0 and the other one the right terminus, i.e. node \(n-1\). Then follow the previous connection procedure for the odd number of n-1 nodes not including node \(n-1\). Go back to A and identify the right terminus as the only one of two single wires that is open circuit with all other nodes; that gets labeled node \(n-1\). Then remove it from consideration. The other single wire is labeled node 0, and the same procedure is applied as previously to label the remaining nodes.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=179</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>
