<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Amazon poker</title>
	<atom:link href="http://bit-player.org/2007/amazon-poker/feed" rel="self" type="application/rss+xml" />
	<link>http://bit-player.org/2007/amazon-poker</link>
	<description>An amateur's outlook on computation and mathematics.</description>
	<pubDate>Thu, 17 May 2012 08:51:17 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: John S.</title>
		<link>http://bit-player.org/2007/amazon-poker#comment-1473</link>
		<dc:creator>John S.</dc:creator>
		<pubDate>Sat, 12 May 2007 13:53:04 +0000</pubDate>
		<guid isPermaLink="false">http://bit-player.org/?p=96#comment-1473</guid>
		<description>This post recalls the recent "controversy" over whether the iPod's shuffle algorithm was truly random or not. See for example
http://www.msnbc.msn.com/id/6854309/site/newsweek/</description>
		<content:encoded><![CDATA[<p>This post recalls the recent &#8220;controversy&#8221; over whether the iPod&#8217;s shuffle algorithm was truly random or not. See for example<br />
<a href="http://www.msnbc.msn.com/id/6854309/site/newsweek/" rel="nofollow">http://www.msnbc.msn.com/id/6854309/site/newsweek/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Barry Cipra</title>
		<link>http://bit-player.org/2007/amazon-poker#comment-1472</link>
		<dc:creator>Barry Cipra</dc:creator>
		<pubDate>Fri, 11 May 2007 23:10:50 +0000</pubDate>
		<guid isPermaLink="false">http://bit-player.org/?p=96#comment-1472</guid>
		<description>Here's another fun statistical test you can run on your data.  Keep track of the sequence of ups and downs in your rankings.  For example, your April hardback sequence goes

ududuudduuuudduuudududddudud

(i.e., it goes up from 138263 to 192152, then down to 29146, etc.)  Note there are 15 ups and 13 downs.  Let's compare this to a "random" string of 28 binary digits, say

0010010000111111011010101000

(the astute bit-player will notice the fractional part of pi written in binary...).  By happenstance (or perhaps Jeff Bezos has a hand in this as well), this string has 15 zeroes and 13 ones, so it's quite comparable to your ups and downs.   Offhand they look a lot alike.  One way they differ, though (aside from u's and d's versus 0's and 1's), is in how often consecutive entries are the same as opposed to different.  For the random string, the entries stay the same 13 out of 27 times (thanks in part to that long, non-random-looking string of 1's).  For your ups and downs, it happens only 10 times.

Is this significant?  I'll let someone else run a chi-square test on it, but I'll argue here that, if anything, your sequence should have stayed the same 9 out of 27 times, not 10, and changed the other 18.  That's because your ups and downs are not coin flips.  For the random string, each entry could care less what came before it, so it should agree with it half the time and disagree half the time, which 13 out of 27 tries its best to do.  But your ups and downs are based on numbers which, let's assume, are drawn at random from within some range.  A little analysis, based on independent draws of random numbers in the interval [0,1], shows one expects a reversal of fortune not half the time, but two-thirds of the time.  This makes sense, at least qualitatively, because going up means you probably picked a big number, which makes it more likely you'll pick something smaller on the next round, and vice versa.  

I became aware of this (and did the simple analysis) about 15 years ago, when I was still working with my first computer, a Macintosh Plus, the one with a full megabyte of RAM.  The screensaver it came with was the old happy Macintosh icon, which jumped around an otherwise dark screen.  I found myself staring at it one day while I was supposedly thinking, and noticed that it tended to reverse its left-right direction of motion much more often than not.  (It did the same in the up-down direction as well.)  I won't confess to how long I spent staring in fascination at that screensaver.  Let's just say I collected a lot of data before I did the analysis.

It would be of idle interest to see what your complete sequence reveals.  One final note:  I elided the gap in your April data, giving a down trend from the 7th to the 8th to the 10th before the uptick on the 11th -- i.e., ...ddu...  If the missing ranking bounced up from 55256, the sequence would go ...dudu... -- for 9 out of 28 consecutive entries staying the same.  On the other hand, if the missing data were less than 36333....</description>
		<content:encoded><![CDATA[<p>Here&#8217;s another fun statistical test you can run on your data.  Keep track of the sequence of ups and downs in your rankings.  For example, your April hardback sequence goes</p>
<p>ududuudduuuudduuudududddudud</p>
<p>(i.e., it goes up from 138263 to 192152, then down to 29146, etc.)  Note there are 15 ups and 13 downs.  Let&#8217;s compare this to a &#8220;random&#8221; string of 28 binary digits, say</p>
<p>0010010000111111011010101000</p>
<p>(the astute bit-player will notice the fractional part of pi written in binary&#8230;).  By happenstance (or perhaps Jeff Bezos has a hand in this as well), this string has 15 zeroes and 13 ones, so it&#8217;s quite comparable to your ups and downs.   Offhand they look a lot alike.  One way they differ, though (aside from u&#8217;s and d&#8217;s versus 0&#8217;s and 1&#8217;s), is in how often consecutive entries are the same as opposed to different.  For the random string, the entries stay the same 13 out of 27 times (thanks in part to that long, non-random-looking string of 1&#8217;s).  For your ups and downs, it happens only 10 times.</p>
<p>Is this significant?  I&#8217;ll let someone else run a chi-square test on it, but I&#8217;ll argue here that, if anything, your sequence should have stayed the same 9 out of 27 times, not 10, and changed the other 18.  That&#8217;s because your ups and downs are not coin flips.  For the random string, each entry could care less what came before it, so it should agree with it half the time and disagree half the time, which 13 out of 27 tries its best to do.  But your ups and downs are based on numbers which, let&#8217;s assume, are drawn at random from within some range.  A little analysis, based on independent draws of random numbers in the interval [0,1], shows one expects a reversal of fortune not half the time, but two-thirds of the time.  This makes sense, at least qualitatively, because going up means you probably picked a big number, which makes it more likely you&#8217;ll pick something smaller on the next round, and vice versa.  </p>
<p>I became aware of this (and did the simple analysis) about 15 years ago, when I was still working with my first computer, a Macintosh Plus, the one with a full megabyte of RAM.  The screensaver it came with was the old happy Macintosh icon, which jumped around an otherwise dark screen.  I found myself staring at it one day while I was supposedly thinking, and noticed that it tended to reverse its left-right direction of motion much more often than not.  (It did the same in the up-down direction as well.)  I won&#8217;t confess to how long I spent staring in fascination at that screensaver.  Let&#8217;s just say I collected a lot of data before I did the analysis.</p>
<p>It would be of idle interest to see what your complete sequence reveals.  One final note:  I elided the gap in your April data, giving a down trend from the 7th to the 8th to the 10th before the uptick on the 11th &#8212; i.e., &#8230;ddu&#8230;  If the missing ranking bounced up from 55256, the sequence would go &#8230;dudu&#8230; &#8212; for 9 out of 28 consecutive entries staying the same.  On the other hand, if the missing data were less than 36333&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carl Witty</title>
		<link>http://bit-player.org/2007/amazon-poker#comment-1471</link>
		<dc:creator>Carl Witty</dc:creator>
		<pubDate>Fri, 11 May 2007 18:20:39 +0000</pubDate>
		<guid isPermaLink="false">http://bit-player.org/?p=96#comment-1471</guid>
		<description>I computed the probabilities with a short SAGE program (SAGE is a computer algebra system using Python as a programming language, and providing bindings for many many other computer algebra programs: http://www.sagemath.org/).

I put the code I used here: http://sage.math.washington.edu/home/cwitty/bitplayer.py

The code is short, rather than fast or readable.  Note that the computations use interval arithmetic, giving guaranteed (barring bugs) bounds on the probabilities in question; it would be trivial to use higher-precision interval arithmetic, providing as many digits of the correct answer as were desired.

To run the code, install SAGE and run it; then type:

sage: load bitplayer.py
sage: hands()
sage: dig2()</description>
		<content:encoded><![CDATA[<p>I computed the probabilities with a short SAGE program (SAGE is a computer algebra system using Python as a programming language, and providing bindings for many many other computer algebra programs: <a href="http://www.sagemath.org/" rel="nofollow">http://www.sagemath.org/</a>).</p>
<p>I put the code I used here: <a href="http://sage.math.washington.edu/home/cwitty/bitplayer.py" rel="nofollow">http://sage.math.washington.edu/home/cwitty/bitplayer.py</a></p>
<p>The code is short, rather than fast or readable.  Note that the computations use interval arithmetic, giving guaranteed (barring bugs) bounds on the probabilities in question; it would be trivial to use higher-precision interval arithmetic, providing as many digits of the correct answer as were desired.</p>
<p>To run the code, install SAGE and run it; then type:</p>
<p>sage: load bitplayer.py<br />
sage: hands()<br />
sage: dig2()</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brian</title>
		<link>http://bit-player.org/2007/amazon-poker#comment-1467</link>
		<dc:creator>brian</dc:creator>
		<pubDate>Fri, 11 May 2007 12:55:21 +0000</pubDate>
		<guid isPermaLink="false">http://bit-player.org/?p=96#comment-1467</guid>
		<description>To Jonathan Katz:

As I said, some people can carry out such a calculation quite deftly. It all looks easy -- almost inevitable -- once you see it done.</description>
		<content:encoded><![CDATA[<p>To Jonathan Katz:</p>
<p>As I said, some people can carry out such a calculation quite deftly. It all looks easy &#8212; almost inevitable &#8212; once you see it done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brian</title>
		<link>http://bit-player.org/2007/amazon-poker#comment-1466</link>
		<dc:creator>brian</dc:creator>
		<pubDate>Fri, 11 May 2007 12:54:05 +0000</pubDate>
		<guid isPermaLink="false">http://bit-player.org/?p=96#comment-1466</guid>
		<description>To John S.:

Far be it from me to use my blog to promote my book!  :)

As it happens, the genesis of the book was very much like the highway experience you describe. The difference is that the inquisitor continually asking "What's that?" was my young daughter.</description>
		<content:encoded><![CDATA[<p>To John S.:</p>
<p>Far be it from me to use my blog to promote my book!  :)</p>
<p>As it happens, the genesis of the book was very much like the highway experience you describe. The difference is that the inquisitor continually asking &#8220;What&#8217;s that?&#8221; was my young daughter.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brian</title>
		<link>http://bit-player.org/2007/amazon-poker#comment-1465</link>
		<dc:creator>brian</dc:creator>
		<pubDate>Fri, 11 May 2007 12:51:41 +0000</pubDate>
		<guid isPermaLink="false">http://bit-player.org/?p=96#comment-1465</guid>
		<description>To Carl Witty:

Many thanks for the correction. Can you say a word about how those numbers were calculated?</description>
		<content:encoded><![CDATA[<p>To Carl Witty:</p>
<p>Many thanks for the correction. Can you say a word about how those numbers were calculated?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Katz</title>
		<link>http://bit-player.org/2007/amazon-poker#comment-1464</link>
		<dc:creator>Jonathan Katz</dc:creator>
		<pubDate>Fri, 11 May 2007 09:40:35 +0000</pubDate>
		<guid isPermaLink="false">http://bit-player.org/?p=96#comment-1464</guid>
		<description>It seems an easier way to calculate the probability of a full house is as follows: there are 10=(5 choose 3) ways that 3 'a's and 2 'b's can appear in a sequence of 5 items. We then have 9 choices for whatever letter appears in the first position (regardless of whether it's an 'a' or a 'b') and are then left with 9 choices for the other letter. This gives a total of 10*9*9=810 ways to make a full house, in agreement with your calculation.</description>
		<content:encoded><![CDATA[<p>It seems an easier way to calculate the probability of a full house is as follows: there are 10=(5 choose 3) ways that 3 &#8216;a&#8217;s and 2 &#8216;b&#8217;s can appear in a sequence of 5 items. We then have 9 choices for whatever letter appears in the first position (regardless of whether it&#8217;s an &#8216;a&#8217; or a &#8216;b&#8217;) and are then left with 9 choices for the other letter. This gives a total of 10*9*9=810 ways to make a full house, in agreement with your calculation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John S.</title>
		<link>http://bit-player.org/2007/amazon-poker#comment-1463</link>
		<dc:creator>John S.</dc:creator>
		<pubDate>Thu, 10 May 2007 22:09:38 +0000</pubDate>
		<guid isPermaLink="false">http://bit-player.org/?p=96#comment-1463</guid>
		<description>I had not heard about your book before, but it looks very interesting. My first job out of college was with a company that didn't like to spend money on airfare, so I had to do a lot of cross-country driving with my boss. Whenever we would pass an interesting-looking factory or some other large piece of industrial infrastructure, he would point it out and ask us young engineers "What's that?" or "What do you think they make there?" Guessing wasn't good enough; we had to explain our answers. "How do you know?" he would ask, or "What makes you say that?"

I learned a lot from that guy!</description>
		<content:encoded><![CDATA[<p>I had not heard about your book before, but it looks very interesting. My first job out of college was with a company that didn&#8217;t like to spend money on airfare, so I had to do a lot of cross-country driving with my boss. Whenever we would pass an interesting-looking factory or some other large piece of industrial infrastructure, he would point it out and ask us young engineers &#8220;What&#8217;s that?&#8221; or &#8220;What do you think they make there?&#8221; Guessing wasn&#8217;t good enough; we had to explain our answers. &#8220;How do you know?&#8221; he would ask, or &#8220;What makes you say that?&#8221;</p>
<p>I learned a lot from that guy!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carl Witty</title>
		<link>http://bit-player.org/2007/amazon-poker#comment-1462</link>
		<dc:creator>Carl Witty</dc:creator>
		<pubDate>Thu, 10 May 2007 20:38:21 +0000</pubDate>
		<guid isPermaLink="false">http://bit-player.org/?p=96#comment-1462</guid>
		<description>Actually, the results using a Benford distribution are not the same as the results using a uniform distribution (although they are admittedly very very close).  With a uniform distribution, the probabilities are given (as exact, terminating decimals) above; with a Benford distribution, the probabilities are:

   hand            prediction
	
five of a kind        0.0001105728747...
four of a kind        0.004763041358...
full house            0.009931354354...
three of a kind       0.0736751048...
two pairs             0.1092466737...
one pair              0.503990913...
bust                  0.298900149...

Also, with a Benford distribution, the probability of a 0 as the second digit is 11.9679...%, and the probability of a 9 as the second digit is only 8.4997...%.</description>
		<content:encoded><![CDATA[<p>Actually, the results using a Benford distribution are not the same as the results using a uniform distribution (although they are admittedly very very close).  With a uniform distribution, the probabilities are given (as exact, terminating decimals) above; with a Benford distribution, the probabilities are:</p>
<p>   hand            prediction</p>
<p>five of a kind        0.0001105728747&#8230;<br />
four of a kind        0.004763041358&#8230;<br />
full house            0.009931354354&#8230;<br />
three of a kind       0.0736751048&#8230;<br />
two pairs             0.1092466737&#8230;<br />
one pair              0.503990913&#8230;<br />
bust                  0.298900149&#8230;</p>
<p>Also, with a Benford distribution, the probability of a 0 as the second digit is 11.9679&#8230;%, and the probability of a 9 as the second digit is only 8.4997&#8230;%.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

