The word variable as used in mathematics (and in other scientific fields that use mathematics) is somewhat vague and may have different meanings depending on the context. Variables are usually denoted by a single Roman or Greek letter, e.g. , although sometimes a whole word or phrase can be used also.
Here is a list of some of the meanings of variable:
- (i) As “mathematical” variables.
These stand for a concrete object, for example, an element of the real numbers That is, when we write the symbol , it is a stand-in for various numbers: e.g. . But we do not name these numbers specifically, because we may want to talk about all these numbers at once, in a general statement, theorem, or proof about numbers.
Sense (i) is probably the most common usage in mainstream mathematics.
- (ii) As placeholders in functional notation.
For example, we may be defining a function using the phrase “define the function for complex numbers . This usage of a variable is slightly different from sense (i), because our objective is to talk about the function , and not its value at a number which is . The notation “” is merely a much more convenient way of saying: “define the function which takes a complex number, multiplies it by itself, and then adds four to it”. It could also be rephrased this way: “define a function such that the statement is true for all complex numbers (in sense (i))”.
On the other hand, the symbol , if we were to contemplate it as a “variable”, arguably belongs to the sense (i); in this case we are talking about some specific function, not all functions.
- (iii) As “formal” variables.
For instance, we may talk about a formal polynomial . This is similar to sense (ii), but is not exactly the same. The variable here is not necessarily a complex number, or in any fixed domain at all. It is a formal symbol, which we later replace by actual elements of the real numbers, or matrices, etc. at our whim. And here is not a function; it is a polynomial.
- (iv) As pieces of (experimental) data.
Used in the sciences. One may say “at , ” which may really mean: “at 4 seconds from the start of the experiment, the object is 23.1 metres to the right of its initial position”.
So the symbols and are being used in the meaning of “time” and “position” in general. There may or may not be a functional relation between the “variables” and . If there is, we might say “ is a function of ”, and we can talk about quantities such as .
If we want to talk about a specific (but unnamed) time, we can use a notation such as “when ” for some variable in sense (i).
The field of probability and statistics follows a similar practice for what are termed “random variables”, which are really functions defined on a measure space . But in practice they are usually denoted with variable notation: e.g. “the random variable ”, and a specific value of this random variable , at some unspecified , is denoted by .
- (v) As state variables in computer algorithms.
In this case, a variable stands for a computer memory location. Or in more abstract language, is a name for a container which may hold some object. The contents of this container may change as time passes or when it is modified by a program that the computer is executing.
In formal language, putting a value in the container is often denoted by notation like “”.
Note that the above distinctions are not always clear-cut. and the same symbol may be used for different purposes at once, which of course, may lead to confusion.