echo on
% Solution to question 2 
s = 0.25455767
% (a) Thursday The following range found by experiment
N = logspace(14,16,100);
supposed_to_be_s = (N+s) - N;
plot( N, supposed_to_be_s )
% From the graph, we lose it at N = 4.5e15, roughly.
% (a) Friday The following range found by bisection
type Squash
Squash(s,50)
Squash(s,100)
Squash(s,75)
Squash(s,62)
Squash(s,55)
Squash(s,52)
Squash(s,53)
% So 53 is our answer.
%(b) 
S = [ 2 5 1 5
      5 7 2 6
      4 6 3 7
      5 7 4 8 ];
S = S(1:2,1:2)
% I don't have those programs handy, so I did the parametric
% plot instead.  Because of the difficulty of taking roots
% of negative numbers, I just worked symmetrically with 
% the positive quadrant.
%
% Image of a quarter-circle
theta = linspace(0,pi/2,100);
p = 10*s
x = cos(theta).^(2/p);
y = sin(theta).^(2/p);
x = [ -x, x, x, -x ];
y = [ -y, -y,y,  y ];
% x^p + y^p = 1, therefore (let's check)
one = abs(x).^p + abs(y).^p;
res = one - 1;
norm(res,inf)
xy = [x;y]; % 2 by 100
Sxy = S*xy;
figure(1)
plot( x,y,'k.')
axis([-1,1,-1,1])
axis('square')
figure(2)
plot( Sxy(1,:), Sxy(2,:), 'r.' )
axis([-10,10,-10,10])
axis('square')
% (c) (Thursday) The  following range was found by experiment
x = linspace(30,40)/s;
y = exp(s*x).*log(1+exp(-s*x));
figure(3)
plot( x, y, 'k.') 

% (c) (Friday) The following range was found by experiment
x = logspace(-6,-5);
y = (1-cos(s*x))./x.^2;
figure(4)
plot(x,y,'r.')
% So, for this s, about 5.e-6 is the place where things begin to break down.