# Variable or constant?

1. Sep 24, 2008

### tgt

Suppose you are given the statement

'there exists x in the real numbers such that x^2-2=0'

Would you say the x is a variable or a constant?

There are two solutions for x so in this case x is a variable?

But what if you're given

'there exists x in the real numbers such that x-2=0'

There is only one solution, x=2. Would you say x is a variable or a constant?

What happens if it's the statement
'there exists (x,y) in the real numbers such that x^2+y^2=0'?
Are x and y treated as variables or constant? It seems variables is the more likely answer.

In all cases, x does seem to act like variables because they could be any real number with the condition that they satisfy the equation.

Last edited: Sep 24, 2008
2. Sep 24, 2008

### HallsofIvy

Roughly speaking, a "variable" is any symbol, represnting something that might conceivably change- even if it turns out to have a specific value. "x" is a variable in that it might take on any value. Of course, once we write "x- 2= 0", we have restricted it to a single value. In that case, I would say it is a number (as opposed to representing a number which it did in any case) but I would not say that x is a constant- later I might lift that restriction and require it satisfy some other condition.

3. Sep 25, 2008

### Tac-Tics

A very interesting question! This is something I think should be taught somewhere in mathematics, but sadly, you just have to pick up on it yourself.

Variables are funny things. They have names (x, y, z) and sometimes, we specify their type as well (integer, real, continuous function)... but variables also have two other properties: a binding form and a scope.

A binding form is a mathematical construct or syntax which creates the variable. We use many in mathematics. Here are the ones you are most familiar with:

* Function definitions:
$$f(x) = x^2 - 1$$.... the variable x is created by a function definition

* Summation:
$$\Sigma_{i=0}^{\infty}\frac{1}{2^n}$$... the variable i is created by the sigma

* Integrals:
$$\int e^x dx$$... the variable x is created by the integral.

*"Let" statements:
Let $$\pi$$ be the ratio of the circumference of a circle to its diameter. Then, the area of a circle is $$\pi r^2$$.... introduces $$\pi$$

* Logical quantifiers:
$$\forall x: \exists y: x + y = 0$$.... create the variables x and y

* Setbuilder notation:
$$\{x | \sqrt{x} \in \mathbb{Z}, x \in \mathbb{Z} \}$$... creates x

Variables can only live for so long. In the summation example, the variable i ceases to exist outside of the expression being summed over. In the case of the logical quantifier, we have two variables with a nested scope. x exists for all of "$$\exists y: x + y = 0$$" and y, which is defined deeper in the expression only exists for "$$x + y = 0$$".

Variable names are also unimportant. You can just as easily define $$f(x) = x^2 - 1$$ as $$f(y) = y^2 - 1$$ and you end up with the same function. (Of course, you have to be careful about doing silly things, like $$f(f) = f^2 - 1$$... we'll ignore those cases for now).

So back to your question. What is the difference between a variable and a constant? The answer is: it depends. You must first choose an expression you wish to analyze. Let's take the quantifier example to start with:

$$\forall x: \exists y: x + y = 0$$

In this expression, both x and y are each "bound" by their own personal binding form. In this case, we call them variables. They don't have a definite value at this point.

But consider this subexpression:

$$\exists y: x + y = 0$$

From this point of view, we can no longer "see" the binding form for x. We say x is unbound. An unbound variable is the same as a constant. We can treat x as if it has a definite, unchanging value.

I want to offer an example in calculus, but it's a little difficult to do using standard mathematics notation. But this technique is well-developed in computer science, namely, in Lambda Calculus.

4. Sep 26, 2008

### tgt

Do you take binding as being a quantifier? So unbounded means no quantifier exists?

5. Sep 26, 2008

### Tac-Tics

Sorta =-)

Unbound means the quantifier binding the variable isn't within the expression you're looking at. Every variable has to come from somewhere (even if it's not explicit).

Taking that last line again, $$\exists y: x + y = 0$$. The variable x has a quantifier. It's the $$\forall$$ in the statement just above it. But while the quantifier exists in the outer expression, it is not in the subexpression that we're interested in.

"Constant-ness" is relative to what expression you're investigating.

6. Sep 27, 2008

### tgt

Did you just show that a variable can become a constant? If not then can it still happen?

What happens if you define a constant in any system? Then that constant was never once a variable? And will continue being a constant in all its sub systems.

Last edited: Sep 27, 2008
7. Sep 27, 2008

### Tac-Tics

It's just a relative property. Like a ball in free space. It could look to you like the ball is at rest or it could look to be in motion. It depends on your point of view.

With the question of whether or not a variable is constant, the difference is your point of view is defined by what expression you're looking at.

I'm not sure quite exactly what you mean, but it sounds like you're talking about what happens when you come across a term "let c be a constant." In this case, calling c a constant is redundant (you could have just as effectively called it a real number or whatever). "Let" is a binding form. In math textbooks, let-expressions are sometimes very large. When you say "let c be a real", it's not unusual for the variable c to exist until the end of the chapter. If it does, then for all theorems or problems that c is used in, c is constant with respect to that theorem or problem.

8. Sep 29, 2008

### M Grandin

Maybe a "constant" could be defined as a "fixed value represented by a symbol" - perhaps what people also spontaneously think? So in formula circle area = PI x r ^2, "PI" is a constant but in expression circle area = 3.141592... x r ^2, "3.141592..." is not a constant
but a specific value. Like exponent "2" is not a constant but a value in the expression.

Of course my point of view is trivial and doesn´t imply something new. :shy:

9. Sep 29, 2008

### HallsofIvy

Strictly speaking, one should only use the word "variable" in talking about functions, not equations. It is better to refer to the "x" in x2= 2 as an "unknown number", not a variable. The "x" in f(x)= x2 is a variable.

10. Sep 29, 2008

### Tac-Tics

But if equal things are equal, shouldn't 3.14159.... be a constant whenever $$\pi$$ is?

They are very much variables even in equations! A variable which parametrizes a function is often called a parameter, of course. But it seems silly to say that the 'x' in $$\exists x: x^2 - 4x + 1 = 0$$ is *not* a variable while the 'x' in $$f(x) = x^2 - 4x + 1$$ is.

11. Sep 29, 2008

### M Grandin

No, I mean "PI" is the label of a constant, while "3.141592..." is a numerical (proximity or exact) value of that constant. The constant symbol represents a theoretically correct value, while the evaluated numerical value may not be exactly true. At least this is my own
non-professional point of view.

12. Sep 29, 2008

### Tac-Tics

But if one were to call such a thing a constant, it would not be a constant in the same sense as used in calculus. When we say that $$\frac{d}{dx}(au) = a \frac{d}{dx}(u)$$ whenever a is a constant.

One more note about the definition of constant I use above that is somewhat implicit. When you have two bound variables in an expression, the "inner" variable (the one bound in the inner-most expression) can take on a value in terms of the outer one.

To illustrate this, in analysis, we often see proofs that follow an $$\epsilon - \delta$$ form. The trick with these is to find a value of $$\delta$$ in terms of $$\epsilon$$ to satisfy a logical statement such as
$$\forall \epsilon: \exists \delta: \forall y: |x - y| < \epsilon => |f(x) - f(y)| < \delta$$

(In this case, proving continuity of f at a point x. Also, note that f and x are constants in this statement!)

The reason we can define $$\delta$$ in terms of $$\epsilon$$ is because within the scope of $$\delta$$, $$\epsilon$$ is a constant.

13. Sep 29, 2008

### M Grandin

Thanks for further interesting comments, Tac-Tics !

Regarding your first derivation rule containing "constant a", I may say that "a" fulfills
my definition of a constant: 1) It is represented by a symbol. 2) It is exactly defined
(as being whatever), and cannot even be replaced by a specific generally yelding value.
So you must stay with your symbol "a" as a not numerically specified value.

Regarding the later part of your post I may return later, when I have studied it closer.

14. Sep 29, 2008

### HallsofIvy

Hmm. Well, that's a little better. The "x" in $x^2- 4x+ 1= 0$ can be either $2+ \sqrt{3}$ or $2- \sqrt{3}$ so it can vary a little! Not as much as the x in $f(x)= x^2- 4x+ 1$ which can be any real number (or any complex number if the domain of your function is the complex numbers).

15. Sep 29, 2008