<?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>DanAllan.com &#187; Java</title>
	<atom:link href="http://www.danallan.com/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.danallan.com</link>
	<description></description>
	<lastBuildDate>Wed, 21 Dec 2011 18:24:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Uno Unending</title>
		<link>http://www.danallan.com/projects/2008/uno/</link>
		<comments>http://www.danallan.com/projects/2008/uno/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 02:19:48 +0000</pubDate>
		<dc:creator>Dan Allan</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Projects & Adventures]]></category>
		<category><![CDATA[card game]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.danallan.com/?p=102</guid>
		<description><![CDATA[<a title="Wikipedia article" href="http://en.wikipedia.org/wiki/Uno_(game)" target="_blank">Uno games</a> can go on forever. Game length depends mainly on how the cards get shuffled.  How long is an Uno game likely to take?  Does including more players make a <em>longer</em> game or just more chances for <em>someone</em> to win and end it?

Sounds like the perfect way to squirm out of taking History of Mathematics by writing an independent paper about Uno!  <em>My musings here are brief and not math-y.</em>]]></description>
			<content:encoded><![CDATA[<p><a title="Wikipedia article" href="http://en.wikipedia.org/wiki/Uno_(game)" target="_blank">Uno games</a> can go on forever. How long is an Uno game likely to take? Does including more players make the game longer, or does it make it shorter? (I think there&#8217;s a reasonable argument for either guess.)</p>
<p>This sounds like the perfect way to squirm out of a college course requirement by writing an independent paper about Uno!</p>
<p>Most people play Uno with a casual strategy, and it&#8217;s not hard to program a computer to imitate that. My laptop can simulate one million Uno games in about five minutes. Then it tells me how long the games took. The results look like this.</p>
<div id="attachment_104" class="wp-caption alignnone" style="width: 510px"><a href="http://www.danallan.com/wp-content/uploads/2008/08/2-4-players-unscaled.png"><img class="size-full wp-image-104" title="2-4-players-unscaled" src="http://www.danallan.com/wp-content/uploads/2008/08/2-4-players-unscaled.png" alt="Red = 2-player games; Green = 3-player games; Blue = 4-player games" width="500" height="325" /></a><p class="wp-caption-text">Red = 2-player games; Green = 3-player games; Blue = 4-player games</p></div>
<p>First Conclusion: adding players makes the game take longer. Not a surprise.</p>
<p>But there are two ways to count how long an Uno game takes. You could count <em>total number of turns </em>or you could count <em>rounds</em> — that is, times that play circles around the table. (Rounds = Turns / Number of Players.) Here&#8217;s the same data, counted in rounds.</p>
<div id="attachment_106" class="wp-caption alignnone" style="width: 510px"><a href="http://www.danallan.com/wp-content/uploads/2008/08/2-4-players-scaled.png"><img class="size-medium wp-image-106" title="2-4-players-scaled" src="http://www.danallan.com/wp-content/uploads/2008/08/2-4-players-scaled-500x319.png" alt="Red = 2-player games; Green = 3-player games; Blue = 4-player games" width="500" height="319" /></a><p class="wp-caption-text">Red = 2-player games; Green = 3-player games; Blue = 4-player games</p></div>
<p>The curves have changed places: adding players makes for <em>shorter </em>Uno games if we count rounds. This makes sense: more players means more chances that <em>someone </em>is holding a winning hand.</p>
<p><strong>The Conclusion: </strong>Uno games with more players tend to take longer in terms of actual turns, but it takes fewer <em>rounds </em>of play for someone to win.</p>
<p><strong>Going First Helps. </strong>The first player has a small but measurable advantage. In fact, each player has a 0.5% better chance of winning than the player who plays after him. (This works for big games, too. I ran simulations up to 12 players.)</p>
<p><strong>What&#8217;s with those peaks? </strong>The first peak, at 7 rounds, corresponds to Player 1 holding a perfect hand, going out at the earliest possible turn. The secondary peak, at 11 rounds, corresponds to the same scenario, but Player 1 was also hit by a Draw 4 card. This can be confirmed by simulating games using a deck without Draw 4 cards in it.</p>
<div id="attachment_108" class="wp-caption alignnone" style="width: 510px"><a href="http://www.danallan.com/wp-content/uploads/2008/08/remove-d4.png"><img class="size-medium wp-image-108" title="Remove Draw 4 Cards" src="http://www.danallan.com/wp-content/uploads/2008/08/remove-d4-500x325.png" alt="" width="500" height="325" /></a><p class="wp-caption-text">Red = standard deck; Blue = deck without Draw 4 or Wild Draw 4 card</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.danallan.com/projects/2008/uno/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

