<?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; sum</title>
	<atom:link href="http://blog.yhuang.org/?feed=rss2&#038;tag=sum" 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>a problem of moments</title>
		<link>https://blog.yhuang.org/?p=934</link>
		<comments>https://blog.yhuang.org/?p=934#comments</comments>
		<pubDate>Sun, 07 Oct 2012 07:59:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[mathbb]]></category>
		<category><![CDATA[mathbf]]></category>
		<category><![CDATA[proof]]></category>
		<category><![CDATA[sum]]></category>
		<category><![CDATA[Vert]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=934</guid>
		<description><![CDATA[We would like to prove the following fact: For any non-negative random variable having finite first and second moments, . The proof isn&#8217;t difficult. Here are three different ones. Proof 1. We already know from Jensen&#8217;s inequality that if is convex. This gives for any . The trick to make it be is to note [...]]]></description>
			<content:encoded><![CDATA[<p>We would like to prove the following fact:</p>
<p>For any non-negative random variable \(X\) having finite first and second moments, \(\mathbb P(X>0) \ge (\mathbb EX)^2/\mathbb EX^2\).</p>
<p>The proof isn&#8217;t difficult. Here are three different ones.<br />
<span id="more-934"></span><br />
<strong>Proof 1.</strong> We already know from Jensen&#8217;s inequality that \(\mathbb E f(X) \ge f(\mathbb E X)\) if \(f\) is convex. This gives \((\mathbb EX)^2/\mathbb EX^2 \le 1\) for any \(X\). The trick to make it be \(\le \mathbb P(X>0)\) is to note that the density at \(X=0\) contributes nothing to any moment. In particular, if \(F_X(t)\) is the distribution function of \(X\), then define a random variable \(Y\) that is \(X\) without the probability at zero, that is, according to the distribution function \(F_Y(t)=(F_X(t)-F_X(0))/(1-F_X(0))\). Then Jensen&#8217;s gives \((\mathbb EY)^2/\mathbb EY^2 \le 1\). However, \(\mathbb EY = \mathbb EX / (1-F_X(0)) = \mathbb EX / \mathbb P(X>0)\), and \(\mathbb EY^2 = \mathbb EX^2 / (1-F_X(0)) = \mathbb EX^2 / \mathbb P(X>0)\), so \((\mathbb EX)^2/\mathbb EX^2 = [(\mathbb EY)^2 \mathbb P(X>0)^2] / [\mathbb EY^2 \mathbb P(X>0)] \le \mathbb P(X>0)\). \(\blacksquare\)</p>
<p>The statement would also work for non-positive \(X\), of course; and an analogous statement can be made for arbitrary \(X\) comparing \(\mathbb P(X\ne 0)\) with some combination of moments for the positive and negative parts of \(X\).</p>
<p><strong>Proof 2.</strong> Apparently this problem can also be proved by an application of the Cauchy-Schwarz inequality. Assume the probability space \((\Omega, \mathcal F, \mathbb P)\). The space of finite second-moment real-valued random variables \(L_2(\Omega)=\{X(\omega):\Omega \to R\}\) with the inner product \(\langle X,Y\rangle_{L_2(\Omega)}=\mathbb E XY\) and induced norm \(\Vert X\Vert_{L_2(\Omega)}=\sqrt{\mathbb EX^2}\) is a Hilbert space (modulo \(L_2\) equivalence). Given this, let us apply Cauchy-Schwarz on the two random variables \(X\) and \(\mathbf 1_{X>0}\):</p>
\(\langle X, \mathbf 1_{X>0} \rangle^2 \le \Vert X \Vert^2 \Vert \mathbf 1_{X>0} \Vert^2\), by Cauchy-Schwarz<br />
\((\mathbb E X \mathbf 1_{X>0})^2 \le \mathbb EX^2 \mathbb E\mathbf 1_{X>0}\), specializing to \(L_2(\Omega)\)<br />
\((\mathbb E X)^2 \le \mathbb EX^2 \mathbb P(X>0)\), by noting that \(X = X \mathbf 1_{X>0}\).  \(\blacksquare\)
<p>This is a special case of something called the <a href="http://en.wikipedia.org/wiki/Paley%E2%80%93Zygmund_inequality">Paley-Zygmund inequality</a>. I didn&#8217;t know such a thing existed.</p>
<p><strong>Proof 3.</strong> This one only proves the discrete case. It is well known that for positive discrete random variables \(X\), \(\mathbb EX = \sum_{k=0}^\infty \mathbb P(X>k) = \mathbb P(X>0)+\mathbb P(X>1)+\cdots\). Basically \(\mathbb P(X=1)\) is counted once, \(\mathbb P(X=2)\) is counted twice, and so on. The analogous thing can be derived for \(\mathbb EX^2\), except now we need to count in squares. Happily we also know that squares accumulate by odd integers, i.e. \(n^2=1+3+5+\cdots+(2n-1)\), so \(\mathbb EX^2 = \sum_{k=0}^\infty \mathbb (2k+1) \mathbb P(X>k) = \mathbb P(X>0)+3\mathbb P(X>1)+5\mathbb P(X>2)+\cdots\).</p>
<p>Let&#8217;s simplify the notation a bit. Put \(q_k=\mathbb P(X>k)\), then \(q_0\ge q_1\ge q_2 \ge \cdots\). We just need to prove that \(q_0\ge (q_0+q_1+q_2+\cdots)^2 / (q_0+3q_1+5q_2+\cdots)\), which is to say, \((q_0+q_1+q_2+\cdots)^2 \le q_0(q_0+3q_1+5q_2+\cdots)\). The two sides both have limits, so this just requires some accounting. On the left hand side, \((q_0+q_1+q_2+\cdots)^2\) expands to \(q_0^2+(q_1^2+2q_0q_1)+(q_2^2+2q_0q_2+2q_1q_2)+\cdots = Q_0+Q_1+Q_2+\cdots\), where \(Q_k \triangleq q_k^2 + 2 \sum_{i=0}^{k-1} q_iq_k \le (2k+1)q_0q_k \triangleq R_k\). But \(R_0+R_1+R_2+\cdots\) is exactly the right hand side. So the left hand sum is dominated by the right hand sum.  \(\blacksquare\)</p>
<p>With some real analysis, this proof could be made to work for random variables that are not discrete, but it might also turn into a special case of Proof 1. In any case, it&#8217;s interesting in its own right.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=934</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>tensors</title>
		<link>https://blog.yhuang.org/?p=655</link>
		<comments>https://blog.yhuang.org/?p=655#comments</comments>
		<pubDate>Sun, 16 Oct 2011 12:33:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[basis]]></category>
		<category><![CDATA[component elements]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[math math]]></category>
		<category><![CDATA[overbrace]]></category>
		<category><![CDATA[space]]></category>
		<category><![CDATA[sum]]></category>
		<category><![CDATA[vector products]]></category>
		<category><![CDATA[vector space]]></category>
		<category><![CDATA[vector spaces]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=655</guid>
		<description><![CDATA[This has been a confusing topic, with half a dozen Wikipedia pages on the subject. Here I took some notes. Tensors are sums of &#8220;products&#8221; of vectors. There are different kinds of vector products. The one used to build tensors is, naturally, the tensor product. In the Cartesian product of vector spaces , the set [...]]]></description>
			<content:encoded><![CDATA[<p>This has been a confusing topic, with half a dozen Wikipedia pages on the subject. Here I took some notes.</p>
<p>Tensors are sums of &#8220;products&#8221; of vectors. There are different kinds of vector products. The one used to build tensors is, naturally, the <strong>tensor product</strong>. In the Cartesian product of vector spaces \(V\times W\), the set elements are tuples like \((v,w)\) where \(v\in V, w\in W\). A tensor product \(v\otimes w\) is obtained by tupling the component <strong>bases</strong> rather than the component elements. If \(V\) has basis \(\{e_i\}_{i\in\{1,&#8230;,M\}}\) and \(W\) has basis \(\{f_j\}_{j\in\{1,&#8230;,N\}}\), then take \(\{(e_i,f_j)\}_{i\in\{1,&#8230;,M\},j\in\{1,&#8230;,N\}}\) as the basis of the <strong>tensor product space</strong> \(V\otimes W\). Then define the tensor product \(v\otimes w\) as</p>
<p>(1) \(\sum_{i,j} v_i w_j (e_i,f_j) \in V\otimes W\),</p>
<p>if \(v=\sum_i v_i e_i\) and \(w=\sum_j w_j f_j\). The entire tensor product space \(V\otimes W\) is defined as sums of these tensor products</p>
<p>(2) \(\{\sum_k v_k\otimes w_k | v_k\in V, w_k\in W\}\).</p>
<p>So tensors in a given basis can be represented as multidimensional arrays.</p>
<p>\(V\otimes W\) is also a vector space, with \(MN\) basis dimensions (c.f. \(V\times W\) with \(M+N\) basis dimensions). But additionally, it has internal multilinear structure due to the fact that it is made of component vector spaces, namely:</p>
<p>\((v_1+v_2)\otimes w = v_1\otimes w + v_2\otimes w\)<br />
\(v\otimes (w_1+w_2) = v\otimes w_1 + v\otimes w_2\)<br />
\(\alpha (v\otimes w) = (\alpha v)\otimes w = v\otimes (\alpha w)\)<br />
<span id="more-655"></span><br />
Higher-order (n-th order) tensor products \(v_1\otimes v_2\otimes \cdots \otimes v_n\) are obtained by chaining in the obvious way, likewise for higher-order tensor product spaces \(V_1\otimes V_2\otimes \cdots \otimes V_n\). With this, <strong>concatenation</strong> of tensors are also defined, i.e. \(S_{i_1,&#8230;i_m} \in V_1\otimes \cdots \otimes V_m\) and \(T_{i_{m+1},&#8230;,i_n} \in V_{m+1}\otimes \cdots \otimes V_n\), then \(S_{i_1,&#8230;,i_m}\otimes T_{i_{m+1},&#8230;,i_n} = Z_{i_1,&#8230;,i_n} \in V_1\otimes \cdots \otimes V_n\). In other words, the indices are appended. This is essentially the <strong>Kronecker product</strong>, which generalizes the <strong>outer product</strong>.</p>
<p>However, usually when tensors are mentioned, the tensor product spaces under discussion are already specialized to those generated from a single base vector space \(V\) and its dual space \(V^*\), rather than from a collection of arbitrary vector spaces. In such a space \(P(m,n) = \overbrace{V\otimes \cdots \otimes V}^{m} \otimes \overbrace{V^*\otimes \cdots \otimes V^*}^{n}\), the component spaces (and their bases, indices, etc.) naturally belong to two groups, those from \(V\) are called <strong>contravariant</strong>, those from \(V^*\) are called <strong>covariant</strong>,  and an (m,n)-tensor from \(P(m,n)\) is written \(T^{i_1,&#8230;,i_m}_{j_1,&#8230;,j_n}\).</p>
<p>This specialization allows the <strong>contraction</strong> of tensors to be defined. A contraction basically chooses one covariant vector component and one contravariant vector component from a tensor and applies the former as a functional on the latter, e.g., contracting \(T^{i_1,&#8230;,i_m}_{j_1,&#8230;,j_n} = v_{i_1}\otimes \cdots \otimes v_{i_m} \otimes v^*_{j_1} \otimes \cdots \otimes v^*_{j_n}\) on the pair of indices \(i_1\) and \(j_1\) gives \(Z^{i_2,&#8230;,i_m}_{j_2,&#8230;,j_n} = v^*_{j_1}(v_{i_1}) (v_{i_2}\otimes \cdots \otimes v_{i_m} \otimes v^*_{j_2} \otimes \cdots \otimes v^*_{j_n})\). \(v^*_{j_1}(v_{i_1})\) of course is an <strong>inner product</strong> that sums over the dimensions of the paired components. Contraction generalizes the <strong>trace</strong> operator. Combined with concatenation, this defines a <strong>tensor multiplication</strong>, such that if \(S^{r,i_2,&#8230;,i_m}_{s,j_2,&#8230;,j_n}\in P(m,n)\) and \(T^{s,k_2,&#8230;,k_p}_{r,l_2,&#8230;,l_q}\in P(p,q)\), then \(S^{r,i_2,&#8230;,i_m}_{s,j_2,&#8230;,j_n}T^{s,k_2,&#8230;,k_p}_{r,l_2,&#8230;,l_q}\) is the contraction of \(S^{r,i_2,&#8230;,i_m}_{s,j_2,&#8230;,j_n}\otimes T^{s,k_2,&#8230;,k_p}_{r,l_2,&#8230;,l_q}\) on all common indices that can be paired, e.g. \(r,s\). This is the so-called <strong>Einstein notation</strong>, and generalizes <strong>matrix multiplication</strong>.</p>
<p>The distinction of \(V\) vs. \(V^*\) also manifests in the <strong>change-of-basis</strong> rules for tensors, which inherit from the change-of-basis rules of the component vector spaces, which are:</p>
<ul>
<li><strong>contravariant</strong> change-of-basis rule: If \(B = [b_1\ b_2\ \cdots\ b_M]\) is a change-of-basis matrix, with the new basis \(\{b_i\}_{i\in \{1,&#8230;,M\}}\) written in the old basis as columns, then for a vector written in the old basis \(v\in V\) and the same vector written in the new basis \(\tilde{v}\in V\), \(v = B\tilde{v}\). Therefore, we have
<p>(3) \(v \mapsto \tilde{v} = B^{-1}v\).</li>
<li><strong>covariant</strong> change-of-basis rule: If additionally \(a^T\in V^*\) is a functional written in the old basis and \(\tilde{a}^T\in V^*\) is the same functional written in the new basis, then \(\forall v\in V: a^T v = \tilde{a}^T \tilde{v} = \tilde{a}^T B^{-1}v\). Therefore, we have
<p>(4) \(a^T \mapsto \tilde{a}^T = a^T B\).</li>
</ul>
<p>Combining (1), it can be shown that, for a change-of-basis tensor \(B = {B^{-1}}^{i_1}_{i_1}\cdots {B^{-1}}^{i_m}_{i_m}B^{j_1}_{j_1}\cdots B^{j_n}_{j_n}\), an (m,n)-tensor \(T^{i_1,&#8230;,i_m}_{j_1,&#8230;,j_n}\) has the change-of-basis rule \(T^{i_1,&#8230;,i_m}_{j_1,&#8230;,j_n} \mapsto BT^{i_1,&#8230;,i_m}_{j_1,&#8230;,j_n}\).</p>
<p>Okay, so what&#8217;s the point of these tensors? Basically, an (m,n)-tensor \(T^{i_1,&#8230;,i_m}_{j_1,&#8230;,j_n}\in P(m,n)\) represents a multilinear input-output relationship that takes \(n\) vectors as input and produces \(m\) vectors as output. If used &#8220;canonically&#8221; on an input \(X^{j_1,&#8230;,j_n}\in P(n,0)\), you get \(T^{i_1,&#8230;,i_m}_{j_1,&#8230;,j_n}X^{j_1,&#8230;,j_n} = Y^{i_1,&#8230;,i_m}\in P(m,0)\) as output. The contravariant input gets contracted with the covariant parts of the transformation tensor, and these drive the contravariant parts of the transformation tensor to produce the contravariant output.</p>
<p><img src="wp-content/uploads/images/tensor.png" /><br />
(System diagrams: <strong>Rank</strong> is the minimal number of terms in a tensor. On the left, a rank-1 tensor transformation; on the right, a rank-\(K\) one. )</p>
<p>An example is linear transformations, which are (1,1)-tensors (1 vector in, 1 vector out). In array representation these would just be matrices. Any rank-\(K\) linear transformation \(T^v_a\) is decomposable into a \(K\)-term tensor \(\sum_{k=1}^K v_k\otimes a_k\), but 1-term (1,1)-tensors are outer products, so this is the matrix \(\sum_{k=1}^K v_k a^T_k\), and \(Y^v = T^v_a X^a\) is just \(y = \sum_k v_k (a^T_k x)\).</p>
<p>Most other &#8220;multilinear&#8221; operations on vectors (inner product, cross product, wedge product, determinant) can be written as tensors. For example, the inner product operation (2 vectors in, &#8220;0&#8243; vectors out, i.e. scalar) is the (0,2) \(N\)-term <strong>Kronecker tensor</strong> \(\delta_{i_1 i_2}=\sum_{k=1}^N e^*_k\otimes e^*_k\) where \(\{e^*_k\}_{k\in\{1,&#8230;,N\}}\) are the standard basis of \(V^*\).</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=655</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>t-mobile prepaid optimization</title>
		<link>https://blog.yhuang.org/?p=471</link>
		<comments>https://blog.yhuang.org/?p=471#comments</comments>
		<pubDate>Sat, 28 May 2011 02:50:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[constraint]]></category>
		<category><![CDATA[min]]></category>
		<category><![CDATA[odd occasions]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[prepaid mobile phones]]></category>
		<category><![CDATA[prepaid phones]]></category>
		<category><![CDATA[purch]]></category>
		<category><![CDATA[sum]]></category>
		<category><![CDATA[Table]]></category>
		<category><![CDATA[temporary visitors]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=471</guid>
		<description><![CDATA[t-Mobile has these tiered refill cards for their prepaid mobile phones. The pricing table is here and reproduced below: $10 for 30 minutes, expires in 90 days $25 for 130 minutes, expires in 90 days $40 for 208 minutes, expires in 90 days $50 for 400 minutes, expires in 90 days $100 for 1000 minutes, [...]]]></description>
			<content:encoded><![CDATA[<p>t-Mobile has these tiered refill cards for their prepaid mobile phones. The pricing table is <a href="http://www.callingmart.com/products/wireless/ProductDetail.aspx?ID=35&#038;AspxAutoDetectCookieSupport=1">here</a> and reproduced below:</p>
<p><strong>$10</strong> for 30 minutes, expires in 90 days<br />
<strong>$25</strong> for 130 minutes, expires in 90 days<br />
<strong>$40</strong> for 208 minutes, expires in 90 days<br />
<strong>$50</strong> for 400 minutes, expires in 90 days<br />
<strong>$100</strong> for 1000 minutes, expires in 365 days</p>
<p>So which card should you buy? You could calculate a per minute cost and conclude that $100 for 1000 minutes is the most economical (plus it doesn&#8217;t expire for the longest time). Wrong!</p>
<p>It depends on how much you use the phone. The fact that the minutes expire makes the prepaid plan a <em>virtual monthly plan</em> in the regime where you do not use 1000 or more minutes per year, which is highly likely for people who choose prepaid phones to begin with (e.g. temporary visitors, odd occasions, emergencies, etc.). The constraint in that case is the expiration, not the number of minutes. If you blindly purchased $100 refills one after another, you&#8217;d have more and more unused minutes piling up. Sure, you could still use them, but even at $0.10/min. it is expensive compared to a straight monthly plan if you really mean to call that much. Of course you don&#8217;t, so now what?<br />
<span id="more-471"></span><br />
The trick is time-sharing. (Never thought this phrase would pop up in this context.) Let&#8217;s re-write the table in terms of how much you get for $1, both minutes of call, and days of non-expiry:</p>
<p><strong>$10:</strong> 3 min., 9 days / $1<br />
<strong>$25:</strong> 5.2 min., 3.6 days / $1<br />
<strong>$40:</strong> 5.2 min., 2.25 days / $1<br />
<strong>$50:</strong> 8 min., 1.8 days  / $1<br />
<strong>$100:</strong> 10 min., 3.65 days / $1</p>
<p>We see that the $25, $40, and $50 refills are <em>good for nothing</em>! Why would anyone buy those? A rational person should only buy the $10 and $100 refills in some combination: $10 for when the account is about to expire but there are plenty of minutes, and $100 for when running low on minutes. The &#8220;proof&#8221; is as follows:</p>
<p>We really care about paying the lowest per minute cost for the minutes <em>actually used</em>. To that end, if we divide the purchase between the \(N\) refill options by the weights \(w_i\), \(i=1,&#8230;,N\), and every $1 of the \(i\)th refill option pays for \(m_i\) minutes and \(d_i\) days, then, we want</p>
<p>maximize \(\sum_{i=1}^N w_i d_i\) (equivalently, maximize \(\sum_{i=1}^N w_i m_i\))<br />
subject to \(\sum_{i=1}^N w_i m_i / \sum_{i=1}^N w_i d_i = L\)<br />
and \(\sum_{i=1}^N w_i=1\)</p>
<p><img src="wp-content/uploads/images/tmobile1.png" align="right" />where \(L\) is the minutes per day that we know we use. We don&#8217;t even need to solve this explicitly. The plot shows that every point in the pentagonal region below the red line is achievable with $1, and for any given constraint \(L\), the outer boundary on the red line itself solves the optimization (i.e. is the most economical), and this is done by using only the $10 and $100 refills. Here we assumed infinitely divisible refills. By using the heuristic of when to buy which refill above though, we tend toward the average \(L\) by construction so we are always at the right operating point.</p>
<p><img src="wp-content/uploads/images/tmobile2.png" align="right" />The same analysis can be carried over to the &#8220;gold rewards&#8221; tier, which you get when you purchase the $100 refill and keep the account from expiring year after year (this is what you should do anyway, so even better). The new plot is different but the conclusion is the same, though the $50 refill looks competitive this time.</p>
<p>(For reference, the monthly cost of such a &#8220;virtual monthly plan&#8221; ranges from an incredible $0.82/mo. for 3 min./mo. &#8212; keeping the account active, basically &#8212; to $8.22/mo. for 82 min./mo. For more than 82 min./mo., the cost goes up at a rate of $0.10/min. of course. Unfortunately, you cannot buy &#8220;negative&#8221; refills, otherwise you could do better even in that regime.)</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=471</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>different kind of coupon collector&#8217;s problem</title>
		<link>https://blog.yhuang.org/?p=283</link>
		<comments>https://blog.yhuang.org/?p=283#comments</comments>
		<pubDate>Mon, 11 Oct 2010 09:18:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[call]]></category>
		<category><![CDATA[column sums]]></category>
		<category><![CDATA[math 1]]></category>
		<category><![CDATA[math types]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[partition functions]]></category>
		<category><![CDATA[pigeonhole principle]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[sum]]></category>
		<category><![CDATA[theory]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=283</guid>
		<description><![CDATA[The classic coupon collector&#8217;s problem asks for the number of samples it takes to collect all coupon types from a sequence of coupons in which each of the types of coupons has an unlimited number of copies. Here is a different kind of problem: if there are limited copies of each of the coupon types [...]]]></description>
			<content:encoded><![CDATA[<p>The classic coupon collector&#8217;s problem asks for the number of samples it takes to collect all coupon types from a sequence of coupons in which each of the \(k\) types of coupons has an unlimited number of copies.</p>
<p>Here is a different kind of problem: if there are limited copies of each of the \(k\) coupon types (say, \(d\) copies), how many samples does it take to collect \(t\) coupon types?</p>
<p><span id="more-283"></span><br />
By the pigeonhole principle, we have two extremes: from \(n=0\) to \(n=t-1\) samples, it is impossible to collect \(t\) coupon types; and for \(n>(t-1)d\) samples, it is impossible not to. For number of samples in between, there is some monotonically decreasing probability that \(t\) or more types are <strong>not</strong> collected. Let&#8217;s call the latter probability \(P(n)\). The expected number of samples it takes to collect \(t\) types is then</p>
\(\sum_{n=1}^{(t-1)d} P(n)\)
<p>Finding \(P(n)\) for \(n\ge t\) doesn&#8217;t appear easy, though the combinatorics could be written down (in theory), maybe involving partition functions, Stirling numbers, or whatever. But the question is reduced to the following, which somebody must have solved: given a \(d \times k\) 0-1 matrix, in which \(n\) 1&#8242;s are placed randomly, what is the probability that exactly \(z\) columns are 0-weight (have 0 column sums)?</p>
<p>These papers give some approximations:</p>
<p>http://arxiv.org/PS_cache/arxiv/pdf/0806/0806.1480v3.pdf</p>
<p>http://cs.anu.edu.au/~bdm/papers/irregular.pdf</p>
<p>Does anybody know the actual answer?</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=283</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>red-blue cross problem</title>
		<link>https://blog.yhuang.org/?p=185</link>
		<comments>https://blog.yhuang.org/?p=185#comments</comments>
		<pubDate>Sat, 11 Apr 2009 06:10:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[collinear]]></category>
		<category><![CDATA[face]]></category>
		<category><![CDATA[finite number]]></category>
		<category><![CDATA[line segment]]></category>
		<category><![CDATA[line segments]]></category>
		<category><![CDATA[pair]]></category>
		<category><![CDATA[segment]]></category>
		<category><![CDATA[segment lengths]]></category>
		<category><![CDATA[sum]]></category>
		<category><![CDATA[supposition]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=185</guid>
		<description><![CDATA[Here is a problem described to me by fakalin. Given n red points and n blue points, no three of which are collinear, prove that there exists a pairing of red and blue points such that the line segments connecting each pair do not intersect. The solution is straightforward though it took a while to [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a problem described to me by fakalin. Given n red points and n blue points, no three of which are collinear, prove that there exists a pairing of red and blue points such that the line segments connecting each pair do not intersect.</p>
<p><span id="more-185"></span></p>
<p>The solution is straightforward though it took a while to identify after it was already staring me in the face.</p>
<p>With each pairing is associated a total length (sum of line segment lengths). Since there are a finite number of pairings, there is a minimum length pairing. We claim this pairing must be one that satisfies the problem statement.</p>
<p>Suppose it were not, then there are some 2 red and 2 blue points such that the pairs&#8217; connecting line segments cross. Then uncross the two pairs. This can be done because the points are not collinear. By uncrossing, the sum of the pairs&#8217; segment lengths strictly decreases and therefore the total length also decreases. This contradicts the supposition. Therefore the claim is true.</p>
<p>However, note that a pairing that satisfies the statement need not be minimum total length. (The minimum total length doesn&#8217;t even need to be unique.) Nevertheless, an algorithm for reaching a solution is to start with any pairing, then identify any crossed pairs and uncross them. During this process, crossed pairs count may even increase for a time, but total length always decreases strictly at each step. Therefore, the algorithm will terminate, either when a valid pairing is reached, or when the minimum total length is reached, which also gives a valid pairing.</p>
<p>An extended question is, given the valid pairing, can a non-self-intersecting red-blue alternating path connecting all the points be found? I believe the answer is yes.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=185</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paradox of the risk premium</title>
		<link>https://blog.yhuang.org/?p=194</link>
		<comments>https://blog.yhuang.org/?p=194#comments</comments>
		<pubDate>Wed, 25 Jun 2008 03:44:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[aggregate risk]]></category>
		<category><![CDATA[diversified portfolio]]></category>
		<category><![CDATA[diversified portfolios]]></category>
		<category><![CDATA[excess return]]></category>
		<category><![CDATA[explanation]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[premium]]></category>
		<category><![CDATA[return]]></category>
		<category><![CDATA[risk premium]]></category>
		<category><![CDATA[sum]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=194</guid>
		<description><![CDATA[I mentioned this to an officemate years ago once, but I never was quite satisfied with the explanation that there is a certain amount of excess return built into the price of a company&#8217;s stock as its risk premium, but which can be diversified away through some portfolio of disparate stocks. If, merely by holding [...]]]></description>
			<content:encoded><![CDATA[<p>I mentioned this to an officemate years ago once, but I never was quite satisfied with the explanation that there is a certain amount of excess return built into the price of a company&#8217;s stock as its risk premium, but which can be diversified away through some portfolio of disparate stocks.</p>
<p>If, merely by holding a diversified portfolio, the aggregate risk can be reduced, then one would expect the return demanded for such a portfolio to be less than the sum of the returns of the individual stocks. Yet this is not the case. So we must assume either the portfolio is overperforming, the individual stocks are underperforming, or both. On the other hand, it would seem that the risk premium of any individual stock would be arbitraged away by people holding the most diversified portfolios containing it, thus it is strange that an individual stock could retain an undiversified risk premium. Thus it must not, at least not fully. Its return (and the price it sells for) is also determined by the availability for sale of other not-fully-correlated stocks and their characteristics, even ones that have no material effect on the company&#8217;s performance. This is a sure sign of value arising from the demand for the instrument unrelated to its underlying. It would seem to be mispriced as an individual stock. Perhaps an equilibrium will be struck, but it is still paradoxical to talk about the risk premium of individual stocks as a property of that stock alone.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=194</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
