Saturday, 4 August 2012

EDI: Automated for the people

This is a one-off step aside from the mainstream material of this blog, if anything of such a modest scale can be called mainstream. I would like to share an idea related to another subspace of my life, that is my profession of an EDI Technical Analyst.

Ever since I started in this job I have been trying to find active discussion boards where EDI professionals meet to discuss the challenges of their trade, best practices and emerging technologies 

A brief research showed that there are a few LinkedIn groups with varying popularity around:
an apparently defunct forum 
some company-sponsored websites and blogs 

It is evident that a lot of knowledge is distributed all around, but it is difficult to find a platform where it could be consolidated through open discussions and help people to learn, develop and accomplish their projects.

EDI is a mature technology with its own history, terminology, principles and sub-fields. It is well-defined and structured enough to be worth an independent discussion environment. A good choice of such environment is an important part of the overall success.

Having been active on Stack Exchange, particularly, its Math.SE branch, for some time now I came to appreciate the framework that the forums are designed in. Editing tools, filters, tags, voting system, allocation of reputation points besides other functionalities make it a user-friendly, lively, fair and democratic discussion board. I decided to try to give the EDI community a new start in free collaboration and wrote a proposal for a new forum labelled 

Stack Exchange Q&A site proposal: Electronic Data Interchange (EDI)

on SE playground Area51. Everyone who is either professionally involved in EDI, willing to implement data integration tools in their business, or just keen to learn about the classic and cutting edge technologies is welcome to follow, join, contribute and spread the word!

Wednesday, 4 July 2012

Counting Counter-examples

Without having much time to write really with dissertation and the next assignment deadlines looming and preparing my first article for Mathematics Today (fingers crossed that it is accepted) I still wanted to put down a few follow up thoughts on the brilliant OU course in Functional Analysis I am currently doing.
Apparently the ability to give counter-examples, particularly in analysis is a sign of good understanding of the statements of theorems. These sometimes natural, sometimes pathologic constructions reveal the significance of each individual assumption disproving the hypothesis when one of the former is dropped.
One of the questions in the book asks to test the requirement of completeness of a linear space arising in the formulation of the Banach-Steinhaus theorem. It is the proof of incompleteness of the given space that is interesting. The following construction is suggested:
$$X=\left\{ \left. x=(x_k) \right| \sum \left| x_k\right| <\infty \right\}$$
endowed with the norm
$$\Vert x\Vert=\sup_k\left|x_k\right|$$
where $(x_k)$ stands for a sequence of complex numbers.
There is some sense in which the selected norm is "unnatural" for the given space and that sense is precisely that normed space $\left(X,\Vert .\Vert\right)$ is incomplete.
At risk of locking myself up in patterns I started thinking in the direction of the harmonic series which seems to be the source of a great number of various counter-examples. After some juggling around I considered the sequence
$$x_n=(x_k)_n=\frac{1}{k+n}-\frac{1}{1+k+n}$$
which is really a sequence of infinite sequences. Indeed the partial sum, after "telescoping" gives
$$\sum_{k=1}^n x_n=1-\frac{1}{1+k+n}$$
which tends to 1 and so $x\in X$. It turns out that $x_n$ is Cauchy in $\left(X,\Vert .\Vert\right)$. Now $x_n$ is Cauchy in $\left(X,\Vert .\Vert\right)$, since
$$\Vert x_n - x_m \Vert = \sup_k\left|\frac{1}{k+n}-\frac{1}{k+m}+\frac{1}{1+k+m}-\frac{1}{1+k+n}\right|\to 0$$
Taking $y=\left(\frac{1}{k}\right)$ we note that
$$\lim _{n\to 0}\Vert x_n - y \Vert=0$$
Hence $x_n$ converges to $y$ in the sense of the given norm, however, $y\notin X$ so the space is incomplete.
The book gives a more concise constructive solution working with the sequences of partial sums of the above sequence instead. However, I decided to stick with my ugly one. It is shooting straight into the heart of the problem and working backwards that often allows to resolve more complicated cases and I bet that's how the authors arrived at their solution.
Another example using some "off the shelf" sequences demonstrates the non-triviality of the result of Hahn-Banach extension theorem. The lesson is that it is easy to construct an extension for a functional, but giving a linear extension is far from obvious. Take $f(x)=\lim_n x_n$ where $x$ is a convergent sequence. Consider the space of convergent sequences $c$ as a subspace of bounded sequences $l_{\infty}$. Define $g$ on $l_{\infty}$ by $g(x)=f(x)$ for $x\in c$ and $g(x)=0$ for $x\in l_{\infty}\backslash c$. It can be checked that $g$ is a non-linear extension of $f$ to $l_{\infty}$. Indeed, consider
$$x=(1,1,1,...)$$
$$y=(0,-1,0,-1,...)$$
$x\in c$, hence $g(x)=f(x)=1$. $y\in l_{\infty}\backslash c$, hence $g(y)=0$. So $g(x)+g(y)=1$. On the other hand
$$x+y=(1,0,1,0,...)$$
Clearly $(x+y)\in l_{\infty}\backslash c$, so $g(x+y)=0 \ne g(x)+g(y)$, so $g$ is non-linear.

Saturday, 2 June 2012

From integrating multiplier to integrating operator


I though about this trick and then found an example to apply it to.
$$\frac{dy}{dx}=1+\frac{2}{x+y}$$
$$\frac{dy}{dx}+\frac{dx}{dx}=1+\frac{2}{x+y}+1$$
$$\frac{d(x+y)}{dx}=2\frac{1+(x+y)}{x+y}$$
$$\frac{(x+y+1-1)d(x+y)}{1+(x+y)}=2dx$$
$$\frac{d(1+x+y)}{1+(x+y)}=d(y-x)$$
$$\ln|1+x+y|=(y-x)+\ln C$$
$$1+x+y=C\exp\left(y-x\right)$$
I am still not sure if this is a one-off case or it can be generalised to a consistent method. It all spins around the understanding of $d$ as a linear operator when it comes up in equations and integrals. This is something I am discussing at greater lengths in my self-published book

Welcome to StackExchange

Since two weeks ago I have been addicted to math.SE forum. Here is my profile with a rather modest track record attached to it. I found it a very easy to use and thoughtfully organised environment which encourages users to participate actively and remain fair to each other. Mathematicians can be an unexpectedly tough community, in fact. I found a lot of skilful and deep individuals and enjoyed some beautiful arguments even when they competed with mine. On the downside, I can see that there is a fair amount of showing off clearly seen in some of the discussions (which I am myself far from being free of) when standard textbook exercises attract an avalanche of responses fighting for cheap reputation points. At the some time some of the more technically demanding questions are often left unattended, including one of my own.See how far I can get before the end of the year and how much of my reputation is really worth a badge!

Speaking for the IMA

Two weeks ago I had an honour to speak art the 15th Early Career Mathematicians Conference at the University of Manchester organised by the IMA. The subject of the talk was largely an aggregation of my past work on courses, exercises, these blog posts centred around the core ideas of mathematical analysis.
Although I was not happy about my presentation, because even with quite a few technical examples I think it still is lacking essence. The main reason for it, of course, is that I am not currently working on any specialist subject and still completing my MSc at the Open University. Nevertheless, I got a very positive feedback from the audience of graduate students, school teachers and university professors. The only part that let me down was when someone referred to my statements as the philosophy of mathematics. Although there were all reasons for saying that, my aim remains to be a working mathematician. This year  I am finishing my part-time MSc which took me 3 years, on top of the full time job and finally delving into one of my favourite branches of mathematics with the hope of delivering solid results.
My lecture will be published in the August issue of the Mathematics Today, a quarterly magazine that IMA distribute among their members.

Thursday, 2 February 2012

Finding a particular solution of a second order linear inhomogeneous recurrence equation




Approximation theory and methods did not really fit in the "big picture" of my study plan last year, not only because I am notoriously bad at numerical calculations. Having invested a lot of effort in developing intuition for the behaviour of analytic functions I was suddenly confronted with the cubic splines which seemed to have all those properties, that well-mannered functions would be never allowed to possess.
Nicely, but artificially glued together of several pieces of cubics, smooth only up to the second derivative, vanishing on the entire intervals, now this is what seems really counter-intuitive.


The following is the kind of problem I got stuck with for a while. The task is to express a function, say $$f(x)=x^2$$ in terms of cubic B-splines on the entire real axis. I am omitting a lot of background material focusing on one particular idea that arises in the solution.


$$x^2=\sum_{p=-\infty}^{\infty}\lambda_p B_p(x)$$
Since $$B^3_p(x)$$ has a supporting interval $[p, p+3+1]=[p,p+4]$ of length 4 outside which it vanishes, we can start by expressing the function in terms of $B_{-3} , B_{-2}, B_{-1} ,B_{0}$ on $[0.1]$ and then try to extend the result. Calculating the expressions for the splines on $[0.1]$:
$$B_{-3}(x)=-\frac{1}{24}\left(x-1\right)^{3}$$
$$B_{-2}(x)=\frac{1}{24}\left(3x^{3}-6x^{2}+4\right)$$
$$B_{-1}(x)=\frac{1}{24}\left(-3x^{3}+3x^{2}+3x+1\right)$$
$$B_0(x)=\frac{1}{24}x^{3}$$
multiplying by the respective coefficients, summing and equating powers of $x$ on each side we arrive at the following system of equations:
$$\begin{cases}
-\lambda_{-3}+3\lambda_{-2}-3\lambda_{-1}+\lambda_{0} & =0\\
3\lambda_{-3}-6\lambda_{-2}+3\lambda_{-1} & =0\\
-3\lambda_{-3}+3\lambda_{-1} & =24\\
\lambda_{-3}+4\lambda_{-2}+\lambda_{-1} & =0\end{cases}$$

Having the solution (guaranteed by the Schoenberg-Whitney theorem): $(\lambda_{-3},\lambda_{-2},\lambda_{-1},\lambda_0)=(\frac{8}{3},\frac{-4}{3},\frac{8}{3},\frac{44}{3})$
Now we want to find all coefficients on each of the intervals $[\xi_p,\xi_p+4]$ for the points ${\xi_i=ih;i=\pm1,\pm2....}$. From the general expression for the B-spline it can be deduced that
$$B_p(\xi_{p+1})=\frac{1}{24h}$$
$$B_p(\xi_{p+2})=\frac{1}{6h}$$
$$B_p(\xi_{p+3})=\frac{1}{24h}$$
which for $h=1$ leads to the following recurrence relation:
$$\lambda_{j-1}+4\lambda_{j-2}+\lambda_{j-3}=24j^2$$
or, after changing the index
$$\lambda_{j}+4\lambda_{j+1}+\lambda_{j+2}=24(j+3)^2$$
Now here is the trick that I came up with. The last expression can be thought of as a "second-order linear inhomogeneous recurrence relation". The advantage of this approach is that the structure of the solution instantly becomes clear.
The general solution of the corresponding homogeneous relation
$$\lambda_{j}+4\lambda_{j+1}+\lambda_{j+2}=0$$
is derived using the standard method of solving this type of recurrencies and is given by the following expression:
$$\lambda^h_j=\alpha\left(-2-\sqrt{3}\right)^{j}+\beta\left(-2+\sqrt{3}\right)^{j}$$
It can also be found using generating functions. Not surprisingly it depends on 2 arbitary constants, as it takes 2 initial terms, $\lambda_0$ and $\lambda_{-1}$ to reconstruct the whole sequence from the three-term recurrency. Applying the general ideas from the linear systems we deduce that in order to obtain the general solution of the inhomogeneous recurrency we have to add a particular solution to the expression above.
Since the RHS is the quadratic polynomial it makes sence to look for the particular solution in the form:
$$\lambda^p_j=aj^2+bj+c$$
Substituting this into the original recurrency and gatherig together the powers of $j$ we obtain:
$$6aj^2+(12a+6b)j+8a+6b+6c=24j^2+144j+216$$
which after equating powers gives the solution $(a,b,c)=(4,16,\frac{44}{3})$
Thus the general solution of the inhomogeneous equation is given by the following formula:
$$\lambda_j=\alpha\left(-2-\sqrt{3}\right)^{j}+\beta\left(-2+\sqrt{3}\right)^{j}+4j^2+16j+\frac{44}{3}$$
Now we can use the values of $\lambda_0$ and $\lambda_{-1}$ to determine the constants (bearing in mind that $\left(-2-\sqrt{3}\right)\left(-2+\sqrt{3}\right)=-1$):
$$\frac{44}{3}=\alpha+\beta+\frac{44}{3}$$
$$\frac{8}{3}= -\alpha\left(-2+\sqrt{3}\right)-\beta\left(-2-\sqrt{3}\right)+\frac{8}{3}$$
which gives $\alpha=\beta=0$. Thus finally:
$$\lambda_j=4j^2+16j+\frac{44}{3}$$
which is the solution of the original problem.

Sunday, 15 January 2012

Calculus in a warehouse

One of the most frequent remarks that I get when I mention studying applied mathematics is "applied to what?.." It is not always easy to give convincing examples straight away, because for me the enormous role of this science in all aspects of life is just so obvious. This is why I like to discover the unusual cases where some elaborate techniques can be applied to in quite mundane areas.


This is one of the small problems I formulated for myself during my studies of maritime logistics, just for the sake of curiosity. Calculations are pretty simple and straightforward, but the results look nice, also with some unexpected turn in the middle.


In maritime transport one has to deal with the so-called bulk cargoes (iron ore, coal, fertilizers etc) which are often stored in the ports in large piles. I once considered determining some quantitative characteristics that are useful for designing the warehouse to store such type of cargo.


Let’s approximate the pile of cargo with the geometrical body of height $H$ having a rectangle $L_2\times B$ at its base and 4 facets inclined towards the centre at equal slope, thus forming the upper horizontal edge of length $L_1$:


Its volume can be calculated as follows:
$$V=\int_0^HS(x)dx$$
Where
$$S(x)=a(x)b(x)=\left(L_{1}+\frac{L_{2}-L_{1}}{H}x\right)\frac{Bx}{H}=B\left(L_{1}\frac{x}{H}+\left(L_{2}-L_{1}\right)\left(\frac{x}{H}\right)^{2}\right)$$
So that
$$V=BH\int_0^1\left(L_1\frac{x}{H}+(L_2-L_1)\left(\frac{x}{H}\right)^2\right)d\left(\frac{x}{H}\right)=\frac{HB}{6}(2L_2+L_1)$$
Now let us determine the amount of energy required to form the pile (meaning mechanical work that has to be done against the forces of gravity). Assume that density of the cargo is $\gamma$ kg/m3. To lift a small layer to height $H-x$ requires:
$$dA=\gamma gdV(H-x)=\gamma gB\left(L_1\frac{x(H-x)}{H}+\frac{(L_2-L_1)x^2(H-x)}{H^2}\right)dx$$
Thus, total work equals:
$$A=\gamma gB\int_0^H(L_1\frac{x(H-x)}{H}+\frac{(L_2-L_1)x^2(H-x)}{H^2})dx=\frac{\gamma gBH^2}{12}(L_1+L_2)$$


No we can ask the following question: if volume is a given value, what should be length and breadth so that the pile occupies minimal warehouse area? To simplify calculations and cancel out some parameters let us introduce the value called “angle of natural slope”. This is the term from soil mechanics which means the angle that the substance makes against horizontal surface. It depends on density, viscosity and inter-particle friction and can be found in special tables.
Let:
$$\frac{2H}{B}=\tan \chi$$
$$H=\frac{1}{2}B\tan\chi;L_1=L_2-\frac{2H}{\tan\chi}=L-B$$
$$V=\frac{B^2\tan\chi}{12}(3L-B)$$
Assuming that V=const, obtain expression for L and insert it in the formula for the area S=LB:
$$L=\frac{4V}{B^2\tan\chi}+\frac{B}{3}$$
$$S=LB=\frac{4V}{B\tan\chi}+\frac{B^2}{3}$$
$$S'(B)=-\frac{4V}{B^2\tan\chi}+\frac{2B}{3}=0$$
$$B=\sqrt[3]{\frac{6V}{\tan\chi}}$$
$$L=\left(\frac{4}{\sqrt[3]{36}}+\frac{2}{3}\sqrt[3]{36}\right)\sqrt[3]{\frac{V}{\tan\chi}}$$
$$S=4\left(\frac{1}{\sqrt[3]{6}}+1\right)\left(\frac{V}{\tan\chi}\right)^{2/3}\approx 4.4\left(\frac{V}{\tan\chi}\right)^{2/3}$$
Now, assuming again that $V=const$, let us determine the values of $L$, $B$ again which minimize the amount of energy required to form the pile. Again, substituting for $L$, but now in the expression for $A$ we obtain:
$$A=\frac{\gamma gBH^2}{12}(L_1+L_2)=\frac{\gamma g H^2}{48}\left(\frac{8VB}{\tan\chi}-\frac{B^4}{3}\right)$$
$$A'(B)=\frac{\gamma g \tan^2 \chi}{48}\left(\frac{8V}{\tan\chi}-\frac{4B^3}{3}\right)=0$$
$$B=\sqrt[3]{\frac{6V}{\tan\chi}}$$
Remarkably, we get the same values which were obtained to minimize the base area, although the approach is now quite different.
To complete the picture we can use the derived results to determine maximum allowed volume for a single pile if unitary pressure on the ground is limited by some given value $q$ kg/m2:
$$\frac{V\gamma}{S}<q$$
$$V<\frac{qS}{\gamma}=\frac{q}{\gamma}4.4\left(\frac{V}{\tan\chi}\right)^{2/3}$$
$$V<\frac{(4.4q)^3}{\gamma^3\tan\chi}\approx 85.3\frac{q^3}{\gamma^3\tan\chi}$$