Unary Operations Vs Unary function

1.2k Views Asked by At

Im very confused with unary operations. I have read from WikiPedia and many other sites what unary operations are. Specifically...

In mathematics, a unary operation is an operation with only one operand, i.e. a single input. An example is a function $f: A \to A$, where $A$ is a set. The function $f$ is a unary operation on $A$.

Common notations are prefix notation (e.g. $+$$−$$\neg$), postfix notation (e.g. factorial $n!$), functional notation (e.g. $\sin x$ or $\sin(x)$), and superscripts (e.g. transpose $A^T$). Other notations exist as well. For example, in the case of the square root, a horizontal bar extending the square root sign over the argument can indicate the extent of the argument.

I don't understand why trigonometric functions, logarithms, square root etc. are considered unary operations.

Can you make more accessible to me? Thank you.

3

There are 3 best solutions below

2
On

Your title suggests you are wondering about the difference between "unary operation" and "unary function". There is no difference. An operation is just a special type of function.

3
On

Unary operations of the form $f : A\to A$ take in one element of the base set and spit out another element. In the case of the trigonometric functions, $A=\mathbb R$, so e.g. the sine function takes in a real number (the angle) and spits out another real number (its sine). This is true for all other trigonometric functions, with a few caveats. Similarly, the logarithm function takes in a single (positive) real number (some $x$) and outputs another real number (the exponent $y$ such that $x= e^y$).

Both the trig functions and the logarithm are written in functional notation when acting on an argument: $f(x) $, where $f$ is some symbol that identifies the function (for the tangent it’s usually $\tan$, for the logarithm it can be either $\log$ or $\ln$). Sometimes, when the argument of the function is simple enough, the parentheses are dropped: $\cos x$, $\ln 4x$, but when ambiguities may arise it is better to use them: $$\cos (x + 3) \quad \mathit{non} \quad \cos x + 3; \qquad \ln(4x) - 1 \quad \mathit{non} \quad \ln 4x -1.$$

The square root does the same thing as the others (it takes in a positive number $x$ and outputs the number $y$ such that $y^2=x$), but is usually notated a bit differently: instead of an expression like $\mathrm{sqrt}(x^2 + 3) - x$, you will find $$ \sqrt{x^2 + 3}-x$$ where the elongated line above the argument indicates how far it extends (it includes $x^2+3$, but not $-x$).

All of these functions are called unary operations because they take in a single argument. There are functions which may take in two, or even $n$-many, which are called binary and $n$-ary operations accordingly. An example of binary operator is the addition operator, which takes in two values and outputs another value: it is rarely denoted in functional notation $+(a,b)$ and more commonly like $a+b$. Due to its associativity it can be trivially extended to an $n$-ary operator.

0
On

An $n$-ary (unary, binary, ternary, etc...) operation on $A$ is a function which takes as input points in $A^n$. It may have different properties, and stone of them are named. For instance, we call it closed if the image of the function is contained in $A$.