<?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; consideration</title>
	<atom:link href="http://blog.yhuang.org/?feed=rss2&#038;tag=consideration" 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>problem of strings</title>
		<link>https://blog.yhuang.org/?p=848</link>
		<comments>https://blog.yhuang.org/?p=848#comments</comments>
		<pubDate>Wed, 07 Mar 2012 05:19:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[binom]]></category>
		<category><![CDATA[consideration]]></category>
		<category><![CDATA[matter]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[sum]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=848</guid>
		<description><![CDATA[This is a problem via fakalin. You have 10 pieces of string, each with two ends. You randomly pick two ends of string (possibly from the same string, possibly from different ones) and tie them together, creating either a longer piece of string or a loop. You keep doing this until you run out of [...]]]></description>
			<content:encoded><![CDATA[<p>This is a problem via fakalin.</p>
<blockquote><p>You have 10 pieces of string, each with two ends. You randomly pick two ends of string (possibly from the same string, possibly from different ones) and tie them together, creating either a longer piece of string or a loop. You keep doing this until you run out of free ends.</p>
<p>What is the expected number of loops you end up with?</p></blockquote>
<p><span id="more-848"></span><br />
Things to note are the following:</p>
<p>- Once a loop is made from a string, it is removed from further consideration.<br />
- Picking two ends from the same string immediately makes a loop.<br />
- Picking two ends from different strings makes a longer string.</p>
<p>So in the end, no matter which two ends are picked, we have one fewer open string than we started with.</p>
<p>Let \(f(n)\) be the expected number of loops with \(n\) open strings. We know \(f(1)=1\). With \(n\) strings, the probability of picking two ends from the same string is \(n/\binom{2n}{2}\). So:</p>
\(f(n) = n/\binom{2n}{2} (f(n-1) + 1) + (1 &#8211; n/\binom{2n}{2}) f(n-1)\)<br />
\(= f(n-1) + n/\binom{2n}{2} = f(n-1) + n / [2n (2n - 1) / 2] = f(n-1) + 1 / (2n-1)\)
<p>That is, \(f(n) = \sum_{i=1}^n 1/(2i-1)\), \(f(10) = 1841/863\).</p>
<p>For large \(n\), this sum does not converge, in fact it is obvious that \(f(n)\) grows like \(\log n\).</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=848</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Combinatorics problem (McDonald&#8217;s)</title>
		<link>https://blog.yhuang.org/?p=63</link>
		<comments>https://blog.yhuang.org/?p=63#comments</comments>
		<pubDate>Thu, 08 Mar 2007 09:09:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[backslash]]></category>
		<category><![CDATA[consideration]]></category>
		<category><![CDATA[cup]]></category>
		<category><![CDATA[exclusion principle]]></category>
		<category><![CDATA[Happy]]></category>
		<category><![CDATA[happy meals]]></category>
		<category><![CDATA[interesting fact]]></category>
		<category><![CDATA[McDonald]]></category>
		<category><![CDATA[set]]></category>
		<category><![CDATA[straightforward application]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=63</guid>
		<description><![CDATA[Buy 16 Happy Meals, each time get a toy from a set of 8. What is the probability that the whole set is collected? A straightforward application of the inclusion-exclusion principle will do. The sets under consideration are sets of Happy Meals. Happy Meals are the same or different only based on the sequence of [...]]]></description>
			<content:encoded><![CDATA[<p>Buy 16 Happy Meals, each time get a toy from a set of 8. What is the probability that the whole set is collected?<br />
<span id="more-63"></span><br />
A straightforward application of the inclusion-exclusion principle will do.</p>
<p>The sets under consideration are sets of Happy Meals. Happy Meals are the same or different only based on the sequence of toys received.</p>
<p>We have subsets now with different properties. Let \(A\subset \{1,\ldots,8\}\) be a set of toys, and \(T_{A}\) be the set of Happy Meals that do not contain toys in \(A\). For example, \(T_{\{1\}}\) is the set of Happy Meals missing toy 1. What we really want to find is the size of this set:</p>
\( T_{\{\}}\backslash(T_{\{1\}}\cup\cdots\cup T_{\{8\}}) \)
<p>which contain just those Happy Meals that aren&#8217;t missing any toys.</p>
<p>Here&#8217;s where we apply the inclusion-exclusion principle. The size of the second part above is:<br />
\(\sum_{i=1}^{8} (-1)^{i-1} (\sum_{A:|A|=i} |T_A|)\)<br />
or<br />
\((|T_{\{1\}}|+ \cdots +|T_{\{8\}}|) &#8211; (|T_{\{1\}}\cap T_{\{2\}}|+ \cdots +|T_{\{7\}}\cap T_{\{8\}}|) + (|T_{\{1\}}\cap T_{\{2\}}\cap T_{\{3\}}| + \cdots ) &#8211; \cdots\)</p>
<p>Now, notice the following interesting fact:</p>
\(T_{A \cup B} = T_A \cap T_B\),</p>
<p>because the Happy Meals that are missing toys in \(A\cup B\) are exactly those that do not contain toys in \(A\) and do not contain toys in \(B\). Further note that \(|T_A|=|T_B|\) if \(|A|=|B|\), because the number of Happy Meals only depends on the number of excluded toys that characterizes them. So replace \(|T_A|\) by \(N_{|A|}\)
<p>Taking the above into consideration, we find the size of \(T_{\{1\}}\cup\cdots\cup T_{\{8\}}\) to be </p>
\(\sum_{i=1}^{8} (-1)^{i-1} (\sum_{A:|A|=i} N_i) = \sum_{i=1}^{8} (-1)^{i-1} {8\choose i} N_i\)
<p>Clearly, the number of Happy Meals that do not contain some particular pre-determined \(i\) toys is \(N_i = (8-i)^{16}\), so the size of the set is \(\sum_{i=1}^{8} (-1)^{i-1} {8 \choose i} (8-i)^{16}\) or \({8 \choose 1}7^{16} &#8211; {8 \choose 2}6^{16} + {8 \choose 3}5^{16} &#8211; {8 \choose 4}4^{16} + {8 \choose 5}3^{16} &#8211; {8 \choose 6}2^{16} + {8 \choose 7}1^{16} = 195119050093696\).</p>
<p>The answer to the original problem is </p>
<p>\((8^{16} &#8211; 195119050093696)/8^{16} = 343/1118 \approx 0.3068\).</p>
<p>The solution is at once generalizable to any number of toys and any number of Happy Meals.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=63</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
