Defining an operation such that ##1+2+3=123##

  • B
  • Thread starter Saracen Rue
  • Start date
In summary, there is a need to define an operation that "joins" two numbers instead of adding them, which is called concatenation. This operation is often used in computer languages for strings or text but there is no standardized symbol for it in other fields. The suggested symbol is the plus '+' symbol, with quotes used to differentiate it from numerical addition. In some computer languages, the addition operator is used for concatenation, causing some debate among purists. In Python, there are multiple ways to concatenate strings and there are various examples of string concatenation in different programming languages.
  • #1
Saracen Rue
150
10
Firstly, I'm aware that title doesn't really make sense but stick with me on this. I'm trying to find a way to define an operation which will "join" two numbers instead of adding them. So for example, ##12+34=1234##. Ideally, it would be great if it also had something similar to sigma notation, like so:
$$\sum_{k=1}^{n} k= 12345...n$$

I'm sure this is actually something trivial that has been defined before, but I was finding it really difficult to search it up on Google (apparently "addition but instead of adding numbers just clomp together" doesn't yield very good results). So yeah, if anyone can tell me a better way to name this sort of maths it'd be greatly appreciated.
 
Mathematics news on Phys.org
  • #2
This is called concatenation. You often have to program this kind of operation for strings or text.
 
  • Like
Likes berkeman, fresh_42, jedishrfu and 2 others
  • #3
In computer languages, this is often done but there is no standardized symbol that would be universally recognized in other fields. Since C++ is such a well-established language, it might be the best thing to mimic. It uses the plus '+' symbol. The trick would be to distinguish it from numerical addition. Consider using quotes to make it clear that you are treating the number as a text string: "12"+"34"="1234".
If this is to appear in a document, you should clearly define your notation and symbology in the document.
 
  • Like
Likes topsquark
  • #4
I suppose you have [tex]\oplus : \mathbb{N}^2 \to \mathbb{N} : (a,b) \mapsto \begin{cases} 10^{1 + \lfloor\log_{10}(b)\rfloor}a + b, & b \neq 0, \\ 10a, & b = 0\end{cases}[/tex] which (if it does what I think it does) is associative but not commutative, and you need to decide whether [tex]
\bigoplus_{n=0}^N a_n[/tex] means [itex]a_0 \oplus a_1 \oplus \cdots \oplus a_N[/itex] or [itex]a_N \oplus a_{N-1} \oplus \cdots \oplus a_0[/itex].
 
  • Like
Likes malawi_glenn and PeroK
  • #5
In some computer languages, the addition operator took on different meaning dependent on the datatypes of items being added. It acted as normal addition for numeric types and as a concatenation operator for string types.

There were some purists who complained that since concatentation is not commutative that the addition operator shouldn't serve that function. However, using the addition operator for concatenation had become a defacto standard and was here to stay.

In Python, one can concat in several different ways:

- string1 + string2
- " ".join(string1, string2)
- ...

https://www.geeksforgeeks.org/python-string-concatenation/

and here's a larger set of multi language string concatentation examples:

https://en.wikipedia.org/wiki/Comparison_of_programming_languages_(string_functions)#Concatenation
 
  • Like
  • Informative
Likes berkeman, PeroK and FactChecker

FAQ: Defining an operation such that ##1+2+3=123##

What is the purpose of defining an operation such that ##1+2+3=123##?

The purpose of defining an operation such that ##1+2+3=123## is to show an example of a non-standard operation that follows a different set of rules than traditional addition. This can help expand our understanding of mathematical operations and encourage creative thinking.

How is this operation different from traditional addition?

This operation is different from traditional addition because it does not follow the standard rules of adding numbers. Instead of adding the numbers together, they are concatenated (or combined) to form a single number. This operation also does not follow the commutative property, meaning the order of the numbers matters.

Is this operation valid in the field of mathematics?

Yes, this operation can be considered valid in the field of mathematics. While it may not follow the traditional rules of addition, it is still a valid mathematical operation that can be used to solve problems and explore new concepts.

Can this operation be used in real-life situations?

While this operation may not have direct applications in real-life situations, it can be a useful tool for understanding mathematical concepts and promoting critical thinking skills. It can also be used as a fun and creative way to approach math problems.

Are there any other examples of non-standard operations?

Yes, there are many other examples of non-standard operations in mathematics. Some examples include the bitwise XOR operation in computer science, the quaternion multiplication operation in physics, and the hyperoperation sequence in abstract algebra. These operations may not follow the traditional rules of addition, but they still have important applications in their respective fields.

Back
Top