<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type='text/xsl' href='http://shitfromthemouth.spaces.live.com/mmm2008-05-17_13.22/rsspretty.aspx?rssquery=en-US;http%3a%2f%2fshitfromthemouth.spaces.live.com%2fcategory%2f%e5%85%b4%e8%b6%a3%2ffeed.rss' version='1.0'?><rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:msn="http://schemas.microsoft.com/msn/spaces/2005/rss" xmlns:live="http://schemas.microsoft.com/live/spaces/2006/rss" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>追忆似水流年: 兴趣</title><description /><link>http://shitfromthemouth.spaces.live.com/?_c11_BlogPart_BlogPart=blogview&amp;_c=BlogPart&amp;partqs=cat%25E5%2585%25B4%25E8%25B6%25A3</link><language>en-US</language><pubDate>Mon, 09 Jun 2008 06:28:34 GMT</pubDate><lastBuildDate>Mon, 09 Jun 2008 06:28:34 GMT</lastBuildDate><generator>Microsoft Spaces v1.1</generator><docs>http://www.rssboard.org/rss-specification</docs><ttl>60</ttl><cf:parentRSS>http://shitfromthemouth.spaces.live.com/blog/feed.rss</cf:parentRSS><live:type>blogcategory</live:type><live:identity><live:id>7830210819026847498</live:id><live:alias>shitfromthemouth</live:alias></live:identity><cf:listinfo><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="typelabel" label="Type" /><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="tag" label="Tag" /><cf:group element="category" label="Category" /><cf:sort element="pubDate" label="Date" data-type="date" default="true" /><cf:sort element="title" label="Title" data-type="string" /><cf:sort ns="http://purl.org/rss/1.0/modules/slash/" element="comments" label="Comments" data-type="number" /></cf:listinfo><item><title>2008元旦</title><link>http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!448.entry</link><description>&lt;div&gt;
&lt;div&gt;这个新年过得不是很爽，天气很冷，也没什么消遣。公司年饭上也没什么运气，是不是预示着今年不咋样呢？恐惧中。。。&lt;/div&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=7830210819026847498&amp;page=RSS%3a+2008%e5%85%83%e6%97%a6&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=shitfromthemouth.spaces.live.com&amp;amp;GT1=shitfromthemouth"&gt;</description><comments>http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!448.entry#comment</comments><guid isPermaLink="true">http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!448.entry</guid><pubDate>Sat, 05 Jan 2008 08:43:16 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://shitfromthemouth.spaces.live.com/blog/cns!6CAA7F40F084070A!448/comments/feed.rss</wfw:commentRss><wfw:comment>http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!448.entry#comment</wfw:comment><dcterms:modified>2008-01-05T08:43:16Z</dcterms:modified></item><item><title>专利和盗版</title><link>http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!437.entry</link><description>&lt;p&gt;&lt;a href="http://www.sipo.gov.cn/sipo/wxfw/wxyjyfz/zlwxyj/2000/zlzdqyjzlwxcs.doc"&gt;专利起源（转载）http://www.sipo.gov.cn/sipo/wxfw/wxyjyfz/zlwxyj/2000/zlzdqyjzlwxcs.doc&lt;/a&gt; 
&lt;p&gt;人们为什么喜欢盗版？便宜，而其用起来效用差不多，这样性价比就高了。为什么便宜呢？这个问题十分复杂。说到盗版，不可避免要说到专利。参看专利起源。专利原意是对于技术的，科学不在此列。为什么专利对科学放一马呢？例如某高人搞明白了某猜想，高兴发狂，但是他一旦向世人阐明他的思想，他的思想就给共享了(阐明不了的会给认为是疯子，例如永动机)。所以不能封装的东西不可能做到独享。用起源文章的话说就是“&lt;span style="font-size:10.5pt;font-family:宋体"&gt;&lt;font color="#000000"&gt;专利制度是一种利用法律和经济手段鼓励人们进行发明创造，以推动科技进步、促进经济发展的一种保障制度&lt;/font&gt;&lt;/span&gt;”。如果封装足够复杂，制造成本高，逆向工程难度大，那么这个技术就很适合专利制度。要你自己复制盗版一个真的火车头，难吧？不过如果这对于一个军工集团来说也不是什么上青天的事情。军事上有没有专利？傻逼逼的，你的飞机都给了人家，人家怎么拆怎么研究你管得着吗。国与国之间的专利问题涉及到世贸组织那些乱七八糟的协定。这都是经济上的事情。但是有些东西生来就有易复制的特性，例如银行那些服务，衍生品，你设计得来好辛苦，但你一公开就全世界都知道怎么做的了。现在信息技术也是这个特性，你几千个人月的成果给人家一复制就拿走了。搞成二进制好一点，逆向工程也不容易。但有人就只用产品，不稀罕你代码。你搞个注册码也没有用，破解得轻松。所有这种特性的工业，都面临这个问题。还在发展中，不过以服务收钱好像有前途些。 
&lt;p&gt;说说著作权有关的工业，就是音乐等。古时候为什么没有著作权？那时候还没有能大规模复制作品，或者说是以这个赚钱。二胡拉得好的，最多给王公们拉拉，想不到卖到四海之内。能写首歌的，天下传唱就爽得不得了。现在这个东东来钱了，大家眼红不得了。比如，卡拉OK，那个闹得，哎。国家那个什么鸟部门也掺和，一地鸡毛。现在出唱片的大多对于新的传播途径有敌视心态，这个不好，以前磁带时代不也是很多翻版的嘛。现在世界变了，新的渠道成本低，cd估计要走黑胶的路了。说远了，音乐里面的抄袭也不是什么新鲜事了，但用户买单呀，原来那作者急得不行，你怎么不分点钱我呢。 
&lt;p&gt;盗版最盛的除了信息产业，非时尚行业莫属。设计这家东西，比源代码更玄。用成衣来说，如果没有牌子，你按什么来判断它的价值？料子，做工，款式。料子，有钱就有好料子。做工，价钱到一定水平之上，差别就很小很小了。那么款式呢，这东西是客观存在的，一般设计实力强的，款式都不错，小作坊都是等着大牌子后面抄(有一季LV出了款红白蓝胶手袋，让有中国特色的小资受不了，^_^)。同一层次的东西，款式水平相差不远，估计也是你中有我中有你，抄来抄去。不过这个时尚的复制，和音乐的相似，稍微改改，英雄所见略同嘛。所以同一阵线的很少指着他人抄袭，这点和信息行业不同。不过最底层的就是张胆明目的仿制，例如名贵手表，明摆着说仿制，没那个材料，没那个做工技术，就是看着像。说到钟表行业，我有点不明白为什么它会蜕化为奢侈品的。(估计大多因为生产技术发展太慢。试想你弄了台镶金镶钻的pc，过两年用不了，给人笑掉大牙。还有个原因就是欧洲佬特意的包装，后面说。)有天听电台，dj说他有个朋友，玩莱卡，给可恶的欧洲佬昆了好多钱。还有些玩酒的朋友，欧洲佬整天在jjyy什么05年的红酒是最好年份的红酒，值得收藏啊什么的，欧洲那些酒庄最便宜的一支，两万块。&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=7830210819026847498&amp;page=RSS%3a+%e4%b8%93%e5%88%a9%e5%92%8c%e7%9b%97%e7%89%88&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=shitfromthemouth.spaces.live.com&amp;amp;GT1=shitfromthemouth"&gt;</description><comments>http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!437.entry#comment</comments><guid isPermaLink="true">http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!437.entry</guid><pubDate>Sun, 11 Nov 2007 05:05:37 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://shitfromthemouth.spaces.live.com/blog/cns!6CAA7F40F084070A!437/comments/feed.rss</wfw:commentRss><wfw:comment>http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!437.entry#comment</wfw:comment><dcterms:modified>2007-11-11T06:16:01Z</dcterms:modified></item><item><title>林杨的space</title><link>http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!432.entry</link><description>&lt;div&gt;
&lt;div&gt;今天上网发现林杨的space终于开了，好开心，不过只是点图片，剩下只字片语。估计也是西文不咋滴，怕写多错多，哇哈哈。&lt;/div&gt;
&lt;div&gt;&lt;a href="http://lyrain1111.spaces.live.com/default.aspx"&gt;http://lyrain1111.spaces.live.com/default.aspx&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=7830210819026847498&amp;page=RSS%3a+%e6%9e%97%e6%9d%a8%e7%9a%84space&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=shitfromthemouth.spaces.live.com&amp;amp;GT1=shitfromthemouth"&gt;</description><comments>http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!432.entry#comment</comments><guid isPermaLink="true">http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!432.entry</guid><pubDate>Sat, 20 Oct 2007 03:03:44 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://shitfromthemouth.spaces.live.com/blog/cns!6CAA7F40F084070A!432/comments/feed.rss</wfw:commentRss><wfw:comment>http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!432.entry#comment</wfw:comment><dcterms:modified>2007-10-20T03:03:44Z</dcterms:modified></item><item><title>The perfect Shuffle</title><link>http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!314.entry</link><description>
把扑克牌从中间分成相等两份，然后把这两份相互交叉，一个压着一个，合成一份。这样就有两种可能。假设A是来自原来的牌上半部分，B来自下半部分，从中间分开，就是AA…A，BB…B两部分，交叉合在一起，就是ABAB..AB或者BABA..BA两种情况。我们先讨论ABAB..AB的情况，即最上面一张和最下面一张始终不动的perfect shuffle。

合并的过程就是：

1.     if 1&amp;lt;=x&amp;lt;=26, then x -&amp;gt; 2x-1 

2.     if 27&amp;lt;=x&amp;lt;=52, then x -&amp;gt; 2(x-26) = 2x-52 

( x -&amp;gt; 2x-1表示在x处的牌被转换到2x-1处。 )

 

注意到2x-1 = 2x-52 modulo 51， 所以我们可以把上面两个合并成一个方程：

            x -&amp;gt; 2x-1 mod 51

 

这个方程迭代若干次之后的结果如下：

 

1 iteration: 2x-1 
2 iterations: 2(2x-1)-1 = 4x-3 
3 iterations: 2(2(2x-1)-1)-1 = 8x-7 
n iterations: (2^n)x - (2^n -1) 
8 iterations: 256x - 255 

 

256x-255 mod 51的结果，恰好就是x。（256x－255＝x+51*5x-51*5）

这样52张牌“完美”洗8次之后，就恢复到原来的排列了。颇为神奇，像许多莫名其妙的东西一样，这个不是一个巧合。

 

AB shuffle 


(1,2,...,n/2)-&amp;gt;(1,3,...,n-1) (上半部分的牌被排到奇数位置) (n/2+1,n/2+2,...,n)-&amp;gt;(2,4,...,n) (下半部分的牌被排到偶数位置) 

 

BA shuffle 


(1,2,...,n/2)-&amp;gt;(2,4,...,n) (上半部分的牌被排到偶数位置) (n/2+1,n/2+2,...,n)-&amp;gt;(1,3,...,n-1) (下半部分的牌被排到奇数位置) 

 

AB Shuffle

 

对于n张牌的AB洗牌方式，下面这两个公式
if 1 &amp;lt;= x &amp;lt;= n/2, then x -&amp;gt; 2x-1  
if n/2+1 &amp;lt;= x &amp;lt;= n, then x -&amp;gt; 2x-n  

等价于

x -&amp;gt; 2x-1 mod n-1 (since 2x-1 = 2x-n mod n-1)

 

k次迭代之后，x变为

 (2^k)x - ((2^k)-1) = x + ((2^k)-1)(x-1) mod (n-1). 

这个可以用归纳法证明，如下：

1次迭代之后，x变为2x-1 mod n-1 = x + ((2^1)-1)(x-1).

假设k-1次迭代之后x变为x + ((2^(k-1))-1)(x-1) mod n-1.

那么k次迭代之后x就变为

2(x+((2^(k-1))-1)(x-1))-1 mod n-1

      ＝2x + 2*(2^(k-1))(x-1) - 2(x-1) – 1

      ＝x + ((2^k)-1)(x-1) mod n-1

一个经典的问题是，给出n张牌，问多少次AB方式的perfect shuffle之后这n张牌被洗回原样。它等价于

      x = x + ((2^k)-1)(x-1) mod n-1  ( 1&amp;lt;=x&amp;lt;=n ).

这个问题即，求k，对于所有1&amp;lt;=x&amp;lt;=n，((2^k)-1)(x-1) = 0 mod n-1。或者描述成， 

对于所有x属于[1,n],n-1能整除((2^k)-1)(x-1)

显然x-1&amp;lt;=n-1，这个问题就等价于求k,使n-1整除(2^k)-1.

结论就是：如果(2^k)-1 = 0  mod n-1,那么n张牌的AB perfect shuffle在k次之后就回到了洗之前的样子。

 

BA Shuffle

 

考虑最开始的描述，对n张牌进行AB shuffle的时候，实际上相当于对去掉最上和最下的两张牌之后的n-2张牌进行BA shuffle。根据AB shuffle的结论，推出BA shuffle的结论：如果(2^k)-1 = 0  mod n+1,那么n张牌的BA perfect shuffle在k次之后就回到了洗之前的样子。&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=7830210819026847498&amp;page=RSS%3a+The+perfect+Shuffle&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=shitfromthemouth.spaces.live.com&amp;amp;GT1=shitfromthemouth"&gt;</description><comments>http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!314.entry#comment</comments><guid isPermaLink="true">http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!314.entry</guid><pubDate>Tue, 29 May 2007 15:12:29 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://shitfromthemouth.spaces.live.com/blog/cns!6CAA7F40F084070A!314/comments/feed.rss</wfw:commentRss><wfw:comment>http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!314.entry#comment</wfw:comment><dcterms:modified>2007-05-29T15:13:48Z</dcterms:modified></item><item><title>猜帽子游戏</title><link>http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!307.entry</link><description>在这个游戏的开头，我们设想自己要参加一个电视游戏大奖赛。规则呢，是这样。我们有 n 个人，作为一个小组来参加游戏。游戏中，主持人会给我们每人头上戴一顶帽子。帽子有黑白两种颜色，可以认为它们在我们各自头上的分布是临时随机决定的。小组中的每一个人，可以看到其他人的帽子颜色，但不知道自己的帽子颜色。每个游戏成员都被要求回答自己帽子的颜色。我们各人面前有三个按钮，可以选择“黑色”“白色”或“弃权”(也就是 pass，不作猜测的意思)。小组成员彼此之间没有任何信息交流，他们必须各自独立地作出自己的选择，并且谁也不知道其他人的选择。如果小组成员全部选择了 pass，也就是每个人都弃权，则他们输了；如果有小组成员作出了明确的猜测，但某个人猜错了，则结果也是输。只有当小组中有人做出猜测，并且每个做出猜测的人都猜对了，他们才能获胜，一起获得最后的大奖。

这个游戏还有最关键的一点：在游戏开始前(帽子戴上之前)，有一个“协商时间”，小组成员可以聚在一起，讨论决定小组应采取什么样的策略。但这个交流过程在游戏开始时自然终止。

现在的问题是：小组选择什么样的策略，才有最大的机会获胜呢？

首先可以肯定，这个最佳策略的获胜概率，肯定不会只是1/(2^n)。容易找到获胜概率为1/2 的策略，但是不是就没有更狡猾的办法了呢？

我认真思考了一下，还真难，留给高手吧~~

参看Why Mathematicians Now Care About Their Hat Color&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=7830210819026847498&amp;page=RSS%3a+%e7%8c%9c%e5%b8%bd%e5%ad%90%e6%b8%b8%e6%88%8f&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=shitfromthemouth.spaces.live.com&amp;amp;GT1=shitfromthemouth"&gt;</description><comments>http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!307.entry#comment</comments><guid isPermaLink="true">http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!307.entry</guid><pubDate>Sun, 27 May 2007 23:58:51 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://shitfromthemouth.spaces.live.com/blog/cns!6CAA7F40F084070A!307/comments/feed.rss</wfw:commentRss><wfw:comment>http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!307.entry#comment</wfw:comment><dcterms:modified>2007-05-30T03:16:23Z</dcterms:modified></item><item><title>27USAMO1998  Problem B1</title><link>http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!306.entry</link><description>A 98*98 chess board has the squares colored alternately black and white in the usual way. A move consists of selecting a rectangular subset of the squares( with boundary parallel to the sides of the board) and changing their color. What is the smallest number of moves required to make all the squares black?
Solution:
Answer:98. 
There are 4 97 adjacent pairs of squares in the border and each pair has one black and one white square. Each move can fix at most 4 pairs, so we need at least 97 moves. However, we start with two corners one color and two another, so at least one rectangle must include a corner sqaure. But such a rectangle can only fix two pairs, so at least 98 moves are needed. It is easy to see that 98 suffice: take 49 1*98 rectangles(alternate rows), and 49 98*1 rectangles(alternate columns).&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=7830210819026847498&amp;page=RSS%3a+27USAMO1998++Problem+B1&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=shitfromthemouth.spaces.live.com&amp;amp;GT1=shitfromthemouth"&gt;</description><comments>http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!306.entry#comment</comments><guid isPermaLink="true">http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!306.entry</guid><pubDate>Sun, 27 May 2007 11:37:40 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://shitfromthemouth.spaces.live.com/blog/cns!6CAA7F40F084070A!306/comments/feed.rss</wfw:commentRss><wfw:comment>http://shitfromthemouth.spaces.live.com/Blog/cns!6CAA7F40F084070A!306.entry#comment</wfw:comment><dcterms:modified>2007-05-27T12:27:58Z</dcterms:modified></item></channel></rss>