text:
File Exchange

## variogramfit

version 1.5 (19.4 KB) by

fits different theoretical variograms to an experimental variogram

Updated

variogramfit performs a least squares fit of various theoretical variograms to an experimental, isotropic variogram. The user can choose between various bounded (e.g. spherical) and unbounded (e.g. exponential) models. A nugget variance can be modelled as well, but higher nested models are not supported.

The function works best with the function fminsearchbnd available on the FEX. You should download it from the File Exchange (File ID: #8277). If you don't have fminsearchbnd, variogramfit uses fminsearch. The problem with fminsearch is, that it might return negative variances or ranges.

Supported bounded models:
'blinear' -- bounded linear
'circular' -- circular model
'spherical' -- spherical model, =default
'pentaspherical' -- pentaspherical model

Supported unbounded functions :
'exponential' -- exponential model
'gaussian' -- gaussian variogram
'whittle' -- Whittle's elementary correlation (involves a modified Bessel function of the second kind).
'stable' -- stable models sensu Wackernagel 1995). Same as gaussian, but with different exponents. Supply the exponent alpha (<2) as an additional pn,pv-pair 'stablealpha',alpha (default = 1.5).
'matern' -- Matern model. Requires an additional pn,pv pair. 'nu',nu (shape parameter > 0, default = 1). Note that for particular values of nu the matern model reduces to other authorized variogram models. (nu = 0.5 : exponential model, nu = 1 : Whittles model, nu -> inf : Gaussian model)

References:
Wackernagel, H. (1995): Multivariate Geostatistics, Springer.
Webster, R., Oliver, M. (2001): Geostatistics for Environmental Scientists. Wiley & Sons.
Minsasny, B., McBratney, A. B. (2005): The Matérn function as general model for soil variograms. Geoderma, 3-4, 192-207.

Diego Rivera

Diego Rivera

### Diego Rivera (view profile)

somebody can help me with a example using funtion by exponential model, or gaussian maybe?.

kons geor

### kons geor (view profile)

Just a realisation of some sort. To model a nugget effect use as initial range and sill, zero (a0=c0=0). This produces the respective model. However I have not tested if it is actually accurate.

Silpakorn D

Ahmed Zidan

### Ahmed Zidan (view profile)

Hello,

I have a data in a regular grid (dx=dy) and x and y have different length.

I am facing a problem to create a covariance matrix, because of the different length and regular grid.

I tried to meshgrid, but the matrix will be very large that matlab can't accept it.

I will be grateful for any suggesting.

Thank you all.

zigang guo

### zigang guo (view profile)

I tried to change the headline to this:
function [a,c,n,S] = variogramfit(h,gammaexp,a0,c0,tau2,eps,numobs,varargin)
And add several lines to the % variogram function definitions Section as:
case 'multifractal'
type = 'bounded';
func = @(b,h)b(2)*eps.^(tau2-1)*(1-.5*(((h./eps)+1).^(tau2+1)-2*(h./eps).^(tau2+1)+(h./eps-1).^(tau2+1)));

As you can see i am trying to use the same routine as you did for the other models. However, these two extra inputs are the issue atm.
Have a nice day!
Bill

Karrock

### Karrock (view profile)

Hi Wolfgang!
I think i might have the same issue as
25 Sep 2012 C. Gutierrez
Even when running the "run example"-code in the function header. Did you identify the problem back then?

Wolfgang Schwanghart

### Wolfgang Schwanghart (view profile)

@Mani Ahmadian: Hi Mani, thanks for your comment. I don't have a good method for dealing with outliers using variogramfit except using an optimization scheme other than "least squares". E.g., least absolute deviations may be less sensitive to outliers. In case you are supplying variogramfit with the binned, experimental variogram, I'd better care for outliers during binning. For example, you might want to adapt the function variogram ( http://www.mathworks.com/matlabcentral/fileexchange/20355-experimental--semi---variogram ) to compute the trimmed mean or median when aggregating binned variogram values.

Dear Wolfgang

Thanks for your great code. It's very complete, but what's your idea about outliers remove and then perform best fit?

Have a nice day
Mani

steve

### steve (view profile)

function [a,c,n,S] = variogramfit(h,gammaexp,a0,c0,numobs,varargin)

h=[2.238; 2; 3; 5.657; 2.238; 1.414;3.606; 3.606; 4.472; 4.123];
gammaexp=[12.5; 12.5; 0; 112.5; 0; 12.5; 50; 12.5; 50; 112.5];
a0=[];
c0=[];
numobs=10;

% check input arguments

if ~exist('a0','var') || isempty(a0)
a0 = max(h)*2/3;
end
if ~exist('c0','var') || isempty(c0)
c0 = max(gammaexp);
end
if ~exist('numobs','var') || isempty(a0)
numobs = [];
end
% check input parameters
params.model = 'spherical';
params.nugget = [];
params.plotit = true;
params.stablealpha = 1.5;
params.solver ='fminsearch';
params.weightfun = 'cressie85';
params.nu = 1;

% check if fminsearchbnd is in the search path
switch lower(params.solver)
case 'fminsearchbnd'
if ~exist('fminsearchbnd.m','file')==2
params.solver = 'fminsearch';
warning('Variogramfit:fminsearchbnd',...
end
end

% check if h and gammaexp are vectors and have the same size
if ~isvector(h) || ~isvector(gammaexp)
error('Variogramfit:inputargs',...
'h and gammaexp must be vectors');
end
% check size of supplied vectors
if numel(h) ~= numel(gammaexp)
error('Variogramfit:inputargs',...
'h and gammaexp must have same size');
end
% remove nans;
nans = isnan(h) | isnan(gammaexp);
if any(nans);
h(nans) = [];
gammaexp(nans) = [];
if ~isempty(numobs)
numobs(nans) = [];
end
end
% check weight inputs
if isempty(numobs);
params.weightfun = 'none';
end
b(1)=a0;
b(2)=c0;
b0 = [a0 c0 params.nugget];

switch lower(params.model)
case 'spherical'
type = 'bounded';
func = @(b,h)b(2)*((3*h./(2*b(1)))-1/2*(h./b(1)).^3);

case 'exponential'
type = 'unbounded';
func = @(b,h)b(2)*(1-exp(-h./b(1)));
otherwise
error('unknown model')
end

% nugget variance
if isempty(params.nugget)
nugget = false;
funnugget = @(b) 0;
else
nugget = true;
funnugget = @(b) b(3);
end

% create weights (see Webster and Oliver)
switch lower(params.weightfun)
case 'cressie85'
weights = @(b,h) (numobs./variofun(b,h).^2)./sum(numobs./variofun(b,h).^2);
case 'mcbratney86'
weights = @(b,h) (numobs.*gammaexp./variofun(b,h).^3)/sum(numobs.*gammaexp./variofun(b,h).^3);
otherwise
weights = @(b,h) 1;
end

% create objective function: weighted least square
objectfun = @(b)sum(((variofun(b,h)-gammaexp).^2).*weights(b,h));
% call solver
switch lower(params.solver)
case 'fminsearch'
% call fminsearch
[b,fval,exitflag,output] = fminsearch(objectfun,b0);
case 'fminsearchbnd'
% call fminsearchbnd
[b,fval,exitflag,output] = fminsearchbnd(objectfun,b0,lb,ub);
otherwise
error('Variogramfit:Solver','unknown or unsupported solver')
end

% create vector with initial values
a = b(1); %range
c = b(2); %sill
b0 = [a0 c0 params.nugget];

if nugget;
n = b(3);%nugget
else
n = [];
end
% Create structure array with results
if nargout == 4;
S.model = lower(params.model); % model
S.func = func;
S.type = type;
switch S.model
case 'matern';
S.nu = params.nu;
case 'stable';
S.stablealpha = params.stablealpha;
end

S.range = a;
S.sill = c;
S.nugget = n;
S.h = h; % distance
S.gamma = gammaexp; % experimental values
S.gammahat = variofun(b,h); % estimated values
S.residuals = gammaexp-S.gammahat; % residuals
COVyhaty = cov(S.gammahat,gammaexp);
S.Rs = (COVyhaty(2).^2) ./...
(var(S.gammahat).*var(gammaexp)); % Rsquare
S.weights = weights(b,h); %weights
S.weightfun = params.weightfun;
S.exitflag = exitflag; % exitflag (see doc fminsearch)
S.algorithm = output.algorithm;
S.funcCount = output.funcCount;
S.iterations= output.iterations;
S.message = output.message;
end
% if you want to plot the results...
if params.plotit
switch lower(type)
case 'bounded'
plot(h,gammaexp,'rs','MarkerSize',10);
hold on
fplot(@(h) funnugget(b) + func(b,h),[0 b(1)])
fplot(@(h) funnugget(b) + b(2),[b(1) max(h)])

case 'unbounded'
plot(h,gammaexp,'rs','MarkerSize',10);
hold on
fplot(@(h) funnugget(b) + func(b,h),[0 max(h)])
end
axis([0 max(h) 0 max(gammaexp)])
xlabel('lag distance h')
ylabel('\gamma(h)')
hold off
end

% fitting functions for fminsearch/bnd
function gammahat = variofun(b,h)

switch type
% bounded model
case 'bounded'
I = h<=b(1);
gammahat = zeros(size(I));
gammahat(I) = funnugget(b) + func(b,h(I));
gammahat(~I) = funnugget(b) + b(2);
% unbounded model
case 'unbounded'
gammahat = funnugget(b) + func(b,h);
if flagzerodistances
gammahat(izero) = funnugget(b);
end
end
end

end

steve

### steve (view profile)

look at that code and please advice me accordingly. i am trying to come up with a variogram for modeling but i just cannot get through. thanks

Wolfgang Schwanghart

### Wolfgang Schwanghart (view profile)

@steve: thanks for your comment. variofun is a subfunction that you'll find below the main function.

steve

### steve (view profile)

nice work there. what am wondering is what does variofun mean? since am trying to run that code am being told that it is an undefined variable. please help

Wolfgang Schwanghart

Roque Santos

### Roque Santos (view profile)

Hello friend,
I used your code in a job (Masters), wanted to know how do I quote your code.
I await
Hug!

Wolfgang Schwanghart

### Wolfgang Schwanghart (view profile)

@Roque Santos: thanks for your comment. Please check the documentation for varargin here: http://www.mathworks.de/de/help/matlab/ref/varargin.html

Roque Santos

### Roque Santos (view profile)

Hello, ... great code! Congratulations on your initiative!
Could not identify the input variable "varargin".
Could you help me?

Jeff

### Jeff (view profile)

Very helpful, thank you. I made a small change so that the nugget can be specified directly and not optimized:
line 299: funnugget = @(b) params.nugget;
line 336: [b,fval,exitflag,output] = fminsearchbnd(objectfun,b0(1:2),lb(1:2),ub(1:2),options);
line 346: n = params.nugget;

It's not pretty, but it works.

Wolfgang Schwanghart

### Wolfgang Schwanghart (view profile)

@Ludwig: Yes. The output is the function parameter, which means that b(1) (or a or S.range) is 1/3 of the range. Sorry for the confusion. Perhaps I should at least provide two different values (S.range and b(1)) in the structure array output.

Ludwig

### Ludwig (view profile)

@Wolfgang: My issue was around the output. For unbounded models, won't S.range (or a) be 1/3 of the range since it is just assigned b(1)?

Wolfgang Schwanghart

### Wolfgang Schwanghart (view profile)

@Ludwig: I know that the way range is used for unbounded models is confusing. When supplying the initial values you should enter the range where the model reaches about 95% of the sill variance. I decided to do so, since it can be easier visually determined from the experimental variogram and can better compared to bounded models. The parameter b(1) in the exponential variogram model
gamma = b(2)*(1-exp(-h./b(1)));
should be approx. 1/3 of this range.

Ludwig

### Ludwig (view profile)

I am working with fitting exponential models to my data and was a bit confused about the outputted range. Should the range be 3x the fitted parameter that is currently being called the range? When I ask the function to include a plot I can see that the given range is not 95% of the sill.

It is possible I am having a misunderstanding.

meo

### meo (view profile)

Wolfgang Schwanghart

### Wolfgang Schwanghart (view profile)

@ C Gutierrez: I think I haven't seen this error so far. Can you send me more information on how you have called variogramfit via the "contact author" interface?

C. Gutierrez

### C. Gutierrez (view profile)

When I try to run this function on either the example data or my own data, I get the following set of errors:
"
Error using variogramfit>@(b)sum(((variofun(b,h)-gammaexp).^2).*weights(b,h))
Too many input arguments.

Error in fminsearchbnd>@(x,varargin)fun(xtransform(x),varargin{:}) (line 233)
intrafun = @(x, varargin) fun(xtransform(x), varargin{:});

Error in fminsearch (line 191)
fv(:,1) = funfcn(x,varargin{:});

Error in fminsearchbnd (line 264)
[xu,fval,exitflag,output] = fminsearch(intrafun,x0u,options,varargin);

Error in variogramfit (line 336)
[b,fval,exitflag,output] = fminsearchbnd(objectfun,b0,lb,ub,options);
"
Have you seen this before?

Wolfgang Schwanghart

### Wolfgang Schwanghart (view profile)

@Vandita: I had requests for the inclusion of a hole-effect model earlier, but I currently don't have the time to implement it. However, it should be fairly easy to modify the function to include the hole-effect.

Vandita

### Vandita (view profile)

I wish to fit a hole effect model to my data using this function. Is there anything existing or if I have to mmodify, what should I take care in addition to adding an equation for that in this code?

Hugoptimus

### Hugoptimus (view profile)

excelent code, it works succesfully and it is clear to review

Wolfgang Schwanghart

### Wolfgang Schwanghart (view profile)

yes, this is possible, but you have to make some changes to the function.

Note that the general variogram parameters are in vector b.

% b(1) range
% b(2) sill
% b(3) nugget

So let's say you fit your horizontal data such that
b(1) = 1;
b(2) = 5;
b(3) = []; % no nugget

Then, before fitting your next model, edit to the following lines (302-313)

% generate upper and lower bounds when fminsearchbnd is used
switch lower(params.solver)
case {'fminsearchbnd'};
% lower bounds
% lb = zeros(size(b0));
lb = [0 5];
% upper bounds
if nugget;
ub = [inf max(gammaexp) max(gammaexp)]; %
else
% ub = [inf max(gammaexp)];
ub = [inf 5];
end
end

This should work. Make the obvious changes if you employ a nugget variance.

Is this a common problem and should it be implemented in variogramfit? If yes, let me know.

Best regards,
Wolfgang

Can I use this to simultaneously fit two variograms using some of the same parameter values? E.g., I want to fit both the horizontal and vertical data such that they have the same sample variance parameter.

Wolfgang Schwanghart

### Wolfgang Schwanghart (view profile)

d.val = gammaexp
d.dist = h

I know it's a little pedestrian...

Regards, Wolfgang

question not function,excuse me :)

Please one stupid function,if I am doing right.
For this function I use output from function variogram d(val)=gammaexp and d(dist)=h?
Thank you a lot for those two functions!

Wolfgang Schwanghart

### Wolfgang Schwanghart (view profile)

@ James,

I think that this should be feasible without too much effort. I would, however, not want to implement it in the existing variogramfit function, but write a wrapper, that evaluates the function for various models and selects the one that has the highest coefficient of determination.

James Ramm

### James Ramm (view profile)

As you know I've used this in conjuction with kriging by GSTAT for large datasets.

I'm now using this to create 3D grids from scattered XYZC data ( - layered geophysical/geological data). This requires many interpolations in a loop. To this end, I wonder if it is possible to automate the model selection process so that the 'best' model may be chosen for each new sample variogram?

Patrick A.

### Patrick A. (view profile)

This submission is absolutely perfect in my opinion. Clear and clean code, well commented, nice code, efficient,... thanks a lot for this !

Christian

### Christian (view profile)

Great program Wolfgang, simplicity of use, great code commenting, everything I could have wanted...(and I didnt have to do it myself!)


text:
How to derive Hicksian demand?

How can I derive Hicksian demand, when from the FOC I only get $$\frac{p_x}{p_y} = \frac13$$ without the usual x & y. So they cannot be derived directly from FOC, but if I plug the price relation into the budget constraint $$I =p_x \cdot x + p_y \cdot y$$ I get the income in the demand function, so this is Marshallian demand. Plugging the relation in expenditure function, obtained from the indirect utility function also doesn't lead to the Hicksian demand (that I obtained via Shephard's lemma and equals $$h_x = U + x + 3y$$).

The problem is to minimize

$$p_x \cdot x + p_y \cdot y \qquad\text{s.t.}\qquad x + 3y ≥ U$$

• Is the constraint $x + 3y \geq U$ or $x + 3y > U$?
– Amit
Aug 24 '19 at 21:07
• it's ≥ sign and I corrected the text, thanks Aug 25 '19 at 8:03

2 Answers

Expenditure minimization problem in the question is as follows : $$\begin{eqnarray*} \min_{x\geq 0, y\geq 0} & \ \ p_Xx + p_Yy \\ \text{s.t.}& \ \ x + 3y \geq U \end{eqnarray*}$$ where $$p_X > 0$$, $$p_Y > 0$$ and $$U \geq 0$$ are given. Since prices are positive, the cost minimizing choice will satisfy the condition that $$x + 3y = U$$. So, we can rewrite the above problem as : $$\begin{eqnarray*} \min_{x\geq 0, y\geq 0} & \ \ p_Xx + p_Yy \\ \text{s.t.}& \ \ x + 3y = U \end{eqnarray*}$$ We can now substitute the value of $$y = \frac{U-x}{3}$$ in the objective and rewrite the problem as : $$\begin{eqnarray*} \min_{0 \leq x \leq U} & \ \ p_Xx + p_Y\left(\dfrac{U-x}{3}\right) \end{eqnarray*}$$

Since the objective $${\color{red} {p_Xx + p_Y\left(\frac{U-x}{3}\right) =\frac{p_YU}{3} + \left(p_X- \frac{p_Y}{3}\right)x }}$$ is linear in $$x$$, solution is straight forward : $$\begin{eqnarray*} x^h(p_X, p_Y, U) \begin{cases} = U & \text{if } p_X < \frac{p_Y}{3} \\ \in [0, U] & \text{if } p_X = \frac{p_Y}{3} \\ = 0 & \text{if } p_X > \frac{p_Y}{3}\end{cases} \end{eqnarray*}$$

To start with, plot the line for which $$$$x + 3y = U$$$$ The red line in the graph above is this line. For simplicity, I've assumed U = 9 in this case but the solution would work for any U > 0.

The region to the right of this line would satisfy your constraint but since we are interested in minimising our cost, we would want our budget line to intersect this particular line.

Case 1: The budget line is flatter (black line) as compared to the constraint line, i.e. Px/Py < 1/3. To minimise cost, the line should be such that it intersects the constraint line at the right corner where x = U.

Case 2: The budget line is steeper (purple line) as compared to the constraint line, i.e, Px/Py > 1/3. To minimise cost, the line should be such that it intersects the constraint line at the left corner where x = 0.

Case 3: If the slope of the budget line is equal to the slope of the constraint line, i.e. if Px/Py = 1/3, any point on the constraint line would be a solution point. x can vary anywhere from 0 to U.

• @svit notice that these three cases in this answers correspond directly to the other answers’ solution(s) Aug 26 '19 at 14:52

format: plain


text:
## Stream: new members

### Topic: Recursively prove

#### AHan (Nov 03 2018 at 08:19):

Sorry, this might seems to be stupid, but I just can't figure out how to prove the problem inductively....

lemma add_nat_ge_self {a : ℕ} (b : ℕ) : a + b ≥ b := match b with | 0 := begin simp, apply nat.zero_le end | succ n := sorry

#### Mario Carneiro (Nov 03 2018 at 09:40):

In lean we write inductive definitions by pattern matching in the definition itself, not using match blocks like coq

#### Mario Carneiro (Nov 03 2018 at 09:41):

lemma add_nat_ge_self {a :  ℕ} : ∀(b : ℕ), a + b ≥ b
| 0 := begin simp, apply nat.zero_le end
| (succ n) := sorry

#### Mario Carneiro (Nov 03 2018 at 09:42):

at the sorry you should now have access to add_nat_ge_self which you can apply recursively

#### Bryan Gin-ge Chen (Nov 03 2018 at 13:37):

What Mario wrote is cleaner but I want to point out that the following is probably what you were going for:

lemma add_nat_ge_self {a :  ℕ} (b : ℕ) : a + b ≥ b :=
match a, b with
| a, 0 := begin simp, apply nat.zero_le end
| a, (nat.succ n) := sorry
end

#### Mario Carneiro (Nov 03 2018 at 13:39):

well if you write it like that you won't be able to fill in the sorry because you don't have access to the recursive function

#### Bryan Gin-ge Chen (Nov 03 2018 at 13:54):

It's there, but it gets a funny name:

lemma add_nat_ge_self {a :  ℕ} (b : ℕ) : a + b ≥ b :=
match a, b with
| a, 0 := begin simp, apply nat.zero_le end
| a, (nat.succ n) := begin
refine nat.succ_le_succ _,
exact _match a n
end
end

#### Bryan Gin-ge Chen (Nov 03 2018 at 14:02):

And I guess you only get access to it if you go into tactic mode; i.e. I can't remove the by exact below:

lemma add_nat_ge_self {a :  ℕ} (b : ℕ) : a + b ≥ b :=
match a, b with
| a, 0 := begin simp, apply nat.zero_le end
| a, (nat.succ n) := nat.succ_le_succ (by exact _match a n)
end

#### AHan (Nov 04 2018 at 03:59):

Oh!! Thanks a lot for the explanation!!

Last updated: May 08 2021 at 05:14 UTC


text:
# Relativistic Lighthouses: The role of Binary Pulsars in proving the Existence of Gravitational Waves

Genre
Conference Talk
Subject Areas
Creator
Dan Kennefick
Contributor

This lecture by Kennefick is about binary pulsars that emit gravitational waves. These gravitational waves have not been discovered yet by direct detection (at the time of this conference, in 2008), although binary pulsars behave as if they do emit gravitational waves. Kennefick discusses a couple of leading papers in the field of gravitational waves, including the perception of their predictions and results.

Type
Sound
Source
Original Publisher
Extent
1 CD
Location
Mainz, Germany
Language
English
Media Status
Online


text:
# Identifying overlapping incomplete squares in image

I am trying to align my device and markers automatically using positioners driven by Mathematica. The camera feed looks like this:

The device is the black square with gold electrodes. The markers are a series of concentric squares broke in the middle of each edge. I need to know (1) the displacement from the center of the device to the center of the markers, and (2) the angular difference between the device and the markers.

The naive ImageLines could give me some results, but it's not robust enough. Sometimes it sees lines everywhere on the image.

img = Import["https://i.imgur.com/YODXeXT.jpg"];
simg = ImageTake[img, {69, 780}, {715, 1408}]~ImageResize~Scaled[.7];
{h, s, b} = ColorSeparate[simg, "HSB"];
HighlightImage[b, {Orange, ImageLines[b // EdgeDetect]}]

The geometry and color of the device & markers will always be the same. Can I make use of that fact to write a more robust algorithm to get the parameters I need from the image? And can I get rid of the hand-written coordinates for ImageTake on the second line?


text:
## Writing Vectors

Posted in mathematics, The Universe and Stuff with tags , , , on October 11, 2021 by telescoper

Once again it’s time to introduce first-year Mathematical Physics students to the joy of vectors, or specifically Euclidean vectors. Some of my students have seen them before, but probably aren’t aware of how much we use them theoretical physics. Obviously we introduce the idea of a vector in the simplest way possible, as a directed line segment. It’s only later on, in the second year, that we explain how there’s much more to vectors than that and explain their relationship to matrices and tensors.

Although I enjoy teaching this subject I always have to grit my teeth when I write them in the form that seems obligatory these days.

You see, when I was a lad, I was taught to write a geometric vector in the following fashion:

$\vec{r} =\left(\begin{array}{c} x \\ y \\ z \end{array} \right).$

This is a simple column vector, where $x,y,z$ are the components in a three-dimensional cartesian coordinate system. Other kinds of vector, such as those representing states in quantum mechanics, or anywhere else where linear algebra is used, can easily be represented in a similar fashion.

This notation is great because it’s very easy to calculate the scalar (dot) and vector (cross) products of two such objects by writing them in column form next to each other and performing a simple bit of manipulation. For example, the scalar product of the two vectors

$\vec{u}=\left(\begin{array}{c} 1 \\ 1 \\ 1 \end{array} \right)$ and $\vec{v}=\left(\begin{array}{c} 1 \\ 1 \\ -2 \end{array} \right)$

can easily be found by multiplying the corresponding elements of each together and totting them up:

$\vec{u} \cdot \vec{v} = (1 \times 1) + (1 \times 1) + (1\times -2) =0,$

showing immediately that these two vectors are orthogonal. In normalised form, these two particular vectors appear in other contexts in physics, where they have a more abstract interpretation than simple geometry, such as in the representation of the gluon in particle physics.

Moreover, writing vectors like this makes it a lot easier to transform them via the action of a matrix, by multipying rows in the usual fashion, e.g.
$\left(\begin{array}{ccc} \cos \theta & \sin\theta & 0 \\ -\sin\theta & \cos \theta & 0 \\ 0 & 0 & 1\end{array} \right) \left(\begin{array}{c} x \\ y \\ z \end{array} \right) = \left(\begin{array}{c} x\cos \theta + y\sin\theta \\ -x \sin \theta + y\cos \theta \\ z \end{array} \right)$
which corresponds to a rotation of the vector in the $x-y$ plane. Transposing a column vector into a row vector is easy too.

Well, that’s how I was taught to do it.

However, somebody, sometime, decided that, in Britain at least, this concise and computationally helpful notation had to be jettisoned and students instead must be forced to write a vector laboriously in terms of base vectors:

$\vec{r} = x\hat{\imath} + y \hat{\jmath} + z \hat{k}$

Some of you may even be used to doing it that way yourself. Why is this awful? For a start, it’s incredibly clumsy. It is less intuitive, doesn’t lend itself to easy operations on the vectors like I described above, doesn’t translate easily into the more general case of a matrix, and is generally just …well… awful. The only amusing thing about this is that you get to tell students not to put a dot on the “i” or the “j” – it always gets a laugh when you point out that these little dots are called “tittles“.

Worse still, for the purpose of teaching inexperienced students physics, it offers the possibility of horrible notational confusion. In particular, the unit vector $\hat{\imath}$ is too easily confused with $i$, the square root of minus one. Introduce a plane wave with a wavevector $\vec{k}$ and it gets even worse, especially when you want to write $\exp(i\vec{k}\cdot \vec{x})$, and if you want the answer to be the current density $\vec{j}$ then you’re in big trouble!

Call me old-fashioned, but I’ll take the row and column notation any day!

(Actually it’s better still just to use the index notation, $a_i$ which generalises easily to $a_{ij}$ and, for that matter, $a^{i}$.)

Or perhaps being here in Ireland we should, in honour of Hamilton, do everything in quaternions.

## Littlewood on the real point’ of lectures

Posted in Education, mathematics, The Universe and Stuff with tags , , , on September 3, 2020 by telescoper

We’re often challenged these days to defend the educational value of the lecture as opposed to other forms of delivery, especially with the restrictions on large lectures imposed by Covid-19. But this is not a new debate. The mathematician J.E. Littlewood felt necessary to defend the lecture as a medium of instruction (in the context of advanced mathematics) way back in 1926 in the Introduction to his book The Elements of the Theory of Real Functions.

(as quoted by G. Temple in his Inaugural Lecture as Sedleian Professor of Natural Philosophy at the University of Oxford in 1954 “The Classic and Romantic in Natural Philosophy”.)

Temple concluded his lecture with:

Classic perfection should be reserved for the monograph: the successful lecture is almost inevitably a romantic adventure. It is at once the grandeur and misery of a scientific classic that it says the last word: it is the charm of a scientific romance that it utters the first word, and thus opens the windows on a new world.

Modern textbooks do try to be more user-friendly than perhaps they were in Littlewood’s day, and they aren’t always “complete and accurate” either, but I think Littlewood is right in pointing out that they do often hide the real point’ so students sometimes can’t see the wood for the trees. The value of lectures is not in trying to deliver masses of detail but to point out the important bits.

It seems apt to mention that the things I remember best from my undergraduate lectures at Cambridge are not what’s in my lecture notes – most of which I still have, incidentally – but some of the asides made by the lectures. In particular I remember Peter Scheuer who taught Electrodynamics & Relativity talking about his first experience of radio astronomy. He didn’t like electronics at all and wasn’t sure radio astronomy was for him, but someone – possibly Martin Ryle – reassured him by saying “All you need to know in order to do this is Ohm’s Law. But you need to know it bloody well.”

## On Grinds

Posted in Literature, mathematics with tags , , , , on July 24, 2020 by telescoper

When I moved to Ireland a couple of years ago, one of the words I discovered had a usage with which I was unfamiliar was grind. My first encounter with this word was after a lecture on vector calculus when a student asked if I knew of anyone who could offer him grinds. I didn’t know what he meant but was sure it wasn’t the meaning that sprang first into my mind so I just said no, I had just arrived in Ireland so didn’t know of anyone. I resisted the temptation to suggest he try finding an appropriate person via Grindr.

I only found out later that grinds are a form of private tuition and they are quite a big industry in Ireland, particularly at secondary school level. School students whose parents can afford it often take grinds in particular subjects to improve their performance on the Leaving Certificate. It seems to be less common for third level students to pay for grinds, but it does happen. More frequently university students actually offer grinds to local schoolkids as a kind of part-time employment to help them through college.

The word grind can also refer to a private tutor, i.e. you can have a maths grind. It can also be used as a verb, in which sense it means to instil or teach by persistent repetition’.

This sense of the word grind may be in use in the United Kingdom but I have never come across it before, and it seems to me to be specific to Ireland.

All of which brings me back to vector calculus, via Charles Dickens.

In Hard Times by Charles Dickens there is a character by the name of Mr Thomas Gradgrind, a grimly utilitarain school superintendent who insisted on teaching only facts.

Thomas Gradgrind (engraving by Sol Eytinge, 1867).

If there is a Mr Gradgrind, why is there neither a Mr Divgrind nor a Mr Curlgrind?

## Math versus Maths

Posted in mathematics, Pedantry with tags , on June 8, 2020 by telescoper

I was amused by this discussion on Dictionary.Com of the different abbreviations of mathematics..

I’d like to think that ending is deliberate!

## R. I. P. John Conway (1937-2020)

Posted in Biographical, mathematics with tags , , , on April 12, 2020 by telescoper

I’ve just heard the sad news that that mathematician John Horton Conway has passed away at the age of 82.

John Conway made very distinguished contributions to many areas of mathematics, especially topology and knot theory, but to many of us he’ll be remembered as the inventor of the Game Of Life. I’ll remember him for that because one of the very first computer programs I ever wrote (in BASIC) was an implementation of that game.

It’s a great illustration of how simple rules can lead to complex structures and it paved the way to a huge increase in interest in cellular automata.

I think he got a bit fed up with people just associating him with a computer game and neglecting his deeper work, but he deserves great credit for directly or indirectly inspiring future scientists.

Rest in peace John Conway (1937-2020).

Posted in Biographical, Education, mathematics with tags , , , on July 1, 2019 by telescoper

Yesterday a comment appeared on an old post of mine about the O-level Examination I took in Mathematics when I was at School. With a shock that reminded me that it was FORTY years ago this summer that I was taking my O-levels at the Royal Grammar School in Newcastle. That’s a memory lane down which I wasn’t anxious to take a trip.

For any youngsters reading this, the GCE (General Certificate of Education) Ordinary Level Examinations O-levels were taken at age sixteen in the United Kingdom back in the day; they were replaced during the 1980s by the modern GCSE Examination. For readers in Ireland the O-levels were roughly equivalent to the Junior Certificate, just as A-levels are roughly equivalent to the Leaving Certificate.

Anyway, that also reminded me that I never got round to posting the other O-level I took in Mathematics that summer, in Additional Mathematics. I thought I’d remedy that failing now, so here are the two papers I took (on Tuesday 26 June 1979 and Thursday 5 July respectively.

I had forgotten that there was so much mechanics in this actually (Section C of each paper). Is that different from equivalent papers nowadays? In fact I’d be interested in comments about the content and level of difficulty of this compared to modern examinations in mathematics via the box below.

P.S. I did ten O-levels that summer of ’79: Mathematics; Additional Mathematics; Combined Science (2); English Language; English Literature; French; Latin; History; and Geography. I still have all the papers and have only posted a subset. If anyone has requests for any others please let me know and I’ll scan them.

## The Problem of the Moving Triangle

Posted in Cute Problems, mathematics with tags , , on August 16, 2018 by telescoper

I found this nice geometric puzzle a few days ago on Twitter. It’s not too hard, but I thought I’d put it in the Cute Problems‘ folder.

In the above diagram, the small equilateral triangle moves about inside the larger one in such a way that it keeps the orientation shown. What can you say about the sum a+b+c?

## When Log Tables aren’t Log Tables

Posted in Education, mathematics, Maynooth with tags , , , , , on May 17, 2018 by telescoper

Every now and then – actually more frequently than that – I reveal myself in Ireland as an ignorant foreigner. The other day some students were going through a past examination paper (from 2014) and I was surprised to see that the front cover (above) mentioned  log tables’.

Now I’m old enough to remember using tables of logarithms (and other mathematical tables  of such things as square roots and trigonometric functions, in the form of lists of numbers) extensively at school. These were provided in this book of four-figure tables (which can now buy for 1p on Amazon, plus p&p).

As a historical note I’ll point out that I was in the first year at my school that progressed to calculators rather than slide rules (in the third year) so I was never taught how to use the former. My set of four-figure tables which was so heavily used that it was falling to bits anyway, never got much use after that and I threw it out when I went to university despite the fact that I’m a notorious hoarder.

Anyway, assuming that the mention of log tables’ was a relic of many years past, I said to the group of students going through the old examination paper that it seemed somewhat anachronistic. I was promptly corrected, and told that log tables’ are in regular use in schools and colleges throughout Ireland, but that the term is a shorthand for a booklet containing a general collection of mathematical formulae, scientific data and other bits of stuff that might come in useful to students; for an example appropriate to the Irish Leaving Certificate, see here. One thing that they don’t contain is a table of logarithms…

Students in Physics & Astronomy at Cardiff University are also given a formula booklet for use during examinations. I don’t remember having access to such a thing as an undergraduate, but I don’t object to it. It seems to me that an examination shouldn’t be a memory test, and giving students the basic formulae as a starting point if anything allows the examiner to concentrate on testing what matters much more, i.e. the ability to formulate and solve a problem. The greatest challenge of science education at University level is, in my opinion, convincing students that their brain is much more than a memory device…

## R.I.P. Maryam Mirzakhani (1977-2017)

Posted in mathematics with tags , , on July 18, 2017 by telescoper

Very sad news arrived at the weekend of the death of the brilliant Iranian-born mathematician Maryam Mirzakhani of breast cancer at the age of just 40. Let me first of all express my heartfelt condolences to her family, friends and colleagues on this devastating loss.

A uniquely creative and inspirational figure, Maryam Mirzakhani was the first woman ever to win the coveted Fields Medal; her citation for that award picks out her work on the dynamics and geometry of Riemann surfaces and their moduli spaces.  Here’s a short video of her talking about her life and work. It’s fascinating not only because of the work itself, but the insight it gives into the way she did it – using very large sheets of paper covered in drawings and notes!

R.I.P. Maryam Mirzakhani (1977-2017).

## Isotropic Random Fields in Astrophysics

Posted in The Universe and Stuff with tags , , on June 29, 2017 by telescoper

So the little workshop  on Isotropic Random Fields in Astrophysics’ I announced some time ago, sponsored via a “seedcorn” grant by the Data Innovation Research Institute, has finally arrived, and having spent most of the day at it I’m now catching up with some other stuff in the office before adjourning for the conference dinner.

This meeting is part of a series of activities aimed at bringing together world-leading experts in the analysis of big astrophysical data sets, specifically those arising from the (previous) Planck (shown above) and (future) Euclid space missions, with mathematical experts in the spectral theory of scalar vector or tensor valued isotropic random fields. Our aim is to promote collaboration between mathematicians interested in probability theory and statistical analysis and theoretical and observational astrophysicists both within Cardiff university and further afield.

It’s been a very interesting day of interleaving talks by cosmologists and mathematicians followed by an open-ended discussion session where we talked about unsolved problems and lines for future research. It’s clear that there are some language difficulties between the two communities but I hope this meeting helps to break down a few barriers and stimulate some new joint research projects.


text:
# quantum machine learning course

quantum-computing machine-learning Resources. From this Quantum Machine Learning course: The definition is that $$X$$ is conditionally independent of $$Y$$ given $$Z$$ $$(X\perp Y|Z)$$, if $$P(X=x, Y=y|Z=z) = P(X=x|Z=z)P(Y=y|Z=z)$$ for all $$x\in X,y\in Y,z\in Z$$. Quantum computers are becoming available, which begs the question: what are we going to use them for? In this course, participants learn the essentials of Quantum Computing. Lecture notes from edX course UTQML101x on Quantum Machine Learning by Peter Wittek (University of Toronto). About. A practical introduction to quantum computing: from qubits to quantum machine learning and beyond ... General description of the course. The skill level of the course is Advanced. We put a strong emphasis on implementing the protocols, using open source frameworks in Python. A curated list of awesome quantum machine learning algorithms,study materials,libraries and software (by language). Quantum computing is one the most promising new trends in information processing. Readme Releases No releases published. Jupyter notebook files are (mostly) identical to the ones offered in the class with some minor modifications for additional explanations. Machine learning can of course be used to help us speed up various types of information processing tasks, but in Detecting quantum speedup by quantum walk with convolutional neural networks , the authors show that neural networks can detect whether a quantum algorithm can produce a speed-up in quantum walk scenarios where theoretical bounds are not known. Graphical models are typically generative in that we explicitly model a probability distribution. Machine learning is a good candidate. Awesome Quantum Machine Learning . It may be possible to receive a verified certification or use the course to prepare for a degree. Lecture six offers an introduction to quantum machine learning, while the final lecture will ask what 'quantum supremacy' is. We start by outlining the conceptual foundations of quantum systems. The goal of this course is to show what benefits current and future quantum technologies can provide to machine learning, focusing on algorithms that are challenging with classical digital computers. Machine Learning, Artificial Intelligence, Physicists, Researchers, Cloud Computing Professionals, Python Programmers, DevOps , Security and Data Science Professionals would cherish this course to join the new era of computing. The course Quantum Machine Learning is an online class provided by University of Toronto through edX. The next chapter focuses on the basic elementary computational operations, with example programs in Python qiskit. edX course on "Quantum Machine Learning" Topics.

22000 Litre Water Tank Dimensions, Skoda Rapid Maintenance Cost Team-bhp, Where Can I Watch Gangster No 1, Tupper Lake Walleye Fishing, Rarest Personality Type Female, Wig Studio 1, Heel Fat Pad Syndrome Treatment, Motorola Sb6121 Manual, Veeranam Lake Pipeline, Hyundai Accent 2015 Interior, Car Door Lock Cylinder Replacement, Car Brite Amazon,


text:
# Graph Neural Network Reinforcement Learning for Autonomous Mobility-on-Demand Systems

Published in (Submitted), 2021

Abstract: Autonomous mobility-on-demand (AMoD) systems represent a rapidly developing mode of transportationwherein travel requests are dynamically handled by a coordinated fleet of robotic, self-driving vehicles. Given a graph representation of the transportation network - one where, for example, nodes represent areas of the city, and edges the connectivity between them - we argue that the AMoD control problem is naturally cast as a node-wise decision-making problem. In this paper, we propose a deep reinforcement learning framework to control the rebalancing of AMoD systems through graph neural networks. Crucially, we demonstrate that graph neural networks enable reinforcement learning agents to recover behavior policies that are significantly more transferable, generalizable, and scalable than policies learned through other approaches. Empirically, we show how the learned policies exhibit promising zero-shot transfer capabilities when faced with critical portability tasks such as inter-city generalization, service area expansion, and adaptation to potentially complex urban topologies. BibTex:


text:
Last edited by Kazizuru
Wednesday, July 29, 2020 | History

4 edition of Linear Differential Equations of Principal Type (Monographs in Contemporary Mathematics) found in the catalog.

Linear Differential Equations of Principal Type (Monographs in Contemporary Mathematics)

Yu. V. Egorov

# Linear Differential Equations of Principal Type (Monographs in Contemporary Mathematics)

## by Yu. V. Egorov

Written in English

Subjects:
• Mathematics,
• Mathematics / General,
• Differential Equations,
• Differential equations, Linear,
• Science/Mathematics

• The Physical Object
FormatHardcover
Number of Pages310
ID Numbers
Open LibraryOL9779389M
ISBN 100306109921
ISBN 109780306109928

Theorem (Equivalence of differential and difference equations). For a differential equation with constant coefficients to have the same solution as a difference equation, the characteristic equation of the differential equation must have as roots the logarithms of the roots of the characteristic equation of the difference equation with the same multiplicities, i.e., their characteristic.   Since I began to write the book, however, several other textbooks have appeared that also aspire to bridge the same gap: An Introduction to Partial Differential Equations by Renardy and Rogers (Springer-Verlag, ) and Partial Differential Equations by Lawrence C. Evans (AXIS, ) are two good s: 5.

This book is a reader-friendly, relatively short introduction to the modern theory of linear partial differential equations. and the propagation of singularities for operators of real principal type. Among the more advanced topics are the global theory of Fourier integral operators and the geometric optics construction in the large, the. CONTENTS Application Modules vii Preface ix About the Cover viii CHAPTER 1 First-Order Differential Equations 1 Differential Equations and Mathematical Models 1 Integrals as General and Particular Solutions 10 Slope Fields and Solution Curves 19 Separable Equations and Applications 32 Linear First-Order Equations 48 Substitution Methods and Exact Equations

Floquet theory is a branch of the theory of ordinary differential equations relating to the class of solutions to periodic linear differential equations of the form ˙ = (), with () a piecewise continuous periodic function with period and defines the state of the stability of solutions.. The main theorem of Floquet theory, Floquet's theorem, due to Gaston Floquet (), gives a canonical form for. Homogeneous equations with constant coefficients look like $$\displaystyle{ ay'' + by' + cy = 0 }$$ where a, b and c are constants. We also require that $$a \neq 0$$ since, if $$a = 0$$ we would no longer have a second order differential equation. When introducing this topic, textbooks will often just pull out of the air that possible solutions are exponential functions.

You might also like
Patent policy

Patent policy

This unemployment - disaster or opportunity?

This unemployment - disaster or opportunity?

boys book of model aeroplanes

boys book of model aeroplanes

Account of arctic discovery on the northern shore of America in the summer of 1838. (Extracted from the London Geographical Journal)

Account of arctic discovery on the northern shore of America in the summer of 1838. (Extracted from the London Geographical Journal)

English religious heritage

English religious heritage

Address of Rufus B. Bullock to the people of Georgia

Address of Rufus B. Bullock to the people of Georgia

Disintegrating Europe (Adamantine Studies on the Changing European Order)

Disintegrating Europe (Adamantine Studies on the Changing European Order)

Act of Parliament for erecting a bank in Scotland

Act of Parliament for erecting a bank in Scotland

Working of village agencies with special reference to peoples participation

Working of village agencies with special reference to peoples participation

ISAMU PAINT CO., LTD.

ISAMU PAINT CO., LTD.

Korean grammar

Korean grammar

### Linear Differential Equations of Principal Type (Monographs in Contemporary Mathematics) by Yu. V. Egorov Download PDF EPUB FB2

Definition of Linear Equation of First Order. A differential equation of type $y’ + a\left(x \right)y = f\left(x \right),$ where $$a\left(x \right)$$ and $$f\left(x \right)$$ are continuous functions of $$x,$$ is called a linear nonhomogeneous differential equation of Linear Differential Equations of Principal Type book consider two methods of solving linear differential equations of first order.

Additional Physical Format: Online version: Egorov, I︠U︡. (I︠U︡riĭ Vladimirovich). Linear differential equations of principal type. New York ; London. This book is a reader-friendly, relatively short introduction to the modern theory of linear partial differential equations.

An effort has been made to present complete proofs in an accessible and self-contained form. The first three chapters are on elementary distribution theory and Sobolev spaces with many examples and applications to equations with constant coefficients.

There are several techniques for solving first-order, linear differential equations. We list them here with links to other pages that discuss those techniques. But before you move on, let's discuss what a first-order, linear ODE is and look at some easier techniques that will save you some time and energy.

This book explains the following topics: First Order Equations, Numerical Methods, Applications of First Order Equations1em, Linear Second Order Equations, Applcations of Linear Second Order Equations, Series Solutions of Linear Second Order Equations, Laplace Transforms, Linear Higher Order Equations, Linear Systems of Differential Equations, Boundary Value Problems and Fourier.

Pseudo differential Operators of Principal Type. Egorov, M. Shubin. Pages This book, the first printing of which was published as Volume 31 of the Encyclopaedia of Mathematical Sciences, contains a survey of the modern theory of general linear partial differential equations and a detailed review of equations with constant.

SAMPLE APPLICATION OF DIFFERENTIAL EQUATIONS 3 Sometimes in attempting to solve a de, we might perform an irreversible step. This might introduce extra solutions.

This book is a reader-friendly, relatively short introduction to the modern theory of linear partial differential equations. An effort has been made to present complete proofs in an accessible and self-contained form. The first three chapters are on elementary distribution theory and Sobolev spaces with many examples and applications to Format: Hardcover.

This book presents the theory of asymptotic integration for both linear differential and difference equations. This type of asymptotic analysis is based on some fundamental principles by Norman Levins.

Linear Equations – In this section we solve linear first order differential equations, i.e. differential equations in the form $$y' + p(t) y = g(t)$$.

We give an in depth overview of the process used to solve this type of differential equation as well as a derivation of the formula needed for the integrating factor used in the solution process.

Linear differential equations of principal type. [Jurij V Egorov] Home. WorldCat Home About WorldCat Help. Search. Search for Library Items Search for Lists Search for Document Type: Book, Internet Resource: All Authors / Contributors: Jurij V Egorov. Find. This is the Multiple Choice Questions Part 1 of the Series in Differential Equations topic in Engineering Mathematics.

In Preparation for the ECE Board Exam make sure to expose yourself and familiarize in each and every questions compiled here taken from various sources including but not limited to past Board Examination Questions in Engineering Mathematics, Mathematics Books.

Equation (1) can be understood as a generalization of the 2n-th order Euler type half-linear differential equation (1)n taF x(n) (n) + n å l=1 (1)n lb n l ta lpF x(n l) (n l) = 0, (2) studied in [1,2].

The two-term even order (Euler type and more general) half-linear differential equations are studied in [1,3,4] and in the book [5] (Section. Partial Diﬀerential Equations Igor Yanovsky, 10 5First-OrderEquations Quasilinear Equations Consider the Cauchy problem for the quasilinear equation in two variables a(x,y,u)u x +b(x,y,u)u y = c(x,y,u), with Γ parameterized by (f(s),g(s),h(s)).

The characteristic equations are dx dt = a(x,y,z), dy dt = b(x,y,z), dz dt = c(x,y,z. The general form of a linear ordinary differential equation of order 1, after dividing out the coefficient of ′ (), is: ′ = () + ().

If the equation is homogeneous, i.e. g(x) = 0, one may rewrite and integrate: ′ =,  = +, where k is an arbitrary constant of integration and = ∫ is an antiderivative ofthe general solution of the homogeneous equation is. In this section we solve linear first order differential equations, i.e.

differential equations in the form y' + p(t) y = g(t). We give an in depth overview of the process used to solve this type of differential equation as well as a derivation of the formula needed for the integrating factor used in the solution process.

I want to point out two main guiding questions to keep in mind as you learn your way through this rich field of mathematics. Question 1: are you mostly interested in ordinary or partial differential equations.

Both have some of the same (or very s. Definition of First-Order Linear Differential Equation A first-order linear differential equation is an equation of the form where P and Q are continuous functions of x.

This first-order linear differential equation is said to be in standard form. dy dx 1 Psxdy 5 Qsxd ANNAJOHNSONPELLWHEELER(–) Anna Johnson Pell Wheeler was awarded a.

TheSourceof the whole book could be downloaded as well. Also could contain in principle: clickable hyperlinks (both internal and external) and Equations with separating variables, integrable, linear.

Higher order equations (c)De nition, Cauchy problem, existence and uniqueness; Linear equations. This Calculus 3 video tutorial provides a basic introduction into second order linear differential equations.

It provides 3 cases that you need to be familia. In general, given a second order linear equation with the y-term missing y″ + p(t) y′ = g(t), we can solve it by the substitutions u = y′ and u′ = y″ to change the equation to a first order linear equation.

Use the integrating factor method to solve for u, and then integrate u to find y. That is: 1. Substitute: .Second linear partial differential equations; Separation of Variables; 2-point boundary value problems; Eigenvalues and Eigenfunctions Introduction We are about to study a simple type of partial differential equations (PDEs): the second order linear PDEs.

Recall that a partial differential equation is any differential equation that contains two.If a particular solution to a differential equation is linear, y=mx+b, we can set up a system of equations to find m and b. See how it works in this video. If a particular solution to a differential equation is linear, y=mx+b, we can set up a system of equations to find m and b.

See how it works in this video.


text:
Find the Standard Deviation 2 , 5 , 6 , 8 , 14

, , , ,
Find the mean.
The mean of a set of numbers is the sum divided by the number of terms.
Simplify the numerator.
Divide by .
Simplify each value in the list.
Convert to a decimal value.
Convert to a decimal value.
Convert to a decimal value.
Convert to a decimal value.
Convert to a decimal value.
The simplified values are .
Set up the formula for sample standard deviation. The standard deviation of a set of values is a measure of the spread of its values.
Set up the formula for standard deviation for this set of numbers.
Simplify the result.
Subtract from .
Raise to the power of .
Subtract from .
Raise to the power of .
Subtract from .
Raise to the power of .
Subtract from .
One to any power is one.
Subtract from .
Raise to the power of .
Subtract from .
Divide by .
Rewrite as .
Factor out of .
Rewrite as .
Pull terms out from under the radical.
The standard deviation should be rounded to one more decimal place than the original data. If the original data were mixed, round to one decimal place more than the least precise.
Find the Standard Deviation 2 , 5 , 6 , 8 , 14


text:
# Arrange (+,-,x,/) into the upsilon grid

• Put operators $(+,-,×,/)$ into the squares.
• Each operator must appears exactly 3 times to make the operations correct.
• C is a constant.
• No BODMA rules ((×) and (/) is NOT HIGHER than (+) and (−)), do the math operation in sequence.
• Check this puzzle for example.


text:
1 answer

# If 2.30 g occupies 0.870 L at 690 torr and 37 degrees C. How would you calculate the molar mass?

###### Question:

If 2.30 g occupies 0.870 L at 690 torr and 37 degrees C. How would you calculate the molar mass?

## Answers

#### Similar Solved Questions

1 answer
##### Answer all parts quickly please thank you 8. Bonus Question (10 points) Only attempt this problem...
Answer all parts quickly please thank you 8. Bonus Question (10 points) Only attempt this problem if you have completed questions 1-5. a. Identify the products A and B in the reaction below. (6 points) Oci AICI: Na Cr2O7 b. Show the mechanism for the formation of compound A. (Hint: The reaction...
1 answer
##### Stanford Semiconductors manufactures specialized chips that sell for $50 each. Stanford's manufacturing costs consist of variable... Stanford Semiconductors manufactures specialized chips that sell for$50 each. Stanford's manufacturing costs consist of variable cost of $6 per chip and fixed costs of$16,000,000. Stanford also incurs $1,800,000 in fixed marketing costs each year. Stanford calculates operating income using abs... 1 answer ##### Robert is a citizen of Germany. He decides to come to the United States to open... Robert is a citizen of Germany. He decides to come to the United States to open a car dealership in Chicago. Robert does not obtain a Green Card, but procures a visa to work in the United States. He is physically present in the United States during the following periods: 20X1 (April 1 through July ... 1 answer ##### The decomposition of dinitrogen pentoxide in carbon tetrachloride solution at 30°C is first order in N205... The decomposition of dinitrogen pentoxide in carbon tetrachloride solution at 30°C is first order in N205 with a rate constant of 4.10x10-3 min., If the initial concentration of N20s is 0.705 M, the concentration of N20s will be M after 316 min have passed.... 1 answer ##### Colligative Properties: Freezing Point Depression Lauris acid is added to a test tube and heated. The... Colligative Properties: Freezing Point Depression Lauris acid is added to a test tube and heated. The test tube is placed in water to freeze the lauric acid. After measuring the temperature, an unknown is added. The lauric acid and unknown are heated to a liquid and placed in cold water(Part B). In ... 1 answer ##### Leon and Heidi decided to invest$2,750 annually for only the first nine years of their...
Leon and Heidi decided to invest $2,750 annually for only the first nine years of their marriage. The first payment was made at age 20. If the annual interest rate is 8% how much accumulated interest and principal will they have at age 652 The accumulated interest and principal will equal$ (Round t...
1 answer


text:
# the software engineering notebook

Fellow software engineers/hackers/devs/code gardeners, do you keep a notebook (digital or plain dead-tree version) to record things you learn?

Since my days assembling glassware and synthesizing various chemicals in the organic chemistry lab, I’ve found keeping notes to be an indispensable tool at getting better and remembering important lessons learned. One of my professors recommended writing down, after every lab sessions, what had been accomplished and what needed to be done next time. When lab sessions are few and far apart (weekly instead of daily), it is easy to forget the details (for example, the mistakes that were made during weighing of chemicals ). A good quick summary helps with this!

When I first started working for a software company, I was overwhelmed. Academic software development was indeed very different to large scale distributed software development. For example, the academic software I wrote was rarely version controlled and had few tests. I had never heard of a ‘build’ or DEV/QA/PROD environments, not to mention things like Gradle or Jenkins. The academic software I worked on was distributed in zip files and usually edited by only one person (usually the original author). The systems I started working on were simultaneously developed by tens of developers across the globe.

To deal with the newbie developer info-flood, I went back to the concept of a ‘software engineering lab notebook’. At first, I jotted down commands needed to setup proper compilation flags for the dev environment and how to run the build locally to debug errors. A bit later, I started jotting down diagrams of the internals of the systems I was working on and summaries of code snippets that I had found particularly thorny to understand. Sometimes these notes proved indispensable in under-stress debug scenarios when I needed to quickly revisit what was happening in a particular area of the codebase without the luxury of a long debug.

In addition to keeping a record of things that can make your development and debug life easier, a software engineering lab notebook can serve as a good way to learn from previous mistakes. When I revisit some of the code I wrote a year ago or even a few months ago, I often cringe. It’s the same feeling as when you read a draft of a hastily written essay or work of fiction and then approach it again with fresh eyes. All of the great ideas suddenly seem - well- less than great. For example, recently I was looking at a server side process that I wrote to perform computations on a stream of events (coming via ZeroMQ connection from another server ) and saw that for some reason I had included a logging functionality that looped through every single item in an update (potentially 100s ) and wrote a log statement with the data! Had the rate of events been higher, this could have caused some performance issues, though the exact quantification of the impact still remains an area where I need to improve. Things such as these go into the notebook to the ‘avoid-in-the-future-list’.

# decision boundary poisoning - a black box attack on a linear SVM

## Introduction

If you regularly browse machine learning websites, you may have seen the image of a self-driving car baffled by a circle of salt drawn on the ground. This ‘hack’ on the car’s sensing devices shows that there is still some work to do to make sure that machine learning algorithms are robust to malicious (or accidental) data manipulation.

Sarah Jamie Lewis’ post on adversarial machine learning is a great introduction and bibliography on the topic of machine learning. One of the papers the article links to is ‘Can Machine Learning be Secure?’ by Barreno et al.

Barreno et al describe various ways to detect attacks and among them talk about examining points near the decision boundary. A large cluster of points around the boundary might indicate that an exploratory attack is taking place.

I wanted to take this idea of points at the decision bounary and explore how one could force a Linear Support Vector Machine classifier trained on the famous Iris dataset to misclassify a rogue point.

## Attack description

This attack with premises that make it largely unrealistic. For example, the attacker in this case has full knowledge of the dataset, can visualise the decision boundary and can force the classifier to retrain at will. This most likely will never happen in the real world. This is a blackbox attack, meaning we assume that the attacker does not know anything about the internals of the Linear SVM classifier and its training process.

1. Begin with a classifier trained on the Iris dataset to distinguish between the Iris setosa and Iris versicolor species
2. The attacking class will be Iris versicolor. We will inject a rogue point into the Iris setosa dataset and then poison the training data until this rogue point is classified as Iris versicolor.

### Prepare the training data

import sklearn
import pandas as pd
import matplotlib
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap

df = pd.read_csv('https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data', header=None)

0 1 2 3 4
0 5.1 3.5 1.4 0.2 Iris-setosa
1 4.9 3.0 1.4 0.2 Iris-setosa
2 4.7 3.2 1.3 0.2 Iris-setosa
3 4.6 3.1 1.5 0.2 Iris-setosa
4 5.0 3.6 1.4 0.2 Iris-setosa
#prepare the class labels. Iris setosa will be labelled as -1, Iris versicolor as 1
X = df.iloc[0:100, 4].values
y= np.where(X=="Iris-setosa", -1, 1)

#prepare the training data
data = df.iloc[0:100, [0,2]].values

### Visualise training data

As we can see from the image below, the data points (whose locations are based on the petal length and sepal length of the two species of Iris ) are linearly separable - so we should be able to learn a good decision boundary with the Linear SVM.

plt.scatter(data[:50, 0], data[:50, 1], color='red', marker='o', label='setosa')
plt.scatter(data[50:100, 0], data[50:100, 1], color='blue', marker='x', label='versicolor')
plt.xlabel('petal length')
plt.ylabel('sepal length')
plt.legend(loc='upper left')
plt.show()

### Attack tools

To monitor the progress of the attack, we will define a helper function below. The function plots the decision boundary learned from the classifier as well as the data. I implemented the function based on the exposition in Python: Deeper Insights into Machine Learning by John Hearty, David Julian and Sebastian Raschka.

def plot_decision_regions(data, y, classifier, resolution=0.02):
"""
A function that plots decision regions based on "Implementing a perceptron algorithm in Python by Raschka et al.
"""
markers = ('s', 'x', 'o', '^', 'v')
colors = ('red', 'blue', 'lightgreen', 'gray', 'cyan')
cmap = ListedColormap(colors[:len(np.unique(y))])

#meshgrid
x1min, x1max = data[:,0].min()-1, data[:, 0].max()+1
x2min, x2max = data[:,1].min()-1, data[:,1].max()+1
xx1, xx2 = np.meshgrid(np.arange(x1min, x1max, resolution), np.arange(x2min, x2max, resolution))
Z = clf.predict(np.array([xx1.ravel(), xx2.ravel()]).T)
Z = Z.reshape(xx1.shape)
plt.contourf(xx1, xx2, Z, alpha=0.4)
plt.xlim(xx1.min(), xx1.max())
plt.ylim(xx2.min(), xx2.max())
for idx, cl in enumerate(np.unique(y)):
plt.scatter(x=data[y==cl,0], y=data[y==cl, 1],
alpha=0.8, c=cmap(idx),
marker=markers[idx], label=cl)
plt.scatter(x=[6.0], y=[1.8],
alpha=0.8, marker='v', c='cyan')

### Linear SVM classification

We will be using the Linear SVM implementation from scikit-learn.

from sklearn import svm

clf = svm.LinearSVC()
clf.fit(data, y)

## Plotting the decision surface before the attack

This is the situation before we begin poisoning the decision boundary. I have added the rogue point in light blue/cyan into the red class at (6.0, 1.8). The aim will be to move the decision boundary so that this point will be misclassified as blue class.

plot_decision_regions(data, y, clf)
plt.legend(loc='upper left')
plt.show()

Let’s define a few helper functions: add_attack_point will merge new poisoned training data with the existing training dataset, retrain_and_plot will rerun the classifier and plot the resulting decision boundaries.

def add_attack_point(data, y, attack_points, attack_class=1):
"""
Add a new attack point to the dataset

Returns:
--------

New dataset including attack point

New class label vector including label for attacking class (1 in this case)
"""
return np.concatenate((data, attack_points)), np.concatenate((y, np.array(len(attack_points)*[attack_class])))

def retrain_and_plot(clf, new_data, new_y):
"""
Retrain the classifier with new data and plot the result
"""
clf.fit(new_data, new_y)
plot_decision_regions(new_data, new_y, clf)
plt.legend(loc='upper left')
plt.show()

### Attack 1 : Add single data point and see what happens

new_data, new_labels = add_attack_point(data, y, [[6.0, 2.0]])

retrain_and_plot(clf, new_data, new_labels)

One of the instances from blue class now falls within the decision boundary of the red class, but this has not caused a remarkable shift in the position of the decision boundary. Let’s continue adding more points close to the rogue point we wish to re-classify as blue.

### Attack 2: More poisoned datapoints

x1_new = [6.0, 6.1, 6.05, 6.08, 6.09]
x2_new = [1.5, 1.4, 1.55, 1.8, 1.75]
new_vals = map(list, zip(x1_new, x2_new))
new_data_2, new_labels_2 = add_attack_point(new_data, new_labels, new_vals)
retrain_and_plot(clf, new_data_2, new_labels_2)

The decision boundary is clearly shifting - close to the mass of new blue attack points.

### Attack 3

x1_new = [5.5, 5.6, 5.559, 5.7, 5.45, 6.0, 6.1, 6.2, 5.9]
x2_new = [2.1, 2.105, 2.110, 2.089, 2.0, 1.8, 1.9, 2.0, 1.9]
new_vals = map(list, zip(x1_new, x2_new))
new_data_3, new_labels_3 = add_attack_point(new_data_2, new_labels_2, new_vals)
retrain_and_plot(clf, new_data_3, new_labels_3)

The rogue point is now classified as class 1.

rogue_point = [[6.0, 1.8]]
clf.predict(rogue_point)

array([1])

### Summary

This was a brief and very incomplete experiment with changing the decision boundaries of Linear SVM classifiers by adding poisoned training data close to the decision boundary. One of the major shortcomings of this exposition is that the points were added in a largely random manner around the rogue point without any sort of attack system. In the next few essays on this subject I hope to present a white box approach to poisoning SVMs ( attacks where attacker has intricate knowledge of how support vector machines work ) as well as developing systematic data poisoning approaches.

# notes on container security I

This post is a set of notes from Jess Frazelle’s talk ‘Benefits of isolation provided by containers’ delivered at O’Reilly Security 2016 Conference in New York. Notes are abbreviated in some places and in places where I was not familiar with concepts from the talk, I’ve added some of my own clarifications/definitions. All mistakes are mine.

### How do containers help security?

• they do not prevent application compromise, but can limit the damage

• the world an attacker sees inside a container is very different than if she would be looking at an app running without a container

### What is a container?

• a group of Linux namespaces and control groups applied to a process

### What are control groups (cgroups) ?

Cgroups limit what a process can use. There various kinds of cgroups: for example, the memory cgroup limits what physical or kernel memory. Another example, the blkio group limits various I/O operations. cgroups are controlled by files

### What are namespaces ?

Namespaces limit what a process can see. They are files located in /proc/{pid}/ns

### Docker and defaults

• by default Docker blocks writing to /proc/{num} and /proc{sys}, mounting and writing to sys

• LSM (Linux Security Modules ) - a framework that allows the Linux kernel to support a variety of security modules such as AppArmor, SELinux. Docker supports LSMs.

• people generally don’t want to write custom AppArmor custom profiles, syntax is not great (note to self: look up how to write AppArmor profiles )

### Docker and seccomp

• seccomp is a Linux kernel security module

• Docker has a default whitelist, which prevents for example cloning a user namespace inside a Docker container ( note to self: look up why this is a weak spot for Linux kernel vulns )

### Docker security in the future

• one sad thing: containers need to run as root
• why: to write to sys/fs for cgroups, we need to be root

• cgroups cannot be created without CAP_SYS_ADMIN

• cgroups namespaces: a potential solution to having to be root when creating a cgroup, but turns out this concept just limits what cgroups you can see

• there are patches in the kernel to make it possible to create cgroups with other users, but not yet

# disconnect

Trying not to fall into a rabbit hole is harder than it should be.

Neurons, cut off from the constant stream of novel fast-food information, are struggling to adjust to a life outside of the internet noosphere.

But the brain is a pliable creature. Slowly, it rewires itself to assign neurons performing information grazing to other tasks, one new connection at a time. It does not feel pleasant and the desire to connect back to the buzz of thousands of internet voices is always present.

The info-FOMO (the fear that the biggest and most important thing will happen on the interwebs while you’re away) is always there, but I can learn to live with it until it fades. Also, I won’t be able to lookup Game of Thrones spoilers, so someone will have to tell me what ultimately happens between Daenerys and Jon Snow.

I have not pulled a complete Aziz Ansari ( the GQ Fall 2017 interview with the comedian reports that he has completed disconnected and removed his browsers from his laptop and phone) yet, but I’ve updated /etc/hosts to have even more entries and am considering permanently switching to lynx. It’s a text based browser and thus hopefully will encourage swift and focused information lookups instead of mindless surfing.

When you visit the tallest floor of a London skyscraper, you realise that perspective matters. From the 39th floor, London appears to be nothing more but a whimsically assembled menagerie of various shapes clustered on the banks of a single ribbon of blue, the Thames, bending around the tongue-like Isle of Dogs on its way to the City.

I sometimes wonder what it would feel like to look at time in this way, with perspective and distance.

It sometimes seems infuriating that time is a dimension that cannot be examined in both directions. We can only look back and hypothesize about the future, but there is no skyscraper we can climb which will show us the whole view.

The future humans will look at us, our buildings and customs and cultures, and wonder why we made the mistakes we did. Perhaps, they will try to walk a bit in our shoes to too see why our choices appeared obvious.

They will look at our tablets and smart phones the way we look at floppy disks, VHS tapes and cassettes, with a wry smile and maybe an eye-roll ( full disclosure: I am a child of the floppy-disk age, but even I rolled eyes at cassettes )

Why should we let posterity have all the fun? Even though every generation is, in a way, blind to the shortcomings and dangers of the technology du-jour, that should not stop us from taking a critical look at what is happening.

Neil Postman, an influential voice on this topic, was a cultural critic and professor, a historian of technology and media. In a March 1997 speech “The Surrender of Culture to Technology” (it is available on Youtube) Postman outlined seven questions that we can use to evaluate a new technology.

Before looking at the questions, we should make note of an important distinction between the words media and technology. A technology to a medium is what a brain is to a mind, Postman says. A technology is machine, a medium is a social creation. How a technology is used by a culture is not necessarily the only way it could be used.

1. What is the problem to which this technology is a solution? There are technologies that are not solutions to any problem.

2. Whose problem is this? Most technologies do solve a problem. Who will benefit from this technology and who will pay for it? These are sometimes not the same people.

3. What new problems might be created, because we have solved the old problem? Technologies generate new problems, but sometimes it is hard to know what new problems will be. For example, Postman argued, that the television, while allowing for mass-communication and mass-entertainment, had permanently changed the nature of political discourse. It would have been fascinating to hear his take on Twitter in November 2016.

4. Which people and what institutions might be most seriously harmed by this technology?

5. What changes in language are being enforced by new technologies? What is lost and what is gained?

6. What sort of institutions acquire special economic and political power because of technological change?

7. What alternative uses might be made of a technology? What alternative media might arise from this technology?

Postman argued that it was not inevitable that television (the physical technology ) became the commercial television we all know today. He cited examples of countries where (in the 90s) television was not subject to any commercial interests. The crux of the argument is that the medium (the current world wide web for example) that exists of a particular technology (the physical internet network) is not the only possible medium we could have created. How a particular technology is transformed into a particular medium is very complex and involves society, politics and greed.


text:
## leetcode Find Median from Data Stream

### leetcode Find Median from Data Stream

Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle value.

Examples:
[2,3,4] , the median is 3

[2,3], the median is (2 + 3) / 2 = 2.5

Design a data structure that supports the following two operations:

• void addNum(int num) – Add a integer number from the data stream to the data structure.
• double findMedian() – Return the median of all elements so far.

For example:

• findMedian() -> 1.5
• findMedian() -> 2

## leetcode Nim Game

### leetcode Nim Game

You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the winner. You will take the first turn to remove the stones.

Both of you are very clever and have optimal strategies for the game. Write a function to determine whether you can win the game given the number of stones in the heap.

For example, if there are 4 stones in the heap, then you will never win the game: no matter 1, 2, or 3 stones you remove, the last stone will always be removed by your friend.

• push
• pop
• 堆的创建及其他应用

## leetcode Graph 图论

• 133 Clone Graph
• 207 Course Schedule
• 210 Course Schedule II

## leetcode 链表

• 依照leetcode定义 自己写的链表创建/打印方法，便于测试
• 19 Remove Nth Node From End of List
• 21 Merge Two Sorted Lists
• 24 Swap Nodes in Pairs
• 25 Reverse Nodes in k-Group
• 61 Rotate List
• 138 Copy List with Random Pointer
• 142 Linked List Cycle II
• 143 Reorder List
• 147 Insertion Sort List
• 148 Sort List
• 160 Intersection of Two Linked Lists
• 203 Remove Linked List Elements
• 237 Delete Node in a Linked List

update:2015-7-14

• add a 203 solution code:
• using recursion and reference to delete linklist node which value equals x
• 单项链表递归删除，使用引用

## leetcode hashtable

• hashtable简洁即实现
• Longest Substring Without Repeating Characters
• 160 Intersection of Two Linked Lists
• 202 Happy Number
• 242 Valid Anagram

## leetcode 动态规划（DP）

• 53 Maximum Subarray
• 62 Unique Paths
• 63 Unique Paths II
• 64 Minimum Path Sum
• 70 Climbing Stairs
• 72 Edit Distance
• 91 Decode Ways
• 97 Interleaving String
• 115 Distinct Subsequences
• 139 Word Break
• 140 Word Break II
• 152 Maximum Product Subarray
• 174 Dungeon Game
• 198 House Robber
• 213 House Robber II
• 221 Maximal Square

## leetcode 回文串

• 5 Longest Palindromic Substring
• Palindrome Number
• 125 Valid Palindrome
• 131 Palindrome Partitioning
• 132 Palindrome Partitioning II
• 214 Shortest Palindrome
• 336 Palindrome Pairs

## leetcode 位运算

• 136 Single Number
• 137 Single Number II
• 190 Reverse Bits
• 191 Number of 1 Bits
• 201 Bitwise AND of Numbers Range
• 260 Single Number III
• 268 Missing Number


text:
# Predicting next action to take to reach a final state

Does anyone know of an algorithm that could be used to determine the next action to take to reach a desired state when trained on time-series data?

For example, a robot starts at a certain state, then takes an action to get to another state. This occurs continuously for many iterations (imagine the robot is randomly exploring a room). If the robot is at a specific starting state, and I desire the robot to end up in a different state, is there an algorithm that could recommend the best next action (or set of next actions) to take to reach that final desired state?

One approach I've tried is to use a neural network with the current state and the next state being the input and the action to get from the current state to the next state being the output. The network would know for a single state how to get to a next desired state that is one action away. The issue is, what if the desired state is many actions away?

The problem you've described can be formalized as a Markov decision process, the foundational problem of reinforcement learning. In broad strokes, reinforcement learning is concerned with how agents (robot) in a given environment (room) out to take actions (movements from one state to another) to maximize some notion of reward.

Formalizing your problem requires defining a few parts of an MDP model:

• Set of states $S$
• Set of actions $A$
• A reward function $R(s)$, defining the reward of arriving in a given state. In your case, a simple scheme of $R(s) = \mathbb{1}(s = s_{goal})$ is one option.
• A transition function $T(s,a,s')$ giving the probability of winding up in state $s'$ having taken action $a$ from state $s$.(Note that you can model deterministic transitions by returning a value of $1$ for a single $s'$.)

If the problem goes on infinitely, you'll also need a discount factor $\gamma$.

In reinforcement learning, the term optimal policy describes a function that returns the best action to take from a given state. I.e., this gives the recommendation you're looking for.

If you know all of the model components described above—or can at least derive ones that match your problem—you can use a variety of planning algorithms to find the optimal policy, e.g. value iteration or policy iteration.

If you don't know the rewards and transitions—say, for example, that the robot is seeking a sensor attached to a charging station and you don't know where it is or the size of the enclosing room—you'll likely need to explore algorithms that observe action-outcome pairs and try to learn optimal policy from these learning episodes.

A full description of these is beyond the scope of your question, but a good place to start is Sutton & Barto's Reinforcement Learning: An Introduction. An html version is freely available. Another resource is RL udacity course produced by Georgia Tech.

In your example, you may also want to research potential-based reward functions. Very loosely, one potential might be the robot's distance to goal state, and the reward would be based on changes to this potential value. (This is described in a paper by Ng, Harada and Russell, and in unit 6 of the GA Tech course mentioned above.)

• Thanks, your answer was very thorough and helpful. I'll look into RL algorithms and check out that book suggestion. May 14 '16 at 18:14

I think you need to use Reinforcement learning Reinforcement learning. Pybrain library for python has an example similar with your task robot explore maze.

• I think this is what OP is looking for. Usually on this site we prefer longer answers, 1 or 2 paragraphs - so perhaps a short summary of why reinforcement learning is a good match to the OP's problem would improve the answer. May 13 '16 at 14:18

You can't know the next best step unless you know the whole best path. Your task is something similar to TSP (traveling salesman problem).

So, how to find the best path?

Probably you can add penalties (not known) to each state. Then you can define your goal as path with minimal total penalty.

(For robot from your example floor will have 0 penalty and some obstacles >0 penalty).

As I know you can't avoid brute forcing through all possible paths unless your task have additional restrictions.

You need to approximate penalties with data you already have. (So, penalties is parameters in your machine learning task) When you estimated penalties you can compute total penalty for each path, so you can find all paths by brute force and find "best" one.(with smallest penalty)


text:
# Compute $\lim\limits_{n \to \infty }\sin \sin \dots\sin n$

I need your help with evaluating this limit:

$$\lim_{n \to \infty }\underbrace{\sin \sin \dots\sin}_{\text{n compositions}}\,n,$$

i.e. we apply the $\sin$ function $n$ times.

Thank you.

#### Solutions Collecting From Web of "Compute $\lim\limits_{n \to \infty }\sin \sin \dots\sin n$"

The first sine is in $I_1=[-1,1]$ hence the $n$th term of the sequence is in the interval $I_n$ defined recursively by $I_1=[-1,1]$ and $I_{n+1}=\sin(I_n)$. One sees that $I_n=[-x_n,x_n]$ where $x_1=1$ and $x_{n+1}=\sin(x_n)$. The sine function is such that $0\le\sin(x)\le x$ for every nonnegative $x$ hence $(x_n)$ is nonincreasing and bounded below by zero hence it converges to a limit $\ell$. The sine function is continuous hence $\ell=\sin(\ell)$. The only fixed point of the sine function is zero hence $\ell=0$. This proves that $x_n\to0$, that the sequence $(I_n)$ is nonincreasing and that its intersection is reduced to the point zero and finally, that the sequence considered in the post converges to zero.

Edit: The argument above shows that for every sequence $(z_n)$, the sequence $(s_n)$ defined by $s_n=\sin\sin\cdots\sin(z_n)$ (the sine function being iterated $n$ times to define $s_n$) converges to zero. In other words, there is nothing particular about the choice $z_n=n$.

The limit is zero. The expression $\sin(n)$ for a large integer $n$ is a “random” number between $-1$ and $+1$. You might be afraid that by applying $\sin$ many times, it will be even more random.

But it’s not the case because $\sin x$ for any $x$ may be Taylor-expanded
$$\sin x = x – \frac{x^3}{3!} + \frac {x^5}{5!} – \dots$$
and for small $|x|$, only the first few terms are important, so the effect of computing the sines is to do almost nothing, except for a small reduction of the absolute value of $|x|$.

It is enough to notice that $|\sin n| < 1$ for all positive integers $n$; the inequality is strict because $\pi$ is irrational. We may rewrite the Taylor expansion above as an inequality
$$|\sin x| \leq |x| – \frac{|x|^3}{7}$$
for any $|x|<1$. To prove the inequality above, check that it holds for $|x|=1$, and it consequently has to hold for $|x|<1$ because for ever smaller $|x|$, the adjustments from $x^5/5!$ are ever smaller. The inequality is sharp unless $x=0$.

So we’re led to compute the $(n-1)$ times “embedded sine” of a number between $-1$ and $+1$. Each embedding subtracts at least $|x|^3/7$ from the value of $|x|$. It is easy to see that this sequence is decreasing and positive, so it must have a non-negative limit. And the limit can’t be positive, $L$, because one more iteration brings $L$ to a strictly smaller number which cannot converge back to $L$ because of the monotonic character of the sequence.

So the limit has to be zero.

By the way, for large enough $n$, the member of the sequence becomes independent of small variations of $n$ (except for the sign). So for example, for all $n$ around $10,000$, the composite sine is very close to $\pm 0.017$.

The absolute value of the $n$-th element of the sequence actually goes like $1.7/\sqrt{n}$ where the value $1.7$ is approximate. One may actually show why this decrease of $a_n$ is right. It is because
$$\frac{1.7}{\sqrt{n}} – \frac{1}{3!} \left( \frac{1.7}{\sqrt{n}} \right)^3 = \frac{1.7}{\sqrt{n+1}} + O(n^{-5/2})$$
which is true and easily provable if you Taylor-expand this expression:
$$1.7 (n+1)^{-1/2} = 1.7 n^{-1/2} + 1.7 (-1/2) n^{-3/2} – \dots$$
Well, you can see that
$$1.7 \times (1/2) \approx 1.7^3/6$$
and it is actually possible to get the exact value of the constant $1.7$:
$$1.7 \approx \sqrt{3}$$
So for very large $n$,
$$|a_n| = \frac{\sqrt{3}}{\sqrt{n}} + O(n^{-3/2}).$$