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

Similar documents
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 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 Fall 2016 Babak Ayazifar, Vladimir Stojanovic Homework 2

Designing Information Devices and Systems I Fall 2018 Homework 3

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

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

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 2018 Homework 11

Designing Information Devices and Systems I Spring 2019 Homework 11

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

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

Designing Information Devices and Systems I Fall 2018 Homework 5

Designing Information Devices and Systems I Spring 2018 Homework 13

Designing Information Devices and Systems I Spring 2018 Homework 10

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

Designing Information Devices and Systems I Spring 2018 Homework 7

Designing Information Devices and Systems I Spring 2019 Homework 7

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

Designing Information Devices and Systems I Summer 2017 D. Aranki, F. Maksimovic, V. Swamy Midterm 1. Exam Location: 2050 VLSB

Using Microsoft Excel

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

Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Homework 5. This homework is due October 6, 2014, at 12:00 noon.

Designing Information Devices and Systems I Fall 2018 Homework 7

Designing Information Devices and Systems I Spring 2019 Homework 5

AP Physics B SUMMER ASSIGNMENT Summer, Instructor: Rhett Butler

Designing Information Devices and Systems I Discussion 2A

Designing Information Devices and Systems II Fall 2018 Elad Alon and Miki Lustig Homework 9

Motion II. Goals and Introduction

1.1 Administrative Stuff

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

Designing Information Devices and Systems I Summer 2017 D. Aranki, F. Maksimovic, V. Swamy Midterm 2. Exam Location: 100 Genetics & Plant Bio

Chapter 5 Simplifying Formulas and Solving Equations

Designing Information Devices and Systems II Spring 2016 Anant Sahai and Michel Maharbiz Midterm 1. Exam location: 1 Pimentel (Odd SID + 61C)

MATH 221: SOLUTIONS TO SELECTED HOMEWORK PROBLEMS

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

Measurement & Lab Equipment

Chapter 1 Linear Equations. 1.1 Systems of Linear Equations

MATH 408N PRACTICE MIDTERM 1

LAB 2 - ONE DIMENSIONAL MOTION

Honors Math 2 Unit 5 Exponential Functions. *Quiz* Common Logs Solving for Exponents Review and Practice

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

CSE 241 Class 1. Jeremy Buhler. August 24,

WELCOME TO PHYSICS 201. Dr. Luis Dias Summer 2007 M, Tu, Wed, Th 10am-12pm 245 Walter Hall

base 2 4 The EXPONENT tells you how many times to write the base as a factor. Evaluate the following expressions in standard notation.

MATH240: Linear Algebra Review for exam #1 6/10/2015 Page 1

Linear equations The first case of a linear equation you learn is in one variable, for instance:

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

QUADRATICS 3.2 Breaking Symmetry: Factoring

Mathematica Project 3

Spring 2018 Math Week Week 1 Task List

Lesson 5b Solving Quadratic Equations

b) (1) Using the results of part (a), let Q be the matrix with column vectors b j and A be the matrix with column vectors v j :

Designing Information Devices and Systems II Spring 2017 Murat Arcak and Michel Maharbiz Homework 9

Calculus II. Calculus II tends to be a very difficult course for many students. There are many reasons for this.

Physics 6A Lab Experiment 6

36 What is Linear Algebra?

Unit 2 Modeling with Exponential and Logarithmic Functions

Exam 1 Review. IEA Section 2 2/5/2018 Section 3 2/5/2018

Experiment 0 ~ Introduction to Statistics and Excel Tutorial. Introduction to Statistics, Error and Measurement

Fall 2017 Math 108 Week Week 1 Task List

Designing Information Devices and Systems I Fall 2015 Anant Sahai, Ali Niknejad Final Exam. Exam location: You re Done!!

Designing Information Devices and Systems II Fall 2018 Elad Alon and Miki Lustig Homework 12

Performance script for sixth graders By Thomas Kuo and Kimberly Kline LEAPS Fellows, University of California, Santa Barbara

Welcome to IB Math - Standard Level Year 2

Designing Information Devices and Systems I Fall 2017 Midterm 1. Exam Location: 155 Dwinelle

Physics Motion Math. (Read objectives on screen.)

These Choice Boards cover the fourteen units for eighth grade Common Core math.

LINEAR ALGEBRA. and VECTOR GEOMETRY Volume 2 of 2 September 2014 edition

Math 308 Spring Midterm Answers May 6, 2013

Welcome to IB Math - Standard Level Year 2.

Weeks 8 and 9. Eclectic Equations

CHAPTER 8: MATRICES and DETERMINANTS

Example: 2x y + 3z = 1 5y 6z = 0 x + 4z = 7. Definition: Elementary Row Operations. Example: Type I swap rows 1 and 3

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

Overlay Analysis II: Using Zonal and Extract Tools to Transfer Raster Values in ArcMap

BANKING DAY SCHEDULE (SHORT DAY)

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

Roberto s Notes on Linear Algebra Chapter 4: Matrix Algebra Section 7. Inverse matrices

LAB PHYSICS MIDTERM EXAMINATION STUDY GUIDE

Beer s Law 29 January 2019

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

MATLAB Project 2: MATH240, Spring 2013

Egyptian Fractions: Part I

Take the Anxiety Out of Word Problems

Math 54 Homework 3 Solutions 9/

Example: 2x y + 3z = 1 5y 6z = 0 x + 4z = 7. Definition: Elementary Row Operations. Example: Type I swap rows 1 and 3

AP Physics 2 Summer Assignment

Experiment 1: The Same or Not The Same?

Physics 6A Lab Experiment 6

7.1 Solving Systems of Equations

Syllabus, Math 343 Linear Algebra. Summer 2005

STANDARDS OF LEARNING CONTENT REVIEW NOTES. ALGEBRA I Part II 1 st Nine Weeks,

Econ 1123: Section 2. Review. Binary Regressors. Bivariate. Regression. Omitted Variable Bias

Egyptian Fractions: Part I

is a 3 4 matrix. It has 3 rows and 4 columns. The first row is the horizontal row [ ]

Physics E-1ax, Fall 2014 Experiment 3. Experiment 3: Force. 2. Find your center of mass by balancing yourself on two force plates.

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

Spring 2015 Midterm 1 03/04/15 Lecturer: Jesse Gell-Redman

Transcription:

EECS 6A Designing Information Devices and Systems I Summer 207 D. Aranki, F. Maksimovic, V. Swamy Homework This homework is due on Sunday, June 25, 207, at 2:59. Self-grades are due on Monday, June 26, 207, at 2:59. Submission Format Your homework submission should consist of two files. hw.pdf: A single PDF file that contains all of your answers (any handwritten answers should be scanned) as well as your IPython notebook saved as a PDF. If you do not attach a PDF of your IPython notebook, you will not receive credit for problems that involve coding. Make sure that your results and your plots are visible. hw.ipynb: A single IPython notebook with all of your code in it. In order to receive credit for your IPython notebook, you must submit both a printout and the code itself. Submit each file to its respective assignment on Gradescope.. Administrivia (a) We will be using Gradescope to log your lab grades this term. To get started with this, every student must submit their own lab grade assignment to Gradescope. First, open the template here: http://tinyurl.com/6a-su7-labgrades. This can be done on any Google account. You will be greeted by a view-only document. Next to the name and by the star at the top of the page, as show in Figure below, add the document to your Google Drive. Figure : Adding document to drive. You should then see the document appear in your My Drive. Go find the document in your drive, and right click to Make a Copy. After making a copy, open it up and it should no longer be view-only. Open it up and fill out your Name, Lab Section, and SID. To insert your recent picture, click on the image, and click on Edit. EECS 6A, Summer 207, Homework

Figure 2: Editing Recent Picture. After doing so, it should pull up a drawing window. Delete the Recent Picture textbox and then insert a recent picture of yourself by hitting the Image button up top. Fit it within the lines, so it does not mess up the formatting, and hit Save & Close. Figure : After Inserting Your Picture. Once that is done, save the document as a PDF and submit it to Gradescope Lab Grade. We understand that this is a bit of a hassle, but it helps us learn your names and faces very quickly. (b) Read the syllabus and course policies, which can be found here: http://inst.eecs.berkeley. edu/~ee6a/su7. Then, copy the following statement into your homework submission: I, [insert name here], affirm that I have read and understood the syllabus and I know that the exam dates are [insert midterm date here], [insert midterm 2 date here], [insert final date here]. 2. Elementary Matrices This week, we learned about an important technique for solving systems of linear equations called Gaussian elimination. It turns out that 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 want to row reduce the following augmented matrix: A = 2 0 5 6 0 0 7 2 6 9 0 0 2 5 () EECS 6A, Summer 207, Homework 2

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 solution.) Now, try multiplying the original A on the left by 0 0 0 E = 0 0 0 0 0 0 0 0 (You don t have to include this in your solutions either.) Notice that you get the same thing. EA = 2 0 5 6 0 0 0 2 2 6 9 0 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 and 2 Multiplying row by 4 Adding 2 row 2 to row 4 (putting the result in row 4) and subtracting row 2 from row (putting the result in row ) Hint: For the last one, 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 Equation that is, find E such that EA is in reduced row echelon form. Show that this is true by multiplying out EA. As a reminder, when the augmented matrix is in reduced row echelon form, it will have the form EA = 0 0 0 b 0 0 0 b 2 0 0 0 b 0 0 0 b 4 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 apply the row operations and multiply the matrices in the correct order.. Daniel s Optimal Smoothies Daniel s Optimal Smoothies has a unique way of serving its customers. To ensure the best customer experience, each customer gets a smoothie personalized to his or her tastes. Daniel knows that a lot of customers EECS 6A, Summer 207, Homework

don t know what they want, so when the customer walks up to the counter, they are asked to taste four standard smoothies that cover the entire range of flavors found in the smoothies. Each smoothie is made of 2 cup Greek yogurt, 8 cup vanilla soy milk, 2 cup crushed ice, and cup mystery fruit. The four standard smoothies have the following recipes for the cup of mystery fruit: Fruit [cups] Banana Berry Caribbean Passion Mango-a-go-go Strawberries Wild 2 Strawberries 0 2 Bananas 5 Mangos 0 5 0 Blueberries 0 0 0 Each customer is assumed to have a score (from 0 to 0) for each fruit, and the total score for the smoothie is computed by multiplying the score for a fruit with its proportion in the smoothie. For example, if a customer s score for strawberries is 6 and bananas is, then the total score for the Strawberries Wild smoothie would be 6 2 + = 5. After a customer gives a score (from 0 to 0) for each smoothie, Daniel then calculates (on the spot!) how much the customer likes each fruit. Then Daniel blends up a special smoothie that will maximize the customer s score. Vasuki was thirsty after grading midterms, so Vasuki decided to take a drink break at Daniel s Optimal Smoothies. Vasuki walked in and gave the following ratings: Smoothie Score Banana Berry 6 2 Caribbean Passion 6 2 Mango-a-go-go 7 2 5 Strawberries Wild 5 2 (a) What were Vasuki s ratings for each fruit? Work this problem out by hand. (b) What mystery fruit combination should Daniel put in Vasuki s personalized smoothie? What score would Vasuki give for this smoothie? There may be more than one correct answer. 4. Finding Charges from Potential Measurements We have three point charges Q, Q 2, and Q whose positions are known, and we want to determine their charges. In order to do that, we take three potential measurements U, U 2 and U at three different locations. The locations of the charges and potentials are shown in Figure 4. For the purpose of this problem, the following equation is true: U = k Q r at a point r meters away (for some fixed physical constant k; this problem does not require its numerical value). Furthermore, the potential contributions from different point charges add up linearly. For example, in the setup of Figure 4, the potential measured at point U 2 is U 2 = k Q + k Q 2 2 + k Q. EECS 6A, Summer 207, Homework 4

Q Q 2 m U U 2 Q m U m m Figure 4: Locations of the charges and potentials. Given that the actual potential measurements in the setup of Figure 4 are U = k 4 + 5 + 0 2, 5 U 2 = k 2 + 4 2, 2 U = k 4 + 5 + 0 2, 5 write the system of linear equations relating the potentials to charges. Solve the system to find the charges Q,Q 2,Q. You may use your IPython notebook to solve the system. IPython hint: For constants a i,b i,c i,y i, you can solve the system of linear equations a x + a 2 x 2 + a x = y b x + b 2 x 2 + b x = y 2 c x + c 2 x 2 + c x = y in IPython with the following code: import numpy as np a = np.array([ [a, a2, a], [b, b2, b], [c, c2, c] ]) b = np.array([y, y2, y]) x = np.linalg.solve(a, b) The square root of a number a can be written as np.sqrt(a) in IPython. 5. The Framingham Risk Score The Framingham risk score estimates the 0-year cardiovascular disease (CVD) risk of an individual. There are multiple factors (predictors) that weigh in the calculation of the Framingham score. For each individual, EECS 6A, Summer 207, Homework 5

Patient ID Age [years] Total Chol. [mg/dl] HDL Chol. [mg/dl] SBP [mm Hg] Risk (p) 66 98 55 2 0.550 2 6 80 47 24 0.08 60 80 50 20 0.0940 4 2 2 45 2 0.005 Table : Patient records for 0-year CVD risk assessment. these factors are: gender, age, total cholesterol, level of high-density lipoprotein (HDL) cholesterol, systolic blood pressure (SBP), whether or not the individual smokes, whether or not the individual is treated for high blood pressure and whether or not the individual is diabetic. For this problem, we will focus on the algorithm that estimates the CVD risk for female individuals who smoke, are not treated for high blood pressure, and are not diabetic. To calculate the 0-year CVD risk of an individual in the group described above, a score R is first assigned based on the values of age, total cholesterol, HDL cholesterol, and systolic blood pressure, as follows R =a ln(age (years)) + b ln(total cholesterol (mg/dl))+ c ln(hdl cholesterol (mg/dl)) + d ln(sbp (mm Hg)) where a,b,c and d are constant coefficients and ln( ) denotes the natural (base e) logarithm. After the score R is calculated, it is plugged into the following formula in order to obtain the risk p (in terms of probability) of the individual suffering from a CVD in the next 0 years: p = 0.95 e(r 25.66) (Note that there is a double exponent in the expression.) When the algorithm was first devised, the only copy of the document that reported the coefficients a,b,c and d was shredded by mistake by a new intern in the hospital where the research was conducted. The intern needs to find the values of the coefficients from existing records of hospital patients and needs your help to do so. Throughout the problem, you can approximate any numbers up to the fourth decimal. For example, you can approximate 0.2456789 as 0.246 and 0.24296 as 0.240. (a) The intern dug up some of the records for patients in the study group who fit the criteria of the formula in question. The records are summarized in Table. Use these records to devise a system of linear equations where a,b,c and d are the unknowns. (b) Solve the system of linear equations that you devised in part (a) of this problem. For this question, you may use IPython. Note: The natural logarithm of a number x (i.e. ln(x)) can be written as np.log(x) in IPython. Note: Some of the values in the algorithm were modified from the original study values. 6. Filtering Out The Troll You attended a very important public speech and recorded it using a recording device that consists of two directional microphones. However, there was this particular person in the audience who was trolling around. When you went back home to listen to the recording you realized that the two recordings are dominated by EECS 6A, Summer 207, Homework 6

the troll and you cannot hear the speech. Fortunately since you had two microphones, you realize that there is a way to combine the two recordings such that trolling is removed. Recollecting the scene, the locations of the speaker and the troll are shown in Figure 5. Important Speech 2 microphones +45 0 Troll Figure 5: Locations of the speaker and the troll. The way your recording device works is that each microphone weighs the audio signal depending on the angle of the audio source, relative to the x axis, hence the name directional microphones. More specifically, if the audio source is located at an angle of θ, the first microphone will record the audio signal with weight f (θ) = cos(θ), and the second microphone will record the audio signal with weight f 2 (θ) = sin(θ). For example, an audio source that lies on the x axis will be recorded with the first microphone with weight equal to (since cos(0) = ), but will not be picked by microphone two (since sin(0) = 0). Note that the weights can also be negative. Graphically, the directional characteristics of the microphones are given in Figures 6 and 7 (the red and blue colors denote the positive and negative values of the weight, respectively). Putting all of this together, assume that there are two speakers, A and B, at angles θ and ψ, respectively. Assume that speaker A produces an audio signal represented by the vector a R n. That is, the i-th component of a is the signal at the i-th time step. Similarly, assume speaker B produces an audio signal b, Then the first microphone will record the signal and the second microphone will record the signal m = cos(θ) a + cos(ψ) b, m 2 = sin(θ) a + sin(ψ) b. EECS 6A, Summer 207, Homework 7

90 90 5 45 5 45 80 0 80 0 225 5 225 5 270 Figure 6: Directional characteristics of mic.. 270 Figure 7: Directional characteristics of mic. 2. (a) Using the notation above, let the important speaker be speaker A (with signal a) and let the person trolling be speaker B (with signal b). Express the recordings of the two microphones m and m 2 (i.e. the signals recorded by the first and the second microphones, respectively) as a linear combination of a and b. (b) Recover the important speech a, as a weighted combination of m and m 2. In other words, write a = u m + v m 2 (where u and v are scalars). What are the values of u and v? (c) Partial IPython code can be found in prob.ipynb. Complete the code to get a clean signal of the important speech. What does the speaker say? (Optional: Where is the speech taken from?) Note: You may have noticed that the recordings of the two microphones sounded remarkably similar. This means that you could recover the real speech from two trolled recordings that sounded almost identical! Leave out the fact that the recordings are actually different, and have some fun with your friends who aren t lucky enough to be taking EE6A. 7. Show It Let n be a positive integer. Let { v, 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,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. 8. 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? Note: For this question, if we assume that tips are positive, we need to introduce additional constraints enforcing that, and we wouldn t get a linear system of equations. Therefore, we are going to ignore this constraint and assume that negative tips are acceptable. (a) Suppose 6 people sit around a table and there are 6 plates of tips at the end. EECS 6A, Summer 207, Homework 8

T 2 P T T P 2 P 6 T 6 P P 5 T 4 P 4 T 5 If we know the amounts in every plate of tips (P to P 6 ), can we determine the individual tips of all 6 people (T to T 6 )? If yes, explain why. If not, give two different assignments of T to T 6 that will result in the same P to P 6. (b) The same question as above, but what if we have 5 people sitting around a table? T 2 P T P 5 T 5 P 2 T P 4 P 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. 9. Homework Process and Study Group Who else did you work with on this homework? List names and student ID s. (In case of homework party, you can also just describe the group.) How did you work on this homework? Working in groups of -5 will earn you credit for your participation grade. 0. (PRACTICE) Powers Of Nilpotent Matrices 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.) (a) Calculate A 4 by hand. Make sure you show what A 2 and A are along the way. 0 2 A = 0 0 2 0 0 0 0 0 0 0 (b) Calculate B 4 by hand. Make sure you show what B 2 and B are along the way. 4 2 B = 5 6 6 7 2 2 2 0 EECS 6A, Summer 207, Homework 9