============================================================## Homework Assignments

## HW0: Watch this Geno Auriemma link. (This is how I feel about engagement in this class!) ================================================================ HW1: Bring your computer with you on Wednesday! For Windows Computer Users: 1. Download and install the Notepad++ (version 7.7.1) from this link: ( choose the Notepad++ Installer 64-bit x64: Take this one if you have no idea which one you should take.) 2. Download Python 2 from this link: ( choose the Windows x86-64 MSI installer file) 3. Download Python 3 from this link: ( choose the Windows x86-64 executable installer file) For Mac Computer Users: 1. Download BBedit (the "Free Download") from this link::: We will install the software together in class on Wednesday. ================================================================ Remember to dress up pretty for class on Wednesday for my seating chart pictures! ================================================================ HW2: On your computer, start the terminal (linux/mac) or cmd (Windows) program, like we did in class on Wednesday. Type Python to start the Python Interpreter. This will give you the >>> prompt. Using this prompt, you can work through sections 1.51 (pg 12) - 1.54 (pg 14) in our text. Things will look a little different from the text since we are using the Python Interpreter to accomplish the same things. For example, on page 12, where the text has: In [1]: 2+2 Out [1]: 4 You will see: >>> 2+2 4 >>> (You type 2+2 and press 'Enter', the interpreter shows you the result of the command, which is 4. It then gives you another prompt for the next command). Try doing all the examples in 1.5.1 - 1.5.4 and we will continue in class on Wednesday! ================================================================ HW3: R&S (read and study) sections 1.1-1.3 (pgs 1-9) in our text. Make a copy of our ball.py program we worked with in class on Wednesday, name it hw3-ball.py Use your text editor and modify the program to produce the following output: Email your program to me in an email with the Subject Line: MAT3353, HW3 (Note: We did everything in class to where you should be comfortable with this assignment. However, if something is confusing you, or if you are having troubles, email me and ask questions!) Due: Start of class, Monday, 9/9 ================================================================ HW4: R&S sections 1.4-1.5.4 (pgs 9-14) in our text. Do Exercise 1.2 on pg 27. Name your program HW4-cube-volume.py Do Exercise 1.3 on pg 27. Name your program HW4-circumference-and-area.py Email your programs to me with the Subject Line: MAT3353, HW4 Due: Start of class, Wednesday, 9/11 ================================================================ HW5: R&S sections 1.5.5-1.5.11 (pgs 15-26) in our text. Do Exercise 1.4 on pg 27. Name your program dj-HW5-volume3cubes.py Do Exercise 1.5 on pg 27. Name your program dj-HW5-average-int.py (In all cases on the program name, substitute your own initials in place of dj) Email your programs to me with the Subject Line: MAT3353, HW5 Due: Start of class, Monday, 9/16 ================================================================ HW6: R&S sections 2.3-2.4 (pgs 37-41) in our text. This section shows how to use a sum variable to save a sum of numbers. You will use this technique, but with a while loop to write a program to do the following: Use input statements to get a starting integer and an ending integer. Then Use a while loop and your sum variable to find and then print the sum of these integers. For example, the sum of the integers from 1 to 100 is 5050. That is what your program should print. Here is an example of the output from my program: Due: Start of class, Wednesday, 9/18 ================================================================ HW7: R&S sections 2.1-2.2 (pgs 29-36) in our text. 1) Write a program to allow a user to give an input parameter (call it n) and have your program print the sum of the square root of all the integers from 1 to n. Name your program dj-HW7-square-root-sum.py (with your own initials, of course). Your program output should be similar to a sample run of my program, which looks like this: 2) Exercise 2.11 modified: Write a program to calculate the Leibnitz and Euler approximations to pi for a given value of n. The value of n should be given as a command line parameter. Just have your program print the value of n, the value of the Leibnitz approximation, and the value of the Euler approximation. You do NOT need to do the plotting given in the last paragraph of Exercise 2.11. Name your program dj-HW7-pi.py with your own initials, of course). Your program output should be similar to a sample run of my program, which looks like this: I would recommend that you don't wait too long to start on these. If you wait until just an hour before class, you may not have time to figure everything out! Feel free to email me questions if you get stuck on something. Email your programs to me with the Subject Line: MAT3353, HW7 Due: Start of class, Monday, 9/23 ================================================================ HW8: R&S sections 2.5-2.6 (pgs 41-44) in our text. Make a copy of our xy-chart-cls.py program from the 0918 examples worked in class. Name the copy dj-HW8-xy.py (use your own initials). Modify the program to use a function for y, instead of having the function "hard coded" in the while loop. Email your program to me with the Subject Line: MAT3353, HW8 Due: Start of class, Wednesday, 9/25 ================================================================ HW9: R&S sections 6.0 - 6.21 (pgs 184-193) in our text. 1) Make a copy of our xy-chart2.py (the one we used in class on Wednesday) and name it dj-hw9-xy-chart.py (use your own initials). Add a function to the program that will check to see that the command line parameters for xstart, xdelta, and xend all make sense. If they do not, print a message indicating so, and gracefully quit the program. Your output should be similar to mine here: 2) Use your brute-force-root-finder to find the roots for each of the following functions. After each one, email me a copy of your program, named dj-hw9-2a.py, for the first, and dj-hw9-2b.py for the second (use your own initials). a) f(x) = sin( e^x ) , find a root between 0 and 2. b) f(x) = e^(sin x) , find a root between 1 and 5. Due: Start of class, Monday, 9/30 ================================================================ HW10: 1) Make a copy of our modified_brute_force_root_finder_function.py from class today. Name it dj-hw10-brute-force-root-finder.py. Modify the program to use command line parameters to give the values of a, b, and n to the program. a is the starting point, b is the ending point, and n is the number of points for the x list in the linspace command. Using the same example we used in class today, you should run your program like this: python dj-hw10-brute-force-root-finder.py 0 4 1001 Your output should be similar to this: Email your program to me when you have it. 2) Use your program above to find all the roots to f(x) = sin(e^x) between 0 and 4. Pipe your output to a text file named hw10-output.txt. Email it to me with your program above using the Subject Line: MAT3353, HW10. Due: Start of class, Wednesday, 10/2 ================================================================ HW11: 1) Make a copy of our text-newtons-method-improved.py from class on Wednesday and name it dj-hw11-newton-root-finder.py. Modify the program to use command line inputs for the starting value of x, and the epsilon value. If you use the function x^2 - 9, your output should be similar to mine below: 2) Use your program to find the following roots: a) f(x) = x * cos(x^3); find roots from 2 to 2.5 and an epislon of 0.0001 (hint: you will need to run your program twice, using two different values for xstart). Pipe your output to a text file named hw11-2a.txt. b) f(x) = 30x^3 - 800x^2 - 250x + 20; find a root from 5 to 50 and an epislon of 0.0001 Pipe your output to a text file named hw11-2b.txt. Email your program and text files to me with a Subject Line: MAT3353, hw11 Due: Start of class, Monday, 10/7 ================================================================ HW12: 1) Finish debugging our secant-1007.py from class today. When your program is working correctly, use it to find the roots between 1 and 2 of the following function: f(x) = 3*sin(x^3) - 2*sin(x^2) + 5*sin(x) - 4 Make a copy of your program and name it dj-hw12-secant-1007.py. Send it to me in an email with the Subject Line: MAT3353, HW12a. Include your two roots in the text of the email. 2) Make a copy of your dj-hw12-secant-1007.py program and name it dj-hw12-secant.py. Add the logic and lines to the secant function in this program to protect against the division by zero possibility in the xnew = x1 - y1/m line. Email your program to me in an email with the Subject Line: MAT3353, HW12b. Due: Start of class, Wednesday, 10/9 ================================================================ HW13: Modify our secant-method-with-errors-printed.py from our 1009 work to print the absolute, relative, and percent relative error on each line of the iterations. Name your program dj-hw13-secant-with-errors.py and email it to me with a Subject Line of: MAT3353, HW13 I am using the x^2 - 9 function we used in class last Wednesday and your program output should be similar to this: Due: Start of class, Wednesday, 10/16 ================================================================ Our first test will be on Wednesday, 10/16! Make sure you have your computer in proper working condition, as you will use it for all test questions. Each answer will be emailed to me (like you do on the homework). I would recommend the Windows users turn off any Updates for the day of our test! ================================================================ R&S Chapter 3.1 - 3.2 in our text (pages 55-63).

The final exam for MAT3353.01 (the M/W 1:15 section) is onWednesday (Dec 11th) from 10:00 AM - Noon in this room.Bring your calculator and computerand your study sheets.

============================================================ Note: On all emails for this course, start the subject line out with MAT3353, followed by whatever else is appropriate. Emails without this subject line formatting may not be accepted!

Last updated on ... 8/3, 2019

Created on ... 8/3, 2019