MATH 133 � Linear Algebra and Geometry � Winter 2022 Project Assignment Due date: March 27, 2022 ˆ This assignment must be completed with the software SageMath. You can either install it on your...

1 answer below »
here is my math assignments


MATH 133 � Linear Algebra and Geometry � Winter 2022 Project Assignment Due date: March 27, 2022 ˆ This assignment must be completed with the software SageMath. You can either install it on your computer or run it with an online service such as CoCalc. You can simply edit the notebook that's provided on myCourses to complete your as- signment. ˆ You can work out this assignment in teams of at most two students. Write both names and student IDs in your notebook �le. Only one student from the team must submit the assignment (please do not submit the same �le twice!). ˆ Even though web searching and discussion with your peers is encouraged, you must write your own solutions. Direct copying from another team or from somewhere on the internet and may lead to accusations of plagiarism. ˆ Each question is worth 20 marks, for a total of 60 marks. ˆ Late submissions will be penalized 10% o� per day after the deadline. Question 1. Network Flow An island's main network contains bridges and main roads as in the following �gure. Arrows indicate the tra�c's direction. 700 500 800 300 700 200 200 600 1 2 3 4 5 6 a b c d e f g 400 The number of vehicles crossing each bridge at peak hour (called �ow) is indicated on the �gure. We are interested in the �ow on the main roads (denoted with variables a to g). Our model consists of the following two laws: https://www.sagemath.org/ https://cocalc.com/ 1. Flow is constant along each road. 2. The total �ow coming in any intersection is equal to the total �ow coming out of the intersection. Please answer the following questions. (a) Find a system of linear equations that describe the �ow according to those laws. Enter the augmented matrix of the system in SageMath. (b) Use SageMath to �nd the reduced row echelon form of the matrix. Write the solutions to the system in parametric form. (c) What is the maximal �ow on road b? Justify your answer. (d) What is the minimal �ow on road a? Justify your answer. (e) As a truck convoy blocks road b, an anti-war protest blocks road c. What is then the solution to the system? What do you suggest in order to solve the problem? Question 2. Bitmap Image Processing A bitmap image is a matrix of pixels. Each pixel holds a color value, which can be coded with the RGB (Red, Green, Blue) convention: a color value is a vector c⃗ = (r, g, b) where r, g and b are real numbers between 0 and 1. Equivalently, we can see the bitmap image as a triple (R;G;B), where R,G,B are three matrices containing the red, green and blue values respectively. The following example shows both representations of a 3 × 2 pixels bitmap image. (1; 0; 0) (0; 0; 0)(0.8; 0.2; 1) (1; 1; 0) (0; 1; 0) (1; 1; 1)  ≃ ≃  1 00.8 1 0 1  ;  0 00.2 1 1 1  ;  0 01 0 0 1  In this exercise, we test matrix operations on those colorful matrices. (a) Choose a nice colorful photo (or use the classical one provided with the assignment) in PNG format and import it in Sage by executing the provided pieces of code. This will give you three matrices R, G and B as described above. Show your picture with the provided rgbplot function (which you can reuse in the next parts). (b) Grayscale colors are the RGB triples of the form (x, x, x). We can therefore turn any picture into grayscale by calculating a weighted average x of the three colors on each pixel. A good average you may use is: x = 0.3r+ 0.59g + 0.11b. Convert your picture to grayscale and show it with rgbplot. (c) Given a color (r; g; b), its inverse color is the RGB triple (1− r, 1− g, 1− b). Invert the colors of your picture and show the resulting inverted picture. (d) Calculate the transpose of your image and show it. What geometric transformation does this represent? https://en.wikipedia.org/wiki/Lenna (e) A horizontal �ip of a bitmap picture is a re�ection of the picture about a vertical axis located in the center of the picture. Calculate the horizontal �ip of your picture and show it. (f) Rotate your picture by 90◦ counterclockwise, and show the result. Question 3. Linear Regression The �le data.csv contains a list of 100 points (x, y) (one per line) that are expected to follow a linear model, which means that they should concentrate around a line, with an equation of the form: ax+ by = 1 . The goal of this exercise is to �nd the paramaters a and b of that line. (a) Run the provided code for part (a) in the notebook. This will import the �le data.csv into a matrix M and a make scatter plot of the 100 points. Intuitively speaking, what line seems to �t the data? Explain your reasoning. (b) If the points were all precisely on the same line ax+ by = 1, �nd a system of linear equations that a and b would satisfy. You should have one equation per point in the data set. Enter A, x⃗ and c⃗ in SageMath such that Ax⃗ = c⃗ is the matrix form of your system. Does this system have a solution? (c) Now multiply both sides by AT on the left to get a new system: ATAx⃗ = AT c⃗ Does this new system have a solution? Solve it. (d) With the parameters a and b found in part (c), plot the line ax + by = 1 on the same plot as the scatter plot of part (a). How impressive is that? Note: If you are wondering why this simple trick of multiplying by the transpose seems to work so well, don't worry: we will cover that in class.
Answered 1 days AfterMar 26, 2022

Answer To: MATH 133 � Linear Algebra and Geometry � Winter 2022 Project Assignment Due date: March 27, 2022 ˆ...

Neetha answered on Mar 27 2022
117 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here