From 3b41ea714a36455bba2013b2a352740f168df6a3 Mon Sep 17 00:00:00 2001 From: Mark Date: Wed, 22 Jan 2025 12:31:47 -0800 Subject: [PATCH] Added "Tropical Polynomials" handout --- src/Advanced/Tropical Polynomials/handout.typ | 280 +++++++++++++ src/Advanced/Tropical Polynomials/macros.typ | 70 ++++ src/Advanced/Tropical Polynomials/main.typ | 22 + src/Advanced/Tropical Polynomials/meta.toml | 7 + .../parts/00 arithmetic.typ | 293 +++++++++++++ .../parts/01 polynomials.typ | 387 ++++++++++++++++++ .../Tropical Polynomials/parts/02 cubic.typ | 212 ++++++++++ 7 files changed, 1271 insertions(+) create mode 100755 src/Advanced/Tropical Polynomials/handout.typ create mode 100644 src/Advanced/Tropical Polynomials/macros.typ create mode 100644 src/Advanced/Tropical Polynomials/main.typ create mode 100644 src/Advanced/Tropical Polynomials/meta.toml create mode 100644 src/Advanced/Tropical Polynomials/parts/00 arithmetic.typ create mode 100644 src/Advanced/Tropical Polynomials/parts/01 polynomials.typ create mode 100644 src/Advanced/Tropical Polynomials/parts/02 cubic.typ diff --git a/src/Advanced/Tropical Polynomials/handout.typ b/src/Advanced/Tropical Polynomials/handout.typ new file mode 100755 index 0000000..723e6c6 --- /dev/null +++ b/src/Advanced/Tropical Polynomials/handout.typ @@ -0,0 +1,280 @@ + +/// If false, hide instructor info. +/// +/// Compile with the following command to hide solutions: +/// `typst compile main.typ --input show_solutions=false` +/// +/// Solutions are shown by default. This behavior +/// is less surprising than hiding content by default. +#let show_solutions = { + if "show_solutions" in sys.inputs { + // Show solutions unless they're explicitly disabled + not ( + sys.inputs.show_solutions == "false" or sys.inputs.show_solutions == "no" + ) + } else { + // Show solutions by default + true + } +} + +// Colors +#let ored = rgb("D62121") +#let ogrape = rgb("9C36B5") +#let ocyan = rgb("2288BF") +#let oteal = rgb("12B886") +#let ogreen = rgb("37B26D") +#let oblue = rgb("1C7ED6") + + + +// +// MARK: header +// + +#let make_title( + group, + quarter, + title, + subtitle, +) = { + align( + center, + block( + width: 60%, + height: auto, + breakable: false, + align( + center, + stack( + spacing: 7pt, + ( + text(size: 10pt, group) + h(1fr) + text(size: 10pt, quarter) + ), + line(length: 100%, stroke: 0.2mm), + ( + text(size: 20pt, title) + linebreak() + text(size: 10pt, subtitle) + ), + line(length: 100%, stroke: 0.2mm), + ), + ), + ), + ) +} + +#let warn = { + set text(ored) + align( + center, + block( + width: 60%, + height: auto, + breakable: false, + fill: rgb(255, 255, 255), + stroke: ored + 2pt, + inset: 3mm, + ( + align(center, text(weight: "bold", size: 12pt, [Instructor's Handout])) + + parbreak() + + align( + left, + text( + size: 10pt, + [This handout contains solutions and notes.] + + linebreak() + + [Recompile without solutions before distributing.], + ), + ) + ), + ), + ) +} + +#let preparedby(name) = ( + text( + size: 10pt, + [Prepared by ] + + name + + [ on ] + + datetime + .today() + .display("[month repr:long] [day padding:none], [year]"), + ) +) + +// +// MARK: Solutions +// + +#let solution(content) = { + if show_solutions { + align( + center, + stack( + block( + width: 100%, + breakable: false, + fill: ored, + stroke: ored + 2pt, + inset: 1.5mm, + ( + align(left, text(fill: white, weight: "bold", [Solution:])) + ), + ), + block( + width: 100%, + height: auto, + breakable: false, + fill: ored.lighten(80%).desaturate(10%), + stroke: ored + 2pt, + inset: 3mm, + align(left, content), + ), + ), + ) + } +} + +#let notsolution(content) = { + if not show_solutions { content } +} + + +// +// MARK: Sections +// + +#let generic(t) = block( + above: 8mm, + below: 2mm, + text(weight: "bold", t), +) + +#let _generic_base(kind, ..args) = { + counter("obj").step() + if args.pos().len() == 0 { + generic([ + #kind + #context counter("obj").display(): + ]) + } else { + generic( + [ + #kind + #context counter("obj").display(): + ] + + " " + + args.pos().at(0), + ) + } +} + +#let problem(..args) = _generic_base("Problem", ..args) +#let definition(..args) = _generic_base("Definition", ..args) +#let theorem(..args) = _generic_base("Theorem", ..args) + + +// +// MARK: Misc +// + + +#let hint(content) = { + text(fill: rgb(100, 100, 100), style: "oblique", "Hint: ") + text(fill: rgb(100, 100, 100), content) +} + +#let note(content) = { + text(fill: rgb(100, 100, 100), content) +} + +#let examplesolution(content) = { + let c = oblue + + align( + center, + stack( + block( + width: 100%, + breakable: false, + fill: c, + stroke: c + 2pt, + inset: 1.5mm, + ( + align(left, text(fill: white, weight: "bold", [Example solution:])) + ), + ), + block( + width: 100%, + height: auto, + breakable: false, + fill: c.lighten(80%).desaturate(10%), + stroke: c + 2pt, + inset: 3mm, + align(left, content), + ), + ), + ) +} + + +// +// MARK: wrapper +// + +#let handout( + doc, + group: none, + quarter: none, + title: none, + by: none, + subtitle: none, +) = { + set par(leading: 0.55em, first-line-indent: 0mm, justify: true) + set text(font: "New Computer Modern") + set par(spacing: 0.5em) + show list: set block(spacing: 0.5em, below: 1em) + set heading(numbering: (..nums) => nums.pos().at(0)) + + set page( + margin: 20mm, + width: 8.5in, + height: 11in, + footer: align( + center, + context counter(page).display(), + ), + footer-descent: 5mm, + ) + + + set list( + tight: false, + indent: 5mm, + spacing: 3mm, + ) + + show heading.where(level: 1): it => { + set align(center) + set text(weight: "bold") + block[ + Section #counter(heading).display(): #text(it.body) + ] + } + + make_title( + group, + quarter, + title, + { + if by == none { none } else { [#preparedby(by)\ ] } + if subtitle == none { none } else { subtitle } + }, + ) + + if show_solutions { + warn + } + doc +} + diff --git a/src/Advanced/Tropical Polynomials/macros.typ b/src/Advanced/Tropical Polynomials/macros.typ new file mode 100644 index 0000000..7b40215 --- /dev/null +++ b/src/Advanced/Tropical Polynomials/macros.typ @@ -0,0 +1,70 @@ +#import "./handout.typ": * +#import "@preview/cetz:0.3.1" + + +// Shorthand, we'll be using these a lot. +#let tp = sym.plus.circle +#let tm = sym.times.circle + +#let graphgrid(inner_content) = { + align( + center, + box( + inset: 3mm, + cetz.canvas({ + import cetz.draw: * + let x = 5.25 + + grid( + (0, 0), (x, x), step: 0.75, + stroke: luma(100) + 0.3mm + ) + + if (inner_content != none) { + inner_content + } + + mark((0, x + 0.5), (0, x + 1), symbol: ">", fill: black, scale: 1) + mark((x + 0.5, 0), (x + 1, 0), symbol: ">", fill: black, scale: 1) + + line( + (0, x + 0.25), + (0, 0), + (x + 0.25, 0), + stroke: 0.75mm + black, + ) + }), + ), + ) +} + +/// Adds extra padding to an equation. +/// Used as follows: +/// +/// #eqmbox($ +/// f(x) = -2(x #tp 2)(x #tp 8) +/// $) +/// +/// Note that there are newlines between the $ and content, +/// this gives us display math (which is what we want when using this macro) +#let eqnbox(eqn) = { + align( + center, + box( + inset: 3mm, + eqn, + ), + ) +} + +#let dotline(a, b) = { + cetz.draw.line( + a, + b, + stroke: ( + dash: "dashed", + thickness: 0.5mm, + paint: ored, + ), + ) +} diff --git a/src/Advanced/Tropical Polynomials/main.typ b/src/Advanced/Tropical Polynomials/main.typ new file mode 100644 index 0000000..f4e750d --- /dev/null +++ b/src/Advanced/Tropical Polynomials/main.typ @@ -0,0 +1,22 @@ +#import "./handout.typ": * + +#show: doc => handout( + doc, + group: "Advanced 2", + quarter: link( + "https://betalupi.com/handouts", + "betalupi.com/handouts", + ), + + title: [Tropical Polynomials], + by: "Mark", + subtitle: "Based on a handout by Bryant Mathews", +) + +#include "parts/00 arithmetic.typ" +#pagebreak() + +#include "parts/01 polynomials.typ" +#pagebreak() + +#include "parts/02 cubic.typ" diff --git a/src/Advanced/Tropical Polynomials/meta.toml b/src/Advanced/Tropical Polynomials/meta.toml new file mode 100644 index 0000000..ed4fa95 --- /dev/null +++ b/src/Advanced/Tropical Polynomials/meta.toml @@ -0,0 +1,7 @@ +[metadata] +title = "Tropical Polynomials" + + +[publish] +handout = true +solutions = true diff --git a/src/Advanced/Tropical Polynomials/parts/00 arithmetic.typ b/src/Advanced/Tropical Polynomials/parts/00 arithmetic.typ new file mode 100644 index 0000000..7f813a8 --- /dev/null +++ b/src/Advanced/Tropical Polynomials/parts/00 arithmetic.typ @@ -0,0 +1,293 @@ +#import "../handout.typ": * +#import "../macros.typ": * + += Tropical Arithmetic + +#definition() +The _tropical sum_ of two numbers is their minimum: +$ + x #tp y = min(x, y) +$ + +#definition() +The _tropical product_ of two numbers is their sum: +$ + x #tm y = x + y +$ + + +#problem() +- Is tropical addition commutative? \ + #note([i.e, does $x #tp y = y #tp x$?]) +- Is tropical addition associative? \ + #note([i.e, does $(x #tp y) #tp z = x #tp (y #tp z)$?]) +- Is there a tropical additive identity? \ + #note([i.e, is there an $i$ so that $x #tp i = x$ for all real $x$?]) + +#solution([ + - Is tropical addition commutative?\ + Yes, $min(min(x,y),z) = min(x,y,z) = min(x,min(y,z))$ + - Is tropical addition associative? \ + Yes, $min(x,y) = min(y,x)$ + - Is there a tropical additive identity? \ + No. There is no $n$ where $x <= n$ for all real $x$ +]) + +#v(1fr) + +#problem() +Let's expand $#sym.RR$ to include a tropical additive identity. +- What would be an appropriate name for this new number? +- Give a reasonable definition for... + - the tropical sum of this number and a real number $x$ + - the tropical sum of this number and itself + - the tropical product of this number and a real number $x$ + - the tropical product of this number and itself + +#solution([ + #sym.infinity makes sense, with + $#sym.infinity #tp x = x$; #h(1em) + $#sym.infinity #tp #sym.infinity = #sym.infinity$; #h(1em) + $#sym.infinity #tm x = #sym.infinity$; #h(1em) and + $#sym.infinity #tm #sym.infinity = #sym.infinity$ +]) + +#v(1fr) +#pagebreak() // MARK: page + + + + + +#problem() +Do tropical additive inverses exist? \ +#note([ + Is there an inverse $y$ for every $x$ so that $x #tp y = #sym.infinity$? +]) + +#solution([ + No. Unless $x = #sym.infinity$, there is no x where $min(x, y) = #sym.infinity$ +]) + +#v(1fr) + + + +#problem() +Is tropical multiplication associative? \ +#note([Does $(x #tm y) #tm z = x #tm (y #tm z)$ for all $x,y,z$?]) + +#solution([Yes, since (normal) addition is associative]) + +#v(1fr) + + +#problem() +Is tropical multiplication commutative? \ +#note([Does $x #tm y = y #tm x$ for all $x, y$?]) + +#solution([Yes, since (normal) addition is commutative]) + +#v(1fr) + + +#problem() +Is there a tropical multiplicative identity? \ +#note([Is there an $i$ so that $x #tm i = x$ for all $x$?]) + +#solution([Yes, it is 0.]) + +#v(1fr) + + +#problem() +Do tropical multiplicative inverses always exist? \ +#note([ + For every $x != #sym.infinity$, does there exist an inverse $y$ so that $x #tm y = i$, \ + where $i$ is the additive identity? +]) + +#solution([Yes, it is $-x$. For $x != 0$, $x #tm (-x) = 0$]) + +#v(1fr) +#pagebreak() // MARK: page + + +#problem() +Is tropical multiplication distributive over addition? \ +#note([Does $x #tm (y #tp z) = x #tm y #tp x #tm z$?]) + +#solution([Yes, $x + min(y,z) = min(x+y, x+z)$]) + +#v(1fr) + +#problem() +Fill the following tropical addition and multiplication tables + +#let col = 10mm + +#notsolution( + table( + columns: (1fr, 1fr), + align: center, + stroke: none, + table( + columns: (col, col, col, col, col, col), + align: center, + table.header( + [$#tp$], + [$1$], + [$2$], + [$3$], + [$4$], + [$#sym.infinity$], + ), + + box(inset: 3pt, $1$), [], [], [], [], [], + box(inset: 3pt, $2$), [], [], [], [], [], + box(inset: 3pt, $3$), [], [], [], [], [], + box(inset: 3pt, $4$), [], [], [], [], [], + box(inset: 3pt, $#sym.infinity$), [], [], [], [], [], + ), + table( + columns: (col, col, col, col, col, col), + align: center, + table.header( + [$#tm$], + [$0$], + [$1$], + [$2$], + [$3$], + [$4$], + ), + + box(inset: 3pt, $0$), [], [], [], [], [], + box(inset: 3pt, $1$), [], [], [], [], [], + box(inset: 3pt, $2$), [], [], [], [], [], + box(inset: 3pt, $3$), [], [], [], [], [], + box(inset: 3pt, $4$), [], [], [], [], [], + ), + ), +) + +#solution( + table( + columns: (1fr, 1fr), + align: center, + stroke: none, + table( + columns: (col, col, col, col, col, col), + align: center, + table.header( + [$#tp$], + [$1$], + [$2$], + [$3$], + [$4$], + [$#sym.infinity$], + ), + + box(inset: 3pt, $1$), + box(inset: 3pt, $1$), + box(inset: 3pt, $1$), + box(inset: 3pt, $1$), + box(inset: 3pt, $1$), + box(inset: 3pt, $1$), + + box(inset: 3pt, $2$), + box(inset: 3pt, $1$), + box(inset: 3pt, $2$), + box(inset: 3pt, $2$), + box(inset: 3pt, $2$), + box(inset: 3pt, $2$), + + box(inset: 3pt, $3$), + box(inset: 3pt, $1$), + box(inset: 3pt, $2$), + box(inset: 3pt, $3$), + box(inset: 3pt, $3$), + box(inset: 3pt, $3$), + + box(inset: 3pt, $4$), + box(inset: 3pt, $1$), + box(inset: 3pt, $2$), + box(inset: 3pt, $3$), + box(inset: 3pt, $4$), + box(inset: 3pt, $4$), + + box(inset: 3pt, $#sym.infinity$), + box(inset: 3pt, $1$), + box(inset: 3pt, $2$), + box(inset: 3pt, $3$), + box(inset: 3pt, $4$), + box(inset: 3pt, $#sym.infinity$), + ), + table( + columns: (col, col, col, col, col, col), + align: center, + table.header( + [$#tm$], + [$0$], + [$1$], + [$2$], + [$3$], + [$4$], + ), + + box(inset: 3pt, $0$), + box(inset: 3pt, $0$), + box(inset: 3pt, $1$), + box(inset: 3pt, $2$), + box(inset: 3pt, $3$), + box(inset: 3pt, $4$), + + box(inset: 3pt, $1$), + box(inset: 3pt, $1$), + box(inset: 3pt, $2$), + box(inset: 3pt, $3$), + box(inset: 3pt, $4$), + box(inset: 3pt, $5$), + + box(inset: 3pt, $2$), + box(inset: 3pt, $2$), + box(inset: 3pt, $3$), + box(inset: 3pt, $4$), + box(inset: 3pt, $5$), + box(inset: 3pt, $6$), + + box(inset: 3pt, $3$), + box(inset: 3pt, $3$), + box(inset: 3pt, $4$), + box(inset: 3pt, $5$), + box(inset: 3pt, $6$), + box(inset: 3pt, $7$), + + box(inset: 3pt, $4$), + box(inset: 3pt, $4$), + box(inset: 3pt, $5$), + box(inset: 3pt, $6$), + box(inset: 3pt, $7$), + box(inset: 3pt, $8$), + ), + ), +) + + +#v(2mm) + +#problem() +Expand and simplify $f(x) = (x #tp 2)(x #tp 3)$, then evaluate $f(1)$ and $f(4)$ \ +Adjacent parenthesis imply tropical multiplication + +#solution([ + $ + (x #tp 2)(x #tp 3) + &= x^2 #tp 2x #tp 3x #tp (2 #tm 3) \ + &= x^2 #tp (2 #tp 3)x #tp (2 #tm 3) \ + &= x^2 #tp 2x #tp 5 + $ + + Also, $f(1) = 2$ and $f(4) = 5$. +]) + +#v(1fr) diff --git a/src/Advanced/Tropical Polynomials/parts/01 polynomials.typ b/src/Advanced/Tropical Polynomials/parts/01 polynomials.typ new file mode 100644 index 0000000..b75c454 --- /dev/null +++ b/src/Advanced/Tropical Polynomials/parts/01 polynomials.typ @@ -0,0 +1,387 @@ +#import "../handout.typ": * +#import "../macros.typ": * +#import "@preview/cetz:0.3.1" + += Tropical Polynomials + +#definition() +A _polynomial_ is an expression formed by adding and multiplying numbers and a variable $x$. \ +Every polynomial can be written as +#align( + center, + box( + inset: 3mm, + $ + c_0 + c_1 x + c_2 x^2 + ... + c_n x^n + $, + ), +) +for some nonnegative integer $n$ and coefficients $c_0, c_1, ..., c_n$. \ +The _degree_ of a polynomial is the largest $n$ for which $c_n$ is nonzero. + +#theorem() +The _fundamental theorem of algebra_ implies that any non-constant polynomial with real coefficients +can be written as a product of polynomials of degree 1 or 2 with real coefficients. + +#v(2mm) + +For example, the polynomial $-160 - 64x - 2x^2 + 17x^3 + 8x^4 + x^5$ \ +can be written as $(x^2 + 2x+5)(x-2)(x+4)(x+4)$ + +#v(2mm) +A similar theorem exists for polynomials with complex coefficients. \ +These coefficients may be found using the roots of this polynomial. \ +As it turns out, there are formulas that determine the roots of quadratic, cubic, and quartic #note([(degree 2, 3, and 4)]) polynomials. There are no formulas for the roots of polynomials with larger degrees---in this case, we usually rely on approximate roots found by computers. + +#v(2mm) +In this section, we will analyze tropical polynomials: +- Is there a fundamental theorem of tropical algebra? +- Is there a tropical quadratic formula? How about a cubic formula? +- Is it difficult to find the roots of tropical polynomials with large degrees? + + +#definition() +A _tropical_ polynomial is a polynomial that uses tropical addition and multiplication. \ +In other words, it is an expression of the form +#align( + center, + box( + inset: 3mm, + $ + c_0 #tp (c_1 #tm x) #tp (c_2 #tm x^2) #tp ... #tp (c_n #tm x^n) + $, + ), +) +where all exponents represent repeated tropical multiplication. + +#pagebreak() // MARK: page + + + + +#problem() +Draw a graph of the tropical polynomial $f(x) = x^2 #tp 1x #tp 4$. \ +#hint([$1x$ is not equal to $x$.]) + +#notsolution(graphgrid(none)) + +#solution([ + $f(x) = min(2x , 1+x, 4)$, which looks like: + + #graphgrid({ + import cetz.draw: * + let step = 0.75 + + dotline((0, 0), (4 * step, 8 * step)) + dotline((0, 1 * step), (7 * step, 8 * step)) + dotline((0, 4 * step), (8 * step, 4 * step)) + + line( + (0, 0), + (1 * step, 2 * step), + (3 * step, 4 * step), + (7.5 * step, 4 * step), + stroke: 1mm + oblue, + ) + }) +]) + + +#problem() +Now, factor $f(x) = x^2 #tp 1x #tp 4$ into two polynomials with degree 1. \ +In other words, find $r$ and $s$ so that +#align( + center, + box( + inset: 3mm, + $ + x^2 #tp 1x #tp 4 = (x #tp r)(x #tp s) + $, + ), +) + +we will call $r$ and $s$ the _roots_ of $f$. + +#solution([ + Because $(x #tp r)(x #tp s) = x^2 #tp (r #tp s)x #tp s r$, we must have $r #tp s = 1$ and $r #tm s = 4$. \ + In standard notation, we need $min(r, s) = 1$ and $r + s = 4$, so we take $r = 1$ and $s = 3$: + + #v(2mm) + + $ + f(x) = x^2 #tp 1x #tp 4 = (x #tp 1)(x #tp 3) + $ +]) + +#v(1fr) + +#problem() +How can we use the graph to determine these roots? + +#solution([The roots are the corners of the graph.]) + +#v(0.5fr) +#pagebreak() // MARK: page + + + + + + +#problem() +Graph $f(x) = -2x^2 #tp x #tp 8$. \ +#hint([Use half scale. 1 box = 2 units.]) + +#notsolution(graphgrid(none)) + +#solution([ + #graphgrid({ + import cetz.draw: * + let step = 0.75 + + dotline((0, 0), (8 * step, 8 * step)) + dotline((0.5 * step, 0), (4 * step, 8 * step)) + dotline((0, 4 * step), (8 * step, 4 * step)) + + line( + (0.5 * step, 0), + (1 * step, 1 * step), + (4 * step, 4 * step), + (7.5 * step, 4 * step), + stroke: 1mm + oblue, + ) + }) +]) + +#problem() +Find a factorization of $f$ in the form $a(x #tp r)(x#tp s)$. + +#solution([ + We (tropically) factor out $-2$ to get + + #eqnbox($ + f(x) = -2(x^2 #tp 2x #tp 10) + $) + + + by the same process as the previous problem, we get + #eqnbox($ + f(x) = -2(x #tp 2)(x #tp 8) + $) +]) + +#v(1fr) + +#problem() +Can you see the roots $r$ and $s$ in the graph? \ +How are the roots related to the coefficients of $f$? \ +#hint([look at consecutive coefficients: $0 - (-2) = 2$]) + +#solution([ + The roots are the differences between consecutive coefficients of $f$: + - $0-(-2) = 2$ + - $8 - 0 = 8$ +]) + +#v(0.5fr) + + +#problem() +Find a tropical polynomial that has roots $4$ and $5$ \ +and always produces $7$ for sufficiently large inputs. + +#solution([ + We are looking for $f(x) = a x^2 #tp b x #tp c$. \ + Since $f(#sym.infinity) = 7$, we know that $c = 7$. \ + Using the pattern from the previous problem, we'll subtract $5$ from $c$ to get $b = 2$, \ + and $4$ from $b$ to get $a = -2$. + + And so, $f(x) = -2x^2 #tp 2x #tp 7$ + + #v(2mm) + + Subtracting roots in the opposite order does not work. +]) + +#v(1fr) +#pagebreak() // MARK: page + + +#problem() +Graph $f(x) = 1x^2 #tp 3x #tp 5$. + +#notsolution(graphgrid(none)) + +#solution([ + The graphs of all three terms intersect at the same point: + + #graphgrid({ + import cetz.draw: * + let step = 0.75 + + dotline((0, 1 * step), (3.5 * step, 8 * step)) + dotline((0, 5 * step), (8 * step, 5 * step)) + dotline((0, 3 * step), (5 * step, 8 * step)) + + line( + (0, 1 * step), + (2 * step, 5 * step), + (7.5 * step, 5 * step), + stroke: 1mm + oblue, + ) + }) +]) + + +#problem() +Find a factorization of $f$ in the form $a(x #tp r)(x#tp s)$. + +#solution( + eqnbox($ + f(x) = 1x^2 #tp 3 x #tp 5 = 1(x #tp 2)^2 + $), +) + +#v(1fr) + +#problem() +How is this graph different from the previous two? \ +How is this polynomial's factorization different from the previous two? \ +How are the roots of $f$ related to its coefficients? + +#solution([ + The factorization contains the same term twice. \ + Also note that the differences between consecutive coefficients of $f$ are both two. +]) + +#v(0.5fr) +#pagebreak() // MARK: page + + +#problem() +Graph $f(x) = 2x^2 #tp 4x #tp 4$. + +#notsolution(graphgrid(none)) + +#solution( + graphgrid({ + import cetz.draw: * + let step = 0.75 + + dotline((0, 2 * step), (3 * step, 8 * step)) + dotline((0, 4 * step), (5 * step, 8 * step)) + dotline((0, 4 * step), (8 * step, 4 * step)) + + line( + (0, 2 * step), + (1 * step, 4 * step), + (7.5 * step, 4 * step), + stroke: 1mm + oblue, + ) + }), +) + + +#problem() +Find a factorization of $f$ in the form $a(x #tp r)(x#tp s)$, or show that one does not exist. + +#solution([ + We can factor out a 2 to get $f(x) = 2(x^2 #tp 2x #tp 2)$, + but $x^2 #tp 2x #tp 2$ does not factor. \ + There are no $a$ and $b$ with minimum 2 and sum 2. +]) + +#v(1fr) + +#problem() +Find a polynomial that has the same graph as $f$, but can be factored. + +#solution([ + $ + 2x^2 #tp 3x #tp 4 = 2(x #tp 1)^2 + $ +]) + + +#v(1fr) + +#pagebreak() // MARK: page + + +#theorem() +The _fundamental thorem of tropical algebra_ states that for every tropical polynomial $f$, \ +there exists a _unique_ tropical polynomial $accent(f, macron)$ with the same graph that can be factored \ +into linear factors. + +#v(2mm) + +Whenever we say "the roots of $f$", we really mean "the roots of $accent(f, macron)$." \ +$f$ and $accent(f, macron)$ might be the same polynomial. + +#problem() +If $f(x) = a x^2 #tp b x #tp c$, then $accent(f, macron)(x) = a x^2 #tp B x #tp c$ for some $B$. \ +Find a formula for $B$ in terms of $a$, $b$, and $c$. \ +#hint([there are two cases to consider.]) + +#solution([ + If we want to factor $a(x^2 #tp (b-a)x #tp (c-a))$, we need to find $r$ and $s$ so that + - $min(r,s) = b-a$, and + - $r + s = c - a$ + + #v(2mm) + + This is possible if and only if $2(b-a) <= c-a$, \ + or equivalently if $b <= (a+c) #sym.div 2$ + + #v(8mm) + + *Case 1:* If $b <= (a + c #sym.div) 2$, then $accent(f, macron) = f$ and $b = B$. + + #v(2mm) + + *Case 2:* If $b > (a + c #sym.div) 2$, then + $ + accent(f, macron)(x) + &= a x^2 #tp ((a+c)/2)x #tp c \ + &= a(x #tp (c-a)/2)^2 + $ + has the same graph as $f$, and thus $B = (a+c) #sym.div 2$ + + #v(8mm) + + We can combine these results as follows: + $ + B = min(b, (a+c)/2) + $ +]) + + +#v(1fr) + +#problem() +Find a tropical quadratic formula in terms of $a$, $b$, and $c$ \ +for the roots $x$ of a tropical polynomial $f(x) = a x^2 #tp b x #tp c$. \ +#hint([ + again, there are two cases. \ + Remember that "roots of $f$" means "roots of $accent(f, macron)$". +]) + +#solution([ + *Case 1:* If $b <= (a+c) #sym.div 2$, then $accent(f, macron) = f$ has roots $b-a$ and $c-b$, so + $ + accent(f, macron)(x) = a(x #tp (b-a))(x #tp (c-b)) + $ + + #v(8mm) + + *Case 2:* If $b > (a+c) #sym.div 2$, then $accent(f, macron)$ has root $(c-a) #sym.div$ with multiplicity 2, so + $ + accent(f, macron)(x) = a(x #tp (c-a)/2)^2 + $ + + #v(8mm) + + It is interesting to note that the condition $2b < a+ c$ for there to be two distinct roots becomes $b^2 > a c$ in tropical notation. This is reminiscent of the discriminant condition for standard polynomials! +]) + +#v(1fr) diff --git a/src/Advanced/Tropical Polynomials/parts/02 cubic.typ b/src/Advanced/Tropical Polynomials/parts/02 cubic.typ new file mode 100644 index 0000000..0ff3385 --- /dev/null +++ b/src/Advanced/Tropical Polynomials/parts/02 cubic.typ @@ -0,0 +1,212 @@ +#import "../handout.typ": * +#import "../macros.typ": * +#import "@preview/cetz:0.3.1" + += Tropical Cubic Polynomials + +#problem() +Consider the polynomial $f(x) = x^3 #tp x^2 #tp 3x #tp 6$. \ +- sketch a graph of this polynomial +- use this graph to find the roots of $f$ +- write (and expand) a product of linear factors with the same graph as $f$. + +#notsolution(graphgrid(none)) + +#solution([ + - Roots are 1, 2, and 3. + - $accent(f, macron)(x) = x^3 #tp 1x^2 #tp 3x #tp 6 = (x #tp 1)(x #tp 2)(x #tp 3)$ + + + #graphgrid({ + import cetz.draw: * + let step = 0.75 + + dotline((0, 0), (2.66 * step, 8 * step)) + dotline((0, 1 * step), (3.5 * step, 8 * step)) + dotline((0, 3 * step), (5 * step, 8 * step)) + dotline((0, 6 * step), (8 * step, 6 * step)) + + line( + (0, 0), + (1 * step, 3 * step), + (2 * step, 5 * step), + (3 * step, 6 * step), + (7.5 * step, 6 * step), + stroke: 1mm + oblue, + ) + }) +]) + + + +#v(1fr) +#pagebreak() // MARK: page + +#problem() +Consider the polynomial $f(x) = x^3 #tp x^2 #tp 6x #tp 6$. \ +- sketch a graph of this polynomial +- use this graph to find the roots of $f$ +- write (and expand) a product of linear factors with the same graph as $f$. + +#notsolution(graphgrid(none)) + +#solution([ + - Roots are 1, 2.5, and 2.5. + - $accent(f, macron)(x) = x^3 #tp 1x^2 #tp 3.5x #tp 6 = (x #tp 1)(x #tp 2.5)^2$ + + #graphgrid({ + import cetz.draw: * + let step = 0.75 + + dotline((0, 0), (2.66 * step, 8 * step)) + dotline((0, 1 * step), (3.5 * step, 8 * step)) + dotline((0, 6 * step), (2 * step, 8 * step)) + dotline((0, 6 * step), (8 * step, 6 * step)) + + line( + (0, 0), + (1 * step, 3 * step), + (2.5 * step, 6 * step), + (7.5 * step, 6 * step), + stroke: 1mm + oblue, + ) + }) +]) + + +#v(1fr) + +#problem() +Consider the polynomial $f(x) = x^3 #tp 6x^2 #tp 6x #tp 6$. \ +- sketch a graph of this polynomial +- use this graph to find the roots of $f$ +- write (and expand) a product of linear factors with the same graph as $f$. + +#notsolution(graphgrid(none)) + +#solution([ + - Roots are 2, 2, and 2. + - $accent(f, macron)(x) = x^3 #tp 2x^2 #tp 4x #tp 6 = (x #tp 2)^3$ + + #graphgrid({ + import cetz.draw: * + let step = 0.75 + + dotline((0, 0), (2.66 * step, 8 * step)) + dotline((0, 6 * step), (1 * step, 8 * step)) + dotline((0, 6 * step), (2 * step, 8 * step)) + dotline((0, 6 * step), (8 * step, 6 * step)) + + line( + (0, 0), + (2 * step, 6 * step), + (7.5 * step, 6 * step), + stroke: 1mm + oblue, + ) + }) +]) + + +#v(1fr) +#pagebreak() // MARK: page + + +#problem() +If $f(x) = a x^3 #tp b x^2 #tp c x #tp d$, then $accent(f, macron)(x) = a x^3 #tp B x^2 #tp C x #tp d$ for some $B$ and $C$. \ +Using the last three problems, find formulas for $B$ and $C$ in terms of $a$, $b$, $c$, and $d$. + +#solution([ + + $ + B = min(b, (a+c)/2, (2a+d)/2) + $ + $ + C = min(c, (b+d)/2, (a+2d)/2) + $ +]) + +#v(1fr) +#pagebreak() // MARK: page + +#problem() +What are the roots of the following polynomial? + +#align( + center, + box( + inset: 3mm, + $ + 3 x^6 #tp 4 x^5 #tp 2 x^4 #tp x^3 #tp x^2 #tp 4 x #tp 5 + $, + ), +) + +#solution([ + We have + $ + accent(f, macron)(x) = 3x^6 #tp 2x^5 #tp 1x^4 #tp x^3 #tp 1x^2 #tp 3x #tp 5 + $ + which has roots $-1$, $-1$, $-1$, $1$, $2$, $2$ +]) + + +#v(1fr) +#pagebreak() // MARK: page + +#problem() +If +$ + f(x) = c_0 #tp c_1 x #tp c_2 x^2 #tp ... #tp c_n x^n +$ +then +$ + accent(f, macron)(x) = c_0 #tp C_1 x #tp C_2 x^2 #tp ... #tp C_(n-1) x^(n-1) #tp c_n x^n +$ + +#v(2mm) + +Find a formula for each $C_i$ in terms of $c_0, c_1, ..., c_n$. + +#solution([ + $ + A_j + &= min_(l<=j