1

Let $x=x_N\ldots x_0$, $y=y_M\ldots y_0$ be integers with base-$b$ digits $0 \le x_i,y_j < b$. Concatenate them via

$$x \otimes_b y\triangleq x_N\ldots x_0 y_M\ldots y_0=b^{len_b(y)}x+y=b^{1-\{\log_b{y}\}}xy+y$$

where $len_b(y)=M=\lfloor\log_b{y}\rfloor+1=\log_b{y}-\{\log_b{y}\}+1$, thus extending to all $b \ne 1$.

$\lim_{b \rightarrow 1} b^{1-\{\log_b{y}\}}=1$ when $\log(y) > 0$, so that $\lim_{b \rightarrow 1}x \otimes_b y = xy+y$.

Q: When $b=1$ (unary), concatenation should correspond to addition. Why is $\lim_{b\rightarrow 1} x\otimes_b y \ne x+y$?

I understand there are some difficulties in viewing unary as an honest base.

  • Concatenation is addition in unary, but your $\text{len}(y)$ definition is wrong in the unary case, because $\log_b{y}$ is not defined at $b=1$ and has no limit for $b \to 1$. – dxiv Jan 08 '22 at 03:46
  • $\log_1(y)$ is not defined, but I don't define $len_b(y)$ for $b=1$. If so, in unary I suppose $len_1(y)=y$ so then $x \otimes_1 y=1^y x+y=x+y$, which is fine, but then $\lim_{b \rightarrow 1} x \otimes_b y = xy+y$ still, so $concat_b$ wouldn't be continuous. – Jackson Walters Jan 08 '22 at 04:00

1 Answers1

3

(Too long for a comment.)

$x \otimes_b y\triangleq x_N\ldots x_0 y_M\ldots y_0=b^{\text{len}(y)}x+y$

This works for positional numerals in base $b \ne 1$, and it works because 1) multiplication by $b$ is equivalent to a left-shift of all digits with a $0$ inserted at the rightmost position, and 2) $\text{len}(y)=\lfloor\log_b{y}\rfloor+1$ represents the number of digits in the representation of $y$.

But in the unary numeral system 1) there is no digit $0$ and no notion of left-shifting the digits with "nothing" inserted at the right, and 2) the length of the representation is simply $\text{len}(y)=y$. Because of that, it is not possible to define concatenation for unary numerals as a limit case of concatenation for positional numerals of base $b \ne 1$. Instead, concatenation for unary numerals is simply $\,x \otimes_1 y = x + y\,$.

dxiv
  • 76,497
  • One can certainly define unary concatenation as $\lim_{b \rightarrow 1} x \otimes_b y = xy+y$. A parameterized operation has a missing value and the limit exists, so take it as a def. You can't left shift with nothing on the right, but you can left shift with something. In fact, if you take your unary digit (unit), say |, such that |*|=|+|=|, and represent $x=| \cdot 1^N + \ldots |\cdot 1^0$ and $y=|\cdot 1^M + \ldots + |\cdot 1^0$, then multiplication becomes addition, i.e. $xy=| \cdot 1^{M+N}+\ldots +| \cdot 1^0$, addition is $max$, and $xy+y=\underbrace{| \ldots |}_{M+N}$. – Jackson Walters Jan 08 '22 at 05:31
  • @JacksonWalters $;$ Sorry, but you are only confusing yourself with notation. For any $,y \ne 1,$ you have $,\lim_{b\rightarrow 1} x\otimes_b y = xy + y \ne x+y = x\otimes_1 y,$, so concatenation for unary numerals can not be derived as a limit case of concatenation for positional numerals, at least not this way. Note that the RHS is usual math regardless of the base, so saying that "multiplication becomes addition ... and addition is max" makes no sense. In your example $,x=N+1$, $y=M+1,$, so $,xy=(N+1)(M+1),$ no matter what numeral system you choose to write it in. – dxiv Jan 08 '22 at 06:02
  • Hm, I think you're confused about what a definition is. One can define $x\otimes_1 y \triangleq \lim_{b \rightarrow 1} x \otimes_b y = xy+y$. This is similar to how one would define the value of the function $f(x)=\sin(x)/x$. $f(0)$ is undefined, so we declare $f(0) \triangleq \lim_{x \rightarrow 0} f(x)=1$. In any case, perhaps a better argument against interpolating this way is just that $\otimes_b$ is not associative for non-integer $b$. – Jackson Walters Jan 08 '22 at 07:01
  • With respect to changing the operations, you're absolutely right - multiplication is multiplication, i.e. $xy=NM$ (I meant to write $N-1$ and $M-1$ as the highest indices). I was just pointing out that if you modify the operations in the limit formula to use the tropical semiring instead of the usual ones, the limiting formula does work. I was hoping someone could fill in some details or make sense of this ''over $\mathbb{F}_{1}$''. – Jackson Walters Jan 08 '22 at 07:05
  • 1
    @JacksonWalters $,$ I was under the impression that $,\otimes_b,$ was defined to be concatenation, and the question was why $,\lim_{b\rightarrow 1} x\otimes_b y \ne x\otimes_1 y,$. If, instead, you choose to define $,\otimes_1,$ by the latter limit then, yes, that's a possible definition, albeit a very different one. In that case $,\otimes_1,$ is not concatenation, and it doesn't look too useful otherwise - it's not associative, as you noted, or for example it doesn't even satisfy $,\text{len}(x \otimes_1 y)$ $= \text{len}(y \otimes_1 x),$ in general. – dxiv Jan 08 '22 at 07:14
  • 1
    @JacksonWalters $,$ As to the other point, all the $,\otimes_b,$ math for positional numerals works (only) in the usual reals. I don't see how one could justify switching all of a sudden to tropicals for the sole purpose of getting the limit to magically "work out" for unary numerals. To me at least, that looks like just artificial, coincidental manipulation. Not saying that there couldn't possibly exist some deeper meaning to it, but I'll have to leave that for others to figure out. – dxiv Jan 08 '22 at 07:30
  • Right, right. We could define it as the limit for continuity's sake, but let's agree that $x \otimes_1 y \triangleq x+y$ as $\otimes_b$ is concatenation. The "zero-padding" by mult. by $b^{len_b(y)}$ doesn't work; you have to "unit-pad" using addition. You identify the main issue - the $len_b$ function itself has a harsh discontinuity at $b=1$. Agreed, manipulating ops. seems coincidental, though tropical ops. are a $q$-limit of real ops. $\otimes_b$ itself respects order, so distributes over $max$ and forms a (separate) semiring. Mult. is weird in unary; seemed like a direction to try. – Jackson Walters Jan 08 '22 at 18:20
  • The question is indeed 1) why is $\lim_{b\rightarrow 1} x \otimes_b y \ne x+y$, but also 2) why isn't it so different? If the limit was way different, it wouldn't've raised an eyebrow. – Jackson Walters Jan 08 '22 at 18:27
  • @JacksonWalters "also 2) why isn't it so different" $;-;$ I think that's just chance happening. Whatever value came out, or even if the limit did not exist at all, it would have been hard to assign it a math meaning. It's just that the semantics of multiplying by a power of the base in a positional system $b \gt 1$ completely break down in the unary system $b=1$. – dxiv Jan 08 '22 at 22:57
  • Okay, ignoring the simple but misleading limit expression, and forgetting continuity, define $len_1(y)\triangleq y$, and $x \otimes_b y \triangleq b^{len_b(y)}x+y$ for all positive integers $b$. For $b=1$, I don’t know if the semantics break down completely if you’re comfortable with zero as unit; it’s still a left shift by $y$, it’s just shifting is the same as adding. As for a better “limit”, note $N_b=(\mathbb{N}_{\ge 0},\otimes_b, max)$ forms a semiring for each $b$. $len_b$ is a morphism $N_b \rightarrow N_1$, where $N_1$ is (+,max). – Jackson Walters Jan 08 '22 at 23:52
  • @JacksonWalters However you may fill-in the blanks about those rings and morphisms, I still don't see how you can take a relation which is valid only when $,b \gt 1,$, pass it to the limit $,b \to 1,$, then reinterpret the result in a completely different context using incompatible definitions of the same operations. That said, I am inevitably starting to repeat myself at this point, and I think I'll just leave it at that. – dxiv Jan 09 '22 at 08:49
  • The expression for an op. which depends on an integer $b$ extends to real values $b\ne 1$. It’s natural to ask if the limit agrees with what’s expected for $b=1$. It doesn’t. Agree, the ops. used to define the $\otimes_b$ should be left alone. The second approach in the comments is different. I’m no longer extending to real $b$, and ops. used to define $\otimes_b$ are just $(\cdot,+)$. I’m saying $\otimes_b$ itself forms a monoid (semiring w/ max), and $len_b$ gives a map to the addition monoid. This morphism is “use base-b, then squint your eyes so you can’t distinguish symbols, & count.” – Jackson Walters Jan 09 '22 at 17:47