01 In-Class Assignment: Welcome to CMSE/MTH 314 - Matrix Algebra with Computational Applications#

What can you solve with \(Ax=b\)?

Visual image of three planes intersecting. This is a common image used in linear algebra and will be explained in detail laater in the semester.  It is included here mostly as a visual anchor that can help students when they review their notes.

Image from http://wikipedia.org/


1. Syllabus, Schedule and other Procedures#

Let us now use the time to review the course syllabus, schedule and other procedures.


2. Introductions:#

Get into groups as directed by your instructor. Take a few minutes to introduce yourself to your groupmates.


3. Class Procedures#

All in-class assignments are designed such that you can get started as soon as you show up in class. This is highly recommended. See how far you can get on your own and then you will be ready when it is time for questions. Here are the basic instructions.

✅ Step 1 - Get out your laptop#

✅ Step 2 - Create a Course Assignment Folder in your home directory#

HINT Store all notebooks in the same folder on your computer. They will work better that way.

✅ Step 3 - Download this jupyter notebook#

Download a copy of this notebook (ipynb file which tands for ipython notebook).

✅ Step 4 - Open this assignment in Jupyter#

Open the downloaded file inside of jupyter either on your laptop or upload the file to an on-line server and open it there.

###MSU###

✅ Step 5 - Activate your engineering account#

When you enrolled in class you should have received an engineering login. Go to the following URL to activate the account and set your password.

NOTE: The Default DECS password is APID then the @ symbol.

ALSO NOTE: Anyone not enrolled in the course will likely not have an account.

###MSU###

✅ Step 6 - Log onto the Engineering JupyterHub Website#

###MSU###

✅ Step 7 - Upload this notebook to newly created folder on Jupyterhub#

Once the notebook is uploaded, open it.

###MSU###

###MSU###

✅ Step 8 - Sign in to the course Piazza forum.#

We will be using Piazza for all asynchronous in-class discussions. We use Piazza and our Help Sessions as the primary ways to communicate with students outside of class.

To join the course Piazza forum please use the following link:

###MSU###

Note: For this course, it is perfectly fine to run Jupyter notebooks on your computer instead of on JupyterHub if you prefer to do so. However, if something goes wrong, it is possible that your instructor/TA/LAs will not be able to troubleshoot the problem. For this reason, we strongly suggest making sure you can run Jupyter notebooks on JupyterHub.


4. Example:#

Suppose that we have three objects on a balanced beam. Also suppose we know that one has a mass of 2 kg, and we want to find the two unknown masses. Experimentation with a (assume weightless) meter stick produces these two balances. (diagram not to scale)

Image showing two balanced beams, each with three weights. In the top beam is unknown weight A is a distance of 40 to the left of the fulcrum, unknown weight B is a distance of 15 to the left of the fulcrum and a weight of 2 is 50 to the right of the fulcrum. In the bottom beam is the same unknown weights.  Weight A is now a distance of 50 to the right of the fulcrum, weight B is a distance of 25 to the left of the fulcrum and the weight of 2 is a distance of 25 to the right of the fulcrum.

For the masses to balance we must have the sum of the moments on the left equal to the sum of the moments on the right, where the moment of an object is its mass times its distance from the balance point. That gives a system of two equations:

\[40A + 15B = 50 \times 2\]
\[25B = 25 \times 2 + 50A\]

Do This: Find a solution for the above system of equations and place your solution in the following cell. You may either try to do this by hand, or use tools such as a calculator, your computer, something on the internet, etc.

# Put your answer to the above question here
A = 
B = 

Let us use the following code to test your functon further. Note that this uses the answercheck function provided by your instructors. The cell below including answercheck.py in your working directory.

import os.path
from urllib.request import urlretrieve
if not os.path.isfile("answercheck.py"):
    urlretrieve('https://raw.githubusercontent.com/colbrydi/jupytercheck/master/answercheck.py', 'answercheck.py');

Now, run the cell below to see if your solution to the system of equations was correct.

from answercheck import checkanswer

checkanswer(A,'c4ca4238a0b923820dcc509a6f75849b')
checkanswer(B,'a87ff679a2f3e71d9181a67b7542122c')

# If for some reason you put your answer as a float instead of an integer, use these lines instead.
#checkanswer.float(A,'e4c2e8edac362acab7123654b9e73432')
#checkanswer.float(B,'07078a97d66756f213dbca3e379bf084')

Do This: Using Python, verify that the solution you have found does in fact satisfy the system of equations.

# Put your answer to the above question here

Now suppose we have three unknown masses instead of two. Experimentation with a meter stick produces the two balanced states shown below (diagram not to scale, the masses A and B are not necesarily the same as in the previous scenario).

Image showing two balanced beams, each with four weights. In the top beam is unknown weight A which is a distance of 35 to the left of the fulcrum, unknown weight B is a distance of 21 to the left of the fulcrum, unknown weight C is a distance of 11 to the right of the fulcrum and a weight of 2 is 50 to the right of the fulcrum. In the bottom beam is the same unknown weights.  Weight A is now a distance of 10 to the right of the fulcrum, weight B is a distance of 24 to the right of the fulcrum, weight C is a distance of 25 to the left of the fulcrum and the weight of 2 is still at a distance of 50 to the right of the fulcrum.

Do This Individually: Write the equations for this system below.

Put your answer to the above question here

Do This Individually: Find a solution to the previous system of equations and report the mass for objects A, B and C. Again, you may either try to do this by hand, or use tools such as a calculator, your computer, something on the internet, etc.

# Put your answer to the above question here
A =
B =
C =

Do This Individually: Using Python, verify that the solution you have found satisfies the two equations.

# Put your answer to the above question here

Group Discussion: First, verify that everyone found the same system of two equations involving the three masses A, B, and C. Then, check if everyone found the same solution (A,B,C) to the system of equations. If your group found multiple solutions, collectively verify that all of them work. Then as a group, answer the following questions with some explaination:

a) Do you think there are other solutions to the system that your group didn’t find?

b) Do you have enough information to determine the masses of the three objects? If not, what would you need to do to determine the masses of the three objects?

c) Person 1 claims that object A has a mass of \(8\) kg, while Person 2 claims that object A has a mass of \(4\) kg. Can you conclusively say if either or both of them are wrong?

Do This: Briefly summarize your group’s discussion below.


5. Download and review next pre-class assignment#

I will try my best to post each weeks pre-class assignments before noon on Fridays. Note pre-class assignments are generally due at 11:59pm ET the day before class. To get credit for the pre-class assignment you will need to complete the Jupyter notebook and submit your answers to the short quiz/survey on D2L.

Your next Pre-class assignment should be available on the course website.


Written mostly by Dr. Dirk Colbry, Michigan State University, with some modifications by Dr. Santhosh Karnik, Michigan State University.

Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

###STARTFOOTER###


Congratulations, we’re done!#

Be sure to turn in this notebook as an .html file on D2L. If you finished the in-class assignment early, be sure to show it to an instructor/TA/LA before you leave.