User Tools

Site Tools


Math 445 HW3

Problem 1: Given the vectors x=[3 7 2 9 0] and y=[7 10 2 8 13], what would be the Matlab output for the following expressions? Think through what the answer should be, write it down, and then try it out in Matlab. If you got anything wrong, figure out what your mistake was and why Matlab gave the answer it did.

(a) x > y
(b) y < x
(c) x == y
(d) x <= y
(e) y >= x
(f) x & y
(g) x & (~y)
(h) (~x) & (y)
(i) x | y
(j) xor(x,y)
(k) (x > y) & (y < x)

Problem 2: Write down Matlab expressions for the following. You can assume that a,b,c are logical variables, x,y,z are double-precision numbers, u,v,w are vectors of the same dimension, and A,B,C are matrices of compatible sizes.

(a) Both a and b are true.
(b) Neither a nor b is true.
(c) Either a and b are true, or both b and c are false.
(d) Either x equals y, or x is not equal to z.
(e) x, y, and z are all equal.
(f) None of the components of u equal the corresponding components of v.
(g) Each component of u is the same as either the same component of v or w.
(h) The vector whose components are the polynomial $3u^2 - 5u + 6$ evaluated at each of the components of u.
(i) The matrix product $AB$.
(j) The matrix whose elements are the product of the elements of A and B.

Problem 3: A theater has a seating capacity of 900 and charges $2.50 for children, $4 for students, and $5.50 for adults. At a certain screening with full attendance, there were half as many adults as children and students combined. The total money brought in was $3825. How many children, students, and adults attended the show? show?

gibson/teaching/fall-2014/math445/hw3.txt · Last modified: 2014/09/29 18:34 by gibson