mpp_2023
Mathematical Programming in Python
Spring 2023


https://people.sc.fsu.edu/~jburkardt/classes/mpp_2023/mpp_2023.html

mpp_2023 is the home page for the class "Mathematical Programming in Python," MATH 1800, to be offered at the University of Pittsburgh, Spring Semester 2023.


Some mathematical topics are already at least partially written up:

  1. Chance: generating random values; observing and describing random processes; probability distributions; histograms; the cumulative density function and its inverse; the middle square algorithm; linear congruential generators.
  2. The Collatz problem: iteration; conditional statements; while loops; plotting a sequence; saving a list of values; detecting whether a sequence repeats itself;
  3. Combinatorics: objects include combinations, compositions, partitions, permutations, sequences, sets, trees; operations include count, enumerate, rank, unrank, randomly select. Factoring, arithmetic with very large integers, detecting cycles in functional iteration.
  4. Differential Equations: the Euler method; standard problem format; time and phase plots; reducing higher order systems to first order; error behavior; stepsize adaptivity; higher order solvers; conserved quantities; using the scipy() function solve_ivp().
  5. Gradient descent: optimization; least squares error; the basis gradient descent method; stochastic gradient descent. Gradient descent in higher dimensions; the learning rate;
  6. Graph theory: adjacency matrix or adjacency dictionary; connectedness of a graph; edge distance between nodes; visiting every room in a museum; solving a maze; breadth-first and depth first search; weighted graphs; the shortest distance from one node to all others; the shortest round trip visiting a list of cities.
  7. Iteration: how many mathematical processes involve the repeated application of a formula, including bisection, fixed point iteration, the arithmetic-geometric mean, the perfect shuffle of a deck of cards.
  8. Linear Algebra: a boundary value problem is set up and solved using linear algebra; approximating data using a least squares approach; using the power method or eigenvalue analysis to simulate a random walk through a museum; eigenvalue analysis of a moment of inertia calculation; using the SVD to approximate a matrix or an image.
  9. Polynomials: how to represent a polynomial; evaluation, plotting, differentiation, integration; roots and factoring; multiplication and synthetic division; interpolation; some useful polynomial families.
  10. Quadrature: exact integrals by symbolic methods from sympy; integral estimates by Riemann rules, trapezoidal rule, Simpson's rule, Gauss rules; numerical integration methods from numpy() and scipy(); the Monte Carlo method.
  11. Simulation: modeling a dynamic process that may involve choices or random influences; a three way duel; the game of Snakes and Ladders; two flies land in a circle; a model of epidemics; picking a card at random until you've seen them all; seeking the best job candidate with only one chance to hire or reject.
  12. Triangles: how to represent a triangle; sides, perimeter, area, angles, centroid; is a point in the triangle?; barycentric coordinates, quadrature, random sampling, linear functions on a triangle; triangulating a polygon;
  13. Triangulations: how to represent a triangulation; plotting; the area, orientation, interior and exterior edges, and boundary; random sampling; estimating an integral.


Description: This course introduces the use of computation to define, program, and solve a variety of mathematical problems, and to create reports and plots of the results. Students will be expected to write and run programs on their personal laptops. A series of mathematical topics will be presented for which computational techniques can be applied. The mathematical topics and the necessary computational skills be be presented at an introductory level: the emphasis is on training students in how to use computation to advance their mathematical studies. The class is aimed for undergraduate and graduate students in mathematics; students from other scientific disciplines should also be \ able to handle all the material. For lectures and coursework, the Python programming language will be introduced; students are not required to have previous computational experience, but a student who prefers another computer language will be permitted, within reason, to use that in preference to Python. Each topic will be accompanied by a number of exercises and students will have some choice as to which exercises to work on based on their experience, confidence, and daring.

Prerequisites: Students should have taken Math 0220 (Calculus I) and one of Math 0280 (Introduction to Matrices and Linear Algebra), MATH 1180 (Linear Algebra I), or MATH 1185 (Honors Linear Algebra), with a grade of C or better. No prior knowledge of Python is required, and the mathematical topics will be explained as presented.

Grading: There will be no exams. After each mathematical topic is completed, there will be a set of corresponding computational exercises. Students will propose to work on some subset of these exercises, and will be graded on the quality of their correct understanding, careful implementation, and concise presentation of results.

Text: A textbook is not required for this course. But here are several references that a serious student will find very helpful:

Early start: Students interested in getting an early start before the class begins can install Python on their laptop (Go to

https://www.anaconda.com/products.individual)

and then working through the first four sections of the online Python Tutorial, at

https://docs.python.org/3/tutorial/

Getting Help: The Pitt IT Help Desk may assist you in installing Anaconda on your laptop. Send email to

helpdesk@pitt.edu
or check their web page at

https://www.technology.pitt.edu/247-it-help-desk

Syllabus: the course syllabus.


Last revised on 18 September 2022.