Discrete Math

"All The Mathematical Methods I Learned In My University Math Degree Became Obsolete In My Lifetime" - Keith Devlin

Permutations: We list and count the number of permutations of an n set of length k:



Combinations: We list and count the number of subsets of an n set of cardinality k:



Paths from origin on Lattice.:  Count the number of lattice paths of length n, or to a point (p,n-p). Do you notice any patterns? (https://www.desmos.com/calculator/9cebugvb4v)





Combinatorial identities: It is possible to use sage to verify combinatorial identities. There are too many to possibly do examples of, but here we will illustrate some basic ones:

First, that Sum_{k=0}^n C(n,k)=2^n. We verify this from n ranging from 0 to 99. (Why is this true though? Can you prove it in general?)


Next, Pascals Identity, that C(n,k)=C(n-1,k) + C(n-1,k-1). We verify this from n ranging from 0 to 10. (Why is this true though? Can you prove it in general?)


Recurrence Relations: We can compare a closed form of a sequencee to a recurrence relation. Here we verify that a_n=5*2^n-4*3^n is a solution to the recurrence relation a_n=5a_{n-1}-6_{n-2} subject to initial conditions a_0=1, a_1=-2. (Why is this true though? Can you prove it in general?)



Other Closed Form Sequences: We can compare a closed form of a sequence to a pattern.

In the first example, we show that a_n=0+1+2+3+...n =n(n+1)/2 (Why is this true though? Can you prove it in general?)


In the next example, we show that a_n=1+3+5+..2n+1 =(n+1)^2 (Why is this true though? Can you prove it in general?)