Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Binary operation
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Mathematical operation with two operands}} {{Distinguish|Bitwise operation}} [[File:Binary operations as black box.svg|thumb|A binary operation <math>\circ</math> is a rule for combining the arguments <math>x</math> and <math>y</math> to produce <math>x\circ y</math>]] In [[mathematics]], a '''binary operation''' or '''dyadic operation''' is a rule for combining two [[Element (mathematics)|elements]] (called [[operands]]) to produce another element. More formally, a binary operation is an [[Operation (mathematics)|operation]] of [[arity]] two. More specifically, a '''binary operation''' on a [[Set (mathematics)|set]] is a [[binary function]] that maps every [[ordered pair|pair]] of elements of the set to an element of the set. Examples include the familiar [[arithmetic operations]] like [[addition]], [[subtraction]], [[multiplication]], set operations like union, complement, intersection. Other examples are readily found in different areas of mathematics, such as [[vector addition]], [[matrix multiplication]], and [[Conjugation (group theory)|conjugation in groups]]. A binary function that involves several sets is sometimes also called a ''binary operation''. For example, [[scalar multiplication]] of [[vector space]]s takes a scalar and a vector to produce a vector, and [[scalar product]] takes two vectors to produce a scalar. Binary operations are the keystone of most [[algebraic structure|structure]]s that are studied in [[algebra]], in particular in [[semigroup]]s, [[monoid]]s, [[group (mathematics)|groups]], [[ring (algebra)|rings]], [[field (mathematics)|fields]], and [[vector space]]s. ==Terminology== More precisely, a binary operation on a [[Set (mathematics)|set]] <math>S</math> is a [[Map (mathematics)|mapping]] of the elements of the [[Cartesian product]] <math>S \times S</math> to <math>S</math>:<ref>{{harvnb|Rotman|1973|loc=pg. 1}}</ref><ref>{{harvnb|Hardy|Walker|2002|loc=pg. 176, Definition 67}}</ref><ref>{{harvnb|Fraleigh|1976|loc= pg. 10}}</ref> :<math>\,f \colon S \times S \rightarrow S.</math> If <math>f</math> is not a [[Function (mathematics)|function]] but a [[partial function]], then <math>f</math> is called a '''partial binary operation'''. For instance, division is a partial binary operation on the set of all [[real numbers]], because one cannot [[Division by zero|divide by zero]]: <math>\frac{a}{0}</math> is undefined for every real number <math>a</math>. In both [[model theory]] and classical [[universal algebra]], binary operations are required to be defined on all elements of <math>S \times S</math>. However, [[partial algebra]]s<ref name="Gratzer2008">{{cite book|author=George A. Grätzer|title=Universal Algebra|url=https://archive.org/details/isbn_9780387774862|url-access=registration|year=2008|publisher=Springer Science & Business Media|isbn=978-0-387-77487-9|at=Chapter 2. Partial algebras|edition=2nd}}</ref> generalize [[universal algebra]]s to allow partial operations. Sometimes, especially in [[computer science]], the term binary operation is used for any [[binary function]]. == Properties and examples == Typical examples of binary operations are the [[addition]] (<math>+</math>) and [[multiplication]] (<math>\times</math>) of [[number]]s and [[matrix (mathematics)|matrices]] as well as [[composition of functions]] on a single set. For instance, * On the set of real numbers <math>\mathbb R</math>, <math>f(a,b)=a+b</math> is a binary operation since the sum of two real numbers is a real number. * On the set of natural numbers <math>\mathbb N</math>, <math>f(a,b)=a+b</math> is a binary operation since the sum of two natural numbers is a natural number. This is a different binary operation than the previous one since the sets are different. * On the set <math>M(2,\mathbb R)</math> of <math>2 \times 2</math> matrices with real entries, <math>f(A,B)=A+B</math> is a binary operation since the sum of two such matrices is a <math>2 \times 2</math> matrix. * On the set <math>M(2,\mathbb R)</math> of <math>2 \times 2</math> matrices with real entries, <math>f(A,B)=AB</math> is a binary operation since the product of two such matrices is a <math>2 \times 2</math> matrix. * For a given set <math>C</math>, let <math>S</math> be the set of all functions <math>h \colon C \rightarrow C</math>. Define <math>f \colon S \times S \rightarrow S</math> by <math>f(h_1,h_2)(c)=(h_1 \circ h_2)(c)=h_1(h_2(c))</math> for all <math>c \in C</math>, the composition of the two functions <math>h_1</math> and <math>h_2</math> in <math>S</math>. Then <math>f</math> is a binary operation since the composition of the two functions is again a function on the set <math>C</math> (that is, a member of <math>S</math>). Many binary operations of interest in both algebra and formal logic are [[commutative]], satisfying <math>f(a,b)=f(b,a)</math> for all elements <math>a</math> and <math>b</math> in <math>S</math>, or [[associative]], satisfying <math>f(f(a,b),c)=f(a,f(b,c))</math> for all <math>a</math>, <math>b</math>, and <math>c</math> in <math>S</math>. Many also have [[identity element]]s and [[inverse element]]s. The first three examples above are commutative and all of the above examples are associative. On the set of real numbers <math>\mathbb R</math>, [[subtraction]], that is, <math>f(a,b)=a-b</math>, is a binary operation which is not commutative since, in general, <math>a-b \neq b-a</math>. It is also not associative, since, in general, <math>a-(b-c) \neq (a-b)-c</math>; for instance, <math>1-(2-3)=2</math> but <math>(1-2)-3=-4</math>. On the set of natural numbers <math>\mathbb N</math>, the binary operation [[exponentiation]], <math>f(a,b)=a^b</math>, is not commutative since, <math>a^b \neq b^a</math> (cf. [[Equation x^y = y^x|Equation x<sup>y</sup> = y<sup>x</sup>]]), and is also not associative since <math>f(f(a,b),c) \neq f(a,f(b,c))</math>. For instance, with <math>a=2</math>, <math>b=3</math>, and <math>c=2</math>, <math>f(2^3,2)=f(8,2)=8^2=64</math>, but <math>f(2,3^2)=f(2,9)=2^9=512</math>. By changing the set <math>\mathbb N</math> to the set of integers <math>\mathbb Z</math>, this binary operation becomes a partial binary operation since it is now undefined when <math>a=0</math> and <math>b</math> is any negative integer. For either set, this operation has a ''right identity'' (which is <math>1</math>) since <math>f(a,1)=a</math> for all <math>a</math> in the set, which is not an ''identity'' (two sided identity) since <math>f(1,b) \neq b</math> in general. [[division (mathematics)|Division]] (<math>\div</math>), a partial binary operation on the set of real or rational numbers, is not commutative or associative. [[Tetration]] (<math>\uparrow\uparrow</math>), as a binary operation on the natural numbers, is not commutative or associative and has no identity element. ==Notation== Binary operations are often written using [[infix notation]] such as <math>a \ast b</math>, <math>a+b</math>, <math>a \cdot b</math> or (by [[Juxtaposition#Mathematics|juxtaposition]] with no symbol) <math>ab</math> rather than by functional notation of the form <math>f(a, b)</math>. Powers are usually also written without operator, but with the second argument as [[superscript]]. Binary operations are sometimes written using prefix or (more frequently) postfix notation, both of which dispense with parentheses. They are also called, respectively, [[Polish notation]] <math>\ast a b</math> and [[reverse Polish notation]] <math>a b \ast</math>. == Binary operations as ternary relations == A binary operation <math>f</math> on a set <math>S</math> may be viewed as a [[ternary relation]] on <math>S</math>, that is, the set of triples <math>(a, b, f(a,b))</math> in <math>S \times S \times S</math> for all <math>a</math> and <math>b</math> in <math>S</math>. == Other binary operations == For example, [[scalar multiplication]] in [[linear algebra]]. Here <math>K</math> is a [[field (mathematics)|field]] and <math>S</math> is a [[vector space]] over that field. Also the [[dot product]] of two vectors maps <math>S \times S</math> to <math>K</math>, where <math>K</math> is a field and <math>S</math> is a vector space over <math>K</math>. It depends on authors whether it is considered as a binary operation. ==See also== * [[:Category:Properties of binary operations]] * {{annotated link|Iterated binary operation}} * {{annotated link|Magma (algebra)}} * {{annotated link|Operator (programming)}} * {{annotated link|Ternary operation}} * {{slink|Truth table#Binary operations}} * {{annotated link|Unary operation}} == Notes== {{Reflist}} == References== * {{citation|last=Fraleigh|first=John B.|title=A First Course in Abstract Algebra|edition=2nd|publisher=Addison-Wesley|place=Reading|year=1976|isbn=0-201-01984-1}} * {{citation|last=Hall|first= Marshall Jr.|title=The Theory of Groups|publisher=Macmillan|place=New York|year=1959}} * {{citation|last1=Hardy|first1=Darel W.|last2=Walker|first2=Carol L.|author2-link=Carol Walker|title=Applied Algebra: Codes, Ciphers and Discrete Algorithms|publisher=Prentice-Hall|place=Upper Saddle River, NJ|year=2002|isbn=0-13-067464-8}} * {{citation|last=Rotman|first=Joseph J.|title=The Theory of Groups: An Introduction|publisher=Allyn and Bacon|place=Boston|year=1973|edition=2nd}} == External links == * {{MathWorld|title=Binary Operation|urlname=BinaryOperation}} {{Mathematical logic}} {{Authority control}} {{DEFAULTSORT:Binary Operation}} [[Category:Binary operations| ]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Annotated link
(
edit
)
Template:Authority control
(
edit
)
Template:Citation
(
edit
)
Template:Cite book
(
edit
)
Template:Distinguish
(
edit
)
Template:Harvnb
(
edit
)
Template:MathWorld
(
edit
)
Template:Mathematical logic
(
edit
)
Template:Reflist
(
edit
)
Template:SfnRef
(
edit
)
Template:Short description
(
edit
)
Template:Slink
(
edit
)