Friday, October 25, 2019

Remainders from roots

I described how multisets can be divided to get a quotient and a remainder. This generalizes the process of division of a number, which is actually equivalent to dividing a equal multiset. The process of dividing a multiset can be generalized to other multisets though, which produces a different process. The first immediate thought is that this can be applied to prime factorizations. So for example if we prime factorize 24 we get {2,2,2,3} and if we divide it 2 we get {2} with remainder {2,3}. This division of the prime factorization multiset is essentially the same as taking roots.

So if we take the square root of 24 we get 2 with a remainder of 6, and it is expressed as $2\sqrt{6}$. I particularly like the number 360 because of its unique minimal prime factorization {2,2,2,3,3,5} which forms a progression multiset. If we divide this by two we get $6$ with a remainder of 10 so it is $6\sqrt{10}$. In the case of a cube root we get $2$ with a remainder of $45$ so $2 \sqrt[3]{45}$. In any case, the remainder is the object still in the root symbol and the quotient is the part which is not.

Ordinary division is essentially additive division so when computing division the remainder is added to the quotient as a fraction and the introduction of fractions is what distinguishes the result from the ordinary integers. Roots are multiplicative division so the remainder is multiplied by the quotient, rather then added to it. The remainder is then the algebraic part that distinguishes it from the other rational part.

I have seen the remainder be used to refer to the fractional part of a root, so the square root of 24 would then be 4 with a remainder of 0.898979... going on infinitely in a non-periodic manner. It is useful to consider 4 as the square root of the smallest square number less then the number, but it is wrong to consider 0.898979... to be the remainder. Instead this is the fractional part of the root. This is largely an issue of terminology, but it is interesting nonetheless.

Saturday, October 12, 2019

Multiset division and remainder

The operations of division and remainder, so familar to us because of their use with the natural numbers, can be generalized to multisets. Numerous familiar concepts can be generalized and better understood through the use of multisets, which are relatively underused in the current situation. The first thing one realizes is that we can use this to divide and get the remainder of the prime factorization multiset of a number. So for example with 8 we can divide its factorization by 2 to get 2, and a remainder of 2 which is actually how we compute roots anyways to get $2\sqrt{2}$. So this means that nth-roots are actually based upon dividing a multiset, though it was never taught to me that way and I don't think its that common to describe it like that. Here is some clojure code that deals with the general case of dividing multisets.
(defn multiset-division
  [coll divisor]

  (Multiset.
   (into
    {}
    (for [elem (support coll)
          :let [n (multiplicity coll elem)]
          :when (<= divisor n)]
      [elem (quot n divisor)]))))

(defn multiset-remainder
  [coll divisor]

  (Multiset.
   (into
    {}
    (for [elem (support coll)
          :let [n (multiplicity coll elem)]
          :when (not (zero? (mod n divisor)))]
      [elem (mod n divisor)]))))