ch5.mp 11 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
% CH5.mp
%  MetaPost input file with chapter five pictures.
%
% HISTORY
% 2001-Apr-15 Jim Hefferon jim@joshua.smcvt.edu Written
verbatimtex
%&latex
\documentclass{book}
\usepackage{dvidrv} \usepackage{hrefout}
\usepackage{bookjh,linalgjh}
\usepackage{color}
\usepackage{verbatim}
\begin{document}
etex

input jh
input arrow

defaultscale := 9pt/fontsize defaultfont;

numeric u;  %scaling factor
numeric v;  %vertical scaling factor
numeric w;  %horizontal scaling factor

u:=.04in; v:=u; w:=v;


%--------------------------------
%  section 5.3
%   Map from a space to itself, iterated.
%
beginfig(1);   % map from a space to itself
  %numeric u;  %scaling factor
  %numeric v;  %vertical scaling factor
  %numeric w;  %horizontal scaling factor
  numeric a, b; a=.8in; b=1.1a; % a is width of set, b is hgt
  set_pic(a,b);
  z1=(.4a,.9b);
    drawpoint(z1); label.lft(btex $\vec{v}$ etex,z1);
  z2=(.5a,.55b);
    drawpoint(z2); label.lft(btex $t(\vec{v}\,)$ etex,z2);
  z3=(.6a,.15b);
    drawpoint(z3); label.lft(btex $t^2(\vec{v}\,)$ etex,z3);
  %mapsto(z1,.5[z1,z2]+(.1a,0),z2);
  %mapsto(z2,.5[z2,z3]+(.1a,0),z3);
  draw_action_arrow(z1..(.5[z1,z2]+(.1a,0))..z2);
  draw_action_arrow(z2..(.5[z2,z3]+(.1a,0))..z3);
endfig;


%--------------------------------
%  section 5.3
%   Graph of rank and nullity, on iteration of a transformation.
%
beginfig(2);
  %numeric u;  %scaling factor
  %numeric v;  %vertical scaling factor
  %numeric w;  %horizontal scaling factor
  numeric a, b; % a is width, b is height
  a=2.5in; b=1.25in;
  draw begingraph(a,b);
    setrange(origin,whatever,whatever);
    gdraw "ranknullity.d" plot drawn_point; % btex$\circ$etex;
%   glabel.lft(btex \begin{tabular}{r}
%                         nullity of $t^j$ (above) \\ 
%                         and                      \\ 
%                         rank of $t^j$ (below)
% 			\end{tabular} etex,OUT);
Jim Hefferon's avatar
Jim Hefferon committed
69 70 71 72 73
    glabel.bot(btex \small Power $j$ of the transformation etex,OUT);
    otick.bot(btex \scriptsize $0$etex,1);    
    otick.bot(btex \scriptsize $1$etex,2);    
    otick.bot(btex \scriptsize $2$etex,3);    
    otick.bot(btex \scriptsize $j$etex,5);    
74 75 76
    otick.bot(btex{\ }etex,8);    
    grid.bot(btex$n$etex,9) withcolor .85white;    
    otick.bot(btex{\ }etex,10);    
Jim Hefferon's avatar
Jim Hefferon committed
77
    grid.lft(btex \small $n$etex,8) withcolor .85white;    
78 79
    otick.lft(btex{\ }etex,7);    
    otick.lft(btex{\ }etex,6);    
Jim Hefferon's avatar
Jim Hefferon committed
80
    otick.lft(btex$\small \text{rank}(t^j)$etex,3);    
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
    otick.lft(btex{\ }etex,1);    
    otick.lft(btex{\ }etex,1);    
    otick.lft(btex{\ }etex,1);    
    frame.llft;
  endgraph;
endfig;

%--------------------------------
%  section 5.3
%   Graph of rank and nullity, on iteration of a transformation.
%
beginfig(3);  %graph of rank and nullity on iteration
  %numeric u;  %scaling factor
  %numeric v;  %vertical scaling factor
  %numeric w;  %horizontal scaling factor
  numeric a, b; % a is width, b is height
  a=2.5in; b=1.25in;
  pickup pensquare scaled line_width_light;
  draw (0,b)--(0,0)--(a,0);
  label.lft(btex \begin{tabular}{r}
                      nullity of $t^j$ (above) \\ 
                      and                      \\
		      rank of $t^j$ (below)
		    \end{tabular} etex,.5[(0,b),(0,0)]);
  label.bot(btex Power $j$ of the transformation etex,.5[(0,0),(a,0)]);
endfig;





beginfig(4) % equiv relation; row-equiv mats from ch1.27, further split 
  numeric u;  %scaling factor
  numeric v;  %vertical scaling factor
  numeric w;  %horizontal scaling factor
  u:=1in; v:=u; w:=v; % was: 1in

  path p[]; partition; % dotlabels.ulft(5,6,7,8,9,10,11,12,13);
  label(btex {\scriptsize \ldots} etex,z13);
  x14=.8[x0,x9]; y14=.7[y10,y9]; drawpoint(z14);
Jim Hefferon's avatar
Jim Hefferon committed
121
    label.rt(btex {\scriptsize $S$} etex,z14);
122
  x15=.75[x0,x9]; y15=.35[y10,y9]; drawpoint(z15);
Jim Hefferon's avatar
Jim Hefferon committed
123
    label.rt(btex {\scriptsize $T$} etex,z15);
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284

  pickup pencircle scaled line_width_light;
  % split part in center
  z20=.5[z6,z8]; x21=.8[x20,x14]; y21=y20;
    z22=(z20--(3[z20,z21])) intersectionpoint p3;
    p20 = z20--z22;
    draw p20 dashed evenly scaled .5;
  z23 = point .6 of p1;
    z24 = whatever[z20,z22]; x24 = x23;
    p21 = z23--z24;
    draw p21 dashed evenly scaled .5;
  % split part in upper left
  z30 = point .25 of p1;
    z31 = whatever[z0,z3]; y31 = y30;
    p30 = z30--z31; 
    draw p30 dashed evenly scaled .5;
  % split part in upper right
  z40 = point .55 of p4;
  z41 = point .85 of p4;
    z42 = whatever[z2,z3]; x42 = x40;
    p40 = z40--z42;
    z43 = whatever[z2,z3]; x43 = x41;
    p41 = z41--z43;
    draw p40 dashed evenly scaled .5;
    draw p41 dashed evenly scaled .5;
endfig;







beginfig(5) % equiv relation; finer partition needs more reps 
  numeric u;  %scaling factor
  numeric v;  %vertical scaling factor
  numeric w;  %horizontal scaling factor
  u:=1in; v:=u; w:=v; % was: 1in

  path p[]; partition; % dotlabels.ulft(5,6,7,8,9,10,11,12,13);
  label(btex {\scriptsize \ldots} etex,z13);
  x14=.8[x0,x9]; y14=.7[y10,y9]; %drawpoint(z14);
    label.rt(btex {\scriptsize $\star$} etex,z14);
  x15=.75[x0,x9]; y15=.35[y10,y9]; %drawpoint(z15);
    label.rt(btex {\scriptsize $\star$} etex,z15);

  pickup pencircle scaled line_width_light;
  % split part in center
  z20=.5[z6,z8]; x21=.8[x20,x14]; y21=y20;
    z22=(z20--(3[z20,z21])) intersectionpoint p3;
    p20 = z20--z22;
    draw p20 dashed evenly scaled .5;
  z23 = point .6 of p1;
    z24 = whatever[z20,z22]; x24 = x23;
    p21 = z23--z24;
    draw p21 dashed evenly scaled .5;
    z25=.55[z20,z24]; z26=.4[z24,z23];
    label(btex {\scriptsize $\star$} etex,(x25,y26));
  % split part in upper left
  z30 = point .25 of p1;
    z31 = whatever[z0,z3]; y31 = y30;
    p30 = z30--z31; 
    draw p30 dashed evenly scaled .5;
    z32=.35[z31,z30]; z33=.5[z6,z31];
    label(btex {\scriptsize $\star$} etex,(x32,y33));
    z34=.55[z31,z30]; z35=.5[z3,z31];
    label(btex {\scriptsize $\star$} etex,(x34,y35));
  % split part in upper right
  z40 = point .55 of p4;
  z41 = point .85 of p4;
    z42 = whatever[z2,z3]; x42 = x40;
    p40 = z40--z42;
    z43 = whatever[z2,z3]; x43 = x41;
    p41 = z41--z43;
    draw p40 dashed evenly scaled .5;
    draw p41 dashed evenly scaled .5;

    z44=.5[z5,z43]; z45=.45[z41,z43];
    label(btex {\scriptsize $\star$} etex,(x44,y45));
    z46=.5[z43,z42]; z47=.55[z41,z43];
    label(btex {\scriptsize $\star$} etex,(x46,y47));
    z48=.45[z42,z11]; z49=.65[z40,z42];
    label(btex {\scriptsize $\star$} etex,(x48,y49));
  % then lower left
  z50=.4[z0,z7]; z51=.4[z0,z8];
  label(btex {\scriptsize $\star$} etex,(x50,y51));

  %dotlabels.top(20,21,22,23,24,30,31,40,41,42,43);
endfig;








% ==================== Linear Recurrences ===============


beginfig(6) % Tower of Hanoi (three disks at start) 
  numeric u;  %scaling factor
  numeric v;  %vertical scaling factor
  numeric w;  %horizontal scaling factor
  u:=10pt; v:=u; w:=v; %

  save disk_length, disk_width, disk_hgt;
  numeric disk_length, disk_width, disk_hgt;
  disk_length = 8u;  disk_width = .4disk_length; disk_hgt = .2u;
  save needle_shift; pair needle_shift; needle_shift = (1.2disk_length,0v);
  save needle_length, needle_width, needle_hgt;
  numeric needle_length, needle_width, needle_hgt; % how thick is body of bee?
  needle_length = .4u; needle_width = .4needle_length; needle_hgt = 6u;
  % left needle
  drawdisk(disk_length,disk_width,disk_hgt);
  drawdisk(.9disk_length,.9disk_width,disk_hgt) shifted (0,1.5disk_hgt);
  drawdisk(.8disk_length,.8disk_width,disk_hgt) shifted (0,3disk_hgt);
  drawdisk(needle_length,needle_width,needle_hgt-3disk_hgt)
     shifted (0,needle_hgt);
  % middle needle
  drawdisk(needle_length,needle_width,needle_hgt)
     shifted (0,needle_hgt) shifted needle_shift;
  % right needle
  drawdisk(needle_length,needle_width,needle_hgt)
     shifted (0,needle_hgt) shifted 2needle_shift;
endfig;





beginfig(7) % Tower of Hanoi (three disks at start) 
  numeric u;  %scaling factor
  numeric v;  %vertical scaling factor
  numeric w;  %horizontal scaling factor
  u:=10pt; v:=u; w:=v; %

  save disk_length, disk_width, disk_hgt;
  numeric disk_length, disk_width, disk_hgt;
  disk_length = 8u;  disk_width = .4disk_length; disk_hgt = .2u;
  save needle_shift; pair needle_shift; needle_shift = (1.2disk_length,0v);
  save needle_length, needle_width, needle_hgt;
  numeric needle_length, needle_width, needle_hgt; % how thick is body of bee?
  needle_length = .4u; needle_width = .4needle_length; needle_hgt = 6u;
  % left needle
  drawdisk(disk_length,disk_width,disk_hgt);
  drawdisk(needle_length,needle_width,needle_hgt-disk_hgt)
     shifted (0,needle_hgt);
  % middle needle
  drawdisk(.9disk_length,.9disk_width,disk_hgt)
    shifted needle_shift;
  drawdisk(.8disk_length,.8disk_width,disk_hgt)
    shifted (0,1.5disk_hgt) shifted needle_shift;
  drawdisk(needle_length,needle_width,needle_hgt-2disk_hgt)
     shifted (0,needle_hgt) shifted needle_shift;
  % right needle
  drawdisk(needle_length,needle_width,needle_hgt)
     shifted (0,needle_hgt) shifted 2needle_shift;
endfig;


Jim Hefferon's avatar
Jim Hefferon committed
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351


beginfig(8) % graph of rank falling and nullity rising
  numeric u;  %scaling factor
  numeric v;  %vertical scaling factor
  numeric w;  %horizontal scaling factor
  u:=10pt; v:=u; w:=v; %
  
  % axes
  z0=(0w,0v);
  z1=(-.5w,0v); z2=(20.5w,0v);  % x axis
  z3=(0w,-.5v); z4=(0w,9.5v);  % y axis
  pickup pensquare scaled line_width_light;
  draw z1--z2;
  draw z3--z4;
  label.lrt(btex \small power etex,z2);
  % label.ulft(btex \small power of the transformation etex,z2);
  % point of interest
  z10=(10w,5v);
  % ticks
  pickup updown_tick;
  for i = 1 upto 3:
    drawdot (i*w,0v);
  endfor
  label.bot(btex \scriptsize $0$ etex,(1w,0v));
  label.bot(btex \scriptsize $1$ etex,(2w,0v));
  label.bot(btex \scriptsize $2$ etex,(3w,0v));
  drawdot (x10,0v);
  label.bot(btex \scriptsize $j$ etex,(10w,0v));
  for i = 17 upto 19:
    drawdot (i*w,0v);
  endfor
  label.bot(btex \scriptsize $k$ etex,(18w,0v));
  % label.bot(btex \scriptsize $k+1$ etex,(14w,0v));
  pickup sidetoside_tick;
  for i = 7 upto 9:
    drawdot (0w,i*v);
  endfor
  label.lft(btex \scriptsize $n$ etex,(0w,9v));
  drawdot (0w,y10);
  for i = 1 upto 3:
    drawdot (0w,i*v);
  endfor
  label.lft(btex \scriptsize $0$ etex,(0w,1v));
  % The points
  pickup pencircle scaled line_width_light;
  drawpoint(z10);
    pickup pensquare  scaled line_width_light;
    draw (x10,y10+0.5v)--(x10,y4-0.5v) withcolor .8white;  % vert line above dot
    draw (x10-0.25w,y4-0.5v)--(x10+0.25w,y4-0.5v) withcolor .8white; % whisker at  top
    draw (x10-0.25w,y10+0.5v)--(x10+0.25w,y10+0.5v) withcolor .8white; % whisker at  top
    label.rt(btex \scriptsize $\nullity (t^j)$ etex,(x10,.5[y10,y4]));
    draw (x10,y10-0.5v)--(x10,1v) withcolor .8white; % vert line below dot
    draw (x10-0.25w,y10-0.5v)--(x10+0.25w,y10-0.5v) withcolor .8white; % whisker at top
    draw (x10-0.25w,1v)--(x10+0.25w,1v) withcolor .8white; % whisker at bot
    label.lft(btex \scriptsize $\rank (t^j)$ etex,(x10,.5[y10,1v]));
  pickup pencircle scaled line_width_light;
  drawpoint((1w,9v));
  drawpoint((2w,7v));
  drawpoint((3w,6v));
  drawpoint((17w,3v));
  drawpoint((18w,2v));
  drawpoint((19w,2v));
  drawpoint((20w,2v));
endfig;


352
end