We all know the "apples and oranges" rule which says that it's meaningless to add or subtract two different quantities like apples and oranges. But the same rule doesn't hold for the multiplication and division. So my question is, why two quantities with different units cannot be added to one another but the multiplication of them is allowed and how this is expressed mathematically?
Dimensional Analysis – Adding Different Physical Quantities
dimensional analysismathematicsunits
Related Solutions
Physics is independent of our choice of units
And for something like a length plus a time, there is no way to uniquely specify a result that does not depend on the units you choose for the length or for the time.
Any measurable quantity belongs to some set $\mathcal{M}$. Often, this measurable quantity comes with some notion of "addition" or "concatenation". For example, the length of a rod $L \in \mathcal{L}$ is a measurable quantity. You can define an addition operation $+$ on $\mathcal{L}$ by saying that $L_1 + L_2$ is the length of the rod formed by sticking rods 1 and 2 end-to-end.
The fact that we attach a real number to it means that we have an isomorphism $$ u_{\mathcal{M}} \colon \mathcal{M} \to \mathbb{R}, $$ in which $$ u_{\mathcal{M}}(L_1 + L_2) = u_{\mathcal{M}}(L_1) + u_{\mathcal{M}}(L_2). $$ A choice of units is essentially a choice of this isomorphism. Recall that an isomorphism is invertible, so for any real number $x$ you have a possible measurement $u_{\mathcal{M}}^{-1}(x)$. I'm being fuzzy about whether $\mathbb{R}$ is the set of real numbers or just the positive numbers; i.e. whether these are groups, monoids, or something else. I don't think it matters a lot for this post and, more importantly, I haven't figured it all out.
Now, since physics should be independent of our choice of units, it should be independent of the particular isomorphisms $u_Q$, $u_R$, $u_S$, etc. that we use for our measurables $Q$, $R$, $S$, etc. A change of units is an automorphism of the real numbers; given two units $u_Q$ and $u'_Q$, the change of units is $$ \omega_{u,u'} \equiv u'_Q \circ u_Q^{-1}$$ or, equivalently, $$ \omega_{u,u'} \colon \mathbb{R} \to \mathbb{R} \ni \omega(x) = u'_Q(u_Q^{-1}(x)). $$ Therefore, \begin{align} \omega(x+y) &= u'_Q(u_Q^{-1}(x+y)) \\ &= u'_Q(u_Q^{-1}(x)+u_Q^{-1}(y)) \\ &= u'_Q(u_Q^{-1}(x)) + u'_Q(u_Q^{-1}(y)) \\ &= \omega(x) + \omega(y). \end{align}
So, since $\omega$ is an automorphism of the reals, it must be a rescaling $\omega(x) = \lambda x$ with some relative scale $\lambda$ (As pointed out by @SeleneRoutley, this requires the weak assumption that $\omega$ is a continuous function -- there are everywhere discontinuous solutions as well. Obviously units aren't useful if they are everywhere discontinuous; in particular, so that instrumental measurement error maps an allowed space of $u_\mathcal{M}$ into an interval of $\mathbb{R}$. If we allow the existence of an order operation on $\mathcal{M}$, or perhaps a unit-independent topology, this could be made more precise.).
Consider a typical physical formula, e.g., $$ F \colon Q \times R \to S \ni F(q,r) = s, $$ where $Q$, $R$, and $S$ are all additive measurable in the sense defined above. Give all three of these measurables units. Then there is a function $$ f \colon \mathbb{R} \times \mathbb{R} \to \mathbb{R} $$ defined by $$ f(x,y) = u_S(F(u_Q^{-1}(x),u_R^{-1}(y)). $$
The requirement that physics must be independent of units means that if the units for $Q$ and $R$ are scaled by some amounts $\lambda_Q$ and $\lambda_R$, then there must be a rescaling of $S$, $\lambda_S$, such that
$$ f(\lambda_Q x, \lambda_R y) = \lambda_S f(x,y). $$
For example, imagine the momentum function taking a mass $m \in M$ and a velocity $v \in V$ to give a momentum $p \in P$. Choosing $\text{kg}$ for mass, $\text{m/s}$ for velocity, and $\text{kg}\,\text{m/s}$ for momentum, this equation is $$ p(m,v) = m*v. $$ Now, if the mass unit is changed to $\text{g}$, it is scaled by $1000$, and if the velocity is changed to $\text{cm/s}$, it is scaled by $100$. Unit dependence requires that there be a rescaling of momentum such that $$ p(1000m,100v) = \lambda p(m,v). $$ This is simple -- $10^5 mv = \lambda mv$ and so $\lambda = 10^5$. In other words, $$ p[\text{g} \, \text{cm/s}] = 10^5 p[\text{kg} \, \text{m/s}]. $$
Now, let's consider a hypothetical situation where we have a quantity called "length plus time", defined that when length is measured in meters and time in seconds, and "length plus time" in some hypothetical unit called "meter+second", the equation for "length plus time" is $$ f(l,t) = l + t. $$ This is what you've said - $10 \text{ m} + 5 \text{ s} = 15 \text{ “m+s”}$. Now, is this equation invariant under a change of units? Change the length scale by $\lambda_L$ and the time scale by $\lambda_T$. Is there a number $\Lambda$ such that $$ f(\lambda_L l, \lambda_T t) = \lambda_L l + \lambda_T t $$ is equal to $$ \Lambda f(l,t) = \Lambda(l+t) $$ for all lengths and times $l$ and $t$? No! Therefore, this equation $f = l + t$ cannot be a valid representation in real numbers of a physical formula.
There is really just one underlying principle here: Any equation we write down should not depend on any arbitrary choices we made in order to define the quantities. All the examples you can discuss can be understood in this principle.
Can't add a vector and a scalar. Well, of course a vector is three numbers and a scalar is one number, so, for example, $\mathbf{v} + v$, , where $v$ is a speed, i.e. a scalar with units of velocity, doesn't even make mathematical sense. But we could add imagine adding one component of a vector to a scalar, i.e. $v_z + v$. But, this quantity shouldn't appear in a fundamental law of physics because our choice of what axis to call the $z$ axis is completely arbitrary, and if we made a different choice our equations would look different. But this is situation-dependent. For example, if we were discussing physics in a background uniform gravitational field, then we can use a convention where $z$ points along the direction of gravitational field. This is not arbitrary because the gravitational field sets a preferred direction. By declaring that we are going to call that particular direction the "z-direction'', it makes sense that any equations we then write down will only hold for that particular choice of $z$-axis. That is why the equation for the gravitational potential energy in a gravitational field, $U = mgz$, is valid even though $z$ is a component of the displacement vector $\textbf{r}$. However, you can still translate this equation into one that is valid for any choice of axes, namely $U = m \textbf{g} \cdot \textbf{r}$, where $\textbf{g}$ is the gravitational field vector.
Can't add numbers with different units. The point is that we normally work in units of physics which are chosen completely arbitrarily. If time $t$ is measured in seconds and position $x$ is measured in meters, then it makes no sense to write down an equation involving $x+t$ because this equation would depend on our definition of "second" and "meter", and there is no reason why the laws of physics should depend on the second being defined to be 9,192,631,770 times the period of some radiation mode of a cesium atom. But, if we choose to work in natural units, then this is not an arbitrary choice because, as the name suggests, natural units are uniquely determined given fundamental constants of physics. In natural units, there is nothing wrong with writing an equation involving $x+t$, because we remember that we have made a special choice of units, and the equation will hold only in those units.
Of course, any equation that you can write in natural units can still be translated into arbitrary units. Take Einstein's famous mass-energy equivalence. In natural units ($c=1$) it states that $E = m$. Obviously, in arbitrary units, this is a bad equation because if $E$ is measured in Joules, and $m$ is measured in kg, then it would depend on the definitions of Joules and kg. But that's fine, because this equation only holds in natural units. Its translation into arbitrary units is $E = mc^2$, and the units now match up.
Can't add covariant 4-vectors and contravariant 4-vectors. Again, this is because in special relativity, in order to write down components of vectors we have to make an arbitrary choice of coordinate directions in space-time. Equations we write down in special relativity shouldn't depend on this choice, and this prevents us from adding covariant 4-vectors and contravariant 4-vectors because they transform differently when you change coordinate directions in space-time.
Can't add things in different vector spaces. This is just because, if $\mathbf{v}$ is in one vector space and $\mathbf{w}$ is in a totally different vector space, then you wrote an equation involving $\mathbf{v} + \mathbf{w}$ then it would depend on how you relate the bases between the two vector spaces, which -- given that they are totally different spaces -- there is no way to do non-arbitrarily.
Best Answer
I guess I might as well collect my comments into an answer.
You are actually implicitly asking two questions:
The answer to 1. is positive in certain cases, especially when talking about fruits. The structure is called free abelian group. It's essentialy one copy of integers for every fruit with addition defined component-wise: $(5a + 2o) + (2a + 3o) = (7a + 5o)$ and so on. One can similarly formalize other concepts of addition of different quantities. One can also introduce multiplication and talk about polymonial rings $K[x,y,\dots,z]$ (where the variables are understood to represent units) or take the field of fractions of that, or even introduce non-commutativity. There are many mathematical structures that can accomodate all of the operations ever needed in physics (and more).
So we come to the point 2. We've seen that it's possible to add different quantities. But that tells you nothing about whether such an operation is ever useful. In particular, when talking about elementary operations used in physical problems to arrive at a result which is always a well-defined quantity with units. I claim that this is why we don't use in physics anything else than addition of quantities with same units because we want to have reasonable units at every step of the calculation.
Note that this is also consistent with taking products of different quantities because this operation doesn't spoil the fact that at every step of the derivation we have a well-defined units of the expression.