Finite Mathematics

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

General graphing:  The following Desmos calculator demonstrates multiple ways in which Desmos can be used to graph things, including lines (in multiple forms) inequalities and non-linear functions.  By graphing multiple lines at once, one can also identify the solution to system of equation in 2 variables.  Currently displayed below are lines y=2x-3 and 2x+2y=6 (the point satisfying both equations is (2,1)).  Other graphs are turned off, but you can click them off or on with buttons on the right: (https://www.desmos.com/calculator/fhqvingjmw)





Solving Higher Dimensional System of Equations:  When we have more than 2 variables, it takes more work to find the solution to the system than graphing the 2 lines.  The following uses the reduced row echelon form technique to solve the system.  Right now it is set to solve the system:

2x+3y-2z=10
-2x+y+z=-1
4y=8

You should see when you evaluate that you get as a solution x=1, y=2, z=-1.  You can set A to represent whatever system you want, for example is the system is

2x-y=-3
2x+2y=6

Then we should let A=matrix(QQ, [[2,-1,-3],[-2,2,6]])

Which has solution x=2, y=1.



Visualizing system of equation in 3 variables:  The solution of system of equation with 2 variables is the intersection of lines, the solution to system of equations in 3 variables is the intersection of planes.  It is kinda hard to see what the solutions are exactly by graphing them, but you can get an intuitive sense of what's happening.  The sagecell below is set to graph the system of equations:

2x+3y-2z=10
-2x+y+z=-1
4y=8

It's also easy to see when/why a system of equations has infinite solutions, for example, if we adjusted the  cell below to graph:

2x+3y-2z=10
-2x+y+z=-1
4y-z=9

You could immediatly see that their intersection isn't a single point anymore, it's a line woth infinitely many points.




Two Variable Linear Programming: By setting the appropriate linear expression equal to z, and the appropriate inequalities in the 1st line, you can see the feasible region of the problem.  By entering the corner points of this region into the table you can see which points minimize and maximize z.  For example, the graph below has z=3x+2y, subject to constraints x>=0, y>=0, x+y>=8, 2x+y<=10, 2x+y<=40.  We can see that z is minimized at x=0, y=0 and z=0.  We see can also see that z is maximized when x=2, y=6, z=18.
(https://www.desmos.com/calculator/ngcgdyhjbh)





Linear Programming-Simplex Method: One can also solve linear programming problems via the simplex method. We enter in the matrix A the coeffecients of the bounding inequalities, b the vector of bounds, c the objective function. For example, the code below has z=2x+3y, subject to constraints x>=0, y>=0, x+y>=10, x+3y<=60, 2x+y<=40.  We can see that z is maximized at x=12, y=16.



Higher Dimensional Linear Programming:  The following code was written by Talya Stocksdale (talya.stocksdale@gmail.com) and Emily Marchbanks (emily.marchbanks@newberry.edu).  In an independent study under my direction, they wrote the following implementation of the simplex algorithm.  Currently, it is set to maximize 10x1+12x2, subject to 4x1+4x2<=400, 2x1+4x2<=350, x1, x2>=0.  However, it can be directed at any canonical linear programming problem:




Compound Interest: Recall that given an initial investment or loan with initial value P, it's future value F after earning i interest (or depreciating) after n periods of time, is given by F=P(1+i)^n. Given any 3 of these variables, one should be able to solve for the 4th, and then graph the resulting exponential function representing the value over time (https://www.desmos.com/calculator/posy8euuac):






Regular Payments & Future Value: If you are making regular payments R, at interest rate i, then after n periods, the future value will be S=(R(1+i)^n-1)/i. Again, given any 3 of these things, one can identify the 4th, and graph the future value of each payment. (https://www.desmos.com/calculator/i9mzfzch2l)





Regular Payments & Present Value: If you are making regular payments R, at interest rate i, then after n periods, the present value will be P=R(1-(1+i)^-n)/i. Again, given any 3 of these things, one can identify the 4th, and graph the present value of each payment. (https://www.desmos.com/calculator/pgov0m93ep)





Truth Tables: Using the following symbols:
  • & – and
  • | – or
  • ~ – not
  • ^ – xor
  • -> – if-then
  • <-> – if and only if

We can generate the truth table for any logical compound statement we want, for example consider the statement "p implies q and not r"