David Darmon

MA 237-01, Programming and Technology in Mathematics

Fall 2020

Tuesday, Thursday, 11:40 AM – 1:00 PM, Howard Hall 307
Friday, 11:40 AM – 1:00 PM, Remote via Zoom

This course provides an introduction to the use of technology as a mathematician. A major component of the course consists of building a solid foundation in the skills needed to apply mathematical concepts to programming and vice versa. In addition, the use of technology in written and oral communication and scholarly searches will be covered. Students will also gain an appreciation for the important ethical and social issues related to using technology. Mathematics and programming are inherently social, so students will also learn the customs and conventions of the tribe of mathematicians who use Python, LaTeX, and SageMath.

Prerequisites

MA-120 and MA-126 both passed with a grade of C- or higher.

Professor

Dr. David Darmon ddarmon [at] monmouth.edu
Howard Hall 241

Topics, Notes, Readings

See the end of this page for the current lecture schedule, subject to revision. Homework and additional resources will be linked there, as available.

Course Mechanics

Office Hours

I will have office hours at the following four times each week:

Tuesday,   01:30—02:30 PM Howard Hall 241
Thursday, 10:00—11:00 AM Howard Hall 241
Thursday, 01:30—02:30 PM Howard Hall 241
Friday,     09:00—10:00 AM Howard Hall 241

I will be available for office hours both in-person and on Zoom. For in-person office hours, please email me to make an appointment during one of the times above.

If you are struggling with the homework, having difficulty with the quizzes or exams, or just want to chat, please visit me during my office hours. I am here to help.

Grading Policy

Your final grade will be determined by the following weighting scheme:
30% for homework problem sets
10% for labs
10% for quizzes
20% for exams (10% each)
20% for final project
5% for programming journal
5% for class participation
I will use the standard 10-point breakdown to assign letter grades to numerical grades: with pluses and minuses assigned by dividing the intervals into thirds.

Homework

Homework will be assigned regularly, announced in class, and listed in the Schedule section of this page.

Each homework problem will be graded out of three points: one point for making an honest effort to complete the problem, one point for a technically-correct solution, and one point for clean, well-formatted, documented, and easily readable code.

You will have the opportunity to revise your homework within a week after it is returned and resubmit the new solution to earn back partial credit.

Labs

There will be (approximately) weekly labs. The labs will involve brief exercises related to the latest homework assignment. Attending labs is mandatory. If you miss a lab, your grade for that lab will be a 0.

Pair programming: Labs will be completed in groups using "pair programming," a software development technique where programmers alternate between two roles: a driver who writes the code and an observer who reviews each line of code for correctness and strategizes ways to improve the code moving forward. For each lab, you will randomly be assigned to a partner and the role of either driver or observer. Halfway through the lab, you will switch roles with your partner.

Quizzes

There will be a 20-minute quiz at the beginning of the first lecture after most lab sessions. Quizzes will be announced in advance. Each quiz will contain problems related to the material covered in the readings and during the lectures for a given unit of material. If you miss a quiz, your grade will be a zero for that quiz. Your lowest two quiz grades will be dropped.

Final Project

There will be a month-long final project at the end of the course. You will be assigned into small groups, or, if you prefer, may work alone. You will select a project topic from a list provided by me in the beginning of November. You will write code, document it, write a report, and prepare a presentation on your work to present during the final exam period for this class.

Programming Journal

Learning to program, like learning any new skill, can be frustrating. The computer will always do what you tell it do, which is not always what you want it to do, and determining how to bridge that gap is simultaneously the challenge and the reward of programming. Over the course of the semester, you will keep a programming journal, a document where you record your thoughts about your journey into programming, the struggles you have faced, and the challenges you have overcome. You will also use the programming journal to document common errors that you run into and how to solve them.

You should maintain your programming journal regularly, as you would a personal journal. Updates to your programming journal will be due on the first lecture following each lab.

Class Participation

You are expected to actively participate during each lecture. This includes responding to questions I pose to the class, as well as raising additional questions you may have as I present the material. I will regularly call on both volunteers and non-volunteers and you are expected to either attempt to answer the question or explain your current confusion.

Zoom

We will use Zoom for our remote meetings. During a remote meeting, try to make your surroundings conducive to learning: find a quiet place, close applications and windows on your computer unrelated to class, and clear your work area of other possible distractions. While you are not required to have your video on during the lecture, having it on is highly encouraged. You are expected to have the ability to talk during lecture. Under extenuating circumstances where you are unable to talk, you may interact with the class via the Chat feature in Zoom. In the event that a quiz or test must be taken remotely, I will provide guidelines for how we will hold the quiz or test over Zoom. For these sessions, you will be expected to have your video on.

Attendance

Required. If you expect to miss 2-3 sessions of the course, you should take the course during another semester.

Examination Absences

If you miss an examination your grade will be zero for that exam. If you know you will be absent for an exam you must let me know at least one week in advance to schedule a make-up exam.

Textbook

The required textbooks are:

Collaboration, Cheating, and Plagiarism

All submitted work should be your own. You are welcome and encouraged to use the Internet and consult with others while working on an assignment. However, whenever you have had assistance with a problem, you must state so at the beginning of the problem solution. Unless this mechanism is abused, there will be no reduction in credit for using and reporting such assistance. This policy applies to both individual and group work. In group work, you only need to acknowledge help from outside the group.

Statement on Special Accommodations

Students with disabilities who need special accommodations for this class are encouraged to meet with me or the appropriate disability service provider on campus as soon as possible. In order to receive accommodations, students must be registered with the appropriate disability service provider on campus as set forth in the student handbook and must follow the University procedure for self-disclosure, which is stated in the University Guide to Services and Accommodations for Students with Disabilities. Students will not be afforded any special accommodations for academic work completed prior to the disclosure of the disability, nor will they be afforded any special accommodations prior to the completion of the documentation process with the appropriate disability office.

School of Science Commitment to Equity and Inclusion

The School of Science does not discriminate based on race, gender, ethnicity, sexual orientation, or religion. We strive to create a learning environment that allows everyone to succeed and grow. Towards that end, we are here to assist you in any way we can. Should you experience any difficulties or challenges due to discriminatory or harassing behaviors of any sort in your classes, please know that many people are available to help. You can contact your professor, your academic advisor, the department chair, or any of the Deans (Dean Bachrach, Associate Dean Duckett and Assistant Dean Tiedemann) by email or phone or to meet in person by appointment. There are also resources available in the larger University community including the Office of Equity and Diversity and the Intercultural Center.

COVID-19 and In-person Meetings

During the COVID-19 pandemic, it is critically important that we care for ourselves and each other by taking strict measures to avoid spreading SARS-CoV-2. It is therefore a requirement that face masks are worn properly and appropriate physical distancing is maintained at all times during all classes.

When entering a room, please pick up disinfectant wipes and move as far into the classroom as possible in order to help maintain physical distances. Similarly, leave the room in an orderly fashion and dispose of the wipes on the way out.

Students should wipe down their desktops upon arrival.

Students are expected to wipe down keyboards and monitors with disinfectant wipes (provided) both before and after use.

For further information about COVID-19-related policies, please refer to the Student Handbook.

FERPA Video Prohibition

Under the Family Educational Rights and Privacy Act (FERPA), your education records as a student are confidential and protected. Under most circumstances your records will not be released without your written and signed consent. Part of a student's protected and confidential education records include video and / or audio recordings of students within the classroom. As such, students are strictly prohibited from video or audio recording distance learning lectures off of any platform utilized by professors (Zoom, Webex, etc.). A prohibited recording includes, but is not limited to recordings using the platform, a cell phone, tablet, video camera, audio capture device, etc. Students may be subject to disciplinary action under the Student Code of Conduct if found to have made any video and/or audio recording distance learning lectures without proper consent.

Python

We will use Python regularly throughout the semester.

You can access Python from any web accessible computer using Google Colab. You will need a Google account. I will send out a link via email to a shared Google Drive folder for the course. Resources for homeworks, labs, etc., will be hosted on Google Drive for easy access.

You should also install Python on your personal computer, if you have one. You can install the Anaconda distribution of Python from this link. Be sure to install Python 3.8.

Schedule

Subject to revision. Assignments and solutions will all be linked here, as they are available. All readings are from the textbook by Shapiro unless otherwise noted.
September 8, Lecture 1:
Topics: Intro to course. Scientific Computing. A brief history of scientific computing. What is programming? Python. Python tools: Jupyter Notebooks and Google Colab.
Sections: Preface, Chapter 1, Chapter 6
Learning Objectives
September 10, Lecture 2:
Topics: Basic Python. Programs and statements. Variables and comments. Numbers and types. Functions and packages. Lines, indentation, and other whitespace in Python.
Sections: Chapter 2
Learning Objectives
September 11, Lecture 3:
Topics: Lab 1.
September 15, Lecture 4:
Topics: Algorithms. An algorithm is a finite answer to an infinite number of questions. The Babylonian algorithm for approximating square roots. Flowcharts. Pseudocode. The bisection method for approximating roots of an arbitrary function.
Sections: Chapter 3
Learning Objectives
September 17, Lecture 5:
Topics: Numbers on computers. Binary numbers. Other base systems. Integer representations on a digital computer. Real number representations on a digital computer. Roundoff error. Numerical error.
Sections: Chapter 7, Chapter 8
Learning Objectives
September 18, Lecture 6:
Topics: Lab 2.
Source Code for decimalToBinary()
September 22, Lecture 7:
Topics: Booleans. Logical operators with booleans. Reminder about truth tables. Comparison operators. Flow control. Conditional statements. if, if-else, and if-elif-else statements. Flow diagrams for conditional statements.
Sections: Chapter 12
Learning Objectives
September 24, Lecture 8:
Topics: In-class Exercises.
Sections: Chapter 12
September 25, Lecture 9:
Topics: Iteration. while loops. Flow diagrams for while loops. Mise en place and while loops. Accumulator variables. The Babylonian algorithm via a while loop. Tracking progress in while loops with print() statements. Primality testing. Using conditional statements inside of loops. break statements.
Sections: Chapter 13
Learning Objectives
September 29, Lecture 10:
Topics: In-class Exercises.
Sections: Chapter 13
October 1, Lecture 11:
Topics: Data structures. list. Constructing a list. range() and len(). A list is an addressed box. Counting like a computer scientist: coping with counting from 0. Accessing a list via indexing. Accessing a list via slicing. Growing lists: append() and +.
Sections: Chapter 14, Chapter 15
Learning Objectives
October 2, Lecture 12:
Topics: Lab 3.
Demo of Newton-Raphson for Root Finding
Demo of Newton's Method for Optimization
October 6, Lecture 13:
Topics: Exam 1.
Sections: Lectures 1 - 10
October 8, Lecture 14:
Topics: Python on your personal computer. Terminal applications. The command line. Navigating your computer from a terminal application. Anaconda. ipython. Python scripts. Using Python scripts with ipython. JupyterLab.
Sections: Chapters 4 and 5 and Lecture Notes
Learning Objectives
October 9, Lecture 15:
Topics: Lab 4.
October 13, Lecture 16:
Topics: Functions. Arguments and return values. Anatomy of a function. Defining versus invoking / calling a function. Parameters and arguments. Positional versus keyword arguments. Packing functions into Python scripts. Function documentation.
Sections: Chapter 18
Learning Objectives
October 15, Lecture 17:
Topics: In-class Exercises.
Sections: Chapter 18
October 16, Lecture 18:
Topics: Lab 5.
October 22, Lecture 19:
Topics: Iteration, again. for loops. for loops versus while loops. Summation as a paradigmatic use of for loops. Approximating \(\pi\). Numerical quadrature.
Sections: Chapter 19
Learning Objectives
Demo of Simple Quadrature Rules
October 23, Lecture 20:
Topics: In-class Exercises.
Sections: Chapter 19
Demo of Secant Method for Root Finding
October 27, Lecture 21:
Topics: NumPy, Arrays, and Vectorized Functions. numpy. numpy arrays. Generating structured numpy arrays. Vectorization. Vectorized functions. Vectorized operations. Quadrature via vectorized code.
Sections: Chapter 22
Learning Objectives
October 29, Lecture 22:
Topics: In-class Exercises.
Sections: Chapter 22
October 30, Lecture 23:
Topics: Plotting with matplotlib. Line plots. Interactive figures in IPython and Jupyter. Modifying and decorating plots. Saving plots. Programmatically constructing plots. Scatter plots.
Sections: Chapter 23
Learning Objectives
Demos of Generating Plots in Python
November 3, Lecture 24:
Topics: Exam 2.
Sections: Lectures 11 - 20
November 5, Lecture 25:
Topics: Debugging in Python. Debugging as differential diagnosis. Debugging with print() statements. ipdb. ipdb.pm() and ipdb.set_trace(). Navigating in debugging mode.
Sections: Lecture Notes
Learning Objectives
November 6, Lecture 26:
Topics: Using the internet. Making code more robust. assert. Exceptions. try-except. Version control and git. GitHub. GitHub Desktop.
Sections: Lecture Notes
Learning Objectives
November 10, Lecture 27:
Topics: Writing in math. Markup languages. TeX and LaTeX. Overleaf. Typesetting basic math.
Sections: Lecture Notes
Learning Objectives
An Interactive Introduction to LaTeX: Part 1 by Dr. John D. Lees-Miller
Learn LaTeX in 30 minutes by Overleaf
LaTeX for Data Scientists, in Under 6 Minutes by Andre Ye
List of LaTeX Commands for Common Mathematical Symbols
Detexify for Symbol Recognition
November 12, Lecture 28:
Topics: In-class Exercises.
November 13, Lecture 29:
Topics: Presenting in math. General advice on mathematical presentations. Beamer.
Sections: Lecture Notes
An Interactive Introduction to LaTeX: Part 3 by Dr. John D. Lees-Miller
On Academic Talks: Memory and Fear by Cosma Shalizi
November 17, Lecture 30:
Topics: Typesetting more complicated math. Mathpix Snip. Scholarly search. Stand on the shoulders of giants. Introduction to the academic literature. Using Google Scholar to search the literature. Creating bibliographies using BibTeX. Citations in LaTeX.
Sections: Lecture Notes
Learning Objectives
Mathpix Snip
An Interactive Introduction to LaTeX: Part 2 by Dr. John D. Lees-Miller
November 19, Lecture 31:
Topics: Work on presentations.
November 20, Lecture 32:
Topics: Presentations.
November 24, Lecture 33:
Topics: Symbolic computation and computer algebra. Symbolic computation contra numerical computation. SageMath. Computer algebra using SageMath.
Sections: Lecture Notes
Learning Objectives
Sage for Undergraduates by Gregory Bard
December 1, Lecture 34:
Topics: Symbolic computation and computer algebra, continued. Symbolic calculus in SageMath. Limits. Differentiation. Integration. Mixing symbolic and numerical computation.
Sections: Lecture Notes
Learning Objectives
December 3, Lecture 35:
Topics: In-class Exercises.
December 4, Lecture 36:
Topics: Lab 6.
December 8, Lecture 37:
Topics: Work on final projects.
December 10, Lecture 38:
Topics: Work on final projects.
December 11, Lecture 39:
Topics: Work on final projects.
December 22, Final Exam:
Time: 11:35 AM - 2:25 PM
Location: Via Zoom