<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6026063465329525923</id><updated>2011-08-10T09:04:25.384-04:00</updated><category term='puzzle math statistics'/><category term='puzzle 2010'/><category term='programming puzzle c#'/><title type='text'>Ideas and Observations</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bushkin.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6026063465329525923/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://bushkin.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Leo Bushkin</name><uri>http://www.blogger.com/profile/08042967841611979113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6026063465329525923.post-1093023415531828192</id><published>2010-11-12T10:35:00.003-05:00</published><updated>2010-11-12T10:38:56.300-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='puzzle math statistics'/><title type='text'>Puzzle #2 - Statistical Guesswork</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; font-size: 12px; line-height: 16px; "&gt;&lt;p style="font-size: 1.05em; "&gt;Alice secretly picks two different real numbers by an unknown process and puts them in two (abstract) envelopes.  Bob chooses one of the two envelopes randomly (with a fair coin toss), and shows you the number in that envelope.  You must now guess whether the number in the other, closed envelope is larger or smaller than the one you’ve seen.&lt;/p&gt;&lt;p style="font-size: 1.05em; "&gt;Is there a strategy which gives you a better than 50% chance of guessing correctly, no matter what procedure Alice used to pick her numbers?&lt;/p&gt;&lt;p style="font-size: 1.05em; color: rgb(119, 119, 119); "&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 51); "&gt;&lt;i&gt;While you may think that it is paradoxically defined or has no answer, it turns out that it’s a perfectly valid problem and the answer to it is “Yes.” In fact, there are at least two possible answers to this question that both satisfy the objective.&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6026063465329525923-1093023415531828192?l=bushkin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bushkin.blogspot.com/feeds/1093023415531828192/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6026063465329525923&amp;postID=1093023415531828192&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6026063465329525923/posts/default/1093023415531828192'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6026063465329525923/posts/default/1093023415531828192'/><link rel='alternate' type='text/html' href='http://bushkin.blogspot.com/2010/11/puzzle-2-statistical-guesswork.html' title='Puzzle #2 - Statistical Guesswork'/><author><name>Leo Bushkin</name><uri>http://www.blogger.com/profile/08042967841611979113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6026063465329525923.post-6711038763182188184</id><published>2010-11-10T11:35:00.002-05:00</published><updated>2010-11-10T11:41:04.160-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='puzzle 2010'/><title type='text'>Puzzle #1 - Later but Younger</title><content type='html'>Two children were born to the same mother in the same room of the same hospital on the same day of the same year. One was born at 1:37 am the other at 1:53 am. Interestingly, however, the child born at 1:53 am is considered to be the eldest. How is this possible?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6026063465329525923-6711038763182188184?l=bushkin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bushkin.blogspot.com/feeds/6711038763182188184/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6026063465329525923&amp;postID=6711038763182188184&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6026063465329525923/posts/default/6711038763182188184'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6026063465329525923/posts/default/6711038763182188184'/><link rel='alternate' type='text/html' href='http://bushkin.blogspot.com/2010/11/puzzle-1-later-but-younger.html' title='Puzzle #1 - Later but Younger'/><author><name>Leo Bushkin</name><uri>http://www.blogger.com/profile/08042967841611979113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6026063465329525923.post-138196116120232643</id><published>2009-06-18T10:22:00.004-04:00</published><updated>2009-06-22T22:09:48.528-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programming puzzle c#'/><title type='text'>Programming Puzzle - N-Bit Array Permutation</title><content type='html'>Here's a programming puzzle that came out of an interesting experience working on a recent project of mine.&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;You have an N-bit (boolean) array, where N is odd, for which you must produce all possible permutations of bits. Write a function that can produce the sequence of all possible n-bit permutations, with the following restrictions:&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;The first value in the permutation sequence must consist of all zeros.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;The last value in the permutation sequence must consist of all ones.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Each n-bit permutation must vary by only one bit from the prior permutation.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;No duplicate permutations must be produced.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;No permutations should be omitted from the sequence.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Generating each permutation should require constant time.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;This seemingly simple problem requires some careful thought to solve correctly. Look for the solution in the coming days on my blog.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6026063465329525923-138196116120232643?l=bushkin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bushkin.blogspot.com/feeds/138196116120232643/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6026063465329525923&amp;postID=138196116120232643&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6026063465329525923/posts/default/138196116120232643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6026063465329525923/posts/default/138196116120232643'/><link rel='alternate' type='text/html' href='http://bushkin.blogspot.com/2009/06/programming-puzzle-n-bit-array.html' title='Programming Puzzle - N-Bit Array Permutation'/><author><name>Leo Bushkin</name><uri>http://www.blogger.com/profile/08042967841611979113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6026063465329525923.post-6659242046538378874</id><published>2009-06-10T15:38:00.015-04:00</published><updated>2009-06-11T10:43:17.460-04:00</updated><title type='text'>Is City Traffic an Example of the N-Person Prisoner's Dilemma?</title><content type='html'>Many people have had the unpleasant experience of driving in rush-hour traffic in a major metropolitan area. A common frustration mentioned by many drivers is the inconsiderate, and often unsafe, habits exhibited by drivers in traffic. It's quite typical to see cars crossing into the intersection in an attempt to squeeze through before the light changes - ultimately blocking cross traffic. Other cars pass through red lights indiscriminately or attempt to merge across multiple lanes of traffic. Drivers that follow the rules are often pressured by drivers behind them by honking (and sometimes cursing). Furthermore, drivers taking a right turn from the cross-ways lane cut ahead of these individuals to "sneak" in to traffic. These and other driving behaviors clearly slow the pace of traffic for everyone - not to mention raising tempers and frustration levels.&lt;br /&gt;&lt;br /&gt;So what does this infuriating behavioral issue have to do with the &lt;a href="http://en.wikipedia.org/wiki/Prisoner%27s_dilemma"&gt;prisoner's dilemma&lt;/a&gt; (PD)? Well, let's start by defining the prisoner's dilemma - the classic formulation is credited to Albert Tucker based on the prior work of Merrill Flood and Melvin Dresher in 1950.&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;Two suspects are arrested by the police. The police have insufficient evidence for a conviction, and, having separated both prisoners, visit each of them to offer the same deal. If one testifies (defects from the other) for the prosecution against the other and the other remains silent (cooperates with the other), the betrayer goes free and the silent accomplice receives the full 10-year sentence. If both remain silent, both prisoners are sentenced to only six months in jail for a minor charge. If each betrays the other, each receives a five-year sentence. Each prisoner must choose to betray the other or to remain silent. Each one is assured that the other would not know about the betrayal before the end of the investigation. How should the prisoners act?&lt;/span&gt;&lt;/blockquote&gt;Based on the rules of the dilemma, the optimal outcome &lt;span style="font-style: italic;"&gt;for both prisoners together&lt;/span&gt; is to stay silent and serve the six months sentence in prison. However, each prisoner can improve his own outcome by testifying against the other - so long as the other prisoner stays silent. If both prisoners reason this way and testify against the other, the results are far less desirable - each ends up serving a 5-year sentence. The PD scenario can be generalized to include N-persons - in which case the payoff and costs are spread across all participants. Based on empirical and statistical research, it has been concluded that about 40% of pairs of individuals will ultimately choose to betray each other.&lt;br /&gt;&lt;br /&gt;The Prisoner's Dilemma game illustrates the challenges created in situations where there is a lack of trust amongst the participants. Isolating the participants is necessary to ensure that they act primarily in their own self-interest - without knowledge of the others' choices. Furthermore, the cost/benefit structure of the game creates a strong incentive for an individual participant to betray the other if there is a reasonable chance that the other individual will not betray them.&lt;br /&gt;&lt;br /&gt;So back to the situation of city traffic. Each driver has the choice to follow the rules of the road - letting cars merge appropriately, turning only when there's room, and patiently waiting their turn to move through intersections only when they are confident that can completely pass through. When everyone cooperates, the time it takes for all drivers to pass through traffic approaches the optimal limit imposed purely by driving conditions&lt;sup&gt;1&lt;/sup&gt; (number of vehicles, how long the lights are, road conditions, etc). Unfortunately, when everyone cooperates, the value of "cheating" increases - since an individual driver can reduce his own time in traffic at the expense of everyone else. Unfortunately, when enough drivers choose to cheat, the time it takes for &lt;span style="font-style: italic;"&gt;everyone&lt;/span&gt; to pass through traffic actually goes up.&lt;br /&gt;&lt;br /&gt;This seems like a clear analogy to the n-person PD problem - the temptation of the individual driver to cheat offers a potential benefit (when there are few cheaters) - but can result in a significant cost (when cheating is common). Furthermore, those who choose not to cheat, incur a greater cost than those who do - their commute through traffic is longer than that of the cheaters and they bear the (social) pressure from other impatient drivers.&lt;br /&gt;&lt;br /&gt;The prisoner's dilemma demonstrates what happens when decisions are imposed on a group of individual in a scenario where trust and benefit are placed in opposition. If you trust the other participants in a PD you can choose to cooperate and minimize the cost for the entire group. However, because you can increase your individual benefit by cheating, there is an incentive to compete rather than cooperate.&lt;br /&gt;&lt;br /&gt;Social pressures and consequences can alter the cost/benefit matrix for PD scenarios. If there is a social relationship between the individuals that lasts beyond the PD situation, the decision of whether to compete or cooperate can be vastly different. You are more likely to choose to cooperate with people that you know you're going to have to deal with in the future. Conversely, you're more likely to choose to cheat when you can ignore the identity of the victims - it's generally well accepted that anonymity increases crime. The scenario of city traffic is interesting because it affords many individuals a significant level of anonymity, which helps to explain why we observe so many people behaving badly in traffic.&lt;br /&gt;&lt;br /&gt;There has been some question as to whether the traffic scenario is truly a case of the N-Person PD problem. A &lt;a href="http://oep.oxfordjournals.org/cgi/content/abstract/57/1/70"&gt;paper published&lt;/a&gt; in &lt;a href="http://oep.oxfordjournals.org/"&gt;Oxford Economic Papers&lt;/a&gt; journal in 2005 by Mary Sissons Joshi, Vijay Joshi, and Roger Lamb describes an empirical sociological study conducted on 551 car owners in Oxford. Each was presented with three pairs of alternatives designed as traffic versions of the four outcomes of the PD scenario. Each respondent stated which alternative in each pair they preferred. According to the study, only 2% of the group chose the outcomes which correspond to the  full set of preferences which fit the PD scenario. The plurality or respondents (48%) selected a set of preference which more closely fit an &lt;a href="http://en.wikipedia.org/wiki/Stag_hunt"&gt;assurance game&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-size:small;"&gt;&lt;br /&gt;1. We assume for the sake of the argument that there are no accidents or other obstructive behaviors at play.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6026063465329525923-6659242046538378874?l=bushkin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bushkin.blogspot.com/feeds/6659242046538378874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6026063465329525923&amp;postID=6659242046538378874&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6026063465329525923/posts/default/6659242046538378874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6026063465329525923/posts/default/6659242046538378874'/><link rel='alternate' type='text/html' href='http://bushkin.blogspot.com/2009/06/is-city-traffic-example-of-n-person.html' title='Is City Traffic an Example of the N-Person Prisoner&apos;s Dilemma?'/><author><name>Leo Bushkin</name><uri>http://www.blogger.com/profile/08042967841611979113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
