3 ms·
What about the derivative operator in maths? When you write say d^nf/dx^n in Leibniz notation (or the equivalent in Lagrange notation f^(n)(x)), you have 3 arg
by seanhunter 2y ago
What about the derivative operator in maths? When you write say d^nf/dx^n in Leibniz notation (or the equivalent in Lagrange notation f^(n)(x)), you have 3 arguments. The "f" is the function you are taking the derivative of, the n is what derivative to take and then the (x) is what to name the argument in the resulting function.
Obviously in the common case you're just writing something like f'(x) or f''(x) where the ' stands for ^(1) but it's still a ternary operator.
Another common example in maths is the "limit" operator where you have lim_x->a <someexpr> and the arguments are x, a and someexpr.
- taeric 2y agoThe article touches on sigma notation and such. So, I would expect that is largely how they would treat it. The pitfall you will run into quickly, is that we have very loose definitions between operations and functions. Is akin to wanting a sharp distinction between expressions and terms or statements. There are widely accepted distinctions that typically work, but this is largely convention based with no real intrinsic quality that defines them.
- seanhunter 2y agoSigma, capital pi and the definite integral are interesting. What counts for arity of an operator? For sigma you have 4 things I would argue. - the low and high limits of the index - the name of the index variable in the expression you're summing - the expression itself The name of the index variable doesn't seem to me to be of the same kind as the others in that it's sort of a dummy argument but it's generally needed to make the syntax work[1]. [1] yeah I know people sometimes just write the limits above and below and rely on convention for people to know the name is n or i in the same way they do for the square bracket or big pipe notation (I don't know what that's called) you learn when you learn to take definite integrals.
- taeric 2y agovarargs are a thing for a reason. Same with keyword arguments. The elephant in this discussion remains the idea that operations are somehow different from functions. This is akin to asking what makes a datatype a primitive. There are some that are typically included in that list, but there is no real intrinsic quality of any data that makes it more so.
- seanhunter 2y agoWell yes completely agree. In TFA the author makes some distinctions which seem to me to be more or less arbitrary along these lines. eg Python's "range(min, max,step)" is a ternary operator as far as the author is concerned but but regex substitution "s/pat/subst/flags" is a "datatype constructor" rather than an operator. Not sure why a constructor isn't an operator if range is an operator, especially as the python documentation describes range() as creating an immutable sequence type. > class range(start, stop, step=1) > > Rather than being a function, range is actually an immutable sequence type, as documented in Ranges and Sequence Types — list, tuple, range. https://docs.python.org/3/library/functions.html#func-range https://docs.python.org/3/library/functions.html#func-range From a maths perspective as far as I can see for most "normal maths" an operator is just something which does a mapping between the input domain(s) to the output domain(s) ie it's almost exactly a function. I think when you get to functional analysis there's a more concrete definition in terms of operator algebras but I haven't got there yet myself.
- crdrost 2y agoOn the one hand the n'th derivative operator is clearly a binary operator that you are composing with a function application operator. On the other hand, OP seems to have not noticed that the ternary conditional also has this structure. That is, `f : x` could be syntactic sugar for `f(() => x)` [or perhaps `f(p => p, () => x)` if you like Church encodings] and then there are a few options for meanings of `x ? y` that have `(x ? y) : z` as a conditional.
- seanhunter 2y agoYou need to be able to specify how many derivatives you're taking and what variable(s) you're taking the derivative with respect to. That's two arguments you've partially applied if you have something you can just apply to a function application operator.
- crdrost 2y agoSo I want to clarify that I don't think you're wrong, I just think that that's like saying + is a ternary operator because of course x +^{n} y, which is x plus y n times, and therefore equal to x + (n × y), has three symbols that are related by the terms. When I called this out you started talking now about something a bit different, partial derivatives, which accept two integer indices and not just one. But behold, the symmetrical version of +^n is +^{m, n}, such that x +^{m,n} y = m x + n y. It’s not that any of this is wrong, ya dig? Just that we're counting to three to feel satisfied when there isn't much satisfaction to be gained.
- seanhunter 2y agoGot it. Yes, agree.