Add a tiny section about the tropical semiring to polynomial post

This commit is contained in:
Danila Fedorin 2022-10-25 22:46:05 -07:00
parent 2439a02dbb
commit 0ade4b2efb

View File

@ -202,7 +202,7 @@ way, polynomials like this give us _less_ information than our original ones
we're just warming up - there are more interesting semirings for us to we're just warming up - there are more interesting semirings for us to
consider! consider!
#### Polynomials over Sets of Paths, \\(\\mathcal{P}(\\Pi)\\) #### The Semiring of Sets of Paths, \\(\\mathcal{P}(\\Pi)\\)
Until now, we explicitly said that "all paths of the same length are Until now, we explicitly said that "all paths of the same length are
equivalent". If we're giving directions, though, we might benefit equivalent". If we're giving directions, though, we might benefit
from knowing not just that there _is_ a way, but what roads that from knowing not just that there _is_ a way, but what roads that
@ -267,7 +267,7 @@ consisting of each path from \\(A\\) concatenated with each
path from \\(B\\): path from \\(B\\):
{{< latex >}} {{< latex >}}
A \times B = \{ a \rightarrow b\ |\ a \in A, b \in B \} A \times B \triangleq \{ a \rightarrow b\ |\ a \in A, b \in B \}
{{< /latex >}} {{< /latex >}}
The fact that this definition of multiplication on sets is associative The fact that this definition of multiplication on sets is associative
@ -325,3 +325,55 @@ Multiplying them gives:
This resulting polynomial gives us all the paths from city A to city C, This resulting polynomial gives us all the paths from city A to city C,
grouped by their length! grouped by their length!
#### The Tropical Semiring, \\(\\mathbb{R}\\)
I only have one last semiring left to show you before we move on to something
other than paths between cities. It's a fun semiring though, as even its name
might suggest: we'll take a look at a _tropical semiring_.
In this semiring, we go back to numbers; particularly, real numbers (e.g.,
\\(1.34\\), \\(163\\), \\(e\\), that kind of thing). We even use addition --
sort of. In the tropical semiring, addition serves as the _multiplicative_
operation! This is even confusing to write, so I'm going to switch up notation;
in the rest of this section, I'll use \\(\\otimes\\) to represent the
multiplicative operation in semirings, and \\(\\oplus\\) to represent the
additive one. The symbols \\(\\times\\) and \\(+\\) will be used to represent
the regular operations on real numbers. With that, the operations on our
tropical semiring over real numbers are defined as follows:
{{< latex >}}
\begin{array}{rcl}
x \otimes y & \triangleq & x + y\\
x \oplus y & \triangleq & \min(x,y)
\end{array}
{{< /latex >}}
What is this new semiring good for? How about this: suppose that in addition to
the duration of the trip, you'd like to track the distance you must travel for
each route (shorter routes do sometimes have more traffic!). Let's watch what
happens when we add and multiply polynomials over this semiring.
When we add terms with the same power but different coefficients, like
\\(ax\oplus bx\\), we end up with a term \\(\min(a,b)x\\). In other words,
for each trip duration, we pick the shortest length. When we multiply two
polynomials, like \\(ax\otimes bx\\), we get \\((a+b)x\\); in other words,
when sequencing two trips, we add up the distances to get the combined
distance, just like we'd expect.
We can, of course, come up with a polynomial to match our initial example.
Say that the trips from A to B are represented by \\(2.0x^2\oplus1.5x\\\) (the
shortest two-hour trip is \\(2\\) units of distance long, and the one-hour
trip is \\(1.5\\) units long), and that the trips from B to C are represented
by \\(4.0x^3\oplus1.0x^2\\). Multiplying the two polynomials out gives:
{{< latex >}}
\begin{array}{rcl}
(2.0x^2\oplus1.5x)(4.0x^3\oplus1.0x^2) & = & 6.0x^5 \oplus \min(2.0+1.0, 1.5+4.0)x^4 \oplus 2.5x^3 \\
& = & 6.0x^5 \oplus 3.0x^4 \oplus 2.5x^3
\end{array}
{{< /latex >}}
The only time we used the additive operation in this case was to pick between
two trips of equal druation but different length (two-hour trip from A to B
followed by a two-hour trip from B to C, or one-hour trip from A to C followed
by a three-hour trip from B to C). The first trip wins out, since it requires
only \\(3.0\\) units of distance.