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

**URL:** <https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491>\
**Category:** Factual Questions\
**Created:** [June 5, 2002, 2:44pm UTC](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491 "2002-06-05T14:44:03Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Whack-a-Mole](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/whack-a-mole/32/141_2.png) [@Whack-a-Mole](https://boards.straightdope.com/u/Whack-a-Mole)\
**Post date:** [June 5, 2002, 2:44pm UTC](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491/1 "2002-06-05T14:44:03Z")

</div>

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! = 6_5_4_3_2_1  
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.

---

<div class="post-metadata">

**Author:** ![KneadToKnow](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/kneadtoknow/32/3999_2.png) [@KneadToKnow](https://boards.straightdope.com/u/KneadToKnow)\
**Post date:** [June 5, 2002, 2:49pm UTC](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491/2 "2002-06-05T14:49:33Z")

</div>

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 \*.

---

<div class="post-metadata">

**Author:** ![KneadToKnow](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/kneadtoknow/32/3999_2.png) [@KneadToKnow](https://boards.straightdope.com/u/KneadToKnow)\
**Post date:** [June 5, 2002, 3:06pm UTC](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491/3 "2002-06-05T15:06:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zev\_steinhardt](https://avatars.discourse-cdn.com/v4/letter/z/97f17d/32.png) [@zev\_steinhardt](https://boards.straightdope.com/u/zev_steinhardt)\
**Post date:** [June 5, 2002, 3:06pm UTC](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491/4 "2002-06-05T15:06:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![KarmaComa](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@KarmaComa](https://boards.straightdope.com/u/KarmaComa)\
**Post date:** [June 5, 2002, 3:14pm UTC](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491/5 "2002-06-05T15:14:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Whack-a-Mole](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/whack-a-mole/32/141_2.png) [@Whack-a-Mole](https://boards.straightdope.com/u/Whack-a-Mole)\
**Post date:** [June 5, 2002, 3:38pm UTC](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491/6 "2002-06-05T15:38:06Z")

</div>

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.

> [@](#):
>
> \*Originally posted by KneadToKnow \*  
> \*\*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. \*\*

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=5_5=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).

> [@](#):
>
> _Originally posted by zev\_steinhardt:_  
> 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.

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.

---

<div class="post-metadata">

**Author:** ![Crafter\_Man](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/crafter_man/32/458_2.png) [@Crafter\_Man](https://boards.straightdope.com/u/Crafter_Man)\
**Post date:** [June 5, 2002, 3:41pm UTC](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491/7 "2002-06-05T15:41:05Z")

</div>

> [@](#):
>
> \*Originally posted by KneadToKnow \*  
> \*\*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 \*. \*\*

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

---

<div class="post-metadata">

**Author:** ![erislover](https://avatars.discourse-cdn.com/v4/letter/e/71e660/32.png) [@erislover](https://boards.straightdope.com/u/erislover)\
**Post date:** [June 5, 2002, 3:45pm UTC](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491/8 "2002-06-05T15:45:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Newton\_meter](https://avatars.discourse-cdn.com/v4/letter/n/57b2e6/32.png) [@Newton\_meter](https://boards.straightdope.com/u/Newton_meter)\
**Post date:** [June 5, 2002, 3:53pm UTC](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491/9 "2002-06-05T15:53:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Whack-a-Mole](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/whack-a-mole/32/141_2.png) [@Whack-a-Mole](https://boards.straightdope.com/u/Whack-a-Mole)\
**Post date:** [June 5, 2002, 4:07pm UTC](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491/10 "2002-06-05T16:07:42Z")

</div>

> [@](#):
>
> \*Originally posted by Crafter\_Man \*  
> \*\*But isn’t multiplication just a shortcut for addition? If so, does it mean there is only one operator (addition)? \*\*

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!” 😃

> [@](#):
>
> _Newton meter wrote:_  
> 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.

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).

---

<div class="post-metadata">

**Author:** ![zev\_steinhardt](https://avatars.discourse-cdn.com/v4/letter/z/97f17d/32.png) [@zev\_steinhardt](https://boards.straightdope.com/u/zev_steinhardt)\
**Post date:** [June 5, 2002, 4:15pm UTC](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491/11 "2002-06-05T16:15:13Z")

</div>

> [@](#):
>
> \*Originally posted by Whack-a-Mole \*  
> \*\*
> 
> 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). \*\*

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

---

<div class="post-metadata">

**Author:** ![KneadToKnow](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/kneadtoknow/32/3999_2.png) [@KneadToKnow](https://boards.straightdope.com/u/KneadToKnow)\
**Post date:** [June 5, 2002, 4:24pm UTC](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491/12 "2002-06-05T16:24:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Newton\_meter](https://avatars.discourse-cdn.com/v4/letter/n/57b2e6/32.png) [@Newton\_meter](https://boards.straightdope.com/u/Newton_meter)\
**Post date:** [June 5, 2002, 4:27pm UTC](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491/13 "2002-06-05T16:27:36Z")

</div>

> [@](#):
>
> \*Originally posted by Whack-a-Mole \*  
> **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.**

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

```auto

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:

```auto

("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:

```auto

++("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).

---

<div class="post-metadata">

**Author:** ![ZenBeam](https://avatars.discourse-cdn.com/v4/letter/z/3ab097/32.png) [@ZenBeam](https://boards.straightdope.com/u/ZenBeam)\
**Post date:** [June 5, 2002, 5:06pm UTC](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491/14 "2002-06-05T17:06:44Z")

</div>

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 = a_n  
a_a_a_ … _a = a**n ( = 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.

---

<div class="post-metadata">

**Author:** ![engineer\_comp\_geek](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/engineer_comp_geek/32/504_2.png) [@engineer\_comp\_geek](https://boards.straightdope.com/u/engineer_comp_geek)\
**Post date:** [June 5, 2002, 5:10pm UTC](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491/15 "2002-06-05T17:10:51Z")

</div>

> [@](#):
>
> \*Originally posted by Whack-a-Mole \*  
> **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.**

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!

---

<div class="post-metadata">

**Author:** ![Newton\_meter](https://avatars.discourse-cdn.com/v4/letter/n/57b2e6/32.png) [@Newton\_meter](https://boards.straightdope.com/u/Newton_meter)\
**Post date:** [June 5, 2002, 6:20pm UTC](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491/16 "2002-06-05T18:20:17Z")

</div>

> [@](#):
>
> \*Originally posted by engineer\_comp\_geek \*  
> **Computer langauges and mathematics are two different things.**

Nah, it’s all math. 🙂

> [@](#):
>
> **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.**

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

> [@](#):
>
> **In computers, the processor basically needs ADD, SUBTRACT, SHIFT, AND, OR, NOT, XOR, and I think that’s about it.**

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). 😉

---

<div class="post-metadata">

**Author:** ![DonJorge](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@DonJorge](https://boards.straightdope.com/u/DonJorge)\
**Post date:** [June 5, 2002, 7:03pm UTC](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491/17 "2002-06-05T19:03:00Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![fallom](https://avatars.discourse-cdn.com/v4/letter/f/a88e57/32.png) [@fallom](https://boards.straightdope.com/u/fallom)\
**Post date:** [June 5, 2002, 7:09pm UTC](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491/18 "2002-06-05T19:09:46Z")

</div>

> [@](#):
>
> \*Originally posted by engineer\_comp\_geek \*  
> \*\*  
> 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! \*\*

14/50_50 in c++ is the same thing as 14/50_50 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;

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [June 5, 2002, 7:12pm UTC](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491/19 "2002-06-05T19:12:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Newton\_meter](https://avatars.discourse-cdn.com/v4/letter/n/57b2e6/32.png) [@Newton\_meter](https://boards.straightdope.com/u/Newton_meter)\
**Post date:** [June 5, 2002, 8:26pm UTC](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491/20 "2002-06-05T20:26:08Z")

</div>

> [@](#):
>
> \*Originally posted by Chronos \*  
> \*\*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.

[Next page](https://boards.straightdope.com/t/are-there-any-mathematical-functions-beside/112491.md?page=2)
