In
mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
, an expression or mathematical expression is a finite combination of
symbols
A symbol is a mark, sign, or word that indicates, signifies, or is understood as representing an idea, object, or relationship. Symbols allow people to go beyond what is known or seen by creating linkages between otherwise very different co ...
that is
well-formed according to rules that depend on the context. Mathematical symbols can designate numbers (
constants),
variables,
operation
Operation or Operations may refer to:
Arts, entertainment and media
* ''Operation'' (game), a battery-operated board game that challenges dexterity
* Operation (music), a term used in musical set theory
* ''Operations'' (magazine), Multi-Man ...
s,
functions,
brackets, punctuation, and grouping to help determine
order of operations
In mathematics and computer programming, the order of operations (or operator precedence) is a collection of rules that reflect conventions about which procedures to perform first in order to evaluate a given mathematical expression.
For examp ...
and other aspects of
logical syntax.
Many authors distinguish an expression from a ''
formula
In science, a formula is a concise way of expressing information symbolically, as in a mathematical formula or a ''chemical formula''. The informal use of the term ''formula'' in science refers to the general construct of a relationship betwe ...
'', the former denoting a
mathematical object, and the latter denoting a statement about mathematical objects. For example,
is an expression, while
is a formula. However, in modern mathematics, and in particular in
computer algebra
In mathematics and computer science, computer algebra, also called symbolic computation or algebraic computation, is a scientific area that refers to the study and development of algorithms and software for manipulating mathematical expressions ...
, formulas are viewed as expressions that can be evaluated to ''true'' or ''false'', depending on the values that are given to the variables occurring in the expressions. For example
takes the value ''false'' if is given a value less than –1, and the value ''true'' otherwise.
Examples
The use of expressions ranges from the simple:
::
::
(
linear polynomial)
::
(
quadratic polynomial)
::
(
rational fraction)
to the complex:
::
Syntax versus semantics
Syntax
An expression is a syntactic construct. It must be
well-formed: the allowed
operators must have the correct number of inputs in the correct places, the characters that make up these inputs must be valid, have a clear
order of operations
In mathematics and computer programming, the order of operations (or operator precedence) is a collection of rules that reflect conventions about which procedures to perform first in order to evaluate a given mathematical expression.
For examp ...
, etc. Strings of symbols that violate the rules of syntax are not well-formed and are not valid mathematical expressions.
For example, in the
usual notation of
arithmetic
Arithmetic () is an elementary part of mathematics that consists of the study of the properties of the traditional operations on numbers— addition, subtraction, multiplication, division, exponentiation, and extraction of roots. In the 19th ...
, the expression ''1 + 2 × 3'' is well-formed, but the following expression is not:
:
.
Semantics
Semantics is the study of meaning. Formal semantics is about attaching meaning to expressions.
In
algebra
Algebra () is one of the broad areas of mathematics. Roughly speaking, algebra is the study of mathematical symbols and the rules for manipulating these symbols in formulas; it is a unifying thread of almost all of mathematics.
Elementary ...
, an expression may be used to designate a value, which might depend on values assigned to
variables occurring in the expression. The determination of this value depends on the
semantics
Semantics (from grc, σημαντικός ''sēmantikós'', "significant") is the study of reference, meaning, or truth. The term can be used to refer to subfields of several distinct disciplines, including philosophy, linguistics and comput ...
attached to the symbols of the expression. The choice of semantics depends on the context of the expression. The same syntactic expression ''1 + 2 × 3'' can have different values (mathematically 7, but also 9), depending on the
order of operations
In mathematics and computer programming, the order of operations (or operator precedence) is a collection of rules that reflect conventions about which procedures to perform first in order to evaluate a given mathematical expression.
For examp ...
implied by the context (See also
Operations § Calculators).
The semantic rules may declare that certain expressions do not designate any value (for instance when they involve division by 0); such expressions are said to have an undefined value, but they are well-formed expressions nonetheless. In general the meaning of expressions is not limited to designating values; for instance, an expression might designate a condition, or an
equation
In mathematics, an equation is a formula that expresses the equality of two expressions, by connecting them with the equals sign . The word ''equation'' and its cognates in other languages may have subtly different meanings; for example, in F ...
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 internal
direct sum.
Formal languages and lambda calculus
Formal languages allow
formalizing the concept of well-formed expressions.
In the 1930s, a new type of expressions, called
lambda expressions, were introduced by
Alonzo Church and
Stephen Kleene for formalizing
functions and their evaluation. They form the basis for
lambda calculus
Lambda calculus (also written as ''λ''-calculus) is a formal system in mathematical logic for expressing computation based on function abstraction and application using variable binding and substitution. It is a universal model of computation th ...
, a
formal system
A formal system is an abstract structure used for inferring theorems from axioms according to a set of rules. These rules, which are used for carrying out the inference of theorems from axioms, are the logical calculus of the formal system.
A fo ...
used in
mathematical logic
Mathematical logic is the study of formal logic within mathematics. Major subareas include model theory, proof theory, set theory, and recursion theory. Research in mathematical logic commonly addresses the mathematical properties of forma ...
and the
theory of programming languages.
The equivalence of two lambda expressions is
undecidable. 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).
Variables
Many mathematical expressions include
variables. Any variable can be classified as being either a
free variable or a
bound 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 be undefined. Thus an expression represents a
function whose inputs are the values assigned to the free variables and whose output is the resulting value of the expression.
For example, the expression
:
evaluated for ''x'' = 10, ''y'' = 5, will give 2; but it is
undefined for ''y'' = 0.
The evaluation of an expression is dependent on the definition of the mathematical operators and on the system of values that is its context.
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. Example:
The expression
:
has
free variable ''x'', bound variable ''n'', constants 1, 2, and 3, two occurrences of an implicit multiplication operator, and a summation operator. The expression is equivalent to the simpler expression 12''x''. The value for ''x'' = 3 is 36.
See also
*
Algebraic closure
*
Algebraic expression In mathematics, an algebraic expression is an expression built up from integer constants, variables, and the algebraic operations (addition, subtraction, multiplication, division and exponentiation by an exponent that is a rational number). ...
*
Analytic expression
*
Closed-form expression
In mathematics, a closed-form expression is a mathematical expression that uses a finite number of standard operations. It may contain constants, variables, certain well-known operations (e.g., + − × ÷), and functions (e.g., ''n''th r ...
*
Combinator
Combinatory logic is a notation to eliminate the need for quantified variables in mathematical logic. It was introduced by Moses Schönfinkel and Haskell Curry, and has more recently been used in computer science as a theoretical model of com ...
*
Computer algebra expression
*
Defined and undefined
*
Equation
In mathematics, an equation is a formula that expresses the equality of two expressions, by connecting them with the equals sign . The word ''equation'' and its cognates in other languages may have subtly different meanings; for example, in F ...
*
Expression (programming)
*
Formal grammar
*
Formula
In science, a formula is a concise way of expressing information symbolically, as in a mathematical formula or a ''chemical formula''. The informal use of the term ''formula'' in science refers to the general construct of a relationship betwe ...
*
Functional programming
In computer science, functional programming is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions tha ...
*
Logical expression
*
Term (logic)
*
Well-defined expression
Notes
References
*
{{Mathematical logic
Abstract algebra
Logical expressions
Elementary algebra