2014年11月1日星期六

Brain in a vat

Recently, I found a BBC news:
BBC news for fish-brained robot at Science Museum
This news is not new any more, around 2000s. It said that a robot that is controlled by the brain of a fish has gone on display at the Science Museum, London, UK.
lamprey eel brain, engine

Sensors mounted on the machine send "visual" signals to the lamprey brain which, in turn, transmits instructions to the robot's motors. The part of the brain used in the experiment normally keeps the lamprey upright in the water. When connected up correctly, the organ can guide the robot towards a light source.

What a poor fish it is!

How about human's brain? If one day, we can remove a person's brain from the body, suspend it in a vat of life-sustaining liquid, and connect its neurons by wires to a supercomputer which would provide it with electrical impulses identical to those the brain normally receives. Since the brain in a vat gives and receives exactly the same impulses as it would if it were in a skull, and since these are its only way of interacting with its environment, then it is not possible to tell, from the perspective of that brain, whether it is in a skull or a vat.



What a poor brain it is!

Guy, do not be so quick to sympathize with others. Can you tell whether you are a brain in a skull or a vat? Let me tell you the seriousness of this matter. Yet in the first case most of the person's beliefs may be true (if they believe, say, that they are walking down the street, or eating sushi); in the latter case their beliefs are false. Since the argument says one cannot know whether one is a brain in a vat, then one cannot know whether most of one's beliefs might by completely false. Since, in principle, it is impossible to rule out oneself being a brain in a vat, there cannot be good grounds for believing any of the things one beliefs.

That is worst thing!

Aha, but how about the pure mathematics, can we still believe it?

2014年9月10日星期三

Mathematical Principles of Bisection Method for Finding Square Roots

Python code. (Bisection method for finding square roots)
def squareRootBi(x, epsilon):
    """Assume x>=0 and epsilon>0
       Return y s.t. y**2 is within epsilon of x"""
    assert x>=0, "x must be non-negative, not" + str(x)
    assert epsilon>0, "epsilon must be positive, not" + str(epsilon)
    low = 0
    high = max(x,1.0)
    guess = (low + high)/2.0
    counter = 1
    while abs(guess**2 - x) > epsilon and counter <= 100:
        if guess**2 < x:
            low = guess
        else:
            high = guess
        guess = (low + high)/2.0
        counter +=1
    assert counter <=100, "iteration count exceeded."
    print "Bi-method, Num iterations:", counter, "Estimate:", guess
    return guess

We assert that guess**2 tends to x as epsilon tends to 0. To prove this statement we need the following theorem named Nested Interval Theorem which is the fundamental theorem in mathematical analysis.

Theorem. (Nested Interval Theorem)
If I_n=[a_n,b_n] is a sequence of nonempty bounded intervals satisfying I_n>I_2>...>I_n>.... Moreover assuming that the length of I_n tends to 0 as n tends to infinity, then there exists a unique real number c belongs to all the intervals I_n, n=0,1,2,.... such that both of a_n and b_n tend to c as n tends to infinity.

Without loss of generalization, we assume that x>1 and epsilon=1/n. The above code yields a sequence of intervals: I_n, n=0,1,2,..., where we set I_0=[0,x], such that the conditions in the above theorem, that is I_0>I_1>I_2>...>I_n and length of I_n is x/2**n, n=0,1,2,.... Then there exists a unique real number y belongs to all the interval I_n, n=0,1,2,.... Now we can easily see that a_n**2 and b_n**2 tend to x, hence y**2=x. Indeed, we assume that I_n=[a_n, b_n], and from the code it follows that a_n**2<x<b_n**2, letting epsilon tend to 0, that is, n tends to infinity, we see that both of a_n**2 and b_n**2 tend to x, therefore y**2=x.


2014年8月30日星期六

How to completely uninstall Enthought Canopy on Mac OS

1. From Canopy preferences menu, Unset Canopy as your default Python.

2. Remove the following directory:

  •     /Applications/Canopy.app  
  •    also you can uninstall it by using mouse operation "Click".

3. Remove the residual files:
    sudo rm /Users/<your_username>/Library/Enthought

4. Remove the hidden folder:

  •     ~/ls -a   # listing all the files and folders including hidden one
  •     sudo rm ~/.canopy


5. After uninstalling Canopy, if you got the following messages when turning on the terminal:
-bash: /Users/<your_username>/Library/Enthought/Canopy_64bit/User/bin/activate: No such file or directory

You can solve this problem by

  •     ~/ls -a     # listing all the files and folders including hidden one
  •     sudo vi ~/.bash_profile     # opening the bash_profile by vim
  •     Keyboard operations: "ESC" and "i"     # insert mode
  •     Removing the lines which contain the offending file names.
  •     Keyboard operations: "ESC", ":wq"    # Save and exit

Weiqi: how difficult it is to make a computer compete against a human

A brief overview of Weiqi:
Weiqi is a strategy game where two players take turn placing stones on a board, which is wildly popular in China. There are only two types of stones: black stones and white stones.


After Deep Blue defeated Garry Kasparov in 1997, Time Magazine presented a new challenge: Let the computer battle with human. 

Peter Norvig in Google pointed out that even plenty of experts are invited, a hundredfold hardware, software, using correct machine learning algorithms, combined with the achievements of neurological science, it may not be able to reach the computer "Deep Blue" in terms of achievements in chess. Now Chess-playing softwares can compete with the best humans, however even strong amateurs can beat the top Weiqi-playing programs, why? There are three main reasons for this:
1. Game-tree complexity: there are about 10123 possible games in Chess. As for Weiqi, the American Weiqi Association reckons there are 10^700 (>>10123) possible games. In fact, numerical estimates show that the number of possible games of Weiqi far exceeds the number of atoms in the observable universe.

2. Lack of a good heuristic: Chess programs are able to evaluate quite accurately and quickly whether a given position is better than another one. On the contrary, no good heuristic has been found for Weiqi yet.
3. Pattern-recognition: strong Go players rely heavily on recognizing the shapes the stones take. There are too many of them for a computer to try to recognize in a game timeframe, and humans are much better than them at this.

Time Magazine predicted that the computer will use one hundred years or even longer to defeat humans on Weiqi, it seems be a forgone conclusion. But recently, Computer Crazy Stone which is designed by Prof. Remi Coulom of Computer Science at the Third University of Lille, France defeated Ishida Yoshio, a Weiqi master has won five titles. Precisely, Ishida had a four-handicap, this is an unfair duel, and also he is not in his peak condition. However, Crazy Stone is quite an achievement.

The use of randomly played games helped Crazy Stone get much stronger. Crazy Stone adopted the Monte Carlo method. It was found that the best way to evaluate a position is to play, from this position, a lot of games where each player puts stones at random on the board. Norvig in Google explained that this algorithm is an important innovation. After 20 steps, we can not say for sure who will win the game, and so finally we used the Monte Carlo method to determine the position’s score simply by the percentage of won random games. The computer begins with a prior probability distribution for every possible move. It picks one according to this distribution, plays a random game from the corresponding position and uses the result to update the probability for this move. It then selects another possible move according to the updated distribution and so on. So it learns during the game and the randoms play-outs that some kind of responses to his opponent’s moves are likely to have a bad result, and assigns them a lower probability.

It is reasonable to believe that, given time, Crazy Stone will become stronger and stronger and it seems that the prophecy from Time Magazine is soon to be dashed. 



2014年8月28日星期四

How to uninstall Python 2.7 (installed by yourself) on a Mac OS



1. Open the terminal.

2. Remove the Python 2.7 framework:
    sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7

3. Remove the Python 2.7 applications directory: 
    sudo rm -rf "/Applications/Python 2.7"
    
4. Remove the symbolic links in /usr/local/bin that point to Python 2.7:
    cd /usr/local/bin
    ls -l . | grep '../Library/Frameworks/Python.framework/Versions/2.7' | awk   '{print $9}' | xargs sudo rm

5. Back to the system default Python:
    cd /Library/Frameworks/Python.framework/Versions
    sudo rm Current
    sudo ln -s /usr/bin/python Current

PS: If you do not carry out Step 5, then there will be an error when you start python in the terminal.

JCR2013: Fractional Calculus and Applied Analysis

According to Thomson Reuters 2013 Journal Citation Reports SCI Edition.
FRACTIONAL CALCULUS APPLIED ANALYSIS.Impact_factor = 2.974.
This is the first time that "FRACT CALC APPL ANAL" receives these metrics
officially, rank 4/95 in category Mathematics, Interdisciplinary Applications,
and rank 5/250 in category Mathematics, Applied. Although it is not ranked
in "Mathematics" (pure, where it would be most suitable classification), the
data from JCR show that it can be also at 4th place (of 300), after "Commun
Pur Appl Math", "J AM Math Soc", "Acta Math (Djusholm)", and before the next
journals in the list as "Ann Math", "Fixed Point Theory", "Found Comput Math",
"Invent Math", "Mem AM Math Soc", "Duke Math J".

Congratulations!!! :)

PS: FCAA.MCQ (Mathematical Citation Quotient) = 0.50.
There is still much roooom for improvement. :)

2010年12月17日星期五

数学家波利亚之评论数学学习(精彩)

什么是好的教育? 系统的

学习自己发现万物的机会。

------H.Spence

在数学文献中不乏家好的内容丰富的问题集、习题集、复习书等等。在我们看来,
本书和它们都不同,不论在目的、取材和安排上,而且也在建议读者使用的方式上都有
所不同。因此就需要对这几个方面做些说明。

本书的主要目的(我们并不是提得过高)是:通过系统安排的问题,是数学系高年
级的学生习惯于在分析学的几个重要领域中进行独立思考和独立研究。它可供学生和教
师个人进修提高之用,学生可以用它来扩大自己的阅读和听讲内容,或者独立地就书中
个别部分加以仔细研究;教师可以采用它来组织习题课或讨论班。

本书不是单纯的问题选。他的最重要的特色是材料的系统编排,其用意在于激励读者独
立的工作,并启示他以有用的思维习惯。我们在材料最有效的编排上所花费的时间,审慎
和细致的功夫,比起局外人初看之下所想象的要多得多。

传授有关知识对我们来说是次要的事情。我们首先要养成读者的正确态度,加强某些思
维训练,这些在数学中无疑比在其他科学领域中更为重要。

我们不可能详细地制定最有效的思维方法的一般规律,即使能够建立这些规律,他们也
不会是很有用的。人们不再于从理论上去熟记这些正确的规律,而应是其深入到血肉以
备随时和本能的加以利用。因此对于培养一个人的思维能力来讲,只有思维训练才是真
正重要的。独立解决一些难度高的问题对读者的帮助远远超过下文提到的一些经验之谈
,不过在开始阶段照他做并不会带来什么坏处。

人们力图这样去理解一切:孤独的事实,将他与有关的事物作对赵;新的发现,将他与
已熟知的知识相联系;不习惯的,与习惯的相类比;特殊的结论,加以推广;一般的结
果,给予适当的特殊化;复杂情况,分解为组成部分;细节,通过概括,获得全貌。

熟悉一个城市与熟悉一个知识领域有相似之处。一个人必须能从给定的任何地点到达任
何其他站点。如果他能很快选择一条最方便或最快的路径从一个地点到另一个地点,那
么它可算是相当熟悉了。如果他是非常熟悉的话,他甚至还能搞出点新花样,例如进行
一次远足,自始自终避免走某些平时常走的路----这种事情会发生在一些合理的讨论中


借零星的人失去构造完美的知识整体与用未经加工的乱石建筑一道墙也有类似之处,人
们必须把每个新的人是像对每块新的石头那样翻来覆去的从各方面观察它,把它试放到
所有可能的位置上去,直至新的东西在已建成的部分中找到他最合适的位置,使得接触
面竟可能大而裂缝尽可能可能小,从而形成整个坚固的结构。

直线是由两点确定的,类似的,许多新的结果是通过在两个极端情况之间的一类线性插
值得方法得到的。一条直线也可以由一个方向和一个点所确定。新的结果也常从一个值
得注意的特殊情况于某人工作方向的巧合中产生出来的。平行引申也是得到新结果的有
效方法。

一个想法使用一次是一个技巧,经过多次使用就可成为一种方法。在数学归纳法中求证
的结论和为了证明它所能动用的手段是成比例的。他们的比为n+1:1。因此加强求证的结
论也可能带来好处,因为与此同时我们也加强了证明过程中可以动用的手段。在其他场
合也会出现这种情况,即较一般的特法比其特殊的结果可能更容易证明;在这种情况下
最重要的成就应该是建立更一般的论述,提炼本质的东西,掌握完整的情况。

“Qui,nimium probat,nihil probat。”不过人们应当带着怀疑的心情审查每个证明,
看看是否所作的假设在论证中都已用上了。人们应当试图从较少的假设中得到相当的结
论,或者从相同的结论得到较强的结论,仅当找到了反例表明已达到可能的极限时才应
满足。

然而人们决不能忘记有两类推广:一种是容易取得的,一种是有价值的。一种是用稀
释的办法来加以推广,另一种使用集中的方法来加以推广。稀释意味着在大量的水中把肉
煮成汤,集中意味着浓缩大量营养物质为精华。在通常的观点下似乎是互不相关的概念
得到统一便是集中,例如群论浓缩了过去散布于代数、数论、几何中似乎是非常不同的
概念。用稀释进行推广的例子更容易找了,不过据这种例子是很容易伤感情的。

把所有的分析体裁都编成问题是不适宜的。一本问题集,要全面考虑到所有比较重要的
分析领域必然会流于太浩繁和不便使用。当然人们可以用许多不同的方式来选材,我们
的着重点是放在现代分析的中心领域复变函数的理论上,但是我们稍微偏离通常的讲课
、教科书和问题集所遵循的那条路径,在相同情况下优先考虑了我们个人兴趣最接近的
那些领域。我们一层取材于较难得以及还处于急剧发展阶段的领域,这些领域到目前为
止在教科书的专门文献中还很少甚至完全没有涉及。目录表将相当详尽的说明这一点。
某些章节也可供专家参考之用。但是我们在任何地方都没有致力于达到专著的完备性。
因为我们把材料的选辑看作是从属于我们主要目标的。即经我们最大努力来安排材料以
期能给读者提供指导和启发。

材料的来源是极其广泛的。我们从数学知识的经典内容和较为近代的论文中进行了选择
。我们选择的问题中,一部分在各种定期刊物上已经发表了,一部分是由作者口头上传
达给我们的。为了达到我们的目的,我们对材料进行了加工,使它完整化,并且作了大
量的补充。此外,我们在这里首次以问题的形式发表了许多我们自己的结果,其目的在
于能够提供一些甚至对专家来说也是新的内容。


材料安排成两卷,第一卷由比较基本的三篇组成,第二卷由专门处理比较特殊的问题及
应用的六篇组成。

每卷前面一半是问题,另一半是解答。在包含问题的部分,特别在每章的开头,作了些
说明,这些说明回忆了作为背景所需要的一般概念和定理。在问题中经常附有着手解决
的方法和提示。解答以尽可能间接的形式给出。我们略去了不重要的推导,应为对问题
进行认真地考虑后,这些推导当是显而易见的。在例外的情况下仅把解答概略地叙述一
番,并给读者指定专题论文,有时也接触到进一步的引申,其他应用和没有解决的问题


每一篇分成章,每章分成节。每当后边要出现一段说明文字或者要引入一个新的思想进
程时,我们都空开一行予以表示。

本书在各章节内问题的编排方面比起在材料的选择上可能更不同于我们知道的同类书籍
。为了阐明新学到的定理和概念,那种借助适当的特殊情形纯粹的练习题所占的篇幅很
小,孤立的问题很少。单个问题大部分合并成一系列问题,它们平均占有两节的篇幅,
而这些系列的有机构成曾经是我们极其关心的对象。

人们可以从不同的观点——根据所要求的预备知识、难度、方法或结论将问题分类。我
们没有受到这些观点的约束,而选择了不同的安排,这些安排反映了人们在独立研究中
碰到的不同情景。例如某一节涉及的方法可能在开始时只作了简略的说明,接着就用他
们去解决尽可能多的各种形式的问题,从而一步一步得到发展。另一节可能类似的涉及
开头叙述过的定理(或者是已经证明过的,如果这时容易并且很快能做到的话),然后
用几种方法去应用并予以特殊化。别的章节是按上升的格式构成的:一般的定理仅出现
在先行的特殊情况和导致它的推测或简短的注记之后,偶尔比较困难的证明要经过几步
或通过一系列的问题之后才能得到,每个问题引出一个辅助引理,一个独立的证明部分
,或者某种展望,从而构成一连串想法中的一环,利用它读者最后达到要证明的定理。
某些章节提出了“混合理论”,编排得较为松散;他们通过较难的应用来复习前面的材
料,或者提供一些富有本身兴趣的结果。

有时四个衔接的问题构成一个“比例”,其中第四个对第三个的关系与第二个对第一个
的关系一样(推广、理问题和应用),某几节专门用于类比的比较详细地介绍和分析。
这里问题交替取自两个平行的论题。他们同属一对并且构成所谓“连比例”。看来这种
安排是特别富有教益的。

人们可能是为了在书中寻找他个人或他的学生进行练习的机会,也可能完全是为了阅读
而和本书打交道的。在每种情况下,要想达到各自的目的,都能很自然地在本书中找到
使用他的适用方法。

每篇开始的章节所需的准备只是相对少些,不同的章节虽然不是全部,但大部分是相互
独立的,在同一章节中不同节之间的联系也是较松散的,因而人们不必拘泥于原来的顺
序。

想解决问题的读者不仅应当只想问题中问了什么,而且应当想是怎样提出问题的以及在
什么情况下提出的。许多问题如果单独提出,即使是程度高的学生也难于对付,故在这
些问题前后安排了作为准备知识的或帮助理解的问题,通过上下文使得只要有点毅力和
独立工作能力的人就可以解决。当然也会出现没有任何准备的真正的难题。这些大部分
包含在比较松散的片段中(混合题),或者仅仅以孤立问题的形式出现。

提示听任读者使用,但并不想将他们强加给读者。

如果你不能解决一个问题,你不应当丧失信心,“苏格拉的教学法”不是用迅速的回答
问题训练人,而是用提问进行教育。如果反复努力不见成效,那么读者就能更加深入地
对在后半卷中可找到的解答进行分析,揭示其碰壁的原由,并作为永久的收获牢记心中


在本书写作的过程中,在组织中,高年级学生学期练习和解题讨论班上曾多次使用。在
此期间简单的问题在教室里讨论并由学生作口头回答,而较困难的问题限定在适当的时
间内作书面解答,重要的作为范例的问题有教师解答。一学期时间差不多可完成一章的
内容。有几章在这种形式下使用过并根据我们得到的经验作了部分修改。我们认为为了
组织学期练习和讨论班之用,可以大胆推荐我们采用的方法:不是提出孤立的问题,而
是仔细考虑有联系的问题链。这本书的每一章几乎都能作为这种练习的基础。显然,在
实际使用时应当小心一些,不要照搬,特别是作为家庭作业和考试用的一些问题宜于用
类似的加以替换。

每个问题提出后马上阅读它的解答,这样连续的阅读法只能介绍给比较有经验的读者。
但总的来讲,这样不能真正领会本书的精神实质。然而某些章节适合于这样连续阅读并
基本上可采用作为教科书。当然,就这些目的而言书上的表达就过于简练;本意是希望
有点时间去思考公式及其解答之间的联系以及在它的陈述和证明之间的联系。

如果我们的计划没有在所有方面获得成功,我们只能靠两件事实来为自己开脱:首先,
本著作的计划完全是新的,我们没有任何可募仿的样本。其次,各章涉及过广势必要求
太大的篇幅,在某些方面提法的改进需要太多的时间一直与实施整个计划也濒于危险。
进而言之,如果读者能使我们注意本书可能不足之处以便以后有机会予以改进,我们将
表示致谢。