Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Variable or constant?

  1. Sep 24, 2008 #1


    User Avatar

    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. jcsd
  3. Sep 24, 2008 #2


    User Avatar
    Staff Emeritus
    Science Advisor

    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.
  4. Sep 25, 2008 #3
    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:
    [tex]f(x) = x^2 - 1[/tex].... the variable x is created by a function definition

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

    * Integrals:
    [tex]\int e^x dx[/tex]... the variable x is created by the integral.

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

    * Logical quantifiers:
    [tex]\forall x: \exists y: x + y = 0[/tex].... create the variables x and y

    * Setbuilder notation:
    [tex]\{x | \sqrt{x} \in \mathbb{Z}, x \in \mathbb{Z} \}[/tex]... 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 "[tex]\exists y: x + y = 0[/tex]" and y, which is defined deeper in the expression only exists for "[tex]x + y = 0[/tex]".

    Variable names are also unimportant. You can just as easily define [tex]f(x) = x^2 - 1[/tex] as [tex]f(y) = y^2 - 1[/tex] and you end up with the same function. (Of course, you have to be careful about doing silly things, like [tex]f(f) = f^2 - 1[/tex]... 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:

    [tex]\forall x: \exists y: x + y = 0[/tex]

    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:

    [tex]\exists y: x + y = 0[/tex]

    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.
  5. Sep 26, 2008 #4


    User Avatar

    Do you take binding as being a quantifier? So unbounded means no quantifier exists?
  6. Sep 26, 2008 #5
    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, [tex]\exists y: x + y = 0[/tex]. The variable x has a quantifier. It's the [tex]\forall[/tex] 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.
  7. Sep 27, 2008 #6


    User Avatar

    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
  8. Sep 27, 2008 #7
    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.
  9. Sep 29, 2008 #8
    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:
  10. Sep 29, 2008 #9


    User Avatar
    Staff Emeritus
    Science Advisor

    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.
  11. Sep 29, 2008 #10
    But if equal things are equal, shouldn't 3.14159.... be a constant whenever [tex]\pi[/tex] 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 [tex]\exists x: x^2 - 4x + 1 = 0[/tex] is *not* a variable while the 'x' in [tex]f(x) = x^2 - 4x + 1[/tex] is.
  12. Sep 29, 2008 #11
    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. :cool:
  13. Sep 29, 2008 #12
    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 [tex]\frac{d}{dx}(au) = a \frac{d}{dx}(u)[/tex] 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 [tex]\epsilon - \delta[/tex] form. The trick with these is to find a value of [tex]\delta[/tex] in terms of [tex]\epsilon[/tex] to satisfy a logical statement such as
    [tex]\forall \epsilon: \exists \delta: \forall y: |x - y| < \epsilon => |f(x) - f(y)| < \delta[/tex]

    (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 [tex]\delta[/tex] in terms of [tex]\epsilon[/tex] is because within the scope of [tex]\delta[/tex], [tex]\epsilon[/tex] is a constant.
  14. Sep 29, 2008 #13
    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.

  15. Sep 29, 2008 #14


    User Avatar
    Staff Emeritus
    Science Advisor

    Hmm. Well, that's a little better. The "x" in [itex]x^2- 4x+ 1= 0[/itex] can be either [itex]2+ \sqrt{3}[/itex] or [itex]2- \sqrt{3}[/itex] so it can vary a little! Not as much as the x in [itex]f(x)= x^2- 4x+ 1[/itex] which can be any real number (or any complex number if the domain of your function is the complex numbers).
  16. Sep 29, 2008 #15
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: Variable or constant?
  1. Constant Variables? (Replies: 2)