기본 콘텐츠로 건너뛰기

[ML] 결정트리(Decision Tree) 모델

[Math Classic]Calculus Made Easy CH.3

CHAPTER III.

ON RELATIVE GROWING.

All through the calculus we are dealing with quantities that are growing, and with rates of growth. We classify all quantities into two classes: constants and variables. Those which we regard as of fixed value, and call constants, we generally denote algebraically by letters from the be ginning of the alphabet, such as a, b, or c; while those which we consider as capable of growing, or (as mathematicians say) of “varying,” we denote by letters from the end of the alphabet, such as x, y, z, u, v, w, or sometimes t.
Moreover, we are usually dealing with more than one variable at once, and thinking of the way in which one variable depends on the other: for instance, we think of the way in which the height reached by a projectile depends on the time of attaining that height. Or we are asked to consider a rectangle of given area, and to enquire how any increase in the length of it will compel a corresponding decrease in the breadth of it. Or we think of the way in which any variation in the slope of a ladder will cause the height that it reaches, to vary.
Suppose we have got two such variables that depend one on the other. An alteration in one will bring about an alteration in the other, because of this dependence. Let us call one of the variables x, and the other that depends on it y.
Suppose we make $x$ to vary, that is to say, we either alter it or imagine it to be altered, by adding to it a bit which we call $dx$. We are thus causing $x$ to become $x + dx$. Then, because $x$ has been altered, $y$ will have altered also, and will have become $y + dy$. Here the bit $dy$ may be in some cases positive, in others negative; and it won’t (except by a miracle) be the same size as $dx$.

Take two examples.

(1) Let $x$ and $y$ be respectively the base and the height of a right-angled triangle (Fig. 4), of which the slope of the other side is fixed at 30°.
FIG. 4.
If we suppose this triangle to expand and yet keep its angles the same as at first, then, when the base grows so as to become $x + dx$, the height becomes $y + dy$. Here, increasing $x$ results in an increase of $y$. The little triangle, the height of which is $dy$, and the base of which is $dx$, is similar to the original triangle; and it is obvious that the value of the ratio $\frac{dy}{dx}$ is the same as that of the ratio $\frac{y}{x}$. As the angle is 30° it will be seen that here
$$\frac{dy}{dx}=\frac{1}{1.73}$$
(2) Let x represent, in Fig. 5, the horizontal distance, from a wall, of the bottom end of a ladder, AB, of fixed length; and let $y$ be the height it reaches up the wall.
FIG. 5.
Now $y$ clearly depends on $x$. It is easy to see that, if we pull the bottom end A a bit further from the wall, the top end B will come down a little lower. Let us state this in scientific language. If we increase $x$ to $x + dx$, then y will become $y − dy$; that is, when $x$ receives a positive increment, the increment which results to $y$ is negative.
Yes, but how much? Suppose the ladder was so long that when the bottom end A was 19 inches from the wall the top end B reached just 15 feet from the ground. Now, if you were to pull the bottom end out 1 inch more, how much would the top end come down? Put it all into inches: $x = 19 $ inches, $y = 180$  inches. Now the increment of $x$ which we call $dx$, is 1 inch: or $x + dx = 20$ inches.
How much will y be diminished? The new height will be y − dy. If we work out the height by Euclid I. 47, then we shall be able to find how much dy will be. The length of the ladder is $\sqrt{(180)^2+(19)^2}=181 \text{inches}$.
Clearly then, the new height, which is $y − dy$, will be such that
$$(y-dy)^2=(181)^2-(20)^2=32761-400=32361,$$ $$y-dx=\sqrt{32361}=178.89\; \text{inches}.$$
Now $y$ is 180, so that $dy$ is 180 − 179.89 = 0.11 inch.
So we see that making $dx$ an increase of 1 inch has resulted in making dy a decrease of 0.11 inch. And the ratio of $dy$ to $dx$ may be stated thus:
$$\frac{dy}{dx}=-\frac{0.11}{1}.$$
It is also easy to see that (except in one particular position) dy will be of a different size from $dx$.
Now right through the differential calculus we are hunting, hunting, hunting for a curious thing, a mere ratio, namely, the proportion which $dy$ bears to $dx$ when both of them are indefinitely small.
It should be noted here that we can only find this ratio $\frac{dy}{dx}$ when $y$ and $x$ are related to each other in some way, so that whenever $y$ does vary also. For instance, in the first example just taken, if the base $x$ of the triangle be made longer, if the distance $x$ of the foot of the ladder from the wall be made to increase, the height $y$ reached by the ladder decreases in a corresponding manner, slowly at first, but more and more rapidly as $x$ reached becomes greater. In these cases the relation between $x$ and $y$ is perfectly definite, it can be expressed mathematically, being $\frac{y}{x}=tan 30°$ and $x^2+y^2=l^2$ (where $l$ is the length of the ladder) respectively, and $\frac{dy}{dx}$ has the meaning we found in each case.
If, while $x$ is, as before, the distance of the foot of the ladder from the wall, $y$ is, instead of the height reached, the horizontal length of the wall, or the number of bricks in it, or the number of years since it was built, any change in x would naturally cause no change whatever in $y$; in this case $\frac{dy}{dx}$ has no meaning whatever, and it is not possible to find an expression for it. Whenever we use differentials $dx, dy, dz$, etc., the existence of some kind of relation between $x, y, z$, etc., is implied, and this relation is called a “function” in $x, y, z$, etc.; the two expressions given above, for instance, namel $\frac{y}{x} = tan 30°$ and $x^2 + y^2 = l^2$, are functions of $x$ and $y$. Such expressions contain implicitly (that is, contain without distinctly showing it) the means of expressing either $x$ in terms of $y$ or $y$ in terms of $x$, and for this reason they are called implicit functions in $x$ and $y$; they can be respectively put into the forms
$$y=tan 30^{\circ} \; \text{or} \; x=\frac{y}{tan 30^{\circ}}$$ $$y=\sqrt{l^2-x^2} \; \text{or} \; x=\sqrt{l^2-y^2}$$
These last expressions state explicitly (that is, distinctly) the value of $x$ in terms of $y$, or of $y$ in terms of $x$, and they are for this reason called explicit functions of $x$ or $y$. For example $x^2 + 3 = 2y − 7$ is an implicit function in $x$ and $y$; it may be written $y=\frac{x^2+10}{2}$ (explicit function of x) or $x=\sqrt{2y-10}$ (explicit function of y).
We see that an explicit function in $x, y, z$, etc., is simply something the value of which changes when $x, y, z$, etc., are changing, either one at the time or several together. Because of this, the value of the explicit function is called the dependent variable, as it depends on the value of the other variable quantities in the function; these other variables are called the independent variables because their value is not determined from the value assumed by the function. For example, if $u = x^2 sinθ$, $x$ and $θ$ are the independent variables, and $u$ is the dependent variable.
Sometimes the exact relation between several quantities $x, y, z$ either is not known or it is not convenient to state it; it is only known, or convenient to state, that there is some sort of relation between these variables, so that one cannot alter either $x$ or $y$ or $z$ singly without affecting the other quantities; the existence of a function in $x, y, z$ is then indicated by the notation $F (x, y, z)$ (implicit function) or by $x = F (y, z), y = F (x, z)$ or $z = F (x, y)$ (explicit function). Sometimes the letter $f$ or $φ$ is used instead of $F$ , so that $y = F (x), y = f (x)$ and $y = φ(x)$ all mean the same thing, namely, that the value of $y$ depends on the value of $x$ in some way which is not stated.
We call the ratio $\frac{dy}{dx}$ “the differential coefficient of $y$ with respect to $x$". It is a solemn scientific name for this very simple thing. But we are not going to be frightened by solemn names, when the things themselves are so easy. Instead of being frightened we will simply pronounce a brief curse on the stupidity of giving long crack-jaw names; and, having relieved our minds, will go on to the simple thing itself, namely the ratio $\frac{dy}{dx}$.
In ordinary algebra which you learned at school, you were always hunting after some unknown quantity which you called $x$ or $y$; or sometimes there were two unknown quantities to be hunted for simultaneously. You have now to learn to go hunting in a new way; the fox being now neither $x$ nor $y$. Instead of this you have to hunt for this curious cub called $\frac{dy}{dx}$. The process of finding the value of $\frac{dy}{dx}$ is called "differentiating". But, remember, what is wanted is the value of this ratio when both $dy$ and $dx$ are themselves indefinitely small. The true value of the differential coefficient is that to which it approximates in the limiting case when each of them is considered as infinitesimally minute.Let us now learn how to go in quest of $\frac{dy}{dx}$.

NOTE TO CHAPTER III.


How to read Differentials.

It will never do to fall into the schoolboy error of thinking that $dx$ means $d \times x$, for $d$ is not a factor—it means “an element of” or “a bit of” whatever follows. One reads $dx$ thus: “dee-eks.”
$\frac{y}{dx} is read “dee-wy by dee-eks,” or “dee-wy over dee-eks.”
So also $\frac{dt}{du} is read “dee-you by dee-tee.”
Second differential coefficients will be met with later on. They are like this:
$\frac{d^2y}{dx^2}; which is read “dee-two-wy over dee-eks-squared,”
and it means that the operation of differentiating y with respect to x has been (or has to be) performed twice over.
Another way of indicating that a function has been differentiated is by putting an accent to the symbol of the function. Thus if $y = F (x)$, which means that $y$ is some unspecified function of $x$ (see p. 13), we may write $F′(x)$ instead of $\frac{d(F(x))}{dx}$. Similarly, $F″(x)$ will mean that the original function $F(x)$ has been differentiated twice over with respect to $x$.

댓글

이 블로그의 인기 게시물

[Linear Algebra] 유사변환(Similarity transformation)

유사변환(Similarity transformation) n×n 차원의 정방 행렬 A, B 그리고 가역 행렬 P 사이에 식 1의 관계가 성립하면 행렬 A와 B는 유사행렬(similarity matrix)이 되며 행렬 A를 가역행렬 P와 B로 분해하는 것을 유사 변환(similarity transformation) 이라고 합니다. $$\tag{1} A = PBP^{-1} \Leftrightarrow P^{-1}AP = B $$ 식 2는 식 1의 양변에 B의 고유값을 고려한 것입니다. \begin{align}\tag{식 2} B - \lambda I &= P^{-1}AP – \lambda P^{-1}P\\ &= P^{-1}(AP – \lambda P)\\ &= P^{-1}(A - \lambda I)P \end{align} 식 2의 행렬식은 식 3과 같이 정리됩니다. \begin{align} &\begin{aligned}\textsf{det}(B - \lambda I ) & = \textsf{det}(P^{-1}(AP – \lambda P))\\ &= \textsf{det}(P^{-1}) \textsf{det}((A – \lambda I)) \textsf{det}(P)\\ &= \textsf{det}(P^{-1}) \textsf{det}(P) \textsf{det}((A – \lambda I))\\ &= \textsf{det}(A – \lambda I)\end{aligned}\\ &\begin{aligned}\because \; \textsf{det}(P^{-1}) \textsf{det}(P) &= \textsf{det}(P^{-1}P)\\ &= \textsf{det}(I)\end{aligned}\end{align} 유사행렬의 특성 유사행렬인 두 정방행렬 A와 B는 'A ~ B' 와 같

[matplotlib] 히스토그램(Histogram)

히스토그램(Histogram) 히스토그램은 확률분포의 그래픽적인 표현이며 막대그래프의 종류입니다. 이 그래프가 확률분포와 관계가 있으므로 통계적 요소를 나타내기 위해 많이 사용됩니다. plt.hist(X, bins=10)함수를 사용합니다. x=np.random.randn(1000) plt.hist(x, 10) plt.show() 위 그래프의 y축은 각 구간에 해당하는 갯수이다. 빈도수 대신 확률밀도를 나타내기 위해서는 위 함수의 매개변수 normed=True로 조정하여 나타낼 수 있다. 또한 매개변수 bins의 인수를 숫자로 전달할 수 있지만 리스트 객체로 지정할 수 있다. 막대그래프의 경우와 마찬가지로 각 막대의 폭은 매개변수 width에 의해 조정된다. y=np.linspace(min(x)-1, max(x)+1, 10) y array([-4.48810153, -3.54351935, -2.59893717, -1.65435499, -0.70977282, 0.23480936, 1.17939154, 2.12397372, 3.0685559 , 4.01313807]) plt.hist(x, y, normed=True) plt.show()

R 미분과 적분

내용 expression 미분 2차 미분 mosaic를 사용한 미분 적분 미분과 적분 R에서의 미분과 적분 함수는 expression()함수에 의해 생성된 표현식을 대상으로 합니다. expression expression(문자, 또는 식) 이 표현식의 평가는 eval() 함수에 의해 실행됩니다. > ex1<-expression(1+0:9) > ex1 expression(1 + 0:9) > eval(ex1) [1] 1 2 3 4 5 6 7 8 9 10 > ex2<-expression(u, 2, u+0:9) > ex2 expression(u, 2, u + 0:9) > ex2[1] expression(u) > ex2[2] expression(2) > ex2[3] expression(u + 0:9) > u<-0.9 > eval(ex2[3]) [1] 0.9 1.9 2.9 3.9 4.9 5.9 6.9 7.9 8.9 9.9 미분 D(표현식, 미분 변수) 함수로 미분을 실행합니다. 이 함수의 표현식은 expression() 함수로 생성된 객체이며 미분 변수는 다음 식의 분모의 변수를 의미합니다. $$\frac{d}{d \text{변수}}\text{표현식}$$ 이 함수는 어떤 함수의 미분의 결과를 표현식으로 반환합니다. > D(expression(2*x^3), "x") 2 * (3 * x^2) > eq<-expression(log(x)) > eq expression(log(x)) > D(eq, "x") 1/x > eq2<-expression(a/(1+b*exp(-d*x))); eq2 expression(a/(1 + b * exp(-d * x))) > D(eq2, "x") a * (b * (exp(-d * x) * d))/(1 + b