Archive for June 2006

Sudoku challange 2

2006-06-29

sudoku image

In the diagram (click to see the full image), try to determine the value of the 2 red squares. Which is 5, and which is 9? Try your best to do it in mind, without the aid of any sudoku program or pen (including pencil or whatever). Only use other tools if you give up. Once the 2 aforementioned squares are determined, the rest will be as easy as a pie.

Sudoku challange

2006-06-24

image of a sudoku puzzle

If you can visually determine which square can be revealed next, you have the potential to solve some of the most difficult ones. I’ll give answer later.

Answer to sudoku puzzle 1

2006-07-03 edit: The answer is a 8, shown inside a red circle in the right diagram. The key point is to notice that, the possibilities of 8’s in middle left and bottom left 3×3 squares are limited. Why? This is left as an exercise.

華容道的「起源」(之一)

2006-06-17

華容道的「橫刀立馬」式

早些時候我在網上找一些華容道遊戲的源頭的資料,也親自看到了中國人的研究精神發揮得如何淋漓盡致。華容道遊戲是中國人發明的,為甚麼呢?

  1. 古代已經有了河圖洛書,即是 3×3 幻方。
  2. 這個九宮圖可能演變成唐宋時的「重排九宮」遊戲。
  3. 重排九宮遊戲可能是所有滑板類遊戲的祖先。
  4. 滑板類遊戲可能在元朝傳到了歐洲。
  5. 重排九宮遊戲可能演變成華容道。

將上面所有句子串起來,然後將所有可能字樣全部刪除,便得到結論了:

  • 華容道是在我國流傳久遠的一個益智遊戲。
  • 華容道是在中國流傳了數百年的智力玩具。

現在網上看到的文章,這個結論佔至少九成。


另外一成,則認為起源不在中國:

  • 姜長英在他所著《科學思維鍛煉與消遣》中說,「估計它的歷史不過有幾十年。從前人的筆記中沒有發現有玩具華容道的記載。」
  • 目前所見到關於華容道最早的文字記載就是姜長英在 1949 年出版的《科學消遣》。
  • 50 年代許蒓舫的某本書詳細分析了華容道,並給出 100 步解法。
  • 西方在 1870-1880 年代流行「重排十五」遊戲。
  • L.W.Hardy 在 1909 年發明 Pennant Puzzle
  • 往後法國出現L’âne rouge 遊戲,和華容道一模一樣。
  • 可以想像遊戲傳到中國,並加上本土的故事,成為本土化的遊戲。

是比較科學一點了,不過可笑的地方也不遑多讓:

  • 我還找不到那本甚麼《科學消遣》在網上有任何紀錄。[2] [4] 許蒓舫的那本《數學漫談》是 1952 年,找到了紀錄
  • 許蒓舫是何許人也?別人給他的銜頭可多了:
    • 蘇州師大許蒓舫教授
    • 清華大學教授許蒓舫
    • 中國著名數學家許蒓舫
    • 中國學者許蒓舫

    不過,就我所知他是個中國數學教育家,而且是中學教師啊。 [5](他寫的另一本《趣味的數和圖》,好像現在還在家中)

  • 百度這篇文章 [3] 也是講華容道的,許蒓舫那本書書名最初是《趣味數學》,過了幾段就突然變成《數學漫談》了。是不是兩個人 cut and paste 搞出來的?
  • 同樣是上面百度的文章,LW Hardy 1909 年 Pennant Puzzle 的紀錄有是有了,但圓圈裏面一個 C 字,那居然說成是專利的符號? [1]

本文還有續篇。

  1. 2006-07-03 更新:Lewis W. Hardy 真的有申請專利,而且被美國批准了。不過年份有誤,不是 1909 年;而是 1907 年申請,1912 年批准的。但百度將 copyright 和 patent 混淆,太兒戲了。
  2. 2007-12-02 更新:似乎找不到紀錄不是甚麼大不了的事;印象中看哪裏討論過,早幾十年的大陸書似乎都是沒有書號的。經歷過文革,找得到提及《數學漫談》的資料已屬萬幸。
  3. 2008-03-23 更新:百度文章的 link 改了。
  4. 2008-03-25 更新:原來《科學消遣》的作者姜長英已經將書重寫,並以書名《科學思維鍛練與消遣》在 1997 年重新出版,其中有提及自己舊作的書名。
  5. 2008-03-25 更新:在某個 forum (google cache) 中,有回應提及當時蘇州師範學院 (現今稱為蘇州大學) 數學系中的確掛了許蒓舫的名牌出來,應該是可信的。但當時他的健康情況已經比較差,連書店編輯也不當,需要回家養病;如果說是客席教授,偶然地到蘇州師範教授數學,那也說得通。

中國人如何如何優秀

2006-06-08
  • 祖冲之在 5 世紀就求得接近㘣周率 (π) 的分數值了,比外國人要早整整一千年哦!
  • 中國古時老早就有了火藥啦,哪能輪到外國人威風?
  • ……

因為以上的東西,中國人的文化永遠絕對是全世界第一的。因為中國文化遺產是最多的,所以中國人就是最優越的。


從不同的書本、媒體中,從老師的教導中,我們自小就灌輸了這種思想,中國人是最棒的,因為甚麼都是中國人最早發明的。至少我自己遇到的中文書籍如是,歷史教科書如是,報紙文章如是。這方面就不需要詳細再說下去,因為別人已經寫得清清楚楚 (這篇文章就是一個例子),而且文筆尖銳得多。大家就看看甚麼是中國古代四大發明。只是這類文章必定不會受某類人喜歡吧,因為它污蔑中國文化歷史破壞中國人的自尊

但是說中國人目前這一分這一秒如何如何不濟,如何需要自強,卻是寥如晨星。這就是「隱惡揚善」,是中國人自古以來的美德吧?

如果不幸有朝一日我變成柏楊的話,請大家槍斃我,不要把我關進牢內。


04:29 更新:以下是我對於上面「四大發明」的文章,覺得最容易觸動心境的一段說話:

有的时候我会想,咱们中国人怎么就那么在意我们以前是不是第一,不惜撒谎吹牛都要去维护这个第一,却不关心我们现在是不是第一,这是不是一种病态的心理呢?就像一个人,如果生活事业顺利,就很少去回忆过去的事情,也没有时间去回忆。只有失败者,对前途绝望者,对生活失去信心者,才老怀念过去,靠这个来安慰自己。或者是像人老了就喜欢怀念过去,年轻的就喜欢幻想未来。现在中国的复古风气很盛,可能我们中国人真的是觉得已经快走到穷途末路了吧。

How to retrieve the IPv4 address ranges allocated to Hong Kong?

2006-06-06

Since tom.com days, I have always wondered how Leon managed to get all of the IP ranges assigned to Hong Kong. Certainly, the utter crap HKDNR won’t provide this kind of listing. The mystery is keeping me puzzled for all these years.

Finally, I just get it today after searching through APNIC. Basically it’s just one command (wrapped because it’s too long):

wget -q -O - http://ftp.apnic.net/stats/apnic/delegated-apnic-latest | grep '^apnic|HK|ipv4' | awk -F\| 'BEGIN{OFMT="%d"; for (i=0; i<32; i++) {power[32-i]=2^i}} {for (k in power) {if ($5 == power[k]) print $4 “/” k}}’

To retrieve IPv4 address allocation for other districts, use capitalized ISO 3166 code of that district to replace ‘HK’. For example, ‘CN’ for China and ‘TW’ for Taiwan.

2006-06-07 03:41 update: Alan Tam made a good suggestion to make it simpler. Please read the comment.

Captcha is bad for visual impaired? Or just our imagination?

2006-06-01

Sample of captcha image

Unquestionably, the answer is, captcha is absolutely against accessibility. (For those who don’t know what Captcha is, please take a look at the explanation in wikipedia) Captcha is exchanging website accessibility for security, that’s sure.

However, when I knew that Wordpress Captcha plugin is discontinued a few days ago, citing accessibility problem for people with vision problem (e.g. blindness or color blindness), I have a question: is Captcha plugin so bad for these people?

As far as I know, still quite a large portion of blind people are going online with DOS + Lynx, and lynx doesn’t support javascript. Most wordpress sites are already inaccessible for them anyway, captcha shouldn’t make any difference for them. The author of captcha plugin is migrating to wp-hashcash; however, how another chunk of javascript can help in accessibility? Do we really understand the need of the minority, or we just imagine we understand them?

(One point is true though, badly designed captcha affects usability, even for people with normal vision.)

16:30 update: I’m using wp-hashcash to replace captcha as well, but won’t pretend this improves accessibility for the site.