Designing Information Devices and Systems I Fall 2016 Babak Ayazifar, Vladimir Stojanovic Homework 2

Similar documents
Designing Information Devices and Systems I Spring 2017 Babak Ayazifar, Vladimir Stojanovic Homework 2

Designing Information Devices and Systems I Fall 2015 Anant Sahai, Ali Niknejad Homework 2. This homework is due September 14, 2015, at Noon.

Designing Information Devices and Systems I Summer 2017 D. Aranki, F. Maksimovic, V. Swamy Homework 2

Designing Information Devices and Systems I Summer 2017 D. Aranki, F. Maksimovic, V. Swamy Homework 1

Designing Information Devices and Systems I Babak Ayazifar, Vladimir Stojanovic. This homework is due October 25, 2016, at 1PM.

Designing Information Devices and Systems I Fall 2018 Homework 3

Designing Information Devices and Systems I Spring 2017 Babak Ayazifar, Vladimir Stojanovic Homework 6

Designing Information Devices and Systems I Fall 2017 Homework 3

Designing Information Devices and Systems I Spring 2017 Babak Ayazifar, Vladimir Stojanovic Homework 4

Designing Information Devices and Systems I Spring 2016 Elad Alon, Babak Ayazifar Homework 1. This homework is due February 2, 2016, at Noon.

Designing Information Devices and Systems I Spring 2016 Elad Alon, Babak Ayazifar Homework 12

Designing Information Devices and Systems I Spring 2016 Elad Alon, Babak Ayazifar Homework 11

Designing Information Devices and Systems I Fall 2016 Babak Ayazifar, Vladimir Stojanovic Homework 12

Designing Information Devices and Systems I Fall 2018 Homework 5

Math 54 Homework 3 Solutions 9/

MATH 221: SOLUTIONS TO SELECTED HOMEWORK PROBLEMS

Designing Information Devices and Systems I Spring 2019 Homework 11

MATH 341, Section 001 FALL 2014 Introduction to the Language and Practice of Mathematics

Designing Information Devices and Systems I Fall 2015 Anant Sahai, Ali Niknejad Final Exam. Exam location: RSF Fieldhouse, Back Left, last SID 6, 8, 9

Span and Linear Independence

Designing Information Devices and Systems I Spring 2018 Homework 13

Lecture 12: Solving Systems of Linear Equations by Gaussian Elimination

Designing Information Devices and Systems I Fall 2016 Babak Ayazifar, Vladimir Stojanovic Midterm 1. Exam location: 145 Dwinelle, last SID# 2

Lecture 18: The Rank of a Matrix and Consistency of Linear Systems

Designing Information Devices and Systems I Spring 2017 Babak Ayazifar, Vladimir Stojanovic Midterm 1

Math 308 Midterm Answers and Comments July 18, Part A. Short answer questions

x + 2y + 3z = 8 x + 3y = 7 x + 2z = 3

CHAPTER 8: MATRICES and DETERMINANTS

Unit 4 Patterns and Algebra

CMU CS 462/662 (INTRO TO COMPUTER GRAPHICS) HOMEWORK 0.0 MATH REVIEW/PREVIEW LINEAR ALGEBRA

Section 6.3. Matrices and Systems of Equations

Designing Information Devices and Systems I Discussion 4B

Chapter 4. Solving Systems of Equations. Chapter 4

Designing Information Devices and Systems I Spring 2018 Homework 11

Designing Information Devices and Systems I Fall 2018 Lecture Notes Note 6

Designing Information Devices and Systems I Spring 2018 Lecture Notes Note Introduction to Linear Algebra the EECS Way

3 Fields, Elementary Matrices and Calculating Inverses

Recitation 9: Probability Matrices and Real Symmetric Matrices. 3 Probability Matrices: Definitions and Examples

Designing Information Devices and Systems I Fall 2015 Anant Sahai, Ali Niknejad Homework 10. This homework is due November 9, 2015, at Noon.

Review Solutions for Exam 1

Designing Information Devices and Systems I Spring 2018 Homework 7

Designing Information Devices and Systems I Discussion 2A

MA554 Assessment 1 Cosets and Lagrange s theorem

A 2. =... = c c N. 's arise from the three types of elementary row operations. If rref A = I its determinant is 1, and A = c 1

Math 31 Lesson Plan. Day 5: Intro to Groups. Elizabeth Gillaspy. September 28, 2011

For all For every For each For any There exists at least one There exists There is Some

4 Elementary matrices, continued

Designing Information Devices and Systems I Fall 2016 Babak Ayazifar, Vladimir Stojanovic Midterm 1. Exam location: 2050 VLSB, Last Name: Tong-Zzz

7.5 Operations with Matrices. Copyright Cengage Learning. All rights reserved.

Designing Information Devices and Systems I Fall 2018 Lecture Notes Note Introduction to Linear Algebra the EECS Way

Math 31 Lesson Plan. Day 2: Sets; Binary Operations. Elizabeth Gillaspy. September 23, 2011

Designing Information Devices and Systems I Fall 2018 Lecture Notes Note 6

Math 51, Homework-2. Section numbers are from the course textbook.

2 Systems of Linear Equations

Designing Information Devices and Systems I Spring 2016 Elad Alon, Babak Ayazifar Midterm 1

4 Elementary matrices, continued

Final Review Sheet. B = (1, 1 + 3x, 1 + x 2 ) then 2 + 3x + 6x 2

Matrix Inverses. November 19, 2014

Designing Information Devices and Systems I Summer 2017 D. Aranki, F. Maksimovic, V. Swamy Homework 5

Designing Information Devices and Systems I Spring 2019 Lecture Notes Note 6

Designing Information Devices and Systems I Fall 2015 Anant Sahai, Ali Niknejad Midterm 1. Exam location: 60 Evans, last digit SID= 6

Designing Information Devices and Systems I Spring 2017 Official Lecture Notes Note 1

Lecture 2e Row Echelon Form (pages 73-74)

Methods of Mathematics

22A-2 SUMMER 2014 LECTURE 5

MATH10212 Linear Algebra B Homework Week 4

Differential Equations

Abstract & Applied Linear Algebra (Chapters 1-2) James A. Bernhard University of Puget Sound

Lecture 22: Section 4.7

Numerical Methods Lecture 2 Simultaneous Equations

1. Solve each linear system using Gaussian elimination or Gauss-Jordan reduction. The augmented matrix of this linear system is

Systems of equation and matrices

Matrix-Vector Products and the Matrix Equation Ax = b

MATH 315 Linear Algebra Homework #1 Assigned: August 20, 2018

LINEAR ALGEBRA KNOWLEDGE SURVEY

Section 29: What s an Inverse?

Cosets and Lagrange s theorem

CHAPTER 8: MATRICES and DETERMINANTS

Exercise Sketch these lines and find their intersection.

, p 1 < p 2 < < p l primes.

Row Reducing Matrices

Math 1314 Week #14 Notes

Let V be a vector space, and let X be a subset. We say X is a Basis if it is both linearly independent and a generating set.

Chapter 9: Roots and Irrational Numbers

CHAPTER 7: Systems and Inequalities

Math Week 1 notes

Midterm 1 Review. Written by Victoria Kala SH 6432u Office Hours: R 12:30 1:30 pm Last updated 10/10/2015

March 19 - Solving Linear Systems

The scope of the midterm exam is up to and includes Section 2.1 in the textbook (homework sets 1-4). Below we highlight some of the important items.

Solving Quadratic & Higher Degree Equations

Section Matrices and Systems of Linear Eqns.

Designing Information Devices and Systems I Spring 2018 Homework 10

Handout 1 Systems of linear equations Gaussian elimination

Linear Algebra. The analysis of many models in the social sciences reduces to the study of systems of equations.

LECTURES 4/5: SYSTEMS OF LINEAR EQUATIONS

Section 1.8/1.9. Linear Transformations

MATH 3012 N Homework Chapter 9

Use Newton s law of cooling to narrow down the number of suspects by determining when the victim was killed.

Linear Algebra March 16, 2019

Notes on Row Reduction

Transcription:

EECS 16A Designing Information Devices and Systems I Fall 2016 Babak Ayazifar, Vladimir Stojanovic Homework 2 This homework is due September 13th, 2016, at Noon. Optional Problems: We do not grade these problems. Nevertheless, you are responsible for learning the subject matter within their scope. Bonus Problems: We do grade these problems. Doing them will provide an unspecified amount of extra credit; not doing them will not affect your homework grade negatively. We will specify if the problem is in or out of scope. 1. Homework process and study group Who else did you work with on this homework? List names and student ID s. (In case of hw party, you can also just describe the group.) How did you work on this homework? Working in groups of 3-5 will earn credit for your participation grade. 2. Powers of a Nilpotent Matrix (OPTIONAL) Do this problem if you would like more mechanical practice with matrix multiplication. The following matrices are examples of a special type of matrix called a nilpotent matrix. What happens to each of these matrices when you multiply it by itself four times? Multiply them to find out. Why do you think these are called "nilpotent" matrices? (Of course, there is nothing magical about 4 4 matrices. You can have nilpotent square matrices of any dimension greater than 1.) (a) Do A 4 by hand. Make sure you show what A 2 and A 3 are along the way. 0 2 1 3 A = 0 0 1 2 0 0 0 3 (1) 0 0 0 0 (b) Do B 4 by hand. Make sure you show what B 2 and B 3 are along the way. 3 4 2 1 B = 5 6 3 1 6 7 3 2 (2) 2 2 1 0 3. Elementary Matrices Last week, we learned about an important technique for solving systems of linear equations called Gaussian Elimination. It turns out each row operation in Gaussian Elimination can be performed by multiplying the augmented matrix on the left by a specific matrix called an elementary matrix. For example, suppose we EECS 16A, Fall 2016, Homework 2 1

want to row reduce the following augmented matrix: 1 2 0 5. 16 0 1 0 3. 7 A = 2 3 1 6. 9 0 1 0 2. 5 What matrix do you get when you subtract the 4th row from the 2nd row of A (putting the result in row 2)? (You don t have to include this in your solutions.) Now, try multiplying the original A on the left by 1 0 0 0 E = 0 1 0 1 0 0 1 0 (4) 0 0 0 1 (You don t have to include this in your solutions either.) Notice that you get the same thing. 1 2 0 5. 16 0 0 0 1. 2 EA = 2 3 1 6. 9 0 1 0 2. 5 E is a special type of matrix called an elementary matrix. This means that we can obtain the matrix E from the identity matrix by applying an elementary row operation - in this case, subtracting the 4th row from the 2nd row. In general, any elementary row operation can be performed by left multiplying by an appropriate elementary matrix. In other words, you can perform a row operation on a matrix A by first performing that row operation on the identity matrix to get an elementary matrix, and then left multiplying A by the elementary matrix (like we did above). (a) Write down the elementary matrices required to perform the following row operations on a 4 5 augmented matrix. Switching rows 1 and 2 Multiplying row 3 by -4 Adding 2 row 2 to row 4 (putting the result in row 4) and subtracting row 2 from row 1 (putting the result in row 1) Hint: For this last problem, note that if you want to perform two row operations on the matrix A, you can perform them both on the identity matrix and then left multiply A by the resulting matrix. (b) Now, compute a matrix E (by hand) that fully row reduces the augmented matrix A given in Eqn (3) - that is find E such that EA is in full row reduced echelon form. Show that this is true by multiplying out EA. As a reminder in this case, when the augmented matrix is fully row-reduced it will have the form 1 0 0 0. b 1 0 1 0 0. b EA = 2 (6) 0 0 1 0. b 3 0 0 0 1. b 4 (3) (5) EECS 16A, Fall 2016, Homework 2 2

Hint: As before note that you can either apply a set of row operations to the same identity matrix or apply them to separate identity matrices and then multiply the matrices together. Make sure, though, that you both apply the row operations in the correct order and multiply the matrices in the correct order. 4. Pump Properties Proofs (a) You are an engineering intern in the maintenance division at Ela Dam + Co. The pumps are activated at the touch of a large red button, which doesn t leave much room for mistakes. The owner of the pump facility charges his engineers to create a device/system that can reverse the action of the pumps, so that if someone accidentally presses the button they can go back in time and Ctrl-Z the mistake. One of your fellow engineering interns (who isn t from Berkeley) proposes simply reversing the direction of the pumps - as shown in the "Original" and "Reversed" examples below. Will applying the reversed pump diagram return the pools back to the same state they were in before the original pumps were applied? If yes, prove it. If no, provide a counterexample. a a b b c Original c Reverse (b) The intern catches his own mistake, and proposes normalizing the pump transition matrix such that the entries in each column sum to one. This matches the "Original" and "Normalized Reverse" example diagrams shown below. Will applying the reversed pump diagram return the pools back to the same state they were in before the original pumps were applied? If yes, prove it. If no, provide a counterexample. a b c Original b a c Normalized Reverse Mechanism: a + b = 1 c = 1 (c) Suppose a pump s state transition matrix is such that the entries of each column vector sum to one. What is the physical interpretation about the total amount of water in the system? (d) Set up the state transition matrix A for the pump system shown below. Explain what this A matrix implies physically about the amount of water in reservoirs 1 and 3 after many repeated applications of this pump system? (Note: If there is no self arrow / self loop the water does not return to its original pool.) EECS 16A, Fall 2016, Homework 2 3

0.4 0.65 0.5 0.6 (e) There is a pump state transition matrix where the entries of its rows sum to one. Prove that applying this pump system to a uniform vector will return the same uniform vector. A uniform vector is a vector where all the elements are the same. 5. Show It a 11 a 1n. a i j. a n1 a nn 0.2 x x. =. x x Let n be a positive integer. Let { v 1, v 2,..., v k } be a set of k linearly dependent vectors in R n. Show that for any n n matrix A, the set {A v 1,A v 2,...,A v k } is a set of linearly dependent vectors. Make sure that you prove this rigorously for all possible matrices A. 6. Figuring out the tips A number of people gather around a round table for a dinner. Between every adjacent pair of people there is a plate for tips. When everyone has finished eating, each person places half their tip in the plate to their left and half in the plate to their right. In the end, of the tips in each plate, some of it is contributed by the person to its right, and the rest is contributed by the person to its left. Suppose you can only see the plates of tips after everyone has left. Can you deduce everyone s individual tip amounts? (a) Suppose 6 people sit around a table and there are 6 plates of tips at the end. T 3 P 3 T 2 P 2 P 1 T 1 T 4 P4 T 5 If we know the amounts in every plate of tips (P 1 to P 6 ), can we determine the individual tips of all 6 people (T 1 to T 6 )? If yes, explain why. If not, give two different assignments of T 1 to T 6 that will result in the same P 1 to P 6. P 6 T 6 (b) The same question as above, but what if we have 5 people sitting around a table? P 5 T 2 P 2 T 3 T 1 P 1 P 5 T 5 P 3 P 4 T4 (c) If n is the total number of people sitting around a table, for which n can you figure out everyone s tip? You do not have to rigorously prove your answer. EECS 16A, Fall 2016, Homework 2 4

7. Image Stitching Often, when people take pictures of a large object, they are constrained by the field of view of the camera. This means that they have two options by which they can capture the entire object: Stand as far as away as they need to to include the entire object in the camera s field of view (clearly, we do not want to do this as it reduces the amount of detail in the image) (This is more exciting) Take several pictures of different parts of the object, and stitch them together, like a jigsaw puzzle. We are going to explore the second option in this problem. Prof. Ayazifar, who is a professional photographer, wants to construct an image by doing this image stitching. Unfortunately, he took some of the pictures at different angles, as well as at different positions and distances from the object. While processing these pictures, he lost information about the positions and orientations at which he took them. Luckily, you and your friend Marcela, with your wealth of newly acquired knowledge about vectors and rotation matrices, can help him! You and Marcela are designing an iphone app that stitches photographs together into one larger image. Marcela has already written an algorithm that finds common points in overlapping images and it s your job to figure out how to stitch the images together. You recently learned about vectors and rotation matrices in EE16A and you have an idea about how to do this. Your idea is that you should be able to find a single rotation matrix, R, which is a function of some angle, θ, and a translation vector, T, that transforms every common point in one image to that same point in the other image. Once you find the the angle, θ, and the translation vector, T, you will be able to transform one image so that it lines up with the other image. Suppose p is a point in one image and q is the corresponding point (i.e. they represent the same thing in the scene) in the other image. You write down the following relationship between p and q. [ qx q y ] [ ] cosθ sinθ = sinθ cosθ }{{} R(θ) This looks good but then you realize that one of the pictures might be farther away than the other. You realize that you need to add a scaling factor, λ > 0. [ ] [ ][ ] [ ] qx cosθ sinθ px Tx = λ + (8) sinθ cosθ q y (For example, if λ > 1, then the image containing q is closer (appears larger) than the image containing p. If 0 < λ < 1, then the image containing q appears smaller.) You are now confident that if you can find θ, T, and λ, then you will be able to reorient and scale one of the images so that it lines up with the other image. Before you get too excited, however, you realize that you have a problem. Equation (8) is not a linear equation in θ, T, and λ. You re worried that you don t have a good technique for solving nonlinear systems of equations. You decide to talk to Marcela and the two of you come up with a brilliant solution. You decide to "relax" the problem so that you re solving for a general matrix R rather than precisely a scaled rotation matrix. The new equation you come up with is [ ] [ ][ ] [ ] qx R11 R = 12 px Tx + (9) R 21 R 22 p y T y q y [ px p y p y ] + [ Tx T y ] T y (7) EECS 16A, Fall 2016, Homework 2 5

Figure 1: Two images to be stitched together with pairs of matching points labeled. This equation is linear so you can solve for R 11, R 12, R 21, R 22, T x, T y. Also you realize that if p and q actually do differ by a rotation of θ degrees and a scaling of λ, you can expect that the general matrix R that you find will turn out to be a scaled rotation matrix with R 11 = λ cos(θ), R 12 = λ sin(θ), R 21 = λ sin(θ), and R 22 = λ cos(θ). (a) Multiply out Equation (9) into two scalar linear equations. What are the known values and what are the unknowns in each equation? How many unknowns are there? How many equations do you need to solve for all the unknowns? How many pairs of common points p and q will you need in order to write down a system of equations that you can use to solve for the unknowns? (b) Write out a system of linear equations that you can use to solve for the values of R and T. (c) In the IPython notebook prob2.ipynb you will have a chance to test out your solution. Plug in the values that you are given for p x, p y, q x, and q y for each pair of points into your system of equations to solve for the parameters R and T. You will be prompted to enter your results and the notebook will then apply your transformation to the second image and show you if your stitching algorithm works. (d) We will now explore when this algorithm fails. For example, the three pairs of points must all be distinct points. Show that if p 1, p 2, p 3 are co-linear, the system of (9) is underdetermined. Does this make sense geometrically? (Think about the kinds of transformations possible by a general affine transform. An affine transform is one that preserves points, for example in the rotation of a line although the angle of the line might change the length will not. All linear transformations are affine. Click me! Definition of Affine.) Use the fact that: p 1, p 2, p 3 are co-linear iff (p 2 p 1 ) = k(p 3 p 1 ) for some k R. (e) (BONUS) Show that if the three points are not co-linear, the system is fully determined. (f) (BONUS) Marcela comments that perhaps the system (with three co-linear points) is only underdetermined because we relaxed our model too much by allowing for general affine transforms, instead of just isotropic-scale/rotation/translation. Can you come up with a different representation of (8), that will allow for recovering the transform from only two pairs of distinct points? (Hint: Let a = λ cos(θ) and b = λ sin(θ). In other words, enforce R 11 = R 22 and R 12 = R 21 ). 8. Your Own Problem Write your own problem related to this week s material and solve it. You may still work in groups to brainstorm problems, but each student should submit a unique problem. What is the problem? How to formulate it? How to solve it? What is the solution? EECS 16A, Fall 2016, Homework 2 6