Are there any mathematical functions beside +, -, *, / ?

Ok, there are lots of different functions besides add, subtract, multiply and divide.

What I’m asking is are all other functions merely combinations of these four items?

For example:

6! = 654321
10[sup]3[/sup] = 10
10*10

Using other notation certainly decreases the length of an equation when written but if you really wanted to (understanding that some calculations would be insanely huge if written in this fashion) could all equations be written long-hand using only +, -, * and / ?

I am unfamiliar with the extreme math that scientists use having barely touched on Trigonometry in school myself so I don’t know if there has ever been anything else invented math wise besides the four functions I listed.

Well, for that matter, division is just multiplication of fractions and subtraction is just addition of negatives, so I guess technically, you could reduce it to + and *.

Oh, I may have thought of another one. I can’t figure out how to get the square root function using just the signs given in the OP.

Technically, +, -, *, /, etc. are operators, not functions.

There are an infinite number of functions, simply because you can create your own. For example, I will create a function (called Zev() ) which doubles a number.

Thus: Zev(6) = 12.

There are many other mathematical operators. In programming languages, such as c++, you can create your own operators as well. For example, in c++ the ++ operator automatically increments your variable by one. Thus if a = 4, a++ = 5.

Zev Steinhardt

Well, if you take the operators to be functions, I guess you could come up with stuff that can’t be reached immediately. I mean… take the greatest common divisor, e.g. gcd(9,15)=3. You can’t really state that in terms of the operators.

You could also consider non-integer exponentiation… but most stuff is actually manageable through infinite series (sums), as are the trigonometric functions, natural log, etc.

Sorry for confusing functions with operators (if it wasn’t clear already this should help the notion that I am not good at math) but hopefully people will still get the gist of my question.

Well, the square root of a number (x) will give you an answer (y) such that y[sup]2[/sup]=x. As to how to solve for a square root I have no idea if there is a mathematical method or if it is just guess work. E.G. The sqrt of 30=X so…

x=55=25 – Nope
x=6
6=36 – Nope
x=5.5*5.5=30.25 – Nope (but getting closer)
…and so on till you either figure you are close enough or reach for a calculator to get x=5.47722557505 (blah, blah, blah).

That ++ operator seems silly since if a = 4 then a+1 = 5 would seem to do the same thing and it takes the same number of characters. Either way your operator seems to be a shorthand for doing something that ultimately involves only the four operators I mentioned (or even just two as KneadToKnow pointed out). I could write out 123,268! if I wished but it would take me a mighty long time. Nevertheless it is still only shorthand for a string of multiplication.

But isn’t multiplication just a shortcut for addition? If so, does it mean there is only one operator (addition)?

There isn’t just * and +, either, as multiplication is repeated addition.

Any of the root functions are opposites of the power functions, so unless we consider division seperate from multiplication, then roots aren’t different than exponents.

Knead, Newton’s method is a numerical algorithm that can be used to succesively approximate any zero of a differentiable function, and in this case, can be used to find roots of any number. It technically only uses the four standard operators.

Is that you Peano?

Isn’t there really only one operator: the one that gives the successor of a number? And there’s a single constant number: zero?

If you’re asking “what’s the smallest set of functions and constants (nullary functions) that can give me all of arithmetic”, then you’re going down the same road as Peano, but you’ll run into the same wall as Godel.

Yipes! I can’t help but grin at the following image in my mind:

A Physics professor is standing in front of her room of students and they are groaning at the chalk boards filled with field equations that they have been told to solve. The professor says, “I don’t know what all the moaning is about. It’s all just addition!” :smiley:

It figures someone has already been down this road but unfortunately I have no idea what you are talking about (what Peano proposed or what wall Godel ran into).

You’re absolutely correct. a++ is a lot easier to deal with in code than a=a+1.

In any event, other operators include:

% (modulo) operator (the remainder after long division). Thus, 8%3=2

In programming there are other operators that are “psuedo-mathematical.” These include boolean operators ( < > = !=) and the bitwise operators NOT AND and OR.

Zev Steinhardt

That’s cool info to have, erislover. Thanks!

You’re describing an operator that returns the successor of a number, that is:


inc(a) = a + 1

zev described a (postfix) operator that increments a number (by one). The number is actually “mutated”, which isn’t precisely an arithmetic operation. If a were 5 initially, then after a++, a would be 6 (but the value of a++ is (perhaps confusingly) the old value of a).

One way to think of zev’s (postfix) ++ operator is that it is actually a binary (two argument) operator, taking a “store” as an implicit second argument; and that it returns a pair of a number and a new store. The store is a finite function that maps names (variables) to their values. Thus, the (postfix) ++ operator maps a pair of name and store to a pair of number and store:


("a", S)++ = (S("a"), S')

where S’(“a”)=S(“a”)+1, and S’(x)=S(x) for all other variables.

There is also a prefix ++ operator, which returns the new incremented value of the variable:


++("a", S) = (S'("a"), S')

where S’ is defined exactly as above.

These are examples of operators that cannot be easily defined in terms of simple arithmetic operations (you would be required to express a finite function from names to numbers using arithmetical operators).

Assuming multiplication and exponentiation are being counted as separate operators, and not just forms of addition, here’s an infinite set of operators:

a+a+a+ … +a = an
a
aaa = an ( = a[sup]n[/sup] )
a
(a**(a**(… a))) … ) = a
n
a
*(a***(a***( … a))) … ) = a****n
etc…

Sure, ** aren’t very useful beyond the first couple, but there ya go anyway.

Computer langauges and mathematics are two different things. In a computer language like C++ you have something like this:

a=a+1

This of course makes no sense as an algebra equation, but in a computer langauge means calculate everything to the right of the equal sign (a+1) and store it in the variable on the left side of the equal sign (a).

Because you are constantly taking variables and modifying them, the C programming language allows you to use a shorthand notation.

a+=1 translates to a=a+1
a*=7 translates to a=a*7

and similarly for most other operators in C.

In programming, the most common incriment or decrement is by 1, which allows you to loop through arrays and such. Therefore C allows you to take another shortcut, which is to use ++ or – to indicate +=1 and -=1 respectively (saves you 1 more character when you are typing).

So, instead of typing a=a+1 you simply type a++.

Intel processors actually have an incriment operation, so a=a+1 and a++ are actually two different instructions as far as the CPU is concerned.

In computers, the processor basically needs ADD, SUBTRACT, SHIFT, AND, OR, NOT, XOR, and I think that’s about it. From these a CPU can do just about any discrete math function. Note that these could be further reduced (SUBTRACT is just a combination of ADD and NOT for example), but these are all very simply functions to impliment in hardware. Computers multiply and divide using combinations of adds/subtracts and shifts.

One thing programmers quickly learn the hard way is that the math done in computers does not equal the math done on paper. In a computer, if you take 14 and divide it by 50 then multiply it by 50, you will likely get zero as the result (14 divided by 50 is 0 with some remainder which gets lost since computers work in integers, then 0 multiplied by 50 is 0). So be careful comparing computer math to real math!

Nah, it’s all math. :slight_smile:

I would be quite surprised if any modern compiler generated different code for a++ and a=a+1.

All it really needs is the ability to read a symbol from an input tape, and to make a decision based on that symbol and the current “state” about how to write a new symbol on the tape, move the tape head left or right, and enter a new “state”. Oh yeah, and an infinite tape.

Or, if you don’t like that, you only need the ability to abstract over names and bind values to names (the lambda-calculus), or the ability to duplicate values and choose between alternatives (combinatory logic). :wink:

Regarding the OP, I would consider the trigonometric functions (sin(x), cos(x)) and the logaritmic funtions (natural logaritm). Those are based on infinite series…

14/5050 in c++ is the same thing as 14/5050 in “real” math. Since the answer is a floating point number, you have to specify that the integer value will be a float. For example:

float x;
x = 14.0/50.0*50.0;

You can actually construct all of the logic operators from NAND. I think that the same might also be true of XOR.

NAND and NOR are functionally complete. No other single binary (two-argument) boolean functions are.