<?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; coin</title>
	<atom:link href="http://blog.yhuang.org/?feed=rss2&#038;tag=coin" 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>circulating denominations (part 4)</title>
		<link>https://blog.yhuang.org/?p=584</link>
		<comments>https://blog.yhuang.org/?p=584#comments</comments>
		<pubDate>Thu, 14 Jul 2011 15:39:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[canadian money]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[coin]]></category>
		<category><![CDATA[critical element]]></category>
		<category><![CDATA[frequency]]></category>
		<category><![CDATA[idea]]></category>
		<category><![CDATA[latter situation]]></category>
		<category><![CDATA[rough sense]]></category>
		<category><![CDATA[transaction]]></category>
		<category><![CDATA[transaction amounts]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=584</guid>
		<description><![CDATA[&#8230; and wallet distributions. This is part of the Toronto visit series. &#8220;Do you have change for $5?&#8221; &#8220;I can only give you one loonie and two lizes&#8221; &#8220;What?&#8221; Dumps coins on counter. &#8220;Oh&#8230;&#8221; (Canada has no bills under $5 and circulates the $1 and $2 coins.) Before playing with Canadian money, I had thought [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230; and wallet distributions.</p>
<p><em>This is part of the Toronto visit series.</em></p>
<p>&#8220;Do you have change for $5?&#8221;<br />
&#8220;I can only give you one loonie and two lizes&#8221;<br />
&#8220;What?&#8221;<br />
Dumps coins on counter.<br />
&#8220;Oh&#8230;&#8221;</p>
<p>(Canada has no bills under $5 and circulates the $1 and $2 coins.)</p>
<p>Before playing with Canadian money, I had thought that a $2 denomination, whether coin or bill, would be a great idea. But the problem I encountered here was that I was just unable to get very many $1 coins when the $2 coin was also widely circulating. This makes sense, because each transaction at most ends up giving you one additional $1 coin if done optimally. But if you had to always pay odd dollar-amount fees like the $3 streetcar fares, then you need many $1 coins which you don&#8217;t have. Compare this to the US system, where you get lots of $1 bills from daily transactions &#8212; up to four $1 bills in a transaction ($0-$4 in change). It surprised me that the latter situation is more flexible, because I did not take into account the dynamic effects that repeated transactions have.<br />
<span id="more-584"></span><br />
Perhaps the intellectual impetus behind a $2 denomination is based on the idea of binary denominations, namely $1, $2, $4, $8, etc., which seems intuitively &#8220;nice&#8221; for efficiency. It&#8217;s hard to think why this should be desired now, it just seemed obvious. Perhaps in such a system the fewest coins/bills need to be carried to ensure all transaction amounts within a range are possible. Or perhaps the fewest coins/bills change hands on average over transaction amounts distributed a certain way (exponentially decreasing frequency as amounts go up?). Yet this system may not work so well, because though it is great for one transaction, you always need a complete set to make it work for the next transactions. The more critical element is net wallet change.</p>
<p>In fact you want this <strong>wallet distribution</strong> to be, in some rough sense, stable. At worst it should be invariant, and at best, surplus producing. What I mean is illustrated by this:</p>
<p>transaction amount: wallet change<br />
$1: -1 $1<br />
$2: +3 $1, -1 $5<br />
$3: +2 $1, -1 $5<br />
$4: +1 $1, -1 $5<br />
$5: -1 $5</p>
<p>Why pay with $5 for a $2 fee rather than two $1? Well, we assumed that both payment and change-making use the &#8220;lazy algorithm&#8221; seen in real life: it&#8217;s the choice requiring the fewest coins/bills (and among those, the lowest denomination ones). Note that there is an asymmetry since the payer doesn&#8217;t have to make exact change but the cashier must settle with exact change.</p>
<p>If all transactions were integer amounts between $1 and $5, and we have an endless supply of $5 (let&#8217;s say that&#8217;s what the ATM gives), then some transaction amount distribution would make the wallet distribution invariant (as far as it concerns denominations under $5). For example, this (*):</p>
<p>transaction amount: frequency<br />
$1: 17<br />
$2: 3<br />
$3: 3<br />
$4: 2<br />
$5: 1</p>
<p>On the other hand, a flat distribution would give a net surplus of +1 $1 per transaction. Either case would be fine. But in Canada with the $2 coin, the tabulation is different:</p>
<p>transaction amount: wallet change<br />
$1: -1 $1<br />
$2: -1 $2<br />
$3: +1 $2, -1 $5<br />
$4: +1 $1, -1 $5<br />
$5: -1 $5</p>
<p>With the same transaction amount distribution as (*), we would end up with -3 $1 per transaction, a severe deficit. And unlike any other denomination, $1 is a necessity (it&#8217;s an atom). I&#8217;m not saying this transaction amount distribution is right, but whatever it be, the existence of $2 totally changes the wallet situation and in this case made things worse.</p>
<p>In the US, the existing denominations are kind of close to binary, except there is a magnitude gap between $1 and $5 ($2 bills do exist but rarely circulate), which seemed like a fault. But considering what happened in Canada, maybe this is a blessing in disguise.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=584</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>resolving the St. Petersburg paradox</title>
		<link>https://blog.yhuang.org/?p=89</link>
		<comments>https://blog.yhuang.org/?p=89#comments</comments>
		<pubDate>Thu, 24 Jan 2008 02:36:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coin]]></category>
		<category><![CDATA[counterparty]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[initial entry]]></category>
		<category><![CDATA[initial money]]></category>
		<category><![CDATA[logarithmic growth]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[money supply]]></category>
		<category><![CDATA[result]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=89</guid>
		<description><![CDATA[The St. Petersburg paradox is based on one of those gambling games where the usual model of using expected gain to decide whether to play the game gives a counter-intuitive result. In the simplest of examples, you pay some entry fee to play the game, $1 is put in a pot by a counterparty, then [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://en.wikipedia.org/wiki/St._Petersburg_paradox">St. Petersburg paradox</a> is based on one of those gambling games where the usual model of using expected gain to decide whether to play the game gives a counter-intuitive result.</p>
<p>In the simplest of examples, you pay some entry fee to play the game, $1 is put in a pot by a counterparty, then a coin is repeatedly flipped and the pot is doubled on every coin flip by the counterparty, until &#8220;tail&#8221; comes up. You receive the money in the pot. The expected gain of this game is infinite, regardless of the initial entry fee. So it would seem that one should always play the game, regardless of the amount demanded as entry fee. But, as the article points out, &#8220;few of us would pay even $25 to enter such a game.&#8221;<br />
<span id="more-89"></span><br />
(This seems to be one of many variations of the paradox.) The explanations given in the link to resolve the paradox aren&#8217;t satisfactory. &#8220;One can&#8217;t buy what isn&#8217;t sold&#8221; can only be considered a joke, while &#8220;expected utility&#8221; is somewhat plausible, but doesn&#8217;t strike at the central issue, because it can be circumvented with an equally counter-intuitive paradox fitted to the chosen utility function. In contrast to the <a href="http://en.wikipedia.org/wiki/Gambler%27s_ruin">Gambler&#8217;s ruin paradox</a>, I don&#8217;t think that an artificial finite bound on the money supply (in this case, of the counterparty) makes sense as an explanation, but what it reveals as the logarithmic growth of the expected gain against the money supply and the general consequence that imposing some kind of finiteness may explain the paradox, is instructive.</p>
<p>Of course, the only way to get any gain is to actually play the game. If you repeatedly play the game,  your gain does eventually go to infinity. So why would you be reluctant to pay even $25 to enter? It must be because those large pay-offs are so infrequent that to make the initial money back would take too long. Suppose the entry fee is \(W\). Suppose you call it a day when you have a positive pay-off. For that to happen in round \(n\), it must be true that</p>
<p><img align="bottom" alt="Input: \begin{eqnarray*}
2^{f_1} + 2^{f_2} + \dots + 2^{f_k} &amp; &lt; &amp; kW,\  (k&lt;n)\\
2^{f_1} + 2^{f_2} + \dots + 2^{f_n} &amp; \geq &amp; nW
\end{eqnarray*}" src="wp-content/cache/095421c4aa4848b516690799f4a86487.png" /></p>
<p>where \(f_i\) is the number of flips before tail comes up in round \(i\).</p>
<p>Let&#8217;s call n-tuples \((f_1, f_2, \dots, f_n)\) that satisfy the above by the set \(S_n\). The probability of winning in round \(n\) is then</p>
<p><img align="bottom" alt="Input: $$p_n \equiv \sum_{(f_1,\dots,f_n)\in S_n}  \left( \prod_{i=1}^n 2^{f_i+1} \right)^{-1} $$" src="wp-content/cache/708abd4419eedf4e14ddc0a7ca59172c.png" /></p>
<p>from which we can surely get the average number of rounds it will take to win the game \(\sum_{i=1}^\infty n p_n\). If this is incredibly large even for modest \(W\), which is likely the case, then that would explain the paradox, since a game that on average takes longer than a lifetime to win would be played by no one.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=89</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A little Markovian problem</title>
		<link>https://blog.yhuang.org/?p=12</link>
		<comments>https://blog.yhuang.org/?p=12#comments</comments>
		<pubDate>Sun, 29 Oct 2006 20:18:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[backtracks]]></category>
		<category><![CDATA[coin]]></category>
		<category><![CDATA[digraph]]></category>
		<category><![CDATA[heads and tails]]></category>
		<category><![CDATA[hht]]></category>
		<category><![CDATA[player]]></category>
		<category><![CDATA[player player]]></category>
		<category><![CDATA[sequence context]]></category>
		<category><![CDATA[state]]></category>
		<category><![CDATA[transition]]></category>

		<guid isPermaLink="false">http://scripts.mit.edu/~zong/wpress/?p=12</guid>
		<description><![CDATA[Here it is:  A has a fair coin and B has a fair coin. They flip coins together, but only keep track of their own sequences of heads and tails. A stops if the sequence &#8220;HHT&#8221; appears. B stops if the sequence &#8220;HTH&#8221; appears. Which player is more likely to stop first? While it would [...]]]></description>
			<content:encoded><![CDATA[<p>Here it is: </p>
<blockquote><p>A has a fair coin and B has a fair coin. They flip coins together, but only keep track of their own sequences of heads and tails. A stops if the sequence &#8220;HHT&#8221; appears. B stops if the sequence &#8220;HTH&#8221; appears. Which player is more likely to stop first?</p></blockquote>
<p><span id="more-12"></span></p>
<p>While it would first appear that any 3-flip sequence is equally likely and so neither A nor B is more likely to stop before the other, this is wrong. The eight 3-flip sequences are only equally likely when taken independently of the remaining sequence context. By context, I mean there is a time origin in this problem and there is memory from the stopping 3-flip sequence that leads all the way back to it.</p>
<p>The answer is found if we draw the state diagram of the game for each player.</p>
<p>Player A<br />
<img align="bottom" alt="Input: digraph G {
graph [rankdir=LR]
{0 H HH HHT [shape=doublecircle]}
0 -&gt; H [label=H]
0 -&gt; 0 [label=T]
H -&gt; HH [label=H]
H -&gt; 0 [label=T]
HH -&gt; HH [label=H]
HH -&gt; HHT [label=T]
}" src="wp-content/cache/f151847dd4f5adb6d5a138ee4e318e12.png" /></p>
<p>Player B<br />
<img align="bottom" alt="Input: digraph G {
graph [rankdir=LR]
{0 H HT HTH [shape=doublecircle]}
0 -&gt; H [label=H]
0 -&gt; 0 [label=T]
H -&gt; H [label=H]
H -&gt; HT [label=T]
HT -&gt; HTH [label=H]
HT -&gt; 0 [label=T]
}" src="wp-content/cache/df43149372f6033610ee6b9ee0c87df5.png" /></p>
<p>They are pretty much the same, except A&#8217;s diagram has a transition that backtracks by one state where the analogous transition on B&#8217;s diagram backtracks by two. So indeed, A is more likely to stop first.</p>
<p>An interesting thing happens if we let A and B continue flipping even after they are supposed to stop. This changes the destination of one transition in each state diagram. Now the two diagrams look more similar.</p>
<p>Player A<br />
<img align="bottom" alt="Input: digraph G {
graph [rankdir=LR]
{0 H HH}
0 -&gt; H [label=H]
0 -&gt; 0 [label=T]
H -&gt; HH [label=H]
H -&gt; 0 [label=T]
HH -&gt; HH [label=H]
HH -&gt; 0 [label=T color=blue]
}" src="wp-content/cache/1f05e52fe69f93b1f3ca986f4916b9b8.png" /></p>
<p>Player B<br />
<img align="bottom" alt="Input: digraph G {
graph [rankdir=LR]
{0 H HT}
0 -&gt; H [label=H]
0 -&gt; 0 [label=T]
H -&gt; H [label=H]
H -&gt; HT [label=T]
HT -&gt; H [label=H color=blue]
HT -&gt; 0 [label=T]
}" src="wp-content/cache/2485278455bd040486cf9dd6cb8c2592.png" /></p>
<p>In fact, they are equivalent (after a rotational shift of the states). So asymptotically, the sequence &#8220;HTH&#8221; occurs just as frequently as &#8220;HHT&#8221;.</p>
<p>If we look at this a little more carefully, we find that it takes on average 8 flips to see the first &#8220;HHT&#8221; while it takes an average of 10 flips to see the first &#8220;HTH&#8221;. After that, however, both subsequences occur at a rate of every 8 flips (overlapping frames allowed), which of course makes perfect sense, since there are 8 such 3-flip sequences.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.yhuang.org/?feed=rss2&#038;p=12</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
