Why?

Why do we even need to see a single term of a polynomial?

Well, why do biologists use microscopes? Our project is a microscope for the mathematician.

Inspiration

In the Baltimore School of combinatorics, matrices often give rise to symbolic polynomials whose computation is intractable or unnecessary.

In one specific use case, Tutte's Directed Matrix Tree Theorem (TDMTT) gives a listing of all subtrees of a graph. Each term precisely lists a single subtree of the graph by specifying its edges.

Thus, the theorem is most useful if we can see each term, but calculating it (entirely symbolic, no numbers!) would take a very long time — especially a mathematician is trying to derive this or a similar theorem by hand.

So, instead of calculating each term, if one has a factored form of the polynomial, they can now see individual terms using this visualizer. Similarly, proofs of theorems using similar polynomials may be discovered or better understood with the aid of this visualization.

What it does

Suppose we have a factored polynomial (a + b)(c + d) = ac + ad + bc + bd.

Our project allows users to visualize a single term of this expanded form (e.g., bc) for larger or otherwise more interesting polynomials — finite versions of ordinary generating functions, characteristic polynomial, minimal polynomial, determinant, permanent, covenant polynomials.

How we built it

Three of us had never used HTML, CSS, or JavaScript before. One of us doesn't even code! Most of us had never created a real software project, and all of us are attending our first hackathon. We used a lot of tutorials, and coded up different parts of the project. We split front end and back end.

Challenges we ran into

Input parsing, MathJax integration, regular expressions. PHP, integrating front and back end. The MathJax coloring keeps breaking. If that happens, reloading tends to fix the problem. The regex kept getting more and more convoluted.

Our favorite features

  • Input in LaTeX-like format (used by mathematicians)
  • Our submit button ⭐️ glows ⭐️
  • Highlights the summand chosen
  • Regex recognition for a single multiplicand (the x in 3x) is 66 characters long

Features we had to cut

  • Fully expanding out the polynomial. Implementation of a recursive exponential-time algorithm (choose 1 summand from every factor) failed spectacularly.
  • Toggle for whether we want to see exponents for power-one (x^1 or just x) — useful for some use cases, distracting for others. Front- and back-end elements didn't integrate well.

Accomplishments that we're proud of

Each of us is a first-time hackathon attendee! So each of us learned tons of new things today from each other. Also, we created something from scratch using tools we had never even tried before!

What we learned

So much. Again, each of us is a first-time hackathon attendee, and only one of us had ever used any language on our entire stack! We also learned that we are a great team!

What's next for Polynomial Term Visualizer

  1. Provide a “graphical” visualization of polynomials — each factor is a set of nodes, each summand in the factor is a node. Edges are between adjacent factors, meaning that each term of the expanded form of the polynomial is now a path in the graph.
  2. Compute determinant symbolically, integrate with polynomial visualization (easy).
  3. Derive factored form of permanent or covenant in order to plug in (hard, more mathematical).
  4. Create a more inviting graphical interface that highlights the relationship between factors.

General Track, also Art/Multimedia (math is art :P)

Built With

Share this project:

Updates