text:
# 2.1: Newton and Leibniz Get Started

Skills to Develop

• Explain Leibniz’s approach to the Product Rule
• Explain Newton's approach to the Product Rule

## Leibniz’s Calculus Rules

The rules for calculus were ﬁrst laid out in Gottfried Wilhelm Leibniz’s 1684 paper Nova methodus pro maximis et minimis, itemque tangentibus, quae nec fractas nec irrationales, quantitates moratur, et singulare pro illi calculi genus (A New Method for Maxima and Minima as Well as Tangents, Which is Impeded Neither by Fractional Nor by Irrational Quantities, and a Remarkable Type of Calculus for This).

Figure $$\PageIndex{1}$$: Gottfried Wilhelm Leibniz.

Leibniz started with subtraction. That is, if $$x_1$$ and $$x_2$$ are very close together then their diﬀerence, $$∆x = x_2 - x_1$$, is very small. He expanded this idea to say that if $$x_1$$ and $$x_2$$ are inﬁnitely close together (but still distinct) then their diﬀerence, $$dx$$, is inﬁnitesimally small (but not zero).

This idea is logically very suspect and Leibniz knew it. But he also knew that when he used his calculus diﬀerentialis1 he was getting correct answers to some very hard problems. So he persevered.

Leibniz called both $$∆x$$ and $$dx$$ “diﬀerentials” (Latin for diﬀerence) because he thought of them as, essentially, the same thing. Over time it has become customary to refer to the inﬁnitesimal $$dx$$ as a diﬀerential, reserving “diﬀerence” for the ﬁnite case, $$∆x$$. This is why calculus is often called “diﬀerential calculus.”

In his paper Leibniz gave rules for dealing with these inﬁnitely small diﬀerentials. Speciﬁcally, given a variable quantity $$x$$, $$dx$$ represented an inﬁnitesimal change in $$x$$. Diﬀerentials are related via the slope of the tangent line to a curve. That is, if $$y = f(x)$$, then $$dy$$ and $$dx$$ are related by

$dy = \text{(slope of the tangent line)}\cdot dx$

Leibniz then divided by $$dx$$ giving

$\frac{dy}{dx} = \text{(slope of the tangent line)}$

The elegant and expressive notation Leibniz invented was so useful that it has been retained through the years despite some profound changes in the underlying concepts. For example, Leibniz and his contemporaries would have viewed the symbol $$\frac{dy}{dx}$$ as an actual quotient of inﬁnitesimals, whereas today we deﬁne it via the limit concept ﬁrst suggested by Newton.

As a result the rules governing these diﬀerentials are very modern in appearance:

$d(constant) = 0$

$d(z - y + w + x) = dz - dy + dw + dx$

$d(xv) = xdv + v dx$

$d\left ( \frac{v}{y} \right ) = \frac{ydv - vdy}{yy}$

and, when $$a$$ is an integer:

$d(x^a) = ax^{a - 1} dx$

Leibniz states these rules without proof: “. . . the demonstration of all this will be easy to one who is experienced in such matters . . ..” As an example, mathematicians in Leibniz’s day would be expected to understand intuitively that if $$c$$ is a constant, then $$d(c) = c - c = 0$$. Likewise, $$d(x + y) = dx + dy$$ is really an extension of $$(x_2 + y_2) - (x_1 + y_1) = (x_2 - x_1) + (y_2 - y_1)$$.

## Leibniz’s Approach to the Product Rule

The explanation of the product rule using diﬀerentials is a bit more involved, but Leibniz expected that mathematicians would be ﬂuent enough to derive it. The product $$p = xv$$ can be thought of as the area of the following rectangle

Figure $$\PageIndex{2}$$: Area of a rectangle.

With this in mind, $$dp = d(xv)$$ can be thought of as the change in area when $$x$$ is changed by $$dx$$ and $$v$$ is changed by $$dv$$. This can be seen as the $$L$$ shaped region in the following drawing.

Figure $$\PageIndex{3}$$: Change in area when $$x$$ is changed by $$dx$$ and $$v$$ is changed by $$dv$$.

By dividing the $$L$$ shaped region into $$3$$ rectangles we obtain

$d(xv) = xdv + v dx + dx dv$

Even though $$dx$$ and $$dv$$ are inﬁnitely small, Leibniz reasoned that $$dx dv$$ is even more inﬁnitely small (quadratically inﬁnitely small?) compared to $$xdv$$ and $$vdx$$ and can thus be ignored leaving

$d(xv) = xdv + v dx$

You should feel some discomfort at the idea of simply tossing the product $$dx dv$$ aside because it is “comparatively small.” This means you have been well trained, and have thoroughly internalized Newton’s dictum [10]: “The smallest errors may not, in mathematical matters, be scorned.” It is logically untenable to toss aside an expression just because it is small. Even less so should we be willing to ignore an expression on the grounds that it is “inﬁnitely smaller” than another quantity which is itself “inﬁnitely small.

Newton and Leibniz both knew this as well as we do. But they also knew that their methods worked. They gave veriﬁably correct answers to problems which had, heretofore, been completely intractable. It is the mark of their genius that both men persevered in spite of the very evident diﬃculties their methods entailed.

## Newton’s Approach to the Product Rule

In the Principia, Newton “proved” the Product Rule as follows: Let $$x$$ and $$v$$ be “ﬂowing2 quantites” and consider the rectangle, $$R$$, whose sides are $$x$$ and $$v$$. $$R$$ is also a ﬂowing quantity and we wish to ﬁnd its ﬂuxion (derivative) at any time.

Figure $$\PageIndex{4}$$: Isaac Newton

First increment $$x$$ and $$v$$ by $$\frac{∆x}{2}$$ and $$\frac{∆v}{2}$$ respectively. Then the corresponding increment of $$R$$ is

$\left ( x + \frac{\Delta x}{2} \right ) \left ( v + \frac{\Delta v}{2} \right ) = xv + x\frac{\Delta v}{2} + v\frac{\Delta x}{2} + \frac{\Delta x \Delta v}{4}$

Now decrement $$x$$ and $$v$$ by the same amounts:

$\left ( x - \frac{\Delta x}{2} \right ) \left ( v - \frac{\Delta v}{2} \right ) = xv - x\frac{\Delta v}{2} - v\frac{\Delta x}{2} + \frac{\Delta x \Delta v}{4}$

Subtracting the right side of equation $$\PageIndex{11}$$ from the right side of equation $$\PageIndex{10}$$ gives

$∆R = x∆v + v∆x$

which is the total change of $$R = xv$$ over the intervals $$∆x$$ and $$∆v$$ and also recognizably the Product Rule.

This argument is no better than Leibniz’s as it relies heavily on the number $$1/2$$ to make it work. If we take any other increments in $$x$$ and $$v$$ whose total lengths are $$∆x$$ and $$∆v$$ it will simply not work. Try it and see.

In Newton’s defense, he wasn’t really trying to justify his mathematical methods in the Principia. His attention there was on physics, not math, so he was really just trying to give a convincing demonstration of his methods. You may decide for yourself how convincing his demonstration is.

Notice that there is no mention of limits of difference quotients or derivatives. In fact, the term derivative was not coined until 1797, by Lagrange. In a sense, these topics were not necessary at the time, as Leibniz and Newton both assumed that the curves they dealt with had tangent lines and, in fact, Leibniz explicitly used the tangent line to relate two diﬀerential quantities. This was consistent with the thinking of the time and for the duration of this chapter we will also assume that all quantities are diﬀerentiable. As we will see later this assumption leads to diﬃculties.

Both Newton and Leibniz were satisﬁed that their calculus provided answers that agreed with what was known at the time. For example $$d(x^2)= d(xx) = xdx+xdx = 2xdx$$ and $$d(x^3)= d(x^2x)= x^2 dx+xd(x^2)= x^2+x(2xdx) = 3x^2 dx$$, results that were essentially derived by others in diﬀerent ways.

Exercise $$\PageIndex{1}$$

1. Use Leibniz’s product rule $$d(xv) = xdv + vdx$$ to show that if $$n$$ is a positive integer then $$d(x^n) = nx^{n - 1} dx$$
2. Use Leibniz’s product rule to derive the quotient rule $d \left ( \frac{v}{y} \right ) = \frac{ydv - vdy}{yy}$
3. Use the quotient rule to show that if nis a positive integer, then $d(x^{-n}) = -nx^{-n - 1} dx$

Exercise $$\PageIndex{2}$$

Let $$p$$ and $$q$$ be integers with $$q\neq 0$$. Show $d\left ( x^{\frac{p}{q}} \right ) = \frac{p}{q} x^{\frac{p}{q} - 1} dx$

Leibniz also provided applications of his calculus to prove its worth. As an example he derived Snell’s Law of Refraction from his calculus rules as follows.

Given that light travels through air at a speed of $$v_a$$ and travels through water at a speed of $$v_w$$ the problem is to ﬁnd the fastest path from point $$A$$ to point $$B$$.

Figure $$\PageIndex{5}$$: Fastest path that light travels from point $$A$$ to point $$B$$.

According to Fermat’s Principle of Least Time, this fastest path is the one that light will travel.

Using the fact that $$Time = Distance/Velocity$$ and the labeling in the picture below we can obtain a formula for the time $$T$$ it takes for light to travel from $$A$$ to $$B$$.

Figure $$\PageIndex{6}$$: Fermat’s Principle of Least Time.

$T = \frac{\sqrt{x^2 + a^2}}{v_a} + \frac{\sqrt{(c-x)^2 + b^2}}{v_w}$

Using the rules of Leibniz’s calculus, we obtain

\begin{align*} dT &= \left ( \frac{1}{v_a} \frac{1}{2} (x^2 + a^2)^{-\frac{1}{2}} (2x) + \frac{1}{v_w} \frac{1}{2} ((c-x)^2 + b^2)^{-\frac{1}{2}} (2(c-x)(-1))\right )dx\\ &= \left ( \frac{1}{v_a} \frac{x}{\sqrt{x^2 + a^2}} - \frac{1}{v_w} \frac{c-x}{\sqrt{(c-x)^2 + b^2}} \right )dx \end{align*}

Using the fact that at the minimum value for $$T$$, $$dT = 0$$, we have that the fastest path from $$A$$ to $$B$$ must satisfy $$\frac{1}{v_a} \frac{x}{\sqrt{x^2 + a^2}} = \frac{1}{v_w} \frac{c-x}{\sqrt{(c-x)^2 + b^2}}$$. Inserting the following angles

Figure $$\PageIndex{7}$$: Fastest path that light travels.

we get that the path that light travels must satisfy

$\frac{\sin \theta _a}{v_a} = \frac{\sin \theta _w}{v_w}$

which is Snell’s Law.

To compare $$18^{th}$$ century and modern techniques we will consider Johann Bernoulli’s solution of the Brachistochrone problem. In 1696, Bernoulli posed, and solved, the Brachistochrone problem; that is, to ﬁnd the shape of a frictionless wire joining points $$A$$ and $$B$$ so that the time it takes for a bead to slide down under the force of gravity is as small as possible.

Figure $$\PageIndex{8}$$: Finding shape of a frictionless wire joining points $$A$$ and $$B$$.

Bernoulli posed this “path of fastest descent” problem to challenge the mathematicians of Europe and used his solution to demonstrate the power of Leibniz’s calculus as well as his own ingenuity.

I, Johann Bernoulli, address the most brilliant mathematicians in the world. Nothing is more attractive to intelligent people than an honest, challenging problem, whose possible solution will bestow fame and remain as a lasting monument. Following the example set by Pascal, Fermat, etc., I hope to gain the gratitude of the whole scientiﬁc community by placing before the ﬁnest mathematicians of our time a problem which will test their methods and the strength of their intellect. If someone communicates to me the solution of the proposed problem, I shall publicly declare him worthy of praise. [11]

Figure $$\PageIndex{9}$$: Johann Bernoulli.

In addition to Johann’s, solutions were obtained from Newton, Leibniz, Johann’s brother Jacob Bernoulli, and the Marquis de l’Hopital [15]. At the time there was an ongoing and very vitriolic controversy raging over whether Newton or Leibniz had been the ﬁrst to invent calculus. An advocate of the methods of Leibniz, Bernoulli did not believe Newton would be able to solve the problem using his methods. Bernoulli attempted to embarrass Newton by sending him the problem. However Newton did solve it.

At this point in his life Newton had all but quit science and mathematics and was fully focused on his administrative duties as Master of the Mint. In part due to rampant counterfeiting, England’s money had become severely devalued and the nation was on the verge of economic collapse. The solution was to recall all of the existing coins, melt them down, and strike new ones. As Master of the Mint this job fell to Newton [8]. As you might imagine this was a rather Herculean task. Nevertheless, according to his niece:

When the problem in 1696 was sent by Bernoulli–Sir I.N. was in the midst of the hurry of the great recoinage and did not come home till four from the Tower very much tired, but did not sleep till he had solved it, which was by four in the morning. (quoted in [2], page 201)

He is later reported to have complained, “I do not love ... to be ... teezed by forreigners about Mathematical things [2].”

Newton submitted his solution anonymously, presumably to avoid more controversy. Nevertheless the methods used were so distinctively Newton’s that Bernoulli is said to have exclaimed “Tanquam ex ungue leonem.3

Bernoulli’s ingenious solution starts, interestingly enough, with Snell’s Law of Refraction. He begins by considering the stratiﬁed medium in the following ﬁgure, where an object travels with velocities $$v_1, v_2, v_3, ...$$ in the various layers.

Figure $$\PageIndex{10}$$: Bernoulli's solution.

By repeatedly applying Snell’s Law he concluded that the fastest path must satisfy

$\frac{\sin \theta _1}{v_1} = \frac{\sin \theta _2}{v_2} = \frac{\sin \theta _3}{v_3} = \cdots$

In other words, the ratio of the sine of the angle that the curve makes with the vertical and the speed remains constant along this fastest path.

If we think of a continuously changing medium as stratiﬁed into inﬁnitesimal layers and extend Snell’s law to an object whose speed is constantly changing,

Figure $$\PageIndex{11}$$: Snell's law for an object changing speed continuously.

then along the fastest path, the ratio of the sine of the angle that the curve’s tangent makes with the vertical, $$α$$, and the speed, $$v$$, must remain constant.

$\frac{\sin \alpha }{v} = c$

If we include axes and let $$P$$ denote the position of the bead at a particular time then we have the following picture.

Figure $$\PageIndex{11}$$: Path traveled by the bead.

In the above ﬁgure, $$s$$ denotes the length that the bead has traveled down to point $$P$$ (that is, the arc length of the curve from the origin to that point) and a denotes the tangential component of the acceleration due to gravity $$g$$. Since the bead travels only under the inﬂuence of gravity then $$\frac{dv}{dt} = a$$.

To get a sense of how physical problems were approached using Leibniz’s calculus we will use the above equation to show that $$v = \sqrt{2gy}$$.

By similar triangles we have $$\frac{a}{g} = \frac{dy}{ds}$$. As a student of Leibniz, Bernoulli would have regarded $$\frac{dy}{ds}$$ as a fraction so

$a ds = gdy$

and since acceleration is the rate of change of velocity we have

$\frac{dv}{dt} ds= gdy$

Again, $$18^{th}$$ century European mathematicians regarded $$dv$$, $$dt$$, and $$ds$$ as inﬁnitesimally small numbers which nevertheless obey all of the usual rules of algebra. Thus we can rearrange the above to get

$\frac{ds}{dt} dv= gdy$

Since $$\frac{ds}{dt}$$ is the rate of change of position with respect to time it is, in fact, the velocity of the bead. That is

$v dv = g dy$

Bernoulli would have interpreted this as a statement that two rectangles of height $$v$$ and $$g$$, with respective widths $$dv$$ and $$dy$$ have equal area. Summing (integrating) all such rectangles we get:

$\int v dv = \int g dy$

$\frac{v^2}{2} = gy$

or

$v = \sqrt{2gy}$

You are undoubtedly uncomfortable with the cavalier manipulation of inﬁnitesimal quantities you’ve just witnessed, so we’ll pause for a moment now to compare a modern development of equation $$\PageIndex{12}$$ to Bernoulli’s. As before we begin with the equation:

$\frac{a}{g} = \frac{dy}{ds}$

$a = g\frac{dy}{ds}$

Moreover, since acceleration is the derivative of velocity this is the same as:

$\frac{dv}{dt} = g\frac{dy}{ds}$

Now observe that by the Chain Rule $$\frac{dv}{dt} = \frac{dv}{ds} \frac{ds}{dt}$$. The physical interpretation of this formula is that velocity will depend on $$s$$, how far down the wire the bead has moved, but that the distance traveled will depend on how much time has elapsed. Therefore

$\frac{dv}{ds} \frac{ds}{dt} = g\frac{dy}{ds}$

or

$\frac{ds}{dt} \frac{dv}{ds} = g\frac{dy}{ds}$

and since $$\frac{ds}{dt} = v$$

$v\frac{dv}{ds} = g\frac{dy}{ds}$

Integrating both sides with respect to $$s$$ gives:

$\int v\frac{dv}{ds} ds = g\int \frac{dy}{ds} ds$

$\int vdv = g\int dy$

and integrating gives

$\frac{v^2}{2} = gy$

as before.

In eﬀect, in the modern formulation we have traded the simplicity and elegance of diﬀerentials for a comparatively cumbersome repeated use of the Chain Rule. No doubt you noticed when taking Calculus that in the diﬀerential notation of Leibniz, the Chain Rule looks like “canceling” an expression in the top and bottom of a fraction: $$\frac{dy}{du} \frac{du}{dx} = \frac{dy}{dx}$$. This is because for 18th century mathematicians, this is exactly what it was.

To put it another way, $$18^{th}$$ century mathematicians wouldn’t have recognized a need for what we call the Chain Rule because this operation was a triviality for them. Just reduce the fraction. This begs the question: Why did we abandon such a clear, simple interpretation of our symbols in favor of the, comparatively, more cumbersome modern interpretation? This is one of the questions we will try to answer in this course.

Returning to the Brachistochrone problem we observe that $$\frac{\sin \alpha }{v} = c$$ and since $$\sin \alpha = \frac{dx}{ds}$$ we see that

$\frac{\frac{dx}{ds}}{\sqrt{2gy}} = c$

$\frac{dx}{\sqrt{2gy(ds)^2}} = c$

$\frac{dx}{\sqrt{2gy\left [ (dx)^2 + (dy)^2 \right ]}} = c$

Bernoulli was then able to solve this diﬀerential equation.

Exercise $$\PageIndex{3}$$

Show that the equations $$x = \frac{t - \sin t}{4gc^2}$$, $$y = \frac{t - \cos t}{4gc^2}$$ satisfy equation $$\PageIndex{37}$$. Bernoulli recognized this solution to be an inverted cycloid, the curve traced by a ﬁxed point on a circle as the circle rolls along a horizontal surface.

This illustrates the state of calculus in the late 1600’s and early 1700’s; the foundations of the subject were a bit shaky but there was no denying its power.

## References

1 This translates, loosely, as the calculus of diﬀerences.

2 Newton’s approach to calculus – his ‘Method of Fluxions’ – depended fundamentally on motion. That is, he viewed his variables (ﬂuents) as changing (ﬂowing or ﬂuxing) in time. The rate of change of a ﬂuent he called a ﬂuxion. As a foundation both Leibniz’s and Newton’s approaches have fallen out of favor, although both are still universally used as a conceptual approach, a “way of thinking,” about the ideas of calculus.

3 I know the lion by his claw.


text:
# Strange reasoning of unramified extensions having same residue fields are the same.

Let $K$ be a complete with discrete absolute value, assuming $K$ and its residue field are both perfect,$A$ its valuation ring, now let $L$ be a separable algebraic extension of $K$, $B$ the integral closure of $A$ in $L$.

Now if $K'$, $K''$ are unramified extensions of $K$ contained in $L$ with same residue field $k'$, it's well known that this implies $K'=K''$.

But isn't this obvious? I mean if $k'=B'/\mathfrak B'$, then $K'=K''=$ field of fractions of $B'$, why the proofs I saw almost in every books treat it as something needs some explanations? I must misunderstand something...

Some reference(J.S. Milne's Algebraic Number Theory):

• Your argument seems to apply even if $K$ is a number field, where the result is false. How do you get from $k' = B'/\mathfrak B'$ to $K'' = \mathrm{Frac}(B')$? – Mathmo123 Feb 28 '17 at 12:45
• @Mathmo123 By definition of residue field, $B'$ equals to the valuation ring of $K''$, hence $K''$ is equals to the field of fraction of $B'$? – CYC Feb 28 '17 at 14:24
• You have $B'/\mathfrak B'$ = $B''/\mathfrak B''$ where $\mathfrak B'$ and $\mathfrak B''$ are respectively primes of $B'$ and $B''$. That does not tell you that $B' = B''$. For example, $\mathbb Z/5\mathbb Z\cong \mathbb Z(i)/(1+2i)$. – Mathmo123 Feb 28 '17 at 14:45
• @Mathmo123 minor quibble: I think you want $\Bbb Z[i]$ there (since rational functions would give you a field) – Adam Hughes Feb 28 '17 at 15:15
• @CYC no, and that's the point: equal residue fields do not imply the big rings are isomorphic in general. – Adam Hughes Feb 28 '17 at 16:29

The issue here is Hensel's Lemma doesn't hold in the general case of Dedekind domains, the lifting you have is dependent upon the field being Henselian. A toy case: let $K/F$ be a finite degree field Galois extension. If we have a prime $(p)$ of $F$ which splits completely in $K$, as $\mathfrak{p}_1\mathfrak{p}_2\ldots\mathfrak{p}_r$ then

$$\mathcal{O}_F/(p) \cong \mathcal{O}_F/\mathfrak{p}_1$$

but the rings upstairs are obviously not the same. In your case splitting is not behavior you ever witness because there is always a unique maximal ideal, and that's where your assumptions fall apart. And this is a very general case, we know there is a positive density of totally split primes in any Galois number field extension (indeed in any global Galois extension).

In the theorem you quote, the assumption is $L/K$ is an unramified extension, but if eg. $K=\Bbb Q$ or any field with class number $1$, there are no non-trivial, unramified extensions to choose from! So this cannot be some general fact about rings just based on their residue fields, you need Henselian to help you out. Milne's theorem is true (obviously), but it's not applicable to your case without being in the necessary context. This is not just dependent on residue fields, you need the big fields to have more structure (in this case complete DVR with perfect residue field).

• If it means equal up to isomorphism, is the residue field of $K'K''$ still equals to k'(Isn't it $k'k''$)? – CYC Feb 28 '17 at 15:28
• @CYC I don't see your objection. The assumption is that the residue fields are the same, then because the extension is unramified in a Henselian field, this means $[K''K':K]=[k':k]=[K':K]=[K'':K]$ but then $K''K'/K'$ is a trivial extension and likewise $K''K'/K'$ is trivial so $K'\subseteq K'' \subseteq K'$ proving equality. This is the point of a Henselian fields, and part of what distinguishes them from eg. global fields. – Adam Hughes Feb 28 '17 at 15:50
• It uses $K''K'$ also has residue field $k'$ right? But that assumption is based on $K'$ and $K''$ both has residue field $k'$, their residue fields are strictly equal not only isomorphism, so isn't this imply $B'=B''$? – CYC Feb 28 '17 at 15:54
• @CYC I'm a little confused as to your question, you were asking only why things require justification, the answer is: ring quotients being equal does not mean the fraction fields are equal, and in general they aren't, as I illustrate, you can have the same residue field in a non-Henselian context and not the same fraction field for the rings. Look at mathmo's example, there is a unique field of order $5$ and $\Bbb Z/(5)\cong\Bbb Z[i]/(1+2i)$ but the fraction fields are $\Bbb Q$ and $\Bbb Q(i)$ respectively in this case. – Adam Hughes Feb 28 '17 at 16:00
• I found myself falsely assume discrete absolute value as non-archemedian, I think I know the answer now! – CYC Feb 28 '17 at 17:15

format: plain


text:
# Show that there are infinitely many positive integers that are not the sum of $15$ fourth powers

The Question:

Show that there are infinitely many positive integers that are not the sum of $15$ fourth powers.

My Attempt:

I am completely stuck.

The previous parts of this question were to show that there are infinitely many positive integers that are not the sum of:

(i) $3$ squares

(ii) $8$ sixth powers

(iii) $11$ tenth powers

For example, I did (i) by showing that all squares are congruent to either $0$, $1$, or $4 \pmod 8$ and hence all numbers of the form $7+8k$ cannot be the sum of three squares.

Similarly, I found $9+27k$ for (ii) and $12+50k$ for (iii) through exhaustive trial and error.

However, I couldn't do $15$ fourth powers, even with the help of a computer efficiently computing all the modulos for me.

Is there a better way to do this?

• Look at Waring's problem in Wikipedia. – Somos Apr 28 '18 at 22:26
• I already did, but I have yet to find anything that I could use in there? – glowstonetrees Apr 28 '18 at 22:49

Try $$31 \cdot 16^n$$
It begins with the observation that $x^4 \equiv 0, 1 \pmod {16}$ but there is more to be done
For $31 \cdot 16^n$ with $n \geq 1,$ if any of the fourth powers are odd, there are at least sixteen odd fourth powers. On the other hand, if we have all even numbers, then dividing each by $2$ gives a representation of $31 \cdot 16^{n-1},$ so induction says sixteen are required
• But why the $31$? – glowstonetrees Apr 28 '18 at 23:41
• I tried $31 \cdot 16=496$ and it doesn't work? – glowstonetrees Apr 28 '18 at 23:42


text:
# What is the significance of theoretical linear algebra in machine learning/computer vision research?

I am a computer science research student working in application of Machine Learning to solve Computer Vision problems.

Since, lot of linear algebra(eigenvalues, SVD etc.) comes up when reading Machine Learning/Vision literature, I decided to take a linear algebra course this semester.

Much to my surprise, the course didn't look at all like Gilbert Strang's Applied Linear algebra(on OCW) I had started taking earlier. The course textbook is Linear Algebra by Hoffman and Kunze. We started with concepts of Abstract algebra like groups, fields, rings, isomorphism, quotient groups etc. And then moved on to study "theoretical" linear algebra over finite fields, where we cover proofs for important theorms/lemmas in the following topics:

Vector spaces, linear span, linear independence, existence of basis. Linear transformations. Solutions of linear equations, row reduced echelon form, complete echelon form,rank. Minimal polynomial of a linear transformation. Jordan canonical form. Determinants. Characteristic polynomial, eigenvalues and eigenvectors. Inner product space. Gram Schmidt orthogonalization. Unitary and Hermitian transformations. Diagonalization of Hermitian transformations.

I wanted to understand if there is any significance/application of understanding these proofs in machine learning/computer vision research or should I be better off focusing on the applied Linear Algebra?

-
I would recommend sticking to Applied form. Engineering in most form doesn't require the kind of rigor provided by H&K or for that matter, any mathematical subject. You need rigor only if you want to go about proving things or reading papers. –  Inquest Feb 24 '12 at 8:46
@Nunoxic I am sorry to say that not everybody who does Math rigorously do it for going about proving things or reading papers. It is mostly fun and widens the scope for creative thoughts. –  user21436 Feb 24 '12 at 9:03
I'm maybe wrong, but I think Theoretical Computer Science would be a better place for this question, isn't it? –  Pascal Qyy Feb 24 '12 at 9:08
@KannappanSampath, I agree, it does influence the way one thinks but considering the opportunity cost of learning H&K, I doubt its worth taking a course. Maybe, it is worth looking into later (once you already know LA). Plus, something I have realized is, for engineers, the first course should ideally not be a rigorous course. It should be applied and later, if you are interested, pick up a concise rigorous text. But that's just my opinion. –  Inquest Feb 24 '12 at 9:19
@stressed_geek: If you are researching Machine Learning and Computer Vision, presumably you are enrolled in some program and have several teachers and at least one adviser? "What kind of linear algebra -- e.g., which textbook -- would be most useful to me for my work?" is an eminently reasonable question to ask any of these people. And you should ask them: they will know much better than any of us, because they will know you and what you are working on much better than we do. –  Pete L. Clark Feb 24 '12 at 19:49

If you want to do advanced computer vision, and not just implement algorithms, you will need to understand advanced algebraic concepts for linear transformations. You will also need to understand a bit of measure theory and analysis.

Why?

Because research level computer vision involves the development of algorithms. The development of these algorithms necessarily invokes the structural properties of the mathematical objects; properties such as measure, convergence, isometry, isomorphism, etc.

Furthermore, say you have the mechanical skills to develop a computational method. Any true research-level effort is also expected to demonstrate a proof of convergence, establish a domain in which the method is efficacious, compare the method to prior methods, and fundamentally compare the weaknesses and benefits.

This requires at least a solid understanding of graduate-level analysis and linear algebra.

-

From my personal experience, i think the most important topics are Probability, Statistics and Matrix Algebra. Of course, the basics of Linear Algebra are also required, but i guess that goes without saying.

The topics which you mentioned in the course of linear algebra, they can be good to know. For example, there are many unsolved problems in current methods of machine learning. If you have strong foundation of linear algebra, may be you can come up with solution to such existing problems.

Hope this helps.

-


text:
Knowledge Graph Embedding by Translating on Hyperplanes阅读笔记

Authors proposed TransH which models a relation as a hyperplane together with a translation operation on it. It solves the problem of multi-relation and makes a good trade-off between model capacity and efficiency.

# research objective

• solves the problem of multi-relation
• makes a good trade-off between model capacity and efficiency

# Problem Statement

• TransE can’t deal with reflexive, one-to-many, many-to-many and many -to-one relations
• some complex model sacrifice efficiency in the process(although can deal with transE’s problem)

# Contribution

• proposing a method named translation on hyperplanes(TransH)
• interpreting a relation as a translating operation on a hyperplane
• proposing a simple trick to reduce the chance of false negative labeling

# Embedding by Translating on Hyperplanes

## Relations’ Mapping Properties in Embedding

transE

• the representation of an entity is the same when involved in any relations, ignoring distributed representations of entities when invovled in different relaions

## Translating on Hyperplanes (TransH)

#### 目标函数

scoring function：

As the hyperplane $W_r$, the $w_r$ is the normal vector of it, and $\left|w_{r}\right|_{2}^{2}=1$, so the projection $h$ in $w_r$ is:

the score function is:

#### Training

loss function consists of margin-based ranking loss and some constraints:

the constraints:

• the second grantees the translation vectot $d_r$ is in the hyperplane
• they project each $w_r$ to unit $l_2$-ball before visiting each mini-batch

• 是不是不同代表同一含义的投影表示应该相同或者相似
• 这样是不是可以解决同一个实体的多义性问题。

## Reducing Ralse Negative Labels

Authors set different probabilities for replacing the head or tail entity depending on the mapping property of the relation (one-to-many, many-to-one, many-to-many)

• give more chance to replacing the head entity if the relation is one-to-many

• 分别统计每个头实体对应尾实体的数量（反之亦然），按占比进行生成负样例
• 通过这样的方式，例如one-many关系，替换头实体显然更不容易得到正样例（因为只有一种头实体是对的，然而替换尾实体因为对于头实体对应该关系的尾实体更多，说不定就有其他不在此many中的尾实体符合这个关系。
• 相比之下我认为在《Bootstrapping-Entity-Alignment-with-Knowledge-Graph-Embedding》采用的均匀截断负采样效果会更好一些

# Experiments

the detail can be seen in the paper

### outperform TransE in one-to-one

Authors explain:

• entities are connected with relations so that better embeddings of some parts lead to better results on the whole.

## Triplets Classification

This means FB13 is a very dense subgraph where strong correlations exist between entities

## Relational Fact Extraction from Text

• Actually, knowledge graph embedding is able to score a candidate fact, without observing any evidence from ex- ternal text corpus

# Reference

上一篇
Learning Knowledge Embeddings by Combining Limit-based Scoring Loss阅读笔记

2019-06-03

Attention Is All You Need阅读笔记
transformer 是一个完全由注意力机制组成的搭建的模型，模型复杂度低，并可以进行并行计算，使得计算速度快。在翻译模型上取得了较好的效果。本篇论文属于经典必读论文，阅读笔记中对一些不清楚的地方进行了汉语解释，读完论文后阅读参考链接以
2019-05-25
目录


text:
Courses
Courses for Kids
Free study material
Free LIVE classes
More

# If for an arithmetic progression, d=11, what is ${{t}_{17}}-{{t}_{15}}?$.

Last updated date: 26th Mar 2023
Total views: 306k
Views today: 5.83k
Verified
306k+ views
Hint: In an arithmetic progression sequence, the nth term ${{t}_{n}}$ is defined by ${{t}_{n}}=a+(n-1)d$ where a is the first term and d is the common difference of the arithmetic progression.

Let us consider the sequence of numbers as a, a+d, a+2d, a+3d ………. a+(n-1)d, in which successive numbers differ by a constant d. This constant is called the common difference (d) and a is the first term. This type of sequence is called the arithmetic progression.
From the above sequence, we can define the general term ${{t}_{n}}$ as ${{t}_{n}}=a+(n-1)d$.
In an arithmetic progression, ${{t}_{n}}$ means the nth term in the series.
In the same way, ${{t}_{17}}$ is the 17th term of an arithmetic progression and ${{t}_{15}}$ is the 15th term of an arithmetic progression.
Now we will find the term ${{t}_{17}}$ of the arithmetic progression by using the formula for the nth term of the arithmetic progression. So, we will get,
${{t}_{17}}=a+(17-1)d$
$\Rightarrow a+16d$, let this be equation (1).
Now we will express ${{t}_{15}}$ of the arithmetic progression by using the formula for the nth term of the arithmetic progression. So, we will get,
${{t}_{15}}=a+(15-1)d$
$\Rightarrow a+14d$ , let this be equation (2).
According to the question, we are asked to find ${{t}_{17}}-{{t}_{15}}$.
So, we will subtract equation (2) from equation (1), and we will get,
$\Rightarrow {{t}_{17}}-{{t}_{15}}=a+16d-(a+14d)$
$\Rightarrow 2d$ let it be equation (3).
According to the question, the common difference is given as d=11.
Now we will substitute d=11 in equation (3) and we will get,
\begin{align} & {{t}_{17}}-{{t}_{15}}=2\times d \\ & {{t}_{17}}-{{t}_{15}}=2\times 11 \\ & {{t}_{17}}-{{t}_{15}}=22 \\ \end{align}
Hence, we have found that ${{t}_{17}}-{{t}_{15}}$=22.

Note: The common difference of an arithmetic progression can be negative as well as positive. It is necessary to remember the formula to find the general term of an arithmetic progression. The common mistake that a student can make is considering the formula as ${{t}_{n}}=a+(n+1)d$ instead of using the formula ${{t}_{n}}=a+(n-1)d$. This can lead to the wrong answer.


text:
# Appendices¶

## Build Options¶

The shell script makenek is designed to assist the compilation process of Nek5000. The script will create a makefile based on the user settings section in makenek. The GNU gmake utility is used to build Nek5000. Available configurations options:

Table 18 Compiler options
name values default description
PPLIST string   list of pre-processor symbols (CVODE, …)
MPI 1, 0 1 use MPI (needed for a multiprocessor computation)

FC string optional Fortran compiler (mpif77)
CC string optional C compiler (mpicc)
FCLAGS string optional optional Fortan compilation flags
CCLAGS string optional optional C compilation flags
SOURCE_ROOT string optional path of Nek5000 source
USR string optional object list of additional files to compile make intructions (makefile_usr.inc required)
USR_LFLAGS string optional optional linking flags
PROFILING 1, 0 1 enable internal timers for performance statistics
VISIT 1, 0 0 Toggles Visit in situ. See Visit_in_situ for details
VISIT_INSTALL string VISIT in situ Path to VISIT install path. See Visit_in_situ for details.
VISIT_STOP true, false false When running VISIT in situ, simulation stops after step 1 to connect VISIT.

The PPLIST field can be used to activate several features at compilation time. A list of possible options is below:

Table 19 PPLIST options
Symbol Description
NOMPIIO deactivate MPI-IO support
BGQ use Blue Gene Q optimized mxm
XSMM use libxsmm for mxm
CVODE compile with CVODE support for scalars
VENDOR_BLAS use VENDOR BLAS/LAPACK
EXTBAR add underscore to exit call (for BGQ)
NEKNEK activate overlapping mesh solver (experimental)
CMTNEK activate discontinuous Galerkin compressible-flow solver (experimental)

In addition to these preprocessor items, the user can add compilation and linking flags. FFLAGS allows the user to add Fortran compilation flags while CCFAGS allows the user to add C compilation flags. These will be compiler dependent and the user is encouraged to consult the manual of the compiler if specific options are needed/desired. A commonly used flag is -mcmodel which allows for arrays of size larger than 2GB. This option tells the compiler to use a specific memory model to generate code and store data. It can affect code size and performance. If your program has global and static data with a total size smaller than 2GB, -mcmodel=small is sufficient. Global and static data larger than 2GB requires -mcmodel=medium or -mcmodel=large.

## Internal Input Parameters/Switches¶

### Parameters¶

P001 density for the case of constant properties

P002 dynamic viscosity

P007 heat capacity for the case of constant properties

P008 conductivity for the case of constant properties

P010 simulation end time

P011 number of time steps

P012 time step size

P014 time fequency to dump fld files

P015 step frequency to dump fld files

P021 pressure solver tolernace

P022 velocity solver tolerance

P023 number of passive scalars

P024 relative tolerance for Helmholtz solver

P025 absolute tolerance for Helmholtz solver

P026 target Courant number (determines the number of RK4 substeps for OIFS)

P027 temporal discretization order

P028 temporal discretization order for mesh solver

P029 magnetic viscosity

P030 material properties (0: constant, 1: uservp)

P031 number of perturbation modes in linearized N-S.

P032 number of boundary conditions in .re2 file

P033 first field index in .re2

P040 pressure coarse grid solver (0: XXT, 1: AMG)

P041 1 $$\rightarrow$$ multiplicative SEMG

P042 linear solver for the pressure equation (0: GMRES, 1: CG)

P043 0: additive multilevel scheme - 1: original two level scheme.

P044 0=E-based additive Schwarz for PnPn-2; 1=A-based.

P045 Free-surface stability control (defaults to 1.0)

P046 if $$>0$$, do not set Initial Condition (no call to subroutine SETICS).

P047 Poisson ratio for mesh elasticity solve (default 0.4)

P054 direction of fixed flowrate (1: x, 2: y, 3: z), negative means fixed bulk

P055 volumetric flowrate or bulk velocity (see p054) for periodic case

P059 deformed element switch

P060 initialize velocity to 1e-10 (for steady Stokes problem).

P062 byte swap for output

P063 output precision (4: SP, 8: DP)

P064 restart perturbation solution

P065 number of I/O nodes (if $$< 0$$ write in separate subdirectories).

P066 output format (0: ASCII, 4: legacy binary, 6: binary)

P068 averaging frequency in avg_all (0: every timestep).

P084 custom inital time step

P086 use skew-symmetric instead of convective form.

P093 number of previous solutions to use for residual projection.

P094 number of steps starting residual projection for velocity and passive scalars

P095 number of steps starting residual projection for pressure

P099 dealiasing mode ($$<0$$: disabled, 3: old dealiasing, 4: new dealiasing)

P100 RESERVED! pressure preconditioner when using CG solver (0: Jacobi, $$>0$$: two-level Schwarz) or viseversa?

P101 number of additional modes to filter

P103 filter weight for last mode

P107 if $$\neq0$$, add it to h2 in sethlm

P116 NELX number of elements in $$x$$ for FTP

P117 NELY number of elements in $$y$$ for FTP

P118 NELZ number of elements in $$z$$ for FTP

### Logical switches¶

IFFLOW solve for fluid (velocity, pressure)

IFHEAT solve for heat (temperature and/or scalars)

IFTRAN solve transient equations (otherwise, solve the steady Stokes flow)

IFADVC specify the fields with convection

IFTMSH specify the field(s) defined on T mesh (first field is the ALE mesh)

IFAXIS axisymmetric formulation

IFSTRS use stress formulation

IFLOMACH use low Mach number formulation

IFMGRID moving grid

IFCHAR use characteristics for convection operator

IFSYNC use upfront synchronization

IFUSERVP user-defined properties

### Other Input Variables¶

filterType 0: explicit, 1: HPT-RT

restol(:) field solver tolerance

## Commonly used Variables¶

### Solution Variables¶

Variable Name Size Type Short Description
vx (lx1,ly1,lz1,lelv) real x-velocity (u)
vy (lx1,ly1,lz1,lelv) real y-velocity (v)
vz (lx1,ly1,lz1,lelv) real z-velocity (w)
pr (lx2,ly2,lz2,lelv) real pressure (pr)
t (lx1,ly1,lz1,lelt,ldimt) real temperature (t) and passive scalars (ps)
vtrans (lx1,ly1,lz1,lelt,ldimt+1) real convective coefficient
vdiff (lx1,ly1,lz1,lelt,ldimt+1) real diffusion coefficient
vxlag (lx1,ly1,lz1,lelv,2) real x-velocity at previous time steps
vylag (lx1,ly1,lz1,lelv,2) real y-velocity at previous time steps
vzlag (lx1,ly1,lz1,lelv,2) real z-velocity at previous time steps
prlag (lx2,ly2,lz2,lelv,lorder2) real pressure at previous time steps
tlag (lx1,ly1,lz1,lelv,lorder-1,ldimt+1) real t and ps at previous time steps
time real physical time
dt real time step size
dtlag ( 10 ) real previous time step sizes
istep integer time step number

### Geometry Variables¶

Variable Name Size Type Short Description
xm1 (lx1,ly1,lz1,lelt) real x-coordinates for velocity mesh
ym1 (lx1,ly1,lz1,lelt) real y-coordinates for velocity mesh
zm1 (lx1,ly1,lz1,lelt) real z-coordinates for velocity mesh
bm1 (lx1,ly1,lz1,lelt) real mass matrix for velocity mesh
binvm1 (lx1,ly1,lz1,lelv) real inverse mass matrix for velocity mesh
bintm1 (lx1,ly1,lz1,lelt) real inverse mass matrix for t mesh
volvm1 real total volume for velocity mesh
voltm1 real total volume for t mesh
xm2 (lx2,ly2,lz2,lelv) real x-coordinates for pressure mesh
ym2 (lx2,ly2,lz2,lelv) real y-coordinates for pressure mesh
zm2 (lx2,ly2,lz2,lelv) real z-coordinates for pressure mesh
unx (lx1,ly1,6,lelt) real x-component of face unit normal
uny (lx1,ly1,6,lelt) real y-component of face unit normal
unz (lx1,ly1,6,lelt) real z-component of face unit normal
area (lx1,ly1,6,lelt) real face area (surface integral weights)

### Problem Setup Variables¶

Variable Name Size Type Short Description
nid integer MPI rank id (lowest rank is always 0)
nio integer I/O node id
nelv integer number of elements in velocity mesh
nelt integer number of elements in t mesh
ndim integer dimensionality of problem (i.e. 2 or 3)
nsteps integer number of time steps to run
iostep integer time steps between data output
cbc (6,lelt,ldimt+1) character*3 boundary condition
lglel (lelt) integer local to global element number map
gllel (lelg) integer global to local element number map

### Averaging Variables¶

Arrays associated with the avg_all subroutine

Variable Name Size Type Short Description
uavg (ax1,ay1,az1,lelt) real time averaged x-velocity
vavg (ax1,ay1,az1,lelt) real time averaged y-velocity
wavg (ax1,ay1,az1,lelt) real time averaged z-velocity
pavg (ax2,ay2,az2,lelt) real time averaged pressure
tavg (ax1,ay1,az1,lelt,ldimt) real time averaged temperature and passive scalars
urms (ax1,ay1,az1,lelt) real time averaged u^2
vrms (ax1,ay1,az1,lelt) real time averaged v^2
wrms (ax1,ay1,az1,lelt) real time averaged w^2
prms (ax1,ay1,az1,lelt) real time averaged pr^2
trms (ax1,ay1,az1,lelt,ldimt) real time averaged t^2 and ps^2
uvms (ax1,ay1,az1,lelt) real time averaged uv
vwms (ax1,ay1,az1,lelt) real time averaged vw
wums (ax1,ay1,az1,lelt) real time averaged wu
iastep integer time steps between averaged data output

## Commonly used Subroutines¶

subroutine rescale_x(x,x0,x1)
Rescales the array x to be in the range (x0,x1). This is usually called from usrdat2 in the .usr file
subroutine normvc(h1,semi,l2,linf,x1,x2,x3)
Computes the error norms of a vector field variable (x1,x2,x3) defined on mesh 1, the velocity mesh. The error norms are normalized with respect to the volume, with the exception on the infinity norm, linf.
subroutine comp_vort3(vort,work1,work2,u,v,w)
Computes the vorticity (vort) of the velocity field, (u,v,w)
subroutine lambda2(l2)
Generates the Lambda-2 vortex criterion proposed by Jeong and Hussain (1995)
subroutine planar_average_z(ua,u,w1,w2)
Computes the r-s planar average of the quantity u.
subroutine torque_calc(scale,x0,ifdout,iftout)
Computes torque about the point x0. Here scale is a user supplied multiplier so that the results may be scaled to any convenient non-dimensionalization. Both the drag and the torque can be printed to the screen by switching the appropriate ifdout(drag) or iftout(torque) logical.
subroutine set_obj
Defines objects for surface integrals by changing the value of hcode for future calculations. Typically called once within userchk (for istep = 0) and used for calculating torque. (see above)

subroutine avg1(avg,f, alpha,beta,n,name,ifverbose)

subroutine avg2(avg,f, alpha,beta,n,name,ifverbose)

subroutine avg3(avg,f,g, alpha,beta,n,name,ifverbose)
These three subroutines calculate the (weighted) average of f. Depending on the value of the logical, ifverbose, the results will be printed to standard output along with name. In avg2, the f component is squared. In avg3, vector g also contributes to the average calculation.
subroutine outpost(x,vy,vz,pr,tz,' ')
Dumps the current data of x, vy, vz, pr, tz to an .fld or .f0???? file for post processing.
subroutine platform_timer(ivrb)
Runs the battery of timing tests for matrix-matrix products,contention-free processor-to-processor ping-pong tests, and mpi_all_reduce times. Allows one to check the performance of the communication routines used on specific platforms.
subroutine quickmv
Moves the mesh to allow user affine motion.
subroutine runtimeavg(ay,y,j,istep1,ipostep,s5)
Computes, stores, and (for ipostep!0) prints runtime averages of j-quantity y (along w/ y itself unless ipostep<0) with j + ‘rtavg_’ + (unique) s5 every ipostep for istep>=istep1. s5 is a string to append to rtavg_ for storage file naming.
subroutine lagrng(uo,y,yvec,uvec,work,n,m)
Compute Lagrangian interpolant for uo
subroutine opcopy(a1,a2,a3,b1,b2,b3)
Copies b1 to a1, b2 to a2, and b3 to a3, when ndim = 3,
subroutine cadd(a,const,n)
Adds const to vector a of size n.
subroutine col2(a,b,n)
For n entries, calculates a=a*b.
subroutine col3(a,b,c,n)
For n entries, calculates a=b*c.

function glmax(a,n)

function glamax(a,n)

function iglmax(a,n)
Calculates the (absolute) max of a vector that is size n. Prefix i implies integer type.
function i8glmax(a,n)
Calculates the max of an integer*8 vector that is size n.

function glmin(a,n)

function glamin(a,n)

function iglmin(a,n)
Calculates the (absolute) min of a vector that is size n. Prefix i implies integer type.

function glsc2(a,b,n)

function glsc3(a,b,mult,n)

function glsc23(a,b,c,n)

function glsum(a,n)

Computes the global sum of the real arrays a, with number of local entries n

function iglsum(a,n)

Computes the global sum of the integer arrays a, with number of local entries n

function i8glsum(a,n)

Computes the global sum of the integer*8 arrays a, with number of local entries n
subroutine surface_int(dphi,dS,phi,ielem,iside)
Computes the surface integral of scalar array phi over face iside of element ielem. The resulting integral is storted in dphi and the area in dS.

## Generating a Mesh with Genbox¶

### Uniformly Distributed Mesh¶

Suppose you wish to simulate flow through an axisymmetric pipe, of radius $$R=0.5$$ and length $$L=4$$. You estimate that you will need 3 elements in radial $$(y)$$ direction, and 5 in the $$x$$ direction, as depicted in Fig. 12. This would be specified by the following input file (called pipe.box) to genbox:

axisymmetric.rea
2                      spatial dimension
1                      number of fields
#
#    comments:   This is the box immediately behind the
#                refined cylinder in Ugo's cyl+b.l. run.
#
#
#========================================================
#
Box 1                         Pipe
-5 -3                         Nelx  Nely
0.0   4.0   1.0               x0  x1   ratio
0.0   0.5   1.0               y0  y1   ratio
v  ,O  ,A  ,W  ,   ,          BC's:  (cbx0, cbx1, cby0, cby1, cbz0, cbz1)

Fig. 12 Axisymmetric pipe mesh.

• The first line of this file supplies the name of an existing 2D .rea file that has the appropriate run parameters (viscosity, timestep size, etc.). These parameters can be modified later, but it is important that axisymmetric.rea be a 2D file, and not a 3D file.
• The second line indicates the number of fields for this simulation, in this case, just 1, corresponding to the velocity field (i.e., no heat transfer).
• The next set of lines just shows how one can place comments into a genbox input file.
• The line that starts with “Box” indicates that a new box is starting, and that the following lines describe a typical box input. Other possible key characters (the first character of Box, “B”) are “C” and “M”, more on those later.
• The first line after “Box” specifies the number of elements in the $$x$$ and $$y$$ directions. The fact that these values are negative indicates that you want genbox to automatically generate the element distribution along each axis, rather than providing it by hand. (More on this below.)
• The next line specifies the distribution of the 5 elements in the $$x$$ direction. The mesh starts at $$x=0$$ and ends at $$x=4.0$$. The ratio indicates the relative size of each element, progressing from left to right.
• The next line specifies the distribution of the 3 elements in the $$y$$ direction, starting at $$y=0$$ and going to $$y=0.5$$. Again, ratio =1.0 indicates that the elements will be of uniform height.
• The last line specifies boundary conditions on each of the 4 sides of the box:
• Lower-case v indicates that the left $$(x)$$ boundary is to be a velocity boundary condition, with a user-specified distribution determined by routine userbc in the .usr file. (Upper-case $$V$$ would indicate that the velocity is constant, with values specified in the .rea file.)
• O indicates that the right $$(x)$$ boundary is an outflow boundary – the flow leaves the domain at the left and the default exit pressure is $$p=0$$.
• A indicates that the lower $$(y)$$ boundary is the axis—this condition is mandatory for the axisymmetric case, given the fact that the lower domain boundary is at $$y=0$$, which corresponds to $$r=0$$.
• W indicates that the upper $$(y)$$ boundary is a wall. This would be equivalent to a v or V boundary condition, with $${\bf u}=0$$.

Fig. 13 Axisymmetric pipe mesh, graded

Suppose you wish to have the mesh be graded, that you have increased resolution near the wall. In this case you change ratio in the $$y$$-specification of the element distribution. For example, changing the 3 lines in the above genbox input file from

-5 -3                         Nelx  Nely
0.0   4.0   1.0               x0  x1   ratio
0.0   0.5   1.0               y0  y1   ratio

to

-5 -4                         Nelx  Nely
0.0   4.0   1.0               x0  x1   ratio
0.0   0.5   0.7               y0  y1   ratio

yields the mesh shown in Fig. 13.

### User-Specified Distribution¶

Fig. 14 Axisymmetric pipe mesh, user specified.

You can also specify your own, precise, distribution of element locations. For example, another graded mesh similar to the one of the preceding example could be built by changing the genbox input file to contain:

-5  4                                               Nelx  Nely
0.0   4.0   1.0                                     x0  x1   ratio
0.000    0.250    0.375    0.450    0.500           y0  y1 ... y4

Here, the positive number of elements for the $$y$$ direction indicates that genbox is expecting Nely+1 values of $$y$$ positions on the $$y$$-element distribution line. This is the genbox default, which explains why it corresponds to Nely $$>$$ 0. The corresponding mesh is shown in Fig. 14.

## Mesh Modification¶

For complex shapes, it is often convenient to modify the mesh direction in the simulation code, Nek5000. This can be done through the usrdat2 routine provided in the .usr file. The routine usrdat2 is called by Nek5000 immediately after the geometry, as specified by the .rea file, is established. Thus, one can use the existing geometry to map to a new geometry of interest.

For example, suppose you want the above pipe geometry to have a sinusoidal wall. Let $${\bf x} := (x,y)$$ denote the old geometry, and $${\bf x}' := (x',y')$$ denote the new geometry. For a domain with $$y\in [0,0.5]$$, the following function will map the straight pipe geometry to a wavy wall with amplitude $$A$$, wavelength $$\lambda$$:

$y'(x,y) = y + y A \sin( 2 \pi x / \lambda ).$

Note that, as $$y \longrightarrow 0$$, the perturbation, $$yA \sin( 2 \pi x / \lambda )$$, goes to zero. So, near the axis, the mesh recovers its original form.

In Nek5000, you would specify this through usrdat2 as follows

subroutine usrdat2
include 'SIZE'
include 'TOTAL'

real lambda

ntot = nx1*ny1*nz1*nelt

lambda = 3.
A      = 0.1

do i=1,ntot
argx         = 2*pi*xm1(i,1,1,1)/lambda
ym1(i,1,1,1) = ym1(i,1,1,1) + ym1(i,1,1,1)*A*sin(argx)
end do

param(59) = 1.  ! Force nek5 to recognize element deformation.

return
end

Note that, since Nek5000 is modifying the mesh, postx will not recognize the current mesh unless you tell it to, because postx looks to the .rea file for the mesh geometry. The only way for Nek5000 to communicate the new mesh to postx is via the .fld file, so you must request that the geometry be dumped to the .fld file. The result of above changes is shown in Fig. 15.

Fig. 15 Axisymmetric pipe mesh.

### Cylindrical/Cartesian-transition Annuli¶

Fig. 16 Cylinder mesh

Fig. 17 Cylinder mesh

More sophisticated transition treatments may be generated using the GLOBAL REFINE options in prenek or through an upgrade of genb7, as demand warrants. Example 2D and 3D input files are provided in the nek5000/doc files box7.2d and box7.3d. Fig. 16 shows a 2D example generated using the box7.2d input file, which reads:

x2d.rea
2                      spatial dimension
1                      number of fields
#
#
#
#========================================================
#
Y                   cYlinder
3 -24 1             nelr,nel_theta,nelz
.5 .3               x0,y0 - center of cylinder
ccbb                descriptors: c-cyl, o-oct, b-box (1 character + space)
.5 .55 .7 .8        r0 r1 ... r_nelr
0  1  1             theta0/2pi theta1/2pi  ratio
v  ,W  ,E  ,E  ,    bc's (3 characters + comma)

An example of a mesh is shown in Fig. 16. The mesh has been quad-refined once with oct-refine option of prenek. The 3D counterpart to this mesh could joined to a hemisphere/Cartesian transition built with the spherical mesh option in prenek.

## Mesh Extrusion and Mirroring¶

In nek5000/tools, there is a code n2to3.f that can be compiled with your local fortran compiler (preferably not g77). By running this code, you can extend two dimensional domains to three dimensional ones with a user-specified number of levels in the $$z$$-direction. Such a mesh can then be modified using the mesh modification approach. Assuming you have a valid two-dimensional mesh, n2to3 is straightforward to run. Below is a typical session, upon typing n2to3 the user is prompted at the command line

 Input old (source) file name:
h2e
Input new (output) file name:
h3e
input number of levels: (1, 2, 3,... etc.?):
16
input z min:
0
input z max:
16
input gain (0=custom,1=uniform,other=geometric spacing):
1
This is for CEM: yes or no:
n
Enter Z (5) boundary condition (P,v,O):
v
Enter Z (6) boundary condition (v,O):
0
this is cbz: v  O   <---

320 elements written to h3e.rea
FORTRAN STOP

In this context CEM stands for computational electromagnetics, a spin-off of the original Nek5000 code.

The domain in which the fluid flow/heat transfer problem is solved consists of two distinct subdomains. The first subdomain is that part of the region occupied by fluid, denoted $$\Omega_f$$, while the second subdomain is that part of the region occupied by a solid, denoted $$\Omega_s$$. These two subdomains are depicted in Fig. 11. The entire domain is denoted as $$D=\Omega_f \cup \Omega_s$$. The fluid problem is solved in the domain $$\Omega_f$$, while the temperature in the energy equation is solved in the entire domain; the passive scalars can be solved in either the fluid or the entire domain.

We denote the entire boundary of $$\Omega_f$$ as $$\partial \Omega_f$$, that part of the boundary of $$\Omega_f$$ which is not shared by $$\Omega_s$$ as $$\overline{\partial \Omega_f}$$, and that part of the boundary of $$\Omega_f$$ which is shared by $$\Omega_s$$. In addition, $$\partial \Omega_{s}, \overline{\partial \Omega_s}$$ are analogously defined. These distinct portions of the domain boundary are illustrated in Fig. 11. The restrictions on the domain for Nek5000 are itemized below.

• The domain $$\Omega=\Omega_f \cup \Omega_s$$ must correspond either to a planar (Cartesian) two-dimensional geometry, or to the cross-section of an axisymmetric region specified by revolution of the cross-section about a specified axis, or by a (Cartesian) three-dimensional geometry.
• For two-dimensional and axisymmetric geometries, the boundaries of both subdomains, $$\partial \Omega_f$$ and $$\partial \Omega_s$$, must be representable as (or at least approximated by) the union of straight line segments, splines, or circular arcs.
• Nek5000 can interpret a two-dimensional image as either a planar Cartesian geometry, or the cross-section of an axisymmetric body. In the case of the latter, it is assumed that the $$y$$-direction is the radial direction, that is, the axis of revolution is at $$y=0$$. Although an axisymmetric geometry is, in fact, three-dimensional, Nek5000 can assume that the field variables are also axisymmetric ( that is, do not depend on azimuth, but only $$y$$, that is, radius, $$x$$, and $$t$$ ), thus reducing the relevant equations to “two-dimensional” form.

Fully general three-dimensional meshes generated by other softwares packages can be input to prenek as imported meshes.


text:
[This article was first published on DataScience+, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Many R users enjoy working in RStudio, but it’s not your only option for reproducible research in R. Stephen Wahlbrink has written a plugin for Eclipse, Statet, that offers similar functionality to RStudio within the popular Eclipse framework. You can run an R console, compose a document in LaTeX with R code chunks, and link the two through Sweave and the plugin.

## Why choose Eclipse and Statet for R?

This stack isn’t for everyone, but here are some reasons to prefer Eclipse and Statet over RStudio.

• You dislike software that randomly crashes and loses your work
• You are already familiar with Eclipse and use it for other programming tasks.
• You use two monitors. With Eclipse, you can detach and position your work windows wherever you like and make full use of all your screen space. In RStudio, the console and editor windows always remain within the application frame, limiting you to one monitor.
• You like writing in LaTeX or need print quality output. RStudio is probably the better choice if you prefer to write in rmarkdown, but its support for LaTeX is weak. At the time of writing, RStudio will not produce a pdf from LaTeX that contains R generated graphs. Presumably, this is a bug and not a feature and it will be fixed at some point. However, the developers seem to favour markdown and HTML. Currently, support for LaTeX and pdf’s is not as good.

## Installation guide

The Eclipse stack is not as easy to get up and running as RStudio, but it is considerably more stable once you have it working. No worries: this tutorial will walk you through every step of the way. The instructions shown here are based on a clean install of Kubuntu 16.04 and current versions of everything else, as of May 2016. These instructions should work for any Debian based distro. Most of this will also work with Fedora/Centos/RHEL, but I have sometimes found it harder to get up to date versions of things from the repositories these distros use.

Eclipse is cross-platform and this stack is also available to Windows users. The installations are similar, and I specify the differences in the details section. I have used Eclipse/R/Statet on a Windows system without administrator privileges and behind a firewall. I suggest tips for other users in similar controlled environments.

Here is an overview of the what you need to do.

• Install Java.
• Get Eclipse.
• Install R
• Obtain a LaTeX distribution
• From within R, install packages rj and rj.gd from Walhbrink’s site.
• From within Eclipse, install the Statet plugin.
• Launch Eclipse and configure for use with R and LaTeX

Warning: Don’t mix the bitage. Go 64 bit on everything, or 32 bit.

Most of the time, if I have an issue with installing Statet and Eclipse, it’s because I mixed 32 and 64 bit applications. The rest of the time, problems came from badly installing Java.

### Install Java

On windows, you only need the runtime version (JRE) and you probably have this already. On Linux, you need the JDK, because R needs the JDK to compile the rj and rj.gd packages.

Get Eclipse : Download the current version from Eclipse.org.

Linux users : Avoid sudo apt-get install eclipse and download directly from the site. The repos are often out of date.

### Install R

You probably know how to do this already. A note to Windows users in controlled environments. Most of this can be done by users without administrative privileges. However, you will save yourself some trouble later on if you can convince your IT department to do the install for you. They can ensure that the location of your R install is preserved in the Registry. This makes it a lot easier for Eclipse to find R when you want to summon the console.

### Install a LaTeX distribution

Windows users can install MikTex 2.9 from the installer. If you work behind a firewall, be sure to get the complete installation. The default provides a basic selection of packages and installs the rest as needed, on the fly. Your firewall won’t like that.

Warning! The Recommended Download is the 32 bit version. If you are going 64 bit, be sure to download the 64 bit version under Other Downloads.

Linux users can use the version from the repo. If you use the synaptic package manager, go for texlive and texlive-extras, plus any other packages you expect to need. Texlive won’t install packages on the fly, so you need to get all the packages you use up front.

### Extra instructions for Windows users

Windows users also need to inform Miktex where to find the Sweave.sty file. To do this:

• Open Miktex Settings. This program comes with the Miktex installation. There is another program called Miktex Settings (Admin). Ignore this one and use the plain Miktex Settings.
• Select tab Roots.
• Click Add and navigate to folder ..\my R installation\share\texmf
• Select this folder, save and exit Miktex Settings. You’re done.

You may have noticed that Sweave.sty is not actually in the texmf folder. It’s a couple of folders lower down, but this is the folder that Miktex needs to know about.

### Install R packages rj and rj.gd

rj and rj.gd are R packages used to form a bridge between R and Java. You need these to run the R console from Eclipse. These packages are not hosted on Cran, and you need to download them from www.walware.de.

• Launch R
• Navigate to Wahlbrink’s download page for rj and rj.gd.
• Copy the appropriate install code for the version you need and paste into your R console. Typically, you want the first line in the list. The other options refer to earlier versions of Statet, used with earlier versions of Eclipse. At the time of writing, you would enter the following code at the R prompt.
• install.packages(c("rj", "rj.gd"), repos="http://download.walware.de/rj-2.0")
• Quit R

Under Linux, the previous step may take a few moments while the packages compile. You may get an error message to the effect that the system could not compile a simple JNI program. This means that you failed to correctly install the Java JDK, or that R cannot find it. Googling the error message leads to a helpful post on Stack-Overflow, which should resolve the issue. Basically, you need to run sudo R CMD javareconf before attempting to install rj and rj.gd.

If you work behind a firewall, you can do a manual install by downloading the packages from Walware through your browser, .

### Installing the Statet plugin

From Eclipse, install the Statet plugin. As with rj, the plugin can be downloaded and installed manually, or installed on the fly from Eclipse. You want the version that works with the version of Eclipse that you previously installed. In most cases, you will be using the current version of Eclipse with the most recent version of Statet, but if you have reason to maintain a legacy system, earlier versions of Statet are still available on Walware.

In the following screenshots, I install the current version for use with Mars Eclipse. You can click on the images to enlarge them.

Check Walware for the current version of statet and copy the download url. The cursor on the my screenshot (low and center) points towards the line I need to copy.

Now launch Eclipse. Select Help -> Install New Software.

Click Add (top right). A form opens where you paste the URL from Walware. You can also give the plugin a name. On the screenshot, I’m about to click OK.

Eclipse goes onto the Internet and retrieves some information from Walware. It finds 5 plugins. Check the box beside Statet. Do not select the other boxes.

Click Next. The plugin will now download and install. Various screens will appear asking you to agree to the license and warning about unsigned content. Agree to everything and accept everything. Congratulations! You have Statet.

While we’re installing things, let’s grab Ahti Kitsik’s word wrap plugin. As before, select Help -> Install New Software. Click Add and insert Ahti’s download url for the plugin, http://www.ahtik.com/eclipse-update/. Give it a useful name, click OK and proceed as before.

Now exit Eclipse to complete the installation.

### Configuring Eclipse

We have all the tools, but we’re not done yet. We still need to configure Eclipse so that it knows:

• Where to find the R version you are using
• How you want to run R (from which folder, with which Java, etc.)
• Where to find LaTeX and how to run it.

If you have never used Eclipse before, it is easy to get lost at this point. I have supplied detailed instructions with screen shots in part 2 of this tutorial.

Related Post


text:
# How long would it take to be able to make artificial moons? [closed]

Say I want a world where there are many moons orbiting the Earth. They will be man made (so no convenient asteroids).
So there is a scientist and he designs moons.
How far forward from modern day society (2016) would we have to be so that moons are cheap enough to be commercially available?

You can make them out of asteroid bits but I'm not looking for just asteroids. I'm thinking more...synthetic. You can use asteroid bits, I just want a more synthetic moon feel, like a comic moon.

• This will likely close as being primarily opinion based. No one knows how long it will take to develop this much, and there aren't exactly developing fields like this to observe, so people will be left to speculate. – Zxyrra Nov 23 '16 at 3:39
• We've had artificial moons since the 1960s. They are called "satellites"... – John Feltz Nov 23 '16 at 3:45
• Do satellites look like moons? – John Meow Nov 23 '16 at 3:46
• What is a moon? Note that even in a post scarcity society like Star Trek, they don't do anything like this. You don't need just the engineering capacity, but a background that justifies it. Why build a moon rather than a space station? – Brythan Nov 23 '16 at 4:06
• John, you accepted an answer twelve minutes after posting your question. Remember this site is seen worldwide. It takes 24 hours for everybody to have a look at the questions. This is a courtesy. – a4android Nov 23 '16 at 4:51

## Using the Kardashev Scale: 3600 Years from now

The Kardashev Scale categorizes civilizations by how much energy they can harness and control. At Level II, a civ can harness the total power of its native star through a giant space structure - which, you could reason, is about the place, engineeringwise, it would need to be in to be able to build a moon.

Estimates conclude that we will be a Type I in around 200 years - and a Type II around 3400 years from then - so you could argue that about 3600 years from now, we will be able to construct moons at will, with ease.

## Why the answer is not 50 years from now:

• No reputable source supports technological growth at this extreme rate
• It takes thousands of years to form planets and moons with high-speed natural collisions so 50 years is thousands of years too short, even if we had the tech
• We do not have the means to harvest mass on this scale - ex. "blowing up Mars" is not something we can do now, nor will we be able to do, for centuries
• Woow I'm disappointed – MolbOrg Nov 23 '16 at 5:48
• @MolbOrg In me or the human race lol – Zxyrra Nov 23 '16 at 6:06
• I have no doubt about humankind, it is my God. U part of humanity, I part of humanity so we are partially gods, but answer is soso, but it is a part of humanity god thinking ways so my first comment probably was moment of my weakness)) – MolbOrg Nov 23 '16 at 7:45

## 50 years*

I'm the scientists.

Technology itself is not so complex, just stack piles of dirt on top of each other. It is that simply and same way the pointless use of matter. You could do billions of space habitats from that mater for people to live, and wasting all those matter is almost a crime.

But if you wish comic look you have to address that question to designers, and if you do wish just a look, not the mass then you even do not need a mad scientist for that. Just make a big sphere and cover it with dust and purchase moon look design.

If you need moon look and moon mass then Mars can be used to make about 8 moons.

If you ok with moon look, and moon gravity, but 2-10 times bigger size - shell world is a way to go.

## Energy and technology

Kardashev Scale is useless in defining technologies and predicting energy possession vs time. It just says now you a Lieutenant (T1), now you a First Lieutenant (T2), now you a Captain (T3) - but it depends on you and your efforts to get those rank, yes a bit of luck helps, but mostly it is efforts.

Estimating possible power production based on previous earth energy production grow is pointless because of space. On earth, there is one earth related coefficient of that grow, in space it is another space related coefficient.

On earth you have to move million's tonnes of matter to make a dam, to produce few GW of power. (about 30-40 million tonnes for this one Oroville Dam youtube docu about dam's , Oroville Dam, wiki or List of the tallest dams in United States and it produces only 890MW (not its main purpose)) A bit more proper example Sayano–Shushenskaya Dam It was used 10 million cubic meters of concrete, it is about same 30 million tonnes of concrete, and it produces 6.4 GW of power.

6.4 GW it is about 3400 x 3400 m square at 40% efficiency at L1 (Lagrange point). If mass of construction per square meter is about 1kg, difference is not exciting just 3 times less of materials, not exciting because even launching that from moon costs a significant amount of energy. But nice thing about microgravity is that construction can be very light weight, because they do not need same construction strength they need in a gravity well. Thin reflective foil can be used to focus the sun light and it can be with minimal construction strength (some king of light weight frame) 4600 tonnes of foil to focus the light - and that is 10000 less materials to generate same amount of energy.

Concrete is not for free is also energy expensive process to make it.

Escape velocity from the Moon is 2.38 km/s, and to launch let say those 5000 tonnes of materials we need significant amount of energy, but with 6.4GW we can do that each 35 minutes. It is fair to say that we need about same energy to produce the foil and frame, same to collect ore on the Moon, same for just in case(for misc needs, efficiency of launch system, energy to extend its capabilities etc).

So basically the system can grow each 2 hours in 2 times. After 24hours it can produce 4096 times more energy than original system. So The system, even with energy launch costs from the moon have very high grow rate.

On earth, we just can't scale things so fast, because all solutions here are not mass efficient, and there is very limited space to grow the systems, and there no need in such fast grow - not real places to use it for the cost it has.

A situation where we need to create a Moon is different, because we need a lot of energy for different processes involved, and it makes sense to grow energy production as fast as we can to achieve needed energy generation level.

SpaceX reusable launch cost is expected to be 140'000 \$per tonne, it is about 1'400'000 kWh energy wise(0.1\$ per kWh) or 5.04e+12 J per tonne. And the 5000-tonne construction with 6.4GW energy generation may grow 2 times in about 45 days.
No launch loop, no space elevators, but just a technology we expect to have in 10years. 45 days! In Space! by a rocket! compare it to the time it was needed to build both dam's. 15 years for Sayano–Shushenskaya Dam, 7 years for Oroville Dam.

• I didn't multiply energy by 4 as I did for nonrocket launch system, because above energy is a fraction of energy which is needed for the rocket, about 0.23% of it, not significant.

# Uvaga-Achtung-Warning-Внимание

Space and Earth are way way much different than people usually think, for the cost of launching 10000 (actually less) new Martians to the Mars, we can actually be a type 1 civilization in 3.5 years, with SpaceX BF class rocket.

Type 2 - in 6.9 years.

Type 2 not so simple, some technology improvements are needed, but type 1 is easy, no new technologies are needed.

• Blowing up Mars (ignoring the fact that this will be impossible in 50 years, and that even if somehow we could, an average scientist would have governments and budget in his way) to make 8 pseudo-moons is not the same as "cheap enough to be commercially available" so this does not answer OP's Q – Zxyrra Nov 23 '16 at 7:48
• @Zxyrra I provided links to description of technologies op needs for the project, both links in first section of the answer are strongly related. They are not something too sophisticated. Shell world and blow Jupiter and make 25 thousand moons. Moon is pretty significant space body, it never be dirt cheap, specially if it just passive dirt. Really I recommend both links. As about KS, efficiency of energy usage is a big deal actually, in some times it is limited by physics in some we are way below that limit, but more advanced then we were. – MolbOrg Nov 23 '16 at 8:10
• T1 we can be 10 years later just with tech we have today, just because we will to use rockets more efficient, and our efforts more efficient. T2 is a bit more of challenge, same problem as with A supercomputer around the sun I focused on that cheap thing, I knew it will be a issue. – MolbOrg Nov 23 '16 at 8:10
• Moving rockets aside, being able to harvest enough material to make a moon or even assemble it in 50 years is unprecedented. – Zxyrra Nov 23 '16 at 8:13
• @Zxyrra read link I have provided, watch a video. – MolbOrg Nov 23 '16 at 8:15


text:
• Data Types

In summary, nominal variables are used to “name,” or label a series of values. Ordinal scales provide good information about the order of choices, such as in a customer satisfaction survey. Interval scales give us the order of values + the ability to quantify the difference between each one. Finally, Ratio scales give us the ultimate–order, interval values, plus the ability to calculate ratios since a “true zero” can be defined.

https://www.mymarketresearchmethods.com/types-of-data-nominal-ordinal-interval-ratio/

• A More General View of Ensembles

Now that we have know about

• A More General View of Ensembles

People realized that the very successful Boosting method was in essence
Boosting = a very general meta-algorithm for optimization of the mapping function from input variables to output target variables.

This algorithm chooses multiple weak functions that are combined together, just as the ensemble of decision trees are for Random Forests.

• What is the Gradient Though?

• One can imagine that this combined function can have a gradient
• In this case this is the infinistesimal increase in each of the function parameters that would strengthen the current response.

• In an ensemble of decision trees these parameters are all of the split points in each for each data dimension.
• In Random Forests gradient is not used
• In AdaBoost it is used implicitly in a very simple way
• each new decision tree weak learner
• is optimized relative to the negative of this gradient
• since it tries to do well on what the existing model does badly on.
• Doing Better

This idea can then be generalized so that each new weak learner is explicitely treated as a function that points directly away from the gradient of the current combined function.

Given some tree based ensemble model then, represented as a function

• after adding $i$ weak learners already we find that the “perfect” function for the $i+1^{th}$ weak learner would be
• this fills in the gap of what the existing models got wrong.
• This is because then the new combined model perfectly matches the training data:

• In practice we need to be satisfied with merely approaching this perfect update by fitting a functional gradient descent approach where we use an approximation of the true residual (also called the loss function) each step.

• In our case this approximation is simply the sum of the wrong answers (i.e. the residuals) from each weak learner decision tree

{"cards":[{"_id":"52827cc512fe52ddb000005f","treeId":"5282babaf95bac7e40000146","seq":19738299,"position":0.5,"parentId":null,"content":"# Data Types"},{"_id":"52827c8512fe52ddb0000060","treeId":"5282babaf95bac7e40000146","seq":19738305,"position":1,"parentId":"52827cc512fe52ddb000005f","content":"# Data Types\nIn summary, nominal variables are used to “name,” or label a series of values. Ordinal scales provide good information about the order of choices, such as in a customer satisfaction survey. Interval scales give us the order of values + the ability to quantify the difference between each one. Finally, Ratio scales give us the ultimate–order, interval values, plus the ability to calculate ratios since a “true zero” can be defined.\n \nhttps://www.mymarketresearchmethods.com/types-of-data-nominal-ordinal-interval-ratio/"},{"_id":"5e26209fdf5197044c05b309","treeId":"5282babaf95bac7e40000146","seq":19738199,"position":1,"parentId":null,"content":"# Gradient Tree Boosting"},{"_id":"5e26209fdf5197044c05b30a","treeId":"5282babaf95bac7e40000146","seq":19738247,"position":1,"parentId":"5e26209fdf5197044c05b309","content":"## A More General View of Ensembles\nNow that we have know about \n- [DecisionTrees](DecisionTrees)\n- [Boosting](Boosting)\n- [RandomForests](RandomForests) \nwe are ready to learn about a powerful combination of all these concepts with *gradient search* - **Gradient Tree Boosting**.\n"},{"_id":"5e26209fdf5197044c05b30b","treeId":"5282babaf95bac7e40000146","seq":19738248,"position":2,"parentId":"5e26209fdf5197044c05b309","content":"## A More General View of Ensembles\n\nPeople realized that the very successful [Boosting](Boosting) method was in essence \n Boosting = a very general meta-algorithm for optimization of the mapping function from input variables to output target variables. \n\nThis algorithm chooses *multiple weak functions* that are combined together, just as the ensemble of decision trees are for [Random Forests](Random Forests)."},{"_id":"5e26209fdf5197044c05b30c","treeId":"5282babaf95bac7e40000146","seq":19738229,"position":3,"parentId":"5e26209fdf5197044c05b309","content":"## What is the Gradient Though? \n- One can imagine that this combined function can have a **gradient** \n- In this case this is the *infinistesimal increase* in each of the **function parameters** that would **strengthen** the current response.\n\n### We've already used them\n- In an ensemble of decision trees these parameters are **all of the split points** in each for each data dimension.\n- In Random Forests *gradient is not used*\n- In AdaBoost it is used *implicitly* in a very simple way\n - each new decision tree weak learner \n - is optimized relative to the negative of this gradient\n - since it tries to do *well* on what the existing model does *badly* on."},{"_id":"5e26209fdf5197044c05b30f","treeId":"5282babaf95bac7e40000146","seq":19738240,"position":6,"parentId":"5e26209fdf5197044c05b309","content":"## Doing Better\nThis idea can then be generalized so that each new weak learner is *explicitely* treated as a function that points directly away from the gradient of the current combined function."},{"_id":"5e26209fdf5197044c05b310","treeId":"5282babaf95bac7e40000146","seq":19738250,"position":7,"parentId":"5e26209fdf5197044c05b309","content":"## Gradient Tree Boosting\nGiven some tree based ensemble model then, represented as a function \n\n$$T_i(X)\\rightarrow Y$$\n\n- after adding $i$ weak learners already we find that the \"perfect\" function for the $i+1^{th}$ weak learner would be\n$$h(x)=T_i(x) - Y$$ \n- this fills in the gap of what the existing models got wrong. \n - This is because then the new combined model *perfectly matches the training data*: \n$$T_{(i+1)}(x) = T_i(x) + h(x) = Y$$"},{"_id":"52829ccc12fe52ddb000005d","treeId":"5282babaf95bac7e40000146","seq":19738383,"position":7.5,"parentId":"5e26209fdf5197044c05b309","content":"## Gradient Tree Boosting\n- In practice we need to be satisfied with merely *approaching* this perfect update by fitting a **functional gradient descent** approach where we use an *approximation of the true residual* (also called the [loss function](lossfunction)) each step. \n\n- In our case this approximation is simply the sum of the wrong answers (i.e. the residuals) from each weak learner decision tree \n\n$$L(Y, T(X)) = \\sum_i Y-T_i(X)$$"},{"_id":"5e26209fdf5197044c05b311","treeId":"5282babaf95bac7e40000146","seq":19738387,"position":8,"parentId":"5e26209fdf5197044c05b309","content":"## Gradient Tree Boosting\nGradient Tree Boosting explicitly uses the gradient \n\n$$\\nabla L(Y,T_i(X))=[ \\nabla_{w_i} L(Y,T^{w_i}_i (X))]$$\n\nof the loss function of *each tree* to fit a new tree \n$$h(X)= T_i(X) - \\sum_i \\nabla_{T_i}L(Y,T_i(X))$$ \n\nand then add it to the ensemble. \n\nThere is also further optimization of weighting functions for each tree and various regularization methods which can be done. \n\nThe popular algorithm **XGBoost**\\cite{xgboost} implements approach."}],"tree":{"_id":"5282babaf95bac7e40000146","name":"GradientTreeBoosting","publicUrl":"gradient-tree-boosting","latex":true}}


text:
Journal article Open Access

# Simulation of the Nanoscale Joint Surrounding Gate SOI MOSFET Characteristics

Nikolae V. Masalsky

### JSON-LD (schema.org) Export

{
"inLanguage": {
"alternateName": "eng",
"@type": "Language",
"name": "English"
},
{
"@id": "",
"@type": "CreativeWork"
},
{
"@id": "https://hdl.handle.net/100.1/ijitee.K78310991120",
"@type": "CreativeWork"
}
],
"description": "
In order to solve the current problem of increasing the efficiency of modern electronic circuits, the applicability of a nanoscale joint surrounding gate MOSFET with oval work area is discussed. The design and principle of its operation are considered. This concept involves of jointing the working areas of n-channel and p-channel MOSFETs. In fact, the JSMOSFET consists of two "glued" along the halves of MOSFETs: one - nchannel and the other - p-channel, but with one common gate. We analyze the applicability of the design of an oval-shaped protected area. In our case, the contact of two heterogeneously doped regions occurs in the plane passing through the small axis of the oval. The main channels are formed in zones associated with the large axis of the oval. This achieves the main goalincreasing the number of charge carriers. At the same time, the efficiency of short-channel effect suppression is maintained and a high current level of the transistor is provided in the strong inversion mode. By the developed TCAD model of a nanoscale joint surrounding gate MOSFET with an oval work area the electrophysical characteristics of several prototypes with different transverse dimensions were numerically calculated at a supply voltage of 0.5 V. From the simulation results, it follows that all prototypes are low-voltage devices that can function at voltages below 0.5 V in the gigahertz frequency range with a high gain. The proposed devices perform the function of inverting the input signal without distortion. From the comparison of modeling data, the scope scaling capabilities are determined. The obtained results create prerequisites for the development of the proposed transistor architecture, since electronic chips created on their basis will differ in low power supply voltage, high performance, and minimal occupied area, which meets modern requirements for transistors for analog and digital applications.
",
"creator": [
{
"affiliation": "leader researcher of Federal State Institution  \"Federal Scientific Center Research Institute of System Researches\",  Moscow, Russian,",
"@type": "Person",
"name": "Nikolae V. Masalsky"
}
],
"headline": "Simulation of the Nanoscale Joint Surrounding  Gate SOI MOSFET Characteristics",
"datePublished": "2020-10-30",
"keywords": [
"nanoscale SOI MOSFET, surrounding gate, shortchannel effects, logic gate, low supply voltage"
],
"url": "https://zenodo.org/record/5844292",
"contributor": [
{
"affiliation": "Publisher",
"@type": "Person",
"name": "Blue Eyes Intelligence Engineering  and Sciences Publication(BEIESP)"
}
],
"@context": "https://schema.org/",
"identifier": "https://doi.org/10.35940/ijitee.K7831.1091220",
"@id": "https://doi.org/10.35940/ijitee.K7831.1091220",
"@type": "ScholarlyArticle",
"name": "Simulation of the Nanoscale Joint Surrounding  Gate SOI MOSFET Characteristics"
}
31
9
views


text:
每週問題 December 12 , 2016

An $n\times n$ matrix is said to be a semi-magic matrix if the sums of the rows and columns are all equal. Show that a semi-magic matrix $A$ can be decomposed as $A=B+C$ such that for integer $k\ge 1$,

$A^k=B^k+C^k$.

$B=A$$C=0$ 即有平凡分解式。底下考慮非平凡分解式。假設 $n\times n$ 階半幻方矩陣 $A=[a_{ij}]$ 滿足 $\sum_{i=1}^na_{ij}=\sum_{j=1}^na_{ij}=s$$1\le i,j\le n$。令 $n\times n$ 階矩陣 $E$ 的所有元皆為 $1$。因此，$EA=AE=sE$$E^2=nE$。令

$\displaystyle B=\frac{s}{n}E,~~C=A-\frac{s}{n}E$

$\displaystyle BC=\left(\frac{s}{n}E\right)\left(A-\frac{s}{n}E\right)=\frac{s}{n}EA-\frac{s^2}{n^2}E^2 =\frac{s}{n}(sE)-\frac{s^2}{n^2}(nE)=0$


text:
# public tomlokhorst /AwesomePrelude

### Subversion checkout URL

You can clone with HTTPS or Subversion.

Fetching contributors…

Cannot retrieve contributors at this time

file 74 lines (43 sloc) 1.53 kb
 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 \documentclass[xcolor=dvipsnames,sans,mathserif]{beamer}\usepackage[english]{babel}\usepackage{mathpazo}%include polycode.fmt%include code.fmt%if style == newcode> {-# OPTIONS_GHC -F -pgmF lhs2TeX -optF --pre #-}%endif\setbeamersize{text margin left=.5cm}\setbeamersize{text margin right=.5cm}\setbeamertemplate{navigation symbols}{}\setlength\parindent{0.0in}\setlength\parskip{0.25in} % -----------------------------------------------------------------------------\definecolor{stress}{rgb}{0.60,0.60,1.00} \definecolor{c1}{rgb}{1.00,0.70,0.30} \setbeamercolor{title}{fg=c1}\setbeamercolor{frametitle}{fg=c1}\setbeamercolor{normal text}{fg=white}\setbeamercolor{background canvas}{bg=black}\usefonttheme[stillsansseriftext]{serif} \setbeamerfont{frametitle}{family=\rmfamily,shape=\itshape} \newcommand{\stress}[1]{\textcolor{stress}{#1}}\definecolor{subtitle}{rgb}{0.30,0.80,0.30}% -----------------------------------------------------------------------------\begin{document}\title{\LARGE{\texttt{AWESOME PRELUDE}}}\subtitle{\textcolor{subtitle}{Liberating Haskell from datatypes!''}}\author{Tom Lokhorst, Sebastiaan Visser} \date{\today} \frame{\titlepage} % -----------------------------------------------------------------------------\begin{frame}\center{\Huge{$4 + 3 \times 2$}}\end{frame}\include{ArithExpr}\include{Expr}\include{BoolLike}\include{RealExpr}% ------------------ BREAK ---------------\include{Value}\include{Conclusion}\end{document}
Something went wrong with that request. Please try again.


text:
# Getting Started

### Moving and Copying Elements

You can move elements around in your topic using The Element Structure Menu to move, cut, copy and paste elements, giving you exact control over the elements manipulated.

### Tip

You can also copy or move content from one topic to another. Just open another topic in a second browser tab, and use the same procedures to copy and move content as described below.

### Tip

All of the below commands have keyboard shortcuts too.

### Note

Menu commands to move elements work only on elements on the same level, e.g changing the order of list items. To move elements more freely, use the cut and paste commands from the Element Structure Menu.

1. Select the element you wish to move.

2. Click the name of the element in the Element Structure Menu, and choose one of the commands, depending if you want to move the element up or down.

Moving table rows

You can also move table rows up or down. This can only be done with the keyboard shortcuts.

1. Place the cursor in a table cell.

Not in a paragraph or other element inside the cell, but in the actual td element. Check the structure menu to see that you have it in the correct place:

2. Use the keyboard shortcuts with arrow keys for moving the current table row up or down (AltShift or AltShift).

#### Cutting, copying, and pasting elements

1. Place your cursor inside the element you want to cut or copy.

2. Select the element in the Element Structure Menu:

3. Select Copy or Cut.

4. Place the cursor in a location where the selected element would be valid, e.g itemizedlist if you have cut or copied a list item.

5. Select either Insert (if you have cut or copied) or Insert as reuse (works only if you have copied).

### Copy and paste as reuse

This is a very powerful reuse feature, and the easiest way is to do it with the keyboard shortcuts.

If you select Insert as reuse, you have actually reused the same element content, and can update it in one place. One instance will be locked, and the other one will be editable. If you update the editable one you will see that the other updates simultaneously.

Note that this is mostly recommended for small elements, such as paragraphs. You should always take care to consider what is the best reuse strategy, and select between the various techniques, so that you do not lose control over your content.

2. Select the element you want to move by clicking its tag, and then move it where you want it by dragging and dropping, making sure that you do not get warnings about incorrect document structure.


text:
# Evaluating $\iint_{\mathbb{R}\times \mathbb{R}^{+}}e^{-|w-c_{1}|^2-|u-c_{2}|^2}\frac{1}{w_{1}+iw_{2}-u_{1}-iu_{2}}dw_{1}dw_{2}du_{1}du_{2}$

For $c_{1},c_{2}\in \mathbb{H}:=\{Im(z)>0\}$ I want to compute the following integral or prove it doesn't exist:

$$\int_{\mathbb{R}\times \mathbb{R}^{+}}\int_{\mathbb{R}\times \mathbb{R}^{+}}e^{-|w-c_{1}|^2-|u-c_{2}|^2}\frac{1}{w_{1}+iw_{2}-u_{1}-iu_{2}}dw_{1}dw_{2}du_{1}du_{2},$$

where $w_{1},u_{1}\in \mathbb{R}$,$w_{2},u_{2}\in \mathbb{R}^{+}$. Please only hints to help me practice.

Q1 Is there a way to turn this into a contour integral?

It was on mathstackexchange for a while but I didn't get any help, so I deleted it.

Q2 Is it possible that it equals $c\cdot \frac{1}{c_{1}-c_{2}}$?

How would I go about disproving this? This guess came from treating it as a Gaussian integral, doing Laplace method and a power series approximation. One reason I think it is not true is because as we take $c_{1}-c_{2}\to 0$ the right hand side blows up, whereas the left is still bounded from attempt (1).

Attempts

1)Existence of integral. Around a neighbourhood of zero we can bound the integral by

$$c\int_{0}^{\varepsilon}\int_{0}^{\varepsilon} \frac{r\rho}{|r-\rho|}dr d\rho,$$

for $w=re^{i\theta},u=\rho e^{i\phi}$ and this can be computed. Outside that neighbourhood, we have the bound

$$c'\int_{\varepsilon}^{\infty}\int_{\varepsilon}^{\infty}e^{-r^{2}-\rho^{2}} \frac{r\rho}{|r-\rho|}dr d\rho,$$

which is also bounded.

2)Somehow turning this into a contour integral.

$$\int e^{-|w-c_{1}|^{2}-|u-c_{2}|^{2}} \frac{r\rho}{re^{2i\theta}-e^{i\theta}\rho e^{i\phi}}e^{i\theta}d\theta dr$$

$$\int_{r=0}^{\infty}\int_{|w|=r,arg(w)\in [0,\pi]} e^{-|w-c_{1}|^{2}-|u-c_{2}|^{2}} \frac{|w|\rho}{w(w-\rho e^{i\phi})}dw dr$$

and so considering the contour integral over the upper semicircle indented to include pole 0. However, the gaussian is not holomorphic and so we cannot apply the residue theorem.

3)Trying to use the rectangular contour used for the gaussian: $[-R,R]\cup [-R+\tau,R+\tau\cup [-R,-R+\tau]\cup [R,R+\tau]$. However, this required a certain periodic integrand, which we don't have i.e. $f(w):=e^{-w^{2}}\frac{|w|}{w(w-u)}$ with the property $f(w)-f(w+\tau)=e^{-w^{2}}\frac{|w|}{w(w-u)}$.

4)Somehow turning this into a contour integral via Green's theorem: it would require writing $Q_{x}-P_{y}=e^{-|(x,y)|^{2}}\frac{1}{x+iy-u)}$. All we have is $[\partial_{x}-i\partial_{y}]Log(w-u)$.

5)We do change of variables $\widetilde{w}=w-c_{1},\widetilde{u}=u-c_{2}$ and polar coordinates we obtain:

$$\int_{\mathbb{R}\times [-iIm(c_{2}),\infty]}\int_{\mathbb{R}\times [-iIm(c_{1}),\infty]}e^{-|w|^2-|u|^2}\frac{1}{w-u+c_{1}+c_{2}}dw_{1}dw_{2}du_{1}du_{2}.$$

We split the domain $[-iIm(c_{2}),\infty]=[-iIm(c_{2}),0]\cup (0,\infty]$ in order to use polar coordinates; we start with the easier part:

$$\int_{[0,\infty]\times [0,\pi]}\int_{[0,\infty]\times [0,\pi]}e^{-r^2-\rho^2}\frac{r \rho}{re^{i\theta}-\rho e^{i\phi}+c}drd\theta d\rho d\phi.$$

Now this we can study one iterated integral at a time:

$$\int_{[0,\infty]}e^{-r^2}r\int_{ [0,\pi]}\frac{1 }{re^{i\theta}-u+c}d\theta dr.$$

My problem is studying the other part $[-iIm(c_{2}),0]$, which I will post as I find things.


text:
The 1108 is a Hall-effect sensor that provides a voltage output that is proportional to the applied magnetic field.

#### Product Specifications

Sensor Properties
Sensor Type Magnetic Field
Controlled By VoltageRatio Input
Sensor Output Type Ratiometric
Magnetic Flux Min -500 G
Magnetic Flux Max 500 G
Measurement Error Max ± 0.5 %
Magnetic Zero Balance Max 15 G
Magnetic Resolution 1 G
Electrical Properties
Current Consumption Max 2 mA
Output Impedance 1 kΩ
Output Voltage Min 200 mV DC
Output Voltage Max 4.7 V DC
Supply Voltage Min 4.5 V DC
Supply Voltage Max 5.5 V DC
Physical Properties
Operating Temperature Min -20 °C
Operating Temperature Max 85 °C
Neodymium Magnets
Mangetic Field Strength (@ 6.5 mm) 500 G
Length 8.7 mm
Diameter 5 mm

## Getting Started

Welcome to the 1108 user guide! In order to get started, make sure you have the following hardware on hand:

Next, you will need to connect the pieces:

1. Connect the 1108 to the HUB0000 with the Phidget cable.
2. Connect the HUB0000 to your computer with the USB cable.

Now that you have everything together, let's start using the 1108!

## Using the 1108

### Phidget Control Panel

In order to demonstrate the functionality of the 1108, we will connect it to the HUB0000, and then run an example using the Phidget Control Panel on a Windows machine.

The Phidget Control Panel is available for use on both macOS and Windows machines. If you would like to follow along, first take a look at the getting started guide for your operating system:

### First Look

After plugging in the 1108 into the HUB0000, and the HUB0000 into your computer, open the Phidget Control Panel. You will see something like this:

The Phidget Control Panel will list all connected Phidgets and associated objects, as well as the following information:

• Serial number: allows you to differentiate between similar Phidgets.
• Channel: allows you to differentiate between similar objects on a Phidget.
• Version number: corresponds to the firmware version your Phidget is running. If your Phidget is listed in red, your firmware is out of date. Update the firmware by double-clicking the entry.

The Phidget Control Panel can also be used to test your device. Double-clicking on an object will open an example.

### Voltage Ratio Input

Double-click on a Voltage Ratio Input object in order to run the example:

General information about the selected object will be displayed at the top of the window. You can also experiment with the following functionality:

• Modify the change trigger and/or data interval value by dragging the sliders. For more information on these settings, see the data interval/change trigger page.
• Select the 1108 from the Sensor Type drop-down menu. The example will now convert the voltage into Gauss automatically. Converting the voltage to Gauss is not specific to this example, it is handled by the Phidget libraries, with functions you have access to when you begin developing!

## Technical Details

### General

The 1108 is optimized, sensitive, and temperature-stable. It is a ratiometric Hall effect sensor which provides a voltage output that is proportional to the applied magnetic field. Accuracy can be improved on a specific device with offset and/or gain calibration (using known flux).

### Formulas

The Phidget libraries can automatically convert sensor voltage into Gauss by selecting the appropriate SensorType. See the Phidget22 API for more details. The Formula to translate voltage ratio into Gauss is:

### Phidget Cable

The Phidget Cable is a 3-pin, 0.100 inch pitch locking connector. Pictured here is a plug with the connections labelled. The connectors are commonly available - refer to the Analog Input Primer for manufacturer part numbers.

# 1108_0 - Magnetic Sensor

• Brands Phidgets
• Product Code: ES000046
• Availability: In Stock


text:
# truth

Sunday 13 November 2005

Truth is the recognition of reality; reason, man’s only means of knowledge, is his only standard of truth.

Truth is the identification of a fact of reality. Wheter the fact in question is metaphysical or man-made, the fact determines the truth: if the fact exists, there is no alternative in regard to what is true. For instance, the fact that the U.S. has 50 states was not metaphysically necessary — but as long as this is men’s choice, the propostion that "The U.S. has 50 states" is necessarily true. A true proposition must describe the facts as they are. In this sense, a "necessary truth" is a redundancy, and a "contingent truth" a self-contradiction.

See

facts