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. :)