Category: 计算机与 Internet

Maybe we can be put into a system,and be calculated to be a number。

This number describes what we shall do in next step。

So is there a rational number for a human?

In mathematics, irrational number means non-cycle limitless number.

Since a human is always of limit(his life is limited), he is always a rational number if it can be encoded a number.

(These are 2 different concepts, a human’s limited life and his encoded number’s length are different)










This is an ugly spyware when u install something from untrusted source.

One key symption is that when u open default browser, a default url is opened

Even if u set default home URL to about:blank, that URL is still opened.

In fact, it is implemented by appending that URL to ur browser’s quick start URL. So right click ur browser icon, property, remove “” from target.





How many kinds of average number are there for a value depending on time series?

  1. simple moving average
  2. cumulative moving average
  3. weighted moving average
  4. exponential weighted moving average


EWMA is a very interesting one.









assuming input is (a, b), a is alway less than b, say a to be part0, say b to part1

  1. if a = b,print 1
  2. if (a,b) = (1,2) , print 0
  3. if (a,b) = (1,n), n>2
    firstly get n-2, then it can be reduced to scenario 2
    so print
  4. if (a,b) = (2, n), n>2
    if I get 1from part0, it is reduced to (1,n), so I lose. excluding it
    if I get 2 from part0, it is reduced to (0,n), so I lose, excluding it
    So I can only get from part1. get n-1 from part1, reduce it to scenario 2
    so print
  5. if (a,b) = (3, n), n>3
    can not get 1, or 2, or 3 from part0, it will lose   
        if n=4, (3,4) reduce to (3,3), lose
                    (3,4) reduce to (3,2), lose
                    (3,4) reduce to (3,1), lose
                    (3,4) reduce to (3,0), lose
              print 0 for (3,4)
        if n>4, reduce (3,n) to (3,4) by get n-4 from part1
              print 1 for (3,n) n>4
  6. if (a,b) = (4, n), n>4
    (4,n) reduce to (4,3) by get n-3 from part1
    print 1
  7. if(a,b) = (5, n), n>5
    can not get 1,2,3,4,5 from part0, will lose
  8.     if n=6, (5,6) reduce to (5,5), lose
                    (5,6) reduce to (5,4), lose
                    (5,6) reduce to (5,3), lose
                    (5,6) reduce to (5,2), lose
                    (5,6) reduce to (5,1), lose
                    (5,6) reduce to (5,0), lose
              print 0 for (5,6)
        if n>6, reduce (5,n) to (5,6) by get n-6 from part1
              print 1 for (5,n) n>6

  9. if(a,b) = (6, n), n>6
    (6,n) reduce to (6,5) by get n-5 from part1
    print 1

So we can see something here, summarize as such:


  • if a=b, ouput 1
  • sort the pair to be (a,b) to meet a<b
    if a=2n, output 1
    if a=2n+1, b=2n+2, output 0
    if a=2n+1, b>2n+2, output 1
0 n 1
1 2 0
1 n(>2) 1
2 n(>2) 1
3 4 0
3 n(>4) 1
4 n(>4) 1
5 6 0
5 n(>6) 1
6 n(>6) 1
7 8 0
7 n(n>8) 1

    Yellow means they can be changed as required.

  1. Next State
    Input State Input Symbol Output State Output Symbol Action
    S0 i0 S1 i0 0
  2. If then else
    Input State Input Symbol Output State Output Symbol Action
    S0 i0 S1 i0 0
    S0 i1 S2 i1 0
  3. empty Loop
    S0: initial
    S1: loop body start
    S2: loop body end 

    Turing machine Tape Initials:        image

    Input State Input Symbol Output State Output Symbol Action
    S0 0 S1 1 R
    S0 1 S1 2 R
    S0 S1 R
    S0 n-1 S1 n R
    S0 n Sout    
    S1 !FlagS1 S1 FlagS1 0
    S1 FlagS1 S2   R
    S2 any S2   L
    S2 FlagS1 S0 !FlagS1 L
  4. Loop with something between S1 and S2
    Take a look at the red entry at above table, modify S2 to others, and make sure there is a new entry of returning to S2 after ur loop body logic
    Input State Input Symbol Output State Output Symbol Action
    S1 FlagS1 Others   R
      S2   R
    S2 any S2   L
    S2 FlagS1 S0 !FlagS1 L
  5. Copy of A String 111…111
    Input State Input Symbol Output State Output Symbol Action
    S0 0 Sout    
    S0 1 S1 Flag R
    S1 1 S1   R
    S1 0 S2   R
    S2 1 S2   R
    S2 0 S3 1 L
    S3 any-Flag S3   L
    S3 Flag S0 1 R
  6. Append a String 111…111 to a String 111…111||null 
    identical to 5,here is its flow graph
  7. Multiplication

    Input State Input Symbol Output State Output Symbol Action Comment
    S0 0 Sout     exception
    S0 1 S1   R  
    S1 0 S6   R S6=start moving to the end and add the tailing 1
    S1 1 S2 Flag R  
    S2 1 S2   R  
    S2 0 S3   R complete reading 1st number
    S3 0 Sout     exception
    S3 1 S4   R  
    S4   S5     append following 1s to subsequent 1s
    S5 any-Flag S5   L  
    S5 Flag S1 1 R  
    S6 1 S7   R  
    S6 0 Sout     exception
    S7 1 S7   R  
    S7 0 S8   R complete reading 2nd number
    S8 1 S8   R  
    S8 0 Sout 1   normal

Turing Machines

About Turing Machines, this article is a must.


Simply say, A Truing Machine is composed of 5 elements.

  1. Initial State                                  s0
  2. Final State                                   f0
  3. A finite set of state                      S
  4. A finite set of input symbols        I 
  5. A series of functions                    S x I –> S x I x {L, R, 0}

Of course there are others such as tape, read|write head etc.

In this article, it discusses a method to store number by Turing machine, which is different from normal binary system used by current computers. That is, 0 represented by one 1. 1 by two 1s. 2 by three 1s. … …

Using this representation, it gives a Turing machine to define f(n)=n+1.
Further, it gives a Turing machine of f(m,n)=m+n.

Turing machines can be encoded as sequences of 0|1. Further its arguments and it can be set as input of a UTM(Universal Turing Machine) to simulate its behavior. UTM can be thought of as a programmable computer. And Turing machines can be thought of as a program.

Further, UTM can also be encoded as 0|1 sequences and set as input to itself to simulate its behavior.


The number of Turing machine is countable. And computable functions can be represented by a Turing machine.

The number of functions over Natural numbers is uncountable.(

So there exists functions which can not be represented by a Turing machine.


Let us take a look at the way to prove Functions over Natural Number is uncountable(F: NxN).

Firstly, for each n, let us construct the function Fn(x): N—>n, Fn(x) is indefinite and bijectioin to N. So the set of Fn(x) is countable. 

Secondly, assuming F is countable, so there exists a bijection M: N—>Qn(x),Qn(x) belong to F. Now let us construct another a bijection P: N—>Qn(x)+1,

    for each m belongiing to N, P(m)=Qn(m)+1

    Qn(m)+1 is a Natural number,

so P is a member of F.

On the other side, P is different from each of Qn(x), so F is uncountable.


The above method to prove F is uncountable is similar to the way of proving the sequence of 0|1 is uncountable by Cantor.

Let us see what is the common way.

Assuming the set S is countable, then construct an element E from some or all of the set’s elements. On one side, E is not identical to any of the set’s element. On the other side, from the set’s definition, E also belong to S. Contradiction happens here. So S is not countable.

win8 tips

  1. win8下应用字体模糊blurry
  2. 参见这个!topic/chrome/9DnjIpD3xoE

    The point is to enable a option of the app exe.


  3. remove skydrive/onedrive from win8
    using gpedit.msc