기본 콘텐츠로 건너뛰기

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

[Math Classic]Calculus Made Easy CH. 4

CHAPTER IV.

SIMPLEST CASES.

Now let us see how, on first principles, we can differentiate some simple algebraical expression.

Case 1.

Let us begin with the simple expression $y = x^2$. Now remember that the fundamental notion about the calculus is the idea of growing. Mathematicians call it varying. Now as $y$ and $x^2$ are equal to one another, it is clear that if $x$ grows, $x^2$ will also grow. And if $x^2$ grows, then $y$ will also grow. What we have got to find out is the proportion between the growing of $y$ and the growing of $x$. In other words our task is to find out the ratio between $dy$ and $dx$, or, in brief, to find the value of $\frac{dy}{dx}$.
Let $x$, then, grow a little bit bigger and become $x + dx$; similarly, $y$ will grow a bit bigger and will become $y+dy$. Then, clearly, it will still be true that the enlarged $y$ will be equal to the square of the enlarged $x$.
Writing this down, we have: $y+dy=(x+dx)^2$
Doing the squaring we get:
$$y+dy =x^2+2x·dx+(dx)^2.$$
What does $(dx)^2$ mean? Remember that $dx$ meant a bit—a little bit—of $x$. Then $(dx)^2$ will mean a little bit of a little bit of $x$; that is, as explained above (See CH. 2), it is a small quantity of the second order of smallness. It may therefore be discarded as quite inconsiderable in comparison with the other terms. Leaving it out, we then have:
$$y+dy =x^2+2x·dx.$$
Now $y = x^2$ ; so let us subtract this from the equation and we have left
$$dy =2x·dx.$$
Dividing across by $dx$, we find
$$\frac{dy}{dx}=2x.$$
Now this[1] is what we set out to find. The ratio of the growing of $y$ to the growing of $x$ is, in the case before us, found to be $2x$.

Numerical example.

Suppose $x = 100$ and $y = 10, 000$. Then let $x$ grow till it becomes 101 (that is, let $dx = 1$). Then the enlarged y will be 101 × 101 = 10, 201. But if we agree that we may ignore small quantities of the second order, 1 may be rejected as compared with 10, 000; so we may round off the enlarged $y$ to 10, 200. $y$ has grown from 10, 000 to 10, 200; the bit added on is $dy$, which is therefore 200.
$$\frac{dy}{dx}=\frac{200}{1}=200$$
According to the algebra-working of the previous aragraph, we find $\frac{dy}{dx}=2x$. And so it is; for $x = 100$ and $2x = 200$.
But, you will say, we neglected a whole unit.
Well, try again, making dx a still smaller bit.
Try $dx = \frac{1}{10}$. Then $x + dx = 100.1$, and
$$(x +dx)^2 = 100.1 × 100.1 = 10,020.01.$$
Now the last figure 1 is only one-millionth part of the 10, 000, and is utterly negligible; so we may take 10, 020 without the little decimal at the end. And this makes $dy=20$; and $\frac{dy}{dx}=\frac{20}{0.1}=200$, which is still the same as $2x$

Case 2.

Try differentiating y = x 3 in the same way.
We let y grow to $y + dy$, while $x$ grows to $x + dx$.
Then we have
$$y+dy=(x+dx)^3.$$
Doing the cubing we obtain
$$y + dy = x^3 + 3x^2·dx + 3x(dx)^2 + (dx)^3.$$
Now we know that we may neglect small quantities of the second and third orders; since, when dy and dx are both made indefinitely small, $(dx)^2$ and $(dx)^3$ will become indefinitely smaller by comparison. So, regarding them as negligible, we have left:
$$y+dy =x^3+3x^3 \cdot dx.$$
But $y = x^3$ ; and, subtracting this, we have:
$$dy=3x^2 \cdot dx,$$ $$\text{and} \qquad \frac{dy}{dx}=3x^2.$$

Case3.

Try differentiating $y = x^4$. Starting as before by letting both $y$ and $x$ grow a bit, we have:
$$y + dy = (x + dx)^4.$$
Working out the raising to the fourth power, we get
$$y + dy = x^4 + 4x^3 dx + 6x^2(dx)^2 + 4x(dx)^3 + (dx)^4.$$
Then striking out the terms containing all the higher powers of dx, as being negligible by comparison, we have
$$y + dy = x^4 + 4x^3dx.$$
Subtracting the original $y = x^4$ , we have left
$$dy=4x^3dx,$$ $$\text{and} \qquad \frac{dy}{dx}=4x^3.$$

SIMPLEST CASEs

Now all these cases are quite easy. Let us collect the results to see if we can infer any general rule. Put them in two columns, the values of $y$ in one and the corresponding values found for $\frac{dy}{dx}$ in the other: thus
y $\frac{dy}{dx}$
x2 2x
x3 3x2
x4 4x3
Just look at these results: the operation of differentiating appears to have had the effect of diminishing the power of $x$ by 1 (for example in the last case reducing $x^4$ to $x^3$ ), and at the same time multiplying by a number (the same number in fact which originally appeared as the power). Now, when you have once seen this, you might easily conjecture how the others will run. You would expect that differentiating x5 would give $5x^4$ , or differentiating $x^6$ would give $6x^5$ . If you hesitate, try one of these, and see whether the conjecture comes right.
Try $y = x^5$.
$$ \text{Then} \qquad y + dy = (x + dx)^5 $$ $$\qquad = x^5 + 5x^4 dx + 10x^3 (dx)^2 + 10x^2 (dx)^3 + 5x(dx)^4 + (dx)^5.$$
Neglecting all the terms containing small quantities of the higher orders, we have left
$$y + dy = x^5 + 5x^4 dx,$$
and subtracting $y=x^5$ leaves us
$$dy =5x^4 dx,$$
whence $\frac{dy}{dx}=5x^4$, exactly as we supposed.
Following out logically our observation, we should conclude that if we want to deal with any higher power,—call it n—we could tackle it in the same way.
Let $y = x^n$, then, we should expect to find that
$$\frac{dy}{dx} = nx^{n−1}.$$
For example, let $n = 8$, then $y = x^8$ ; and differentiating it would give $\frac{dy}{dx}= 8x^7$.
And, indeed, the rule that differentiating $x^n$ gives as the result $nx^{n−1}$ is true for all cases where $n$ is a whole number and positive. [Expanding $(x + dx)^n$ by the binomial theorem will at once show this.] But the question whether it is true for cases where $n$ has negative or fractional values requires further consideration.

Case of a negative power.

Let $y = x^{−2}$. Then proceed as before:
$$y + dy = (x + dx)^{−2}$$ $$\qquad =x^{-2}\left(1+\frac{dx}{x} \right)^{-2}$$
Expanding this by the binomial theorem (see p. 137 in ch14), we get
$$=x^{-2}\left[1-\frac{2dx}{x}+\frac{2(2+1)}{1 \times 2}\left(\frac{dx}{x}\right)^2-\text{etc}\right]$$ $$=x^{-2}-2x^{-3}\cdot dx+3x^{-4}(dx)^2-4x^{-5}(dx)^3+\text{etc}.$$
So, neglecting the small quantities of higher orders of smallness, we have:
$$y+dy=x^{-2}-2x^{-3}\cdot dx.$$
Subtracting the original y = x −2 , we find
$$dy = −2x^{−3}dx,$$ $$\frac{dy}{dx}=-2x^{-3}.$$
And this is still in accordance with the rule inferred above.

Case of a fractional power.

Let $y = x^{\frac{1}{2}}. Then, as before,
$$y + dy = (x + dx)^{\frac{1}{2}}$$ $$\qquad =x^{\frac{1}{2}}\left(1+\frac{dx}{x}\right)^{\frac{1}{2}}$$ $$\qquad =\sqrt{x}+\frac{1}{2}\frac{dx}{\sqrt{x}}-{\frac{1}{8}\frac{(dx)^2}{x\sqrt{x}}}+\;terms\; with\; higher\; powers\; of\; dx.$$
Subtracting the original y = x^{\frac{1}{2}}, and neglecting higher powers we have left:
$$dy=\frac{1}{2}\frac{dx}{\sqrt{x}}=\frac{1}{2}x^{-\frac{1}{2}}\cdot dx$$
and $\frac{dy}{dx}=\frac{1}{2}x^{-\frac{1}{2}}$. Agreeing with the general rule.

Summary

Let us see how far we have got. We have arrived at the and following rule: To differentiate $x^n$ , multiply by the power and reduce the power by one, so giving us $nx^{n−1}$ as the result.
Exercise I.

(See Answers.) Differentiate the following:
$$\text{(1)}\quad y = x^{13}$$ $$\text{(2)}\quad y = x^{-\frac{3}{2}}$$ $$\text{(3)}\quad y = x^{2a} $$ $$\text{(4)}\quad u = t^{2.4}$$ $$\text{(5)}\quad z=\sqrt[3]{u}$$ $$\text{(6)} \quad y=\sqrt[3]{x^{-3}} $$ $$\text{(7)} \quad u=\sqrt[5]{\frac{1}{x^8}} $$ $$\text{(8)}\quad y=2x^a$$ $$\text{(9)}\quad y=\sqrt[q]{x^3} $$ $$\text{(10)}\quad y=\sqrt[n]{\frac{1}{x^m}}$$
clasYou have now learned how to differentiate powers of x. How easy it is!



[1] N.B.—This ratio $\frac{dy}{dx}$is the result of differentiating y with respect to x. Differentiating means finding the differential coefficient. Suppose we had some other function of $x$, as, for example, $u=7x^2+3$. Then if we were told to differentiate this with respect to x, we should have to find $\frac{du}{dx}$, or, what is the same thing, $\frac{d(7x2+3)}{dx}$. On the other hand, we may have a case in which time was the independent variable (see independent variable), such as this: $y = b + \frac{1}{2}at^2$. Then, if we were told to differentiate it, that means we must find its differential coefficient with respect to $t$. So that then our business would be to try to find $\frac{dy}{dt}$, that is, to find $\frac{d(b+\frac{1}{2}at^2)}{dt}$.

댓글

이 블로그의 인기 게시물

[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