Expressions are commonly distinguished fromformulas: expressions usually denotemathematical objects, whereas formulas are statementsabout mathematical objects.[2] This is analogous tonatural language, where anoun phrase refers to an object, and a wholesentence refers to afact. For example, and are both expressions, while theinequality is a formula. However, formulas are often considered as expressions that can be evaluated to theBoolean valuestrue orfalse.
Toevaluate an expression means to find a numericalvalue equivalent to the expression.[3][4] Expressions can beevaluated orsimplified by replacingoperations that appear in them with their result. For example, the expression simplifies to, and evaluates to
An expression is often used to define afunction, by taking the variables to bearguments, or inputs, of the function, and assigning the output to be the evaluation of the resulting expression.[5] For example, and define the function that associates to each number itssquare plus one. An expression with no variables would define aconstant function. Usually, two expressions are consideredequal orequivalent if they define the same function. Such an equality is called a "semantic equality", that is, both expressions "mean the same thing."
Inelementary algebra, avariable in an expression is aletter that represents a number whose value may change. Toevaluate an expression with a variable means to find the value of the expression when the variable issubstituted with given number. Expressions can besimplified by replacingoperations that appear in them with their result, or by combininglike-terms. Theevaluation of an expression consists of repeating simplification steps until getting eventually a single number.[6]
For example, take the expression; it can be evaluated forx = 3 in the following steps:
, (replace x with 3)
(evaluate the square)
(evaluate the multiplication)
(evaluate the addition)
Aterm is a constant or theproduct of a constant and one or more variables. Some examples include The constant of the product is called thecoefficient. Terms that are either constants or have the same variables raised to the same powers are calledlike terms. If there are like terms in an expression, one can simplify the expression by combining the like terms. One adds the coefficients and keeps the same variable.
Any variable can be classified as being either afree variable or abound variable. For a given combination of values for the free variables, an expression may be evaluated, although for some combinations of values of the free variables, the value of the expression may beundefined. Thus an expression represents anoperation over constants and free variables and whose output is the resulting value of the expression.[7]
For a non-formalized language, that is, in most mathematical texts outside ofmathematical logic, for an individual expression it is not always possible to identify which variables are free and bound. For example, in, depending on the context, the variable can be free and bound, or vice-versa, but they cannot both be free. Determining which value is assumed to be free depends on context andsemantics.[8]
An expression is often used to define afunction, or denotecompositions of functions, by taking the variables to bearguments, or inputs, of the function, and assigning the output to be the evaluation of the resulting expression.[9] For example, and define the function that associates to each number itssquare plus one. An expression with no variables would define aconstant function. In this way, two expressions are said to be equivalent if, for each combination of values for the free variables, they have the same output, i.e., they represent the same function.[10][11] The equivalence between two expressions is called anidentity and is sometimes denoted with
For example, in the expression the variablen is bound, and the variablex is free. This expression is equivalent to the simpler expression12x; that is The value forx = 3 is 36, which can be denoted
Thelanguage of mathematics exhibits a kind ofgrammar (calledformal grammar) about how expressions may be written. There are two considerations for well-definedness of mathematical expressions,syntax andsemantics. Syntax is concerned with the rules used for constructing, or transforming the symbols of an expression without regard to anyinterpretation ormeaning given to them. Expressions that are syntactically correct are calledwell-formed. Semantics is concerned with the meaning of these well-formed expressions. Expressions that are semantically correct are calledwell-defined.
The syntax of mathematical expressions can be described somewhat informally as follows: the allowedoperators must have the correct number of inputs in the correct places (usually written withinfix notation), the sub-expressions that make up these inputs must be well-formed themselves, have a clearorder of operations, etc. Strings of symbols that conform to the rules of syntax are calledwell-formed, and those that are not well-formed are called,ill-formed, and do not constitute mathematical expressions.[12]
For example, inarithmetic, the expression1 + 2 × 3 is well-formed, but
.
is not.
However, being well-formed is not enough to be considered well-defined. For example in arithmetic, the expression is well-formed, but it is not well-defined (seeDivision by zero). Such expressions are calledundefined.
Semantics is the study of meaning.Formal semantics is about attaching meaning to expressions. An expression that defines a uniquevalue or meaning is said to bewell-defined. Otherwise, the expression is said to be ill defined or ambiguous.[13] In general the meaning of expressions is not limited to designating values; for instance, an expression might designate a condition, or anequation that is to be solved, or it can be viewed as an object in its own right that can be manipulated according to certain rules. Certain expressions that designate a value simultaneously express a condition that is assumed to hold, for instance those involving the operator to designate an internaldirect sum.
Inalgebra, an expression may be used to designate a value, which might depend on values assigned tovariables occurring in the expression. The determination of this value depends on thesemantics attached to the symbols of the expression. The choice of semantics depends on the context of the expression. The same syntactic expression1 + 2 × 3 can have different values (mathematically 7, but also 9), depending on theorder of operations implied by the context (See alsoOperations § Calculators).
Forreal numbers, the product is unambiguous because; hence the notation is said to bewell defined.[13] This property, also known asassociativity of multiplication, guarantees the result does not depend on the sequence of multiplications; therefore, a specification of the sequence can be omitted. Thesubtraction operation is non-associative; despite that, there is a convention that is shorthand for, thus it is considered "well-defined". On the other hand,Division is non-associative, and in the case of, parenthesization conventions are not well established; therefore, this expression is often considered ill-defined.
Unlike with functions, notational ambiguities can be overcome by means of additional definitions (e.g., rules ofprecedence, associativity of the operator). For example, in the programming languageC, the operator- for subtraction isleft-to-right-associative, which means thata-b-c is defined as(a-b)-c, and the operator= for assignment isright-to-left-associative, which means thata=b=c is defined asa=(b=c).[14] In the programming languageAPL there is only one rule: fromright to left – but parentheses first.
The term 'expression' is part of thelanguage of mathematics, that is to say, it is not definedwithin mathematics, but taken as aprimitive part of the language. To attempt to define the term would not be doing mathematics, but rather, one would be engaging in a kind ofmetamathematics (themetalanguage of mathematics), usuallymathematical logic. Within mathematical logic, mathematics is usually described as a kind offormal language, and a well-formed expression can bedefined recursively as follows:[7]
A set of individual variables: Acountably infinite amount of symbols representingvariables used for representing an unspecified object in the domain. (Usually letters likex, ory)
A set of operations:Function symbols representingoperations that can be performed on elements over the domain, like addition (+), multiplication (×), or set operations like union (∪), or intersection (∩). (Functions can be understood asunary operations)
Brackets ( )
With this alphabet, the recursive rules for forming a well-formed expression (WFE) are as follows:
Any constant or variable as defined are theatomic expressions, the simplest well-formed expressions (WFE's). For instance, the constant or the variable are syntactically correct expressions.
For instance, if the domain of discourse is thereal numbers, can denote thebinary operation +, then is well-formed. Or can be the unary operation so is well-formed.
Brackets are initially around each non-atomic expression, but they can be deleted in cases where there is a definedorder of operations, or where order doesn't matter (i.e. where operations areassociative).
A well-formed expression can be thought as asyntax tree.[15] Theleaf nodes are always atomic expressions. Operations and have exactly two child nodes, while operations, and have exactly one. There are countably infinitely many WFE's, however, each WFE has a finite number of nodes.
Incomputer algebra, formulas are viewed as expressions that can be evaluated as a Boolean, depending on the values that are given to the variables occurring in the expressions. For example takes the valuefalse ifx is given a value less than 1, and the valuetrue otherwise.
Expressions are often contrasted withstatements—syntactic entities that have no value (an instruction).
Representation of the expression(8 − 6) × (3 + 1) as aLisp tree, from a 1985 Master's Thesis[18]
Except fornumbers andvariables, every mathematical expression may be viewed as the symbol of an operator followed by asequence of operands. In computer algebra software, the expressions are usually represented in this way. This representation is very flexible, and many things that seem not to be mathematical expressions at first glance, may be represented and manipulated as such. For example, an equation is an expression with "=" as an operator, amatrix may be represented as an expression with "matrix" as an operator and its rows as operands.
Acomputation is any type ofarithmetic or non-arithmeticcalculation that is "well-defined".[19] The notion that mathematical statements should be 'well-defined' had been argued by mathematicians since at least the1600s,[20] but agreement on a suitable definition proved elusive.[21] A candidate definition was proposed independently by several mathematicians in the 1930s.[22] The best-known variant was formalised by the mathematicianAlan Turing, who defined a well-defined statement or calculation as any statement that could be expressed in terms of the initialisation parameters of aTuring machine.[23][page needed] Turing's definition apportioned "well-definedness" to a very large class of mathematical statements, including all well-formedalgebraic statements, and all statements written in modern computer programming languages.[24]
Despite the widespread uptake of this definition, there are some mathematical concepts that have no well-defined characterisation under this definition. This includesthe halting problem andthe busy beaver game. It remains an open question as to whether there exists a more powerful definition of 'well-defined' that is able to capture both computable and 'non-computable' statements.[a][25] All statements characterised in modern programming languages are well-defined, includingC++,Python, andJava.[24]
Common examples of computation are basicarithmetic and theexecution of computeralgorithms. Acalculation is a deliberate mathematical process that transforms one or more inputs into one or more outputs orresults. For example,multiplying 7 by 6 is a simple algorithmic calculation. Extracting thesquare root or thecube root of a number using mathematical models is a more complex algorithmic calculation.
Expressions can be computed by means of anevaluation strategy.[26] To illustrate, executing a function callf(a,b) may first evaluate the argumentsa andb, store the results inreferences or memory locationsref_a andref_b, then evaluate the function's body with those references passed in. This gives the function the ability to look up the original argument values passed in through dereferencing the parameters (some languages use specific operators to perform this), to modify them viaassignment as if they were local variables, and to return values via the references. This is the call-by-reference evaluation strategy.[27] Evaluation strategy is part of the semantics of the programming language definition. Some languages, such asPureScript, have variants with different evaluation strategies. Somedeclarative languages, such asDatalog, support multiple evaluation strategies. Some languages define acalling convention.
Inrewriting, areduction strategy or rewriting strategy is a relation specifying a rewrite for each object or term, compatible with a given reduction relation. A rewriting strategy specifies, out of all the reducible subterms (redexes), which one should be reduced (contracted) within a term. One of the most common systems involveslambda calculus.
In the former case, polynomials are evaluated usingfloating-point arithmetic, which is not exact. Thus different schemes for the evaluation will, in general, give slightly different answers. In the latter case, the polynomials are usually evaluated in afinite field, in which case the answers are always exact.
For evaluating theunivariate polynomial the most naive method would use multiplications to compute, use multiplications to compute and so on for a total of multiplications and additions. Using better methods, such asHorner's rule, this can be reduced to multiplications and additions. If some preprocessing is allowed, even more savings are possible
Apolynomial is an expression built withscalars (numbers of elements of some field),variables, and the operators of addition, multiplication, and exponentiation to nonnegative integer powers; for example
Usingassociativity,commutativity anddistributivity, every polynomial expression is equivalent to apolynomial, that is an expression that is alinear combination of products of integer powers of the indeterminates. For example the above polynomial expression is equivalent (denote the same polynomial as
Many author do not distinguish polynomials and polynomial expressions. In this case the expression of a polynomial expression as a linear combination is called thecanonical form,normal form, orexpanded form of the polynomial.
Aformal expression is a kind ofstring ofsymbols, created by the sameproduction rules as standard expressions, however, they are used without regard to the meaning of the expression. In this way, twoformal expressions are considered equal only if they aresyntactically equal, that is, if they are the exact same expression.[29][30] For instance, the formal expressions "2" and "1+1" are not equal.
The equivalence of two lambda expressions isundecidable (but seeunification (computer science)). This is also the case for the expressions representing real numbers, which are built from the integers by using the arithmetical operations, the logarithm and the exponential (Richardson's theorem).
The earliest written mathematics likely began withtally marks, where each mark represented one unit, carved into wood or stone. An example of earlycounting is theIshango bone, found near theNile and dating back over20,000 years ago, which is thought to show a six-monthlunar calendar.[32]Ancient Egypt developed a symbolic system usinghieroglyphics, assigning symbols for powers of ten and using addition and subtraction symbols resembling legs in motion.[33][34] This system, recorded in texts like theRhind Mathematical Papyrus (c. 2000–1800 BC), influenced otherMediterranean cultures. InMesopotamia, a similar system evolved, with numbers written in a base-60 (sexagesimal) format onclay tablets written inCuneiform, a technique originating with theSumerians around 3000 BC. This base-60 system persists today in measuring time andangles.
The "syncopated" stage of mathematics introduced symbolic abbreviations for commonly used operations and quantities, marking a shift from purelygeometric reasoning.Ancient Greek mathematics, largely geometric in nature, drew onEgyptian numerical systems (especiallyAttic numerals),[35] with little interest in algebraic symbols, until the arrival ofDiophantus ofAlexandria,[36] who pioneered a form ofsyncopated algebra in hisArithmetica, which introduced symbolic manipulation of expressions.[37] His notation represented unknowns and powers symbolically, but without modern symbols forrelations (such asequality orinequality) orexponents.[38] An unknown number was called.[39] The square of was; the cube was; the fourth power was; the fifth power was; and meant to subtract everything on the right from the left.[40] So for example, what would be written in modern notation as:Would be written in Diophantus's syncopated notation as:
In the 7th century,Brahmagupta used different colours to represent the unknowns in algebraic equations in theBrāhmasphuṭasiddhānta. Greek and other ancient mathematical advances, were often trapped in cycles of bursts of creativity, followed by long periods of stagnation, but this began to change as knowledge spread in theearly modern period.
^Stoll, Robert R. (1963).Set Theory and Logic. San Francisco, CA: Dover Publications.ISBN978-0-486-63829-4.{{cite book}}:ISBN / Date incompatibility (help)
^Oxford English Dictionary, s.v. "Evaluate (v.), sense a", "Mathematics. To work out the ‘value’ of (a quantitative expression); to find a numerical expression for (any quantitative fact or relation)."
^Oxford English Dictionary, s.v. “Simplify (v.), sense 4.a”, "To express (an equation or other mathematical expression) in a form that is easier to understand, analyse, or work with, e.g. by collecting like terms or substituting variables."
^Stoll, Robert R. (1963).Set Theory and Logic. San Francisco, CA: Dover Publications.ISBN978-0-486-63829-4.{{cite book}}:ISBN / Date incompatibility (help)
^abWeisstein, Eric W."Well-Defined". From MathWorld – A Wolfram Web Resource. Retrieved2013-01-02.
^abDavis, Martin; Davis, Martin D. (2000).The Universal Computer. W. W. Norton & Company.ISBN978-0-393-04785-1.
^Davis, Martin (2006). "Why there is no such discipline as hypercomputation".Applied Mathematics and Computation.178 (1):4–7.doi:10.1016/j.amc.2005.09.066.
^Marshack, Alexander (1991).The Roots of Civilization, Colonial Hill, Mount Kisco, NY.
^Encyclopædia Americana. By Thomas Gamaliel Bradford. Pg314
^Mathematical Excursion, Enhanced Edition: Enhanced Webassign Edition By Richard N. Aufmann, Joanne Lockwood, Richard D. Nation, Daniel K. Cleg. Pg186
^Mathematics and Measurement By Oswald Ashton Wentworth Dilk. Pg14
^Diophantine Equations. Submitted by: Aaron Zerhusen, Chris Rakes, & Shasta Meece. MA 330-002. Dr. Carl Eberhart. 16 February 1999.
^Boyer (1991). "Revival and Decline of Greek Mathematics". pp. 180-182. "In this respect it can be compared with the great classics of the earlier Alexandrian Age; yet it has practically nothing in common with these or, in fact, with any traditional Greek mathematics. It represents essentially a new branch and makes use of a different approach. Being divorced from geometric methods, it resembles Babylonian algebra to a large extent. But whereas Babylonian mathematicians had been concerned primarily with approximate solutions of determinate equations as far as the third degree, the Arithmetica of Diophantus (such as we have it) is almost entirely devoted to the exact solution of equations, both determinate and indeterminate. [...] Throughout the six surviving books of Arithmetica there is a systematic use of abbreviations for powers of numbers and for relationships and operations. An unknown number is represented by a symbol resembling the Greek letter ζ {\displaystyle \zeta } (perhaps for the last letter of arithmos). [...] It is instead a collection of some 150 problems, all worked out in terms of specific numerical examples, although perhaps generality of method was intended. There is no postulation development, nor is an effort made to find all possible solutions. In the case of quadratic equations with two positive roots, only the larger is give, and negative roots are not recognized. No clear-cut distinction is made between determinate and indeterminate problems, and even for the latter for which the number of solutions generally is unlimited, only a single answer is given. Diophantus solved problems involving several unknown numbers by skillfully expressing all unknown quantities, where possible, in terms of only one of them."
^Boyer (1991). "Revival and Decline of Greek Mathematics". p. 178. "The chief difference between Diophantine syncopation and the modern algebraic notation is the lack of special symbols for operations and relations, as well as of the exponential notation."
^A History of Greek Mathematics: From Aristarchus to Diophantus. By Sir Thomas Little Heath. Pg456
^A History of Greek Mathematics: From Aristarchus to Diophantus. By Sir Thomas Little Heath. Pg458