Call Now: (800) 537-1660  
The Algebra Buster
The Algebra Buster


May 24th









May 24th

Math 335 PROBLEM SET 1 SOLUTIONS

Computations in problems 1, 2, and 4 should be done by hand (but do feel free to use MATLAB to check
your answers).

1. [15 points]

a. [9 points]
Compute (BY HAND!) the matrix-vector product Ax for x =


b. [6 points]
Let


Compute AB. (Hint: how can you use part a to speed this up?)

SOLUTION 1a.

and for v = (1, 1,-2),

SOLUTION 1b.

where the last equality fol lows from part a.

2. [17 points]
Let

a. [2 points] Compute 2A - 3B.
b. [5 points] Compute AB and BA. Does AB = BA?
c. [5 points] Compute (AB)C and A(BC). Does (AB)C = A(BC)?
d. [5 points] Compute (AB)T , ATBT and BTAT . Which of these are equal?

SOLUTION 2a.

SOLUTION 2b.



Answer: AB ≠ BA.

SOLUTION 2c.

Answer: (AB)C = A(BC).

SOLUTION 2d.

Answer: (AB)T  = BT AT  .

3. [16 points]

Leslie model of a salmon population. We make the following assumptions:

•We consider only the females in the salmon population.
•The maximum age attained by any in dividual salmon is three years.
•The salmon are grouped into three one-year age classes.
•An individual salmon's chances of surviving from one year to the next is a function of its age.
The survival rate s1, s2 of each age group is known and given by s1 = 0:005, s2 = 0:1.
•The reproduction rate f1, f2, f3 for each age group is known and given by f1 = f2 = 0; f3 = 2000.
•The initial age distribution is given by p(0) = (1000, 1000, 1000)T .

a. [6 points]
Set up the Leslie model

p(k+1) = Lp(k), k = 0, 1, 2 ...
to model the age distributionat time k, i.e., de termine L .

b. [10 points]
Modify population.m to determine the age distribution vector p(k) over time and plot p (k) for
k = 0,...,25. Instead of using the bar command, it may be better to use plot or semi logy
commands to display the age distributions. Submit your code and your (well labeled) gure.

SOLUTION 3a.

SOLUTION 3b.

Modified population.m:

% Example of matrix population modeling.
% Population is divided into 1-year age brackets.

% set up a population matrix, L
% L(1,j) = number of female salmon born to each female
% in the jth age bracket in 1 year .
% L(j+1,j) = probability that members of the jth age bracket
% survive the next year
% L(3,3) = probability that members of the last age bracket
% survive the next year


% initial female population, p0, is uniformly distributed
p0 = [1000,1000,1000];

% The jth column of the matrix P will contain the
% female population vector at year j-1.

P = [p0]; pj = p0;
% iterate for numyears years
numyears = 25;
for j=1:numyears
pj = L*pj; % compute population at year j
P = [P pj]; % store information in column j+1 of P
end

% plot data using color to differentiate groups
figure(1), clf
semilogy([0:numyears],P,'-*')
xlabel('year', 'fontsize', 18)
ylabel('population', 'fontsize',18)
legend('0-1','1-2','2-3')
set(gca,'XTick',0:1:numyears)
set(gca,'PlotBoxAspect Ratio ', [1.6 1 1]);

set(gca,'FontSize',11)
saveas( gcf ,'salmonpopcolor.eps','epsc')

% plot data using LineStyle to differentiate groups
figure(2), clf
set(gcf, 'DefaultAxesLineStyleOrder','-|--|:')
semilogy([0:numyears],P,'k','Linewidth', 2, 'Marker', 'd')
xlabel('year', 'fontsize', 18)
ylabel('population', 'fontsize',18)
legend('0-1','1-2','2-3')
set(gca,'XTick',0:1:numyears)
set(gca,'PlotBoxAspectRatio', [1.6 1 1]);
set(gca,'FontSize',11)
saveas(gcf,'salmonpoplinestyles.eps')

4. [15 points] (Problem 1 on p. 9 of the Lecture Notes)
In order to refresh your matrix-vector multiplication skills please calculate , by hand, the product
ATGA in the 3 compartment case and write out the 4 equations in (1.1). The second equation should
read

SOLUTION 4.

The MATLAB script
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% to define G:
syms R_i R_m
g = 1/R_i*ones(6,1);
for j = 1:3
g(2*j,1) = 1/R_m;
end
G = diag(g);

GA = G*A
S = A'*GA % S = A^TGA

x = sym('[x_1; x_2; x_3; x_4]');

Sx = S*x % = A^TGAx
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

yields the output
GA =





Since f = (i0, 0, 0, 0), the vector equation ATGAx = f is equivalent to the following four scalar
equations:

We could also write these as

Prev Next
 
Home    Why Algebra Buster?    Guarantee    Testimonials    Ordering    FAQ    About Us
What's new?    Resources    Animated demo    Algebra lessons    Bibliography of     textbooks
 

Copyright © 2009, algebra-online.com. All rights reserved.