Skip to content

Instantly share code, notes, and snippets.

View wetmore's full-sized avatar

Matthew Wetmore wetmore

View GitHub Profile
assignment = __dirname.substr(__dirname.lastIndexOf('/') + 1)
module.exports = (grunt) ->
grunt.initConfig
watch:
files: ['!full.tex', '*.tex']
tasks: 'exec:pdf'
options:
event: ['changed']
exec:
@wetmore
wetmore / gist:25a968bd4ffbaf67416a
Created October 4, 2014 20:44
Tex source for a homework assignment with code and math
\documentclass[a4paper,english]{article}
%% Use utf-8 encoding for foreign characters
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{graphicx}
\usepackage{siunitx}
%% Vector based fonts instead of bitmaps
@wetmore
wetmore / gist:2c6286e0873fd2ee4b7e
Created October 4, 2014 20:36
Tex source for notes on a talk about quantum teleportation
\documentclass[11pt, oneside]{article} % use "amsart" instead of "article" for AMSLaTeX format
\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper} % ... or a4paper or a5paper or ...
%\geometry{landscape} % Activate for for rotated page geometry
%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx} % Use pdf, png, jpg, or eps with pdflatex; use eps in DVI mode
% TeX will automatically convert eps --> pdf in pdflatex
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{epigraph}
  1. Give an algorithm to find the longest common subsequence for two given strings using edit distance (the minimal number of additions, deletions and substitutions needed to transform one string into the other).
@wetmore
wetmore / gist:11137017
Last active August 29, 2015 14:00
Fun math problems

Fun problems (rendered at http://mathb.in/18258)

  1. Find $\displaystyle\sum_{n=1}^\infty \frac{n}{2^n}$

  2. Find $\displaystyle\sum_{n=1}^\infty \frac{n^2}{2^n}$

  3. Let $a(k) = \displaystyle\sum_{n=1}^\infty \frac{n^k}{2^n}$. Find a recurrence relation for $a(k)$.

  4. Let $\mathcal{N}$ be the set of natural numbers that do not contain a 6 in their decimal expansion (so, $\mathcal{N} = { 1, 2, 3, 4, 5, 7, \ldots, 14, 15, 17, \ldots }$). Prove that $$ \sum_{n\in\mathcal{N}} \frac{1}{n} < 80 $$