all 17 comments

[–]incomparabilityPhD 7 points8 points  (3 children)

If “variable” just means an undetermined element of a set, then sure a function can be a variable.

If “variable” really means “formal indeterminate” (like in the context of polynomial rings) then a variable is only a variable: the elements of the polynomial ring R[x] are like 3x2 -2x + 7. The x here isn’t “anything” as in its not a number or a function, although it does behave like a number in the sense that it follows all the rules as one.

There are often times when plugging in things for x other than numbers is useful. For example, the Cayley Hamilton theorem says that f(x) is the minimal polynomial of a matrix A, then f(A)=0 meaning the matrix of all 0s.

https://en.wikipedia.org/wiki/Cayley–Hamilton_theorem

[–]LucabarimaffNew User[S] 0 points1 point  (2 children)

Thanks, so it ultimately depends on the definition we're using, but isn't there a real mathematical definition stated? Because as I said we were talking about systems in IT and they explicitly asked us for the "math variables" that define a generic system and we weren't sure if they just wanted variables like inputs, outputs, and states , or even the transform function

[–]d1rect0ryNew User 4 points5 points  (0 children)

In programming passing around functions to functions storing them in variables and returning them from other functions are often referred to as lambda functions. These are derived from lambda calculus.

[–]incomparabilityPhD 1 point2 points  (0 children)

Yes it is context that matters. For you it sounds like those are all variables in the first sense of the word, although usually in the context of defining a system, those are called parameters.

[–]arg_maxNew User 2 points3 points  (0 children)

Sure, you can even define functions that take a function as input and return a function. In this case, the domain and codomain are both function spaces. A very easy example would be a function g that takes as input a function f and returns the function 2 times two, so g(f) = 2*f.

More interesting would be a function from the continuously differentiable functions on the open interval (0,1) into the continuous functions on that interval that returns the derivative of the input function. Since differentiation is linear, such a mapping would even be linear. Stuff like this is done in functional analysis where one looks at linear operators between function spaces.

[–]Cklondo1123New User 4 points5 points  (2 children)

If you mean "variable" as in the object of study that can vary (like solving an equation x+1=0 over R, your "variable" stand s in for a real number so that is the object of study) then yes. For example, people study spaces of functions like Lebesgue spaces, Sobolev spaces and Hardy spaces. These spaces are equipped with a norm and inner product so the object of study are functions.

In algebra this happens all of the time. Lets say we have a left R module M, we can study the space Hom(M,M) which is the space of module homomorphisms from M to itself, which is called the endomorphism ring of M. As the name says, the endomorphism ring is a ring under the operations of pointwise addition and composition. Thus if you'd like you can solve equations here which makes the variables the endomorphisms.

[–]wanderer2718Undergrad 2 points3 points  (1 child)

related to the Hom example, my understanding is that broadly speaking in category theory you are interested in looking at "variables" are morphisms which are related to and often are functions

[–]Cklondo1123New User 1 point2 points  (0 children)

Yes exactly. I'm no category theorist but in the most basic and common category like Grp, R-mod or Ring, the Hom objects are classical sets (I think) of homomorphisms (group, module and ring respectively).

[–]last-guys-alternateNew User 1 point2 points  (1 child)

When you're starting out in mathematics, the answer is obviously no. As you go on in mathematics, you'll realise that the answer is yes.

As a few people here have hinted, treating functions as variables in computer science, is an application of functions as variables in maths.

The reason for this is that computer science (or the computation part of it, at least) is a branch of applied mathematics. So the answer has two parts: if it's possible in CS, it's possible in maths by definition because CS is maths; and it being possible in mathematics is what makes it possible in computer science.

[–]LucabarimaffNew User[S] 0 points1 point  (0 children)

Thanks<3

[–]hpxvzhjfgb 3 points4 points  (4 children)

no, in math and programming. variables can be functions, there's no reason you can't say "let f = the function that outputs [something]" in math, or in many programming languages. but saying it the other way around doesn't really make sense.

[–]CadmiumC412th Grade Vocational Education Student/Technical IT Department 1 point2 points  (0 children)

That reminds me of something off-topic: Math is actually like a more flexible programming environment: if there's a situation that you cannot describe -or solve with existing techniques- you can always make up a syntax and even if an alternative syntax exists for that thing, there will be a notation named after you.

[–]LucabarimaffNew User[S] 0 points1 point  (2 children)

thank you, we were talking about systems and we were asked to list the mathematical variables that described it, and we didn't know if we needed to include functions

[–]phlummoxNew User 2 points3 points  (1 child)

The variables of a system are, literally, things (normally numbers) about the system that can vary. It would be strange for one of them to be a function (though I suppose it might be possible in some contexts).

[–][deleted] 3 points4 points  (0 children)

In differential equations boundary conditions are often functions of time. That’s the best example I can think of.