Operations

You’re certainly already familiar with several mathematical operations, such as addition, subtraction, multiplication, and division. You may also be familiar with the logical operations AND, OR, NOT, XOR, and IF…THEN. More generally, an operation can be defined on any nonempty set. Operations have the following properties.

  • An operation is a function that takes some number of inputs and produces an output.
  • The input and output are elements of the set in question.
  • Operations often use infix notation, like 1+2, rather than prefix notation, like f(x,y). This is just a difference in the way things are written.
  • As a function or mapping, an operation can be defined by its graph Γ. This is a set of ordered n-tuples containing inputs and their output. For example, the equation 1+2=3 corresponds to the ordered triple (1,2,3).
  • Operations are often categorized by the number of inputs. A unary operation has one input, a binary operation has two inputs, a ternary operation has three inputs, and so on.

Arithmetic operations

We’ve already discussed a few of the most common examples of operations. Addition is defined for all number systems and “number-like” systems. Subtraction is defined for the integers and other number systems, but not for the natural numbers or whole numbers. Multiplication is defined for “most” number-like systems. Division is defined for the rational numbers and other numbers but not the integers. Notably, matrices have addition, subtraction, and multiplication, but matrix multiplication is noncommutative. In other words, AxB≠BxA. Most of the examples we’ve seen have been binary operations, with the exception of “minus sign” or negating which is unary.

Notice that these operations can be chained together, like 1+2+3+4+5. This is not a separate, quinary version of addition, but rather results from addition being associative. This means that:

1+(2+(3+(4+5)))=(((1+2)+3)+4)+5

All the examples so far have been associative. Most operations in regular use are.

Logical operations

Boolean logical operations are defined on the set {T, F} or sometimes {0, 1}.

In logic, all the usual operations can be defined in terms of just one. There are multiple single operations that can be used for this. For example, we can define NOT, AND, OR, etc. in terms of NAND (i.e. NOT AND) also known as the Sheffer stroke. Let’s look at how this works.

  • NOT P can be defined as P NAND P. When P is true, P AND P is true, so P NAND P is false. When P is false, P AND P is false, so P NAND P is true.
  • AND can be defined as NOT NAND (now that we’ve defined NOT).
  • P OR Q can be defined as (NOT P) NAND (NOT Q). This can be verified using De Morgan’s laws.
  • It goes similarly for other logical operations.

Alternatively, we can define all the logical operations in terms of NOR in a very similar manner. This fact has practical applications. NASA’s Apollo Guidance Computer had complex logic built only from NOR gates, a type of electrical circuit (Hall 1972 p. 62).

Geometric operations

Geometric transformations can be considered operations on coordinate points. This is a crucial part of analytic geometry. In the xy plane, transformations can be considered binary operations on x and y. For example, the transformation

(x, y) → (-x, y)

is a reflection across the y-axis, while

(x, y) → (x + 3, y – 1)

is a translation 3 units to the right and 1 unit down. Other transformations include rotation and dilation. Transformations can get more complicated though, and theoretically could involve many types of functions. For example one might see something like

(x, y) → (5x2y – 2xyy2 + 4, xy2 – 1)

and in fact all of our examples here have been polynomials of x and y. This is useful because polynomials can be represented by matrices.

In general, any transformation that can be represented by a matrix is called a linear transformation. These “operations” are useful in a wide variety of applications including computer graphics and GIS systems and can be calculated quickly by computers, especially graphics cards. (See d’Eon 2007 for example.)

References

D’Eon, E. (2007). Chapter 42. Deformers. GPU Gems. https://developer.nvidia.com/gpugems/gpugems/part-vi-beyond-triangles/chapter-42-deformers

Hall, E. C. (1972). MIT’s Role in Project Apollo. Volume III: Computer Subsystem. https://ibiblio.org/apollo/hrst/archive/1029.pdf

Leave a comment