Mathematical Computing

Murphy's Laws and Corollaries - Ken's Law: A flying particle will seek the nearest eye.

Welcome to Mathematical Computing!

Click here for printer friendly version

Probability

2/1: In-person learning today! - FINALIZED

* Watch this video: Welcome!

Complete these tasks before class on 2/6:

* Read the syllabus, which is also available on Schoology.
* Have Excel installed on your computer. There are instructions here under Microsoft Office.
* Gain access to Mathematica either by installing it or using Mathematica Online. There are installation instructions for Mathematica are here. To use Mathematica Online, follow the installation instructions on creating an account, then you should have access to the online product.
* Install a Python IDE (Integrated Development Environment). I use Spyder, but there are many other options. I will ask the class for recommendations. You could also ask friends who have taken a course in Python programming which IDE they use.

First Class Survey (to be completed in class)

* Make a copy of the spreadsheet (not the Google doc!) that you submitted today.
* Rename the new spreadsheet 2024-02-01-Lastname-firsthomework.xlsx (or .xls - either one is fine).
* Make another column in the spreadsheet and make a formula that prints "Yes" if the number is a perfect square, and "No" if the number is not a perfect square.

*Bonus: In the column labelled "Prime", make a function that prints "Yes" if the number is a prime number, and "No" if the number is composite.


Week 2

2/6: In-Person Learning Today! - FINALIZED

* We will continue our introduction to Excel today.

Complete these tasks before class on 2/8:

* Make a new tab in a copy of your spreadsheet from today, and iterate the function \(f(x)=a \cos x\). You should be able to change the value of \(a\).Post a copy of this file in your shared folder.
* Check the blog to see if I posted a response.

2/8: In-Person Learning Today - FINALIZED

* We will solve an interesting problem today using Excel!

Complete these tasks before class on 2/13:

* Homework: In a new Excel spreadsheet (make a copy of your in-class work) answer the question we worked on in class for \(p=3\); that is, find all whole numbers such that when we raise the number to the third power then add the digits of that result, we obtain our original number.
* Check the blog to see if I posted a response.
* Be sure that you have access to Mathematica and a Python IDE by Tuesday.

Optional:

* Just a comment: When you upload an Excel file to your Google drive, it stays an Excel file. However, if you double click on it to open it from you Google drive, the file is converted to a Google sheet! To keep the file an Excel file, right click on the file and download it before you open it.


Week 3

2/13: In-Person Class Today! - FINALIZED

* We will begin working with Mathematica today.

Complete these tasks before class on 2/15:

* Read the Mathematica manual on the course webpage.
* In a new Mathematica file. set up code that takes a number, raises it to a power (make the power a variable), separates the number into its digits, and adds the digits together. We've done most of this already, but I want you to make the power a variable. Submit this file in proper format in your shared folder.
* I forgot to send myself a copy of today's in-class file and the computer was restarted - bummer! If there is any part of today's lesson that you want re-posted, let me know. You could also check out the video.
* Check the blog to see if I posted a response.

Optional for Now:

* Make an entry in the Excel manual if you feel so inclined! Some possible topics: how to generate a random number, how to make a graph, how to use conditional formatting to highlight important cells - anything you think you may want to know how to do in the future! Use the format I did, and include your name. I expect you to make some (5, at 4 points each?) entries before the end of the semester. You could also make some entries in the Mathematica manual.

2/15: In-Person Instruction! - FINALIZED

* We will continue our introduction to Mathematica today by working on a familiar problem.

Complete these tasks before class on 2/20:

* Make a copy of today's Mathematica file. Do ONE of these two problems in this new file and upload your file to your shared folder. (On the Help Page I have posted a file with today's code in it in case you want to compare what I did to what you did in class.)

(a) Instead of adding the digits in \(x^p\), raise each digit to a power \(n\) then add them together. For example, if \(p=2\), and \(n=3\), if you started with 9, you would compute \(9^2=81\), separate this into the digits 8 and 1, compute \(8^3\) and \(1^3\), then add those together to obtain 513. I've provided a new findmax function here. For p=2 and n=1, 1 and 9 are the only solution. How many solutions are there for p=2 and n=2, 3, 4, and 5?

(b) Instead of adding the digits in \(x^p\), convert \(x^p\) to another base then add the digits together. For example, if \(p=2\), and \(b=8\), if you started with 9, you would compute \(9^2=81\), convert 81 to base 8 which is 121, then add those together to obtain 4. I've provided a new findmax function here. Only use bases from 2 to 9. For p=2 and b=10, 1 and 9 are the only solution. How many solutions are there for p=3 and b=2, 5, 7, and 9?

* Have your Python IDE ready for class on Tuesday!

* Read the blog!

Optional:

* Nothing right now.


Week 4

2/20: In-Person Instruction! - FINALIZED

* Whoops! I forgot to type this in! You should add one line (or a short loop) to your Python code (in a new file please!) that creates a new list of prime numbers that can be writte in the form \(4n+1\). For example, 5 and 13 should be in the list, but 3 and 7 should not.

* Check the blog for today's response.

2/22: In-Person Instruction! - FINALIZED

* If your code from class today doesn't work yet, finish it. Your code should produce a list of prime numbers that can be written as the sum of two squares, together with the squares. An example of the desired output is in the trial code.

* Also, edit your code to find numbers that can be written as the sum of two cubes. We know that \(2=1^3 + 1^3\). Are there others? Are there any other primes that can be written as the sum of two cubes? Try numbers up to 1000.

* Check the blog for today's response.


Week 5

2/27: In-Person Instruction - FINALIZED

* No additional homework today, other than uploading your code from class today. If you find the problem interesting, coding the three-variable problem could be fun!

* Check to blog for today's response.

2/29: In-Person Instruction! - FINALIZED

* No additional homework, but some of you neglected to upload code or send me an email after today's class. Please do so to receive credit!

*Read the blog for today's response.


Week 6

3/5: No Class - Spring Break

3/7: No Class - Spring Break


Week 7

3/12: In-Person Instruction! - FINALIZED

* Make sure you have a working function as described by Thursday. You should also put your function in a series of loops to check multiple lists of numbers, and have that ready by Thursday. You can see the questions we'll be addressing at the end of today's handout. You can start looking for answers.
* Check the blog for today's response.

3/14: In-Person Instruction! - FINALIZED

* At the end of today's class, upload a word or pdf document with your answer to the question you're working on, and make sure your code produces that answer!

* In a pdf document (create in Word or the word processor of your choice) type the following commands. Check them in the appropriate software to make sure they work!
(1) Write one line of Python code to generate a random real number between a and b and store that value in a variable x.
(2) Write one line of Python code to generate a random integer between a and b and store that value in a variable y.
(3) Write one line of Mathematica code to generate a random real number between a and b and store that value in a variable x.
(2) Write one line of Mathematica code to generate a random integer between a and b and store that value in a variable y.

* Upload your pdf document to your shared folder before class on Tuesday.


Week 8

3/19: In-Person Instruction - FINALIZED

* If your code is working, no homework. If not, get it working. In either case, make sure your code is uploaded to your shared folder before class on Thursday.

3/21: In-Person Instruction - FINALIZED

* Get today's code working before class on Tuesday and upload it to your shared folder. If you had it working in class, you're done! No additional assignment.


Week 9

3/26: In-Person Instruction! - FINALIZED

* If your code is working, no homework. If not, get it working. In either case, make sure your code is uploaded to your shared folder before class on Thursday.

3/28: In-Person Instruction - FINALIZED

* If your code is working, no homework! If not, get it working before class on Tuesday. Upload your code!


Week 10

4/2: In-Person Instruction! - FINALIZED

* If your code is working, no homework! If not, get it working before class on Tuesday. Upload your code!

4/4: Assessment Day - Class Will Not Meet!


Week 11

4/9: In-Person Instruction! - FINALIZED

* Construct a "playgame" function as described in the handout. This should be done before the end of class today. I will test this by loading your code and calling the function.
* Before class on Thursday, get your code working so that you can answer the question posed in the handout. I will test your code by changing the number of dollars that each person has to begin the game. I should be able to do this easily - by changing one easy-to-find variable.

4/11: In-Person Instruction! - FINALIZED

* Get the code for your game working and upload both your code and your Google Doc/Word Document to your shared folder. Be sure to include the length of your game for two different n-sided die (two different n-values).


Week 12

4/16: In-Person Instruction Today! - FINALIZED

* In a new Python file, create code to graph the relation \(x^2 - 0.1 x^3 = 3y^2 - 0.2y^5 - 0.1\cos y\). Choose a cool color for your background, and a tolerance that you think gives you a good picture of what the graph looks like. Name your file with the due date, not today's date.
* Make sure your iterate function is working as described in class. We will use it in class on Thursday! In your new file, iterate(f, -2, 4, 50, 2) and iterate(f,-2, 0.8, 50, 2).

4/18: In-Person Instruction - FINALIZED

* Everyone should have working code from today's class by the end of our class period.
* Construct a coloring function that makes the Julia sets look good. In a Google doc or Word document, copy in the code for your coloring function (p[x,y] = ???) and explain what it does. This is due before class on Tuesday.


Week 13

4/23: In-Person Instruction! - FINALIZED

* Find 3 interesting Julia sets for your function. Upload your code and the three images of your interesting sets to your shared folder. Reminder: name your files

2024-04-23-yourname-description.???, where ??? will be a Python extension or the extension of your image, probably .jpg.

Please fill out this brief survey for the Aspire Center regarding career support.

4/25: In-Person Instruction! - FINALIZED

* Get today's code working. Find two interesting Julia sets for \(f(x)=x^2+c\) as described in class and plot a dot showing where those c-values are on the Mandelbrot set. Upload your Mandelbrot set with the two dots. You should upload 3 images: your two interesting Julia sets for \(f(x)=x^2+c\) and your Mandelbrot set with two dots on it.

-A video for today. Another good video. Today's pictures: picture1, picture2, picture3, picture4.


Week 14

4/30: In-Person Instruction. - FINALIZED

* Using your work today, upload a picture of the Mandelbrot set for your function with four points plotted on it - three should correspond to the interesting Julia sets you found and turned in on 4/25, and one should be new and interesting, found by examining your Mandelbrot set and exploring a new region.

5/2: In-Person Instruction. - FINALIZED

* Make sure you have a working neighbors function. Make a Google Doc or Word document, copy the code for your neighbors function into the document and upload the document into your shared folder.
* Research or develop fun starting configurations for the program you wrote today. Have one ready to share in class on Tuesday.


Week 15

5/7: In-Person Instruction - FINALIZED

* Finish today's code if you haven't already. To receive full credit, finish it by the end of class. To receive significant but reduced credit, finish it before class on Thursday. Answer the question in the handout in a Google doc or Word document, copy your code into that same document, then upload both your code and your document to your shared folder.

5/9: In-Person Instruction. - FINALIZED - YOU MUST BE IN CLASS TO RECEIVE FULL CREDIT FOR THIS ASSIGNMENT.

* See the handout. This assignment must be completed by 11:30 to receive credit. When I run your code, I should see all of your stable state in the gif.


Week 16 - Finals

5/13: Final Exams

5/14: Final Exams - Our final exam period is from 10:30-12:30 on Tueday, May 14. There will be an in-class coding assignment for those who wish to participate. There will be no live stream. You must be in class to complete this assignment. For this assignment, you will NOT be permitted to do an internet search for code. You will need to write it yourself. Some code documentation will be provided.

5/15: Final Exams


Template

Reading Assignment

* Read

Homework

* Do the MyMathLab assignment over today's material. You watched the videos over this material to prepare for today's class.
* Fill out this homework response form after you have completed the assignment. This will count as a writing assignment.

Required Videos to View Before Class on 5/16.

* With the handout available either printed or online, watch these videos. If you have access to a printer, print a copy of the handout to use while watching the videos. If you do not have access to a printer, copy the handouts onto a piece of paper to use while watching the videos.
(1) ??
(2) ??
(3) ??
(4) ??
(5) ??
(6) ??

* While you are watching the videos, take this video quiz. This will count as a quiz. After you take the quiz, the answers should appear on the screen. You should also receive an email confirmation so you can check your answers.

Optional Material

* I have created an optional video assignment in MyMathLab.