User Tools

Site Tools


gibson:teaching:fall-2014:math445:hw1

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gibson:teaching:fall-2014:math445:hw1 [2014/09/04 09:37]
gibson
gibson:teaching:fall-2014:math445:hw1 [2014/09/06 11:43] (current)
gibson
Line 1: Line 1:
 ====== Math 445 HW1 ====== ====== Math 445 HW1 ======
  
-Solve the following problems ​with Matlab. Save your Matlab session ​to a file by turning "​diary ​on". When you're done, edit the diary in a text editor to remove errors and add appropriate comments. Print the edited diary to turn in.+The following problems ​are designed ​to prepare you for Lab 2 on linear algebra
  
-If you have your own computer and want to run Matlab on it, download and install Matlab from {{http://​at.unh.edu/​acs/​services/​software/​ | UNH academic software}}. Otherwise you can do your homework on the computers in Kingsbury N129. +If you have your own computer and want to run Matlab on it, download and install Matlab from {{http://​at.unh.edu/​acs/​services/​software/​ | UNH academic software}}. Otherwise you can do your homework on the computers in Kingsbury N129. Save your Matlab session to a file by turning "diary on". When you're done, edit the diary in a text editor to remove errors and add appropriate comments. Print the edited diary to turn in. Your name, the date, and "Math 445 HW 1" should appear prominently at the top
  
-Remember, you are required to do these homeworks **by yourself**. ​+Remember, you are required to do these homeworks **by yourself**. If you get stuck, refer to your textbook. If you are absolutely stuck, //talk// to a fellow student, the teaching assistant, or the instructor, and get hints for how to proceed. But **do not** copy someone else's solved problem
  
-**Problem 1:** Given two variables $x$ and $y$, write a Matlab expression that evaluates to true (1) if $x$ and $y$ have opposite signs and false (0) otherwise. By opposite signs, I mean one is positive and one is negative. Test the expression by evaluating it with the following pairs of numbers (x,y) = (-5, 4), (5,4), (5,-4), (0,-2), and (3,​0). ​+**Problem 1:** Given two numeric ​variables $x$ and $y$, write a Matlab expression that evaluates to true (1) if $x$ and $y$ have opposite signs and false (0) otherwise. By opposite signs, I mean one is positive and one is negative. Test the expression by evaluating it with the following pairs of numbers (x,y) = (-5, 4), (5,4), (5,-4), (0,-2), and (3,​0). ​
  
 **Problem 2:** The combined resistance $R_T$ of three resistors $R_1, R_2, R_3$ in parallel is given by **Problem 2:** The combined resistance $R_T$ of three resistors $R_1, R_2, R_3$ in parallel is given by
Line 22: Line 22:
 **(b)** Create a column vector x whose elements are the numbers 5, 7, 10, 1.\\ **(b)** Create a column vector x whose elements are the numbers 5, 7, 10, 1.\\
 **%%(c)%%** Use colon syntax to create a row vector x whose elements start at 0, end at 1, and increase in steps of 0.1.\\ **%%(c)%%** Use colon syntax to create a row vector x whose elements start at 0, end at 1, and increase in steps of 0.1.\\
-**(d)** Determine the dimension of x from %%(c)%% and assign the value to the variable d (using Matlab, not by counting!)+**(d)** Determine the dimension of x from %%(c)%% and assign the value to the variable d (using Matlab, not by counting!).\\ 
 +**(e)** Use the ''​linspace''​ function to create a 10-dimensional vector of numbers evenly spaced between 0 and 1.
  
 ** Problem 4:** \\ ** Problem 4:** \\
Line 32: Line 33:
 **%%(c)%%** Assign the third column of A to the variable v.\\ **%%(c)%%** Assign the third column of A to the variable v.\\
 **(d)** Change the first row of A to 8, 1, 4\\ **(d)** Change the first row of A to 8, 1, 4\\
 +
 +**Problem 5:** In Matlab, create a 2 x 2 matrix ​
 +<​latex>​
 +A = \left[
 +\begin{array}{cc}
 +4 & 2 \\
 +-1 & 5 
 +\end{array}
 +\right]
 +</​latex>​
 +and a 2-d vector
 +<​latex>​
 +b = \left[
 +\begin{array}{cc}
 +3 \\
 +4
 +\end{array}
 +\right]
 +</​latex>​.
 +What vector $x$ satisfies $Ax=b$?
 +
 +**Problem 6:** Use Matlab to solve the problem. Nilanjana has 40 coins worth %%$%%6.40. They'​re all quarters and nickels. How many nickels and how many quarters does she have? Verify that your answer solves the problem. ​
 +
 +Hints: Convert the story problem into two equations in two unknowns. Then rewrite this system of equations in matrix-vector notation, $Ax=b$, where $A$ are the known coefficients of the linear equations, $x$ a vector of unknowns, and $b$ a vector of known constants. ​ Enter the matrix $A$ and the known vector $b$ into Matlab, then solve for $x$ using Matlab'​s backslash operator: ''​x = A\b''​. ​
 +
 +**Problem 7:** Use Matlab to solve the problem. Suhasini has 44 coins worth %%$%%7.50. They'​re all quarter, dimes, and nickels. She has twice as many dimes as nickels. How many of each type of coin does she have? Find the answer, and then verify that the solution satisfies the problem. ​
gibson/teaching/fall-2014/math445/hw1.1409848648.txt.gz · Last modified: 2014/09/04 09:37 by gibson