How to programmatically explain the function limit?

 

Mathematics is a precise subject. Natural language has natural weaknesses in terms of logical structure, while programming language naturally has a clear logical structure. We can try to use it to explain some slurred definitions.

The emergence of the limit is to solve the calculation of undefined points, such as the problem of sinx/x at x=0, and x=0 makes the denominator 0, which makes the calculation meaningless. New mathematical tools are urgently needed to study such problems. The concept of the limit is not achieved overnight. Many mathematicians have studied the limit in history. The definition of the limit we see now is the one given by Cauchy in the 19th century

                                                  

 

                                       Whenever a point x is within δ units of cf(x) is within ε units of L 

 

Image source: https://commons.wikimedia.org/wiki/File:L%C3%ADmite_01.svg Thanks to the author

Definition of function limit

The Chinese definition of Baidu Baike is as follows:

Definition: provided the function f (x) at a point x0 in the coring neighborhood is defined within, if there exists a constant a, for any given positive number [epsilon], are   the inequality  

In   the time constant is true, then the constant   is called function   when   the limit when, denoted

                                                                                         

The English definition of Wikipedia is as follows: 

 

The English definition is shorter. In fact, domestic textbooks are translated according to this definition. I think the translation is not very good. After all, the limit is a logical concept set artificially. It does not highlight the natural relationship between the name and the conditions. 

It sounds awkward. If the limit exists, it can only be a number. I can't imagine any other things. The limit can only exist in the form of an exact number. Exactness is the only attribute of the limit. Is such a thing defined in natural language? I try to explain in programming language.


In the programming language, there will be the following conversions:

Any given positive number: For every positive number, one cannot be missed, as long as one is not satisfied, it is wrong, so all positive numbers are traversed.

Exist: at least one number can be found

Established: true

Defined: have a certain value

Dehearted neighborhood: all numbers except the number of center points

Therefore, the above definition becomes: Traversing a small range of positive numbers e has the following facts:

There is a positive number dx, when x satisfies the inequality 0<|x-x0|<dx, the corresponding function value f(x) all satisfies the inequality |f(x)-A|<e

The emphasis here is that there is a continuous area: the dx neighborhood of x0, in this area, the values ​​of f(x) are all in the e neighborhood of A.

Therefore, the above definition becomes: Traverse a small range of positive numbers x1, at least one dx can be found:

When x satisfies the inequality 0<|x-x0|<dx, the corresponding function value f(x) satisfies the inequality |f(x)-A|<e

That is, under the traversing x dx limit values, are satisfying | f (x) -A | < e, it means that A is the independent variable tends to limit at x0.

There is one dissatisfaction in the above process, which means that A is not the limit when the independent variable tends to x0.

At this point, we have sorted out the entire logical structure. Now turn it into pseudo code.

bool A_Is_Limit_Or_Not( f(x), A, x0){

for (i=0;i<fx_field;i++){  //针对f(x),给定一个小邻域半径fx_field,遍历所有取值,检查其中每一个正数,也就是e

    for (j=0;j<x_field;j++){  //针对自变量x,给定一个小邻域半径x_field,遍历所有取值,找到一个dx

        for(x=x0-dx;x<x0+dx;x++){   //把dx作为小邻域半径,遍历dx邻域中的每一个x,检查对应的每一个函数f(x)取值

            if ( !( |f(x)-A|<fx_field ) )   //检查函数f(x)和A的差能否被小邻域半径内的取值e控制住

            return false;//不是极限,结束函数

}

}

}

return true;//能够执行到这里,说明!( |f(x)-A|<fx_field )从未成立过,所以A是趋于x0的极限,结束函数

}

 

Note: The i++, j++, and x++ I write here are not really an integer doing an auto-increment operation, but want to show the meaning of the variable value one by one in the domain.


Regarding the expression of mathematics in programming language, here is a video that speaks very well, and I was inspired to write this article.

 

Guess you like

Origin blog.csdn.net/sinat_39416814/article/details/99576824