Create Beautiful Math Homework

pianomanfrazier

Ryan Frazier

Posted on September 27, 2019

Create Beautiful Math Homework

Throughout my Computer Science degree I have been doing a lot my homework in Latex. It has a steep learning curve but the results are amazing.

For my technical writing class I convinced my group to use Latex instead of Word or Google Docs. In hindsight this created a lot of extra work for me but I learned a lot about customizing a Latex document.

See here for the Latex template I generated.

The things I really liked about this setup was the ability to modularize the document and assign different team members a section. We then collaborated on the document using https://www.overleaf.com. Overleaf has git integration so I could edit the document on my laptop and push the changes back up to overleaf. The downside to this was that my other team members were not programmers and did not know how to use git and had to use the web interface for editing. Generating and managing the bibliography was also very easy using Bibliotex.

For my personal homework I wrote a bash script that reads a config file for the class I am in that has data like the teacher, semester, class name and so forth and generates a new Latex project with a makefile. I have been using this system for 2 semesters and it has been working great. See homework-generator.

For my probability class this semester I also wanted to produce graphs and charts. I have been using the python libraries matplotlib and seaborn to create awesome graphs. My homework often looks better than my textbook (imho).

Here are some highlights of the graphs I did for my homework. The visualizations helped me see what was going on with the math.

Poisson distribution
Poisson Distribution where $$ \lambda = 10 $$ [download poisson.py]

Lognormal Distribution
Lognormal Distribution $$ f(x) = \frac{1}{\sigma x \sqrt{2 \pi}} e^{- (\ln x - \mu)^2 / 2 \sigma^2 }$$ [download lognorm.py]

Using moviepy we can create a nice video of this graph where (\sigma) varies over time.[download lognorm_video.py]

Normal Distribution
Normal Distribution of the Velocity of a Particle $$ f(x) = 2 \frac{mv}{\sigma \sqrt{2 \pi}} e^{- ( \frac{1}{2} mv^2 - \mu)^2 / 2 \sigma ^2} $$ [download velocity.py]

Bivariate
Plot of a Bivariate Distribution $$f_{XY}(x,y) = x e^{-x(y+1)}$$ [download bivariate.py]

And just for fun let's plot a torus and make a video out of it. [download torus.py]

💖 💪 🙅 🚩
pianomanfrazier
Ryan Frazier

Posted on September 27, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Create Beautiful Math Homework
latex Create Beautiful Math Homework

September 27, 2019