Learnt this week … 31 January 2014

1. Roots (solutions) to a polynomial in a single variable

Quite why I was not taught this for ‘A’ level maths is beyond me (or more likely I was and have simply forgotten) but, if we have a polynomial in a single variable:

a_n x^n + a_{n-1} x^{n-1} + ... + n_0 = 0

Then the general form of its factorisation is:

a_n(x - q_n)(x - q_{n- 1}) ... (x - q_1)

and it has the roots:

q_n, q_{n - 1}, ..., q_1

Here’s an (very) outline proof…

Take a polynomial f(x) = 0 with a known root q then f(x) will divide evenly (no remainders) by x - q and so we can say f(x) = g(x)(x - q) where g(x) is of one degree less than f(x) . We can continue this until we are left with a function of degree 0 – i.e. the constant a_n (possibly 1) and then we have the form f(x) = a(x-q_n)...(x-q_1) .

(And I recommend Elliptic Tales: Curves, Counting, and Number Theory for those who want to know more – I am on my second iteration of trying to read this, but it is good fun.)

2. I can construct a curve that has no tangent at any point

At least, algebraically, it has no tangent.

For instance, the line defined by y^2 - 2xy + x^2 = 0.

We define the tangents for such lines, f(x,y) = 0 as, at the point (a, b) as being of the form: \frac {\partial f}{\partial x} x + \frac{\partial f}{\partial y}y = f(a, b)

Now, f(a, b) = 0, but note that \frac {\partial f}{\partial x} and \frac {\partial f}{\partial y} are also equal to zero for all points, so we have 0 = 0 which describes no line.

But – geometrically – this line is the same as that described algebraically by y = x which has a tangent line of y = x .

Are they different lines? They are, algebraically.

(This comes from the same source as point 1).


Poisson distribution puzzle

I asked this on math.stackexchange but have yet to get an answer, so will try here too…

In their monograph “Queues“, Cox and Smith state (paraphrased – this is p5):

In interval (t,t+Δt) the probability of no arrivals in a completely random process is 1−αΔt+o(Δt), for one arrival αΔt+o(Δt) and for more than one arrival o(Δt) where α is the mean rate of arrival.

I cannot follow this… here is my thinking – we take N to be the probability of no arrivals, W to be the probability of one arrival, Z to be the probability of more than one arrival, and A to be the probability of any arrivals.

So 1=N+W+Z=N+A

By my understanding of Cox and Smith:

1=1−αΔt+o(Δt)+αΔt+o(Δt)+o(Δt) =1+3o(Δt) which is surely nonsense.

So, what have I got wrong here?

Learnt this week… 24 January

My friend and former colleague Adam Higgitt every Friday posts a list of “five things I have learned this week”. It’s popular and good fun – especially as Adam is not afraid of an argument if you challenge some of his claims.

For a while I tried to do the same thing myself, but failed miserably.

I am not going to try again, but I am proposing to try something different, if inspired by Adam.

So here is the first list of things “learnt this week” scientific or mathematical facts and amusements. I will aim for five, but this week just did not make it.

1. A random walk can be used to build a binomial distribution – but not a very good one!

Imagine a left-right ruled line centred on zero and a marker than can, in every time step move either left or right be one step where the probability of moving left p_l and of moving right, p_r are both the same: i.e., p_l = p_r = 0.5 . At the “beginning of time” the marker stands at 0.

Then if we count the times the marker is at any given position they will be distributed bionomially (well, as we approach an infinite time). The BASIC code below (which I wrote using BINSIC) should give you an idea (this code runs the risk of an overflow though, of course and the most interesting thing about it is how unlike a binomial distribution the results can be).

10 DIM A(1001)
12 FOR I = 1 TO 1001
14 LET A(I) = 0
20 LET POS = 500
30 FOR I = 1 TO 50000
40 LET X = RND * 2
60 LET A(POS) = A(POS) + 1
90 FOR I = 1 TO 1001
95 LET X = I - 500
110 PRINT X," ",A(I)
120 NEXT I

Here’s a chart of the values generated by similar code (actually run for about 70,000 times):
Not much like a binomial distribution2. Things that are isomorphic have a one-to-one relationship

Up to this point I just had an informal “things that look different but are related through a reversible transformation” idea in my head. But that’s not fully correct.

A simple example might be the logarithms. Every real number has a unique logarithm.

Enhanced by Zemanta

Supernova in Mill Hill

Many years ago I spent a cloudy evening at the University of London’s observatory – in the heart of Mill Hill (presumably when this was built it was many miles from un-natural light and well beyond the city limits.) We ended up playing chess indoors.

Well, it seems city lights are not necessarily a barrier to discovery – as a team there seem to the ones that first spotted a supernova in M82.

Three steps forward, but one step back?

The new English ICT/computer science curriculum promises to be a huge step forward and, in my experience, a chance to teach children something for which their enthusiasm promises to be close to unlimited.

One thing puzzles me, though. Speaking about it today the education secretary, Michael Gove – who deserves some praise for listening to the arguments of the professionals on this issue emphasised that, from the age of 11 children will be taught “at least two” programming languages.


Go to university where, generally, they are training you to be a professional programmer, and they still only teach you one at a time. Why do we expect children at 11 to learn at least two?

So, how good are the English premiership top seven?

oops: got the maths wrong first time – this is the corrected version

Last weekend was said to be one of the worst in the history of English bookmakers (I know, your heart bleeds) as for the first time ever all seven top teams in the English premiership won – so ensuring a lot of fixed odds accumulator payouts.

But just how big an upset was this “for the books”?

Well, the English premier league has been going since the summer of 1992, so this is its 21st season. In the first two seasons there were 22 teams, and since then there have been 20.

So the total game “weeks” have been:

1992/93 – 1994/95: 42 x  2 = 84
1995/96 – 2012/13: 38 x 18 = 684
2013/14 (to last week): 21

Giving a total of 789. So just one week out of 789 makes it sound like the top seven are not very reliable.

But, of course, this ignores the fact that – on most weeks – at least one of the top seven is playing another team in top seven (this is certainly happening this week with Chelsea playing Manchester United).

On any given week the chances of this NOT happening are (for a 20 team league):

\frac{13}{19} \times \frac{12}{17} \times \frac{11}{15} \times \frac{10}{13} \times \frac{9}{11} \times \frac{8}{9} \times \frac{7}{7} = 0.198

While for a 22 team league these odds are:

\frac{15}{21} \times \frac{14}{19} \times \frac{13}{17} \times \frac{12}{15} \times \frac{11}{13} \times \frac{10}{11} \times \frac{9}{9} = 0.248

So, in other words there have been only 84 x 0.198 + 705 x 0.248 = 191 weeks (on average – I’d have to look at the precise run of games this season to be clear) where this was even possible.

And how often should the top teams win? If they decided games on tossing of coins (and we ignore draws as they are ‘wins’ for the bookies) then the top seven would only all win 1 out of 128 weeks. The fact they managed it after 191 weeks might suggest they were worse than that, but we cannot be sure – it probably needs a bigger sample size.

In search of a word

(This post is nothing to do with science and not much to do with computing, but it’s my blog, my rules…)

From wikicommons – credit stevelevine1

I am from Belfast, in (being technical and not political) Northern Ireland. I left there when aged 12 and sometimes some people express surprise that I still have the accent – but the truth is I am nothing other than Irish, even if I have lived in London (university years excepted) for the last 36 years. Belfast is “home” and always will be.

But if I have the accent I don’t, in general, use the same words and phrases that would be common enough in Belfast. Occasionally I find myself using phrases that I suddenly realise nobody else in the room understands (this week I described someone as thinking themselves as “a cut above butter” only to get blank looks). But I don’t think I have ever seriously described somebody as “scundered” or called a spring onion a “scallion” or a trouble maker a “hallion” in mixed company. (Scots may see that much of these words are similar to their own – some people may laugh at “Ulster Scots” as a sop to those unwilling to come to terms with the reality of Irish identity of people in the North, but that doesn’t stop them speaking it.)

One great thing about the internet is that it allows you to find much more about these words’ and phrases’ etymology. So I now know that “guddies” (what I used to call “training shoes”) comes from the Malay words for the gum of the percah tree – geta percha (the shoes having rubber soles).

But one word has eluded me for a long time. “Gee” (look it up) was easily tracked down – though its origin is elusive. Rarities like “cat” (or kat?) – used to describe a severely disappointing experience, venue or event – were found (but still unexplained). But this one was untraceable and I wondered if it was just a seventies fad that had passed away before the internet had the chance to record it.

The word in question was “munks” (or monks?) meaning underpants. Not one, I hasten to add, I ever used myself. I was well brought up! But it was certainly in wide circulation in Andersonstown in the mid – late 1970s. But I cannot (even now) find it referred to anywhere on line.

But then, this week, I found an online guide to the slang of Northern Ireland which used the term “gunks” for underpants. Found it!

The nature of unwritten terms is, of course, that there is no standard spelling or even pronunciation – for  instance, online searches suggest most kids in the North call their plimsolls “gutties” – but those tees were always dees where I grew up.

So, if the word – or some form of it – is still well enough used or known to appear online, where does it come from?

Polar vortices and climate change

Satellite Image Shows Entry of the Polar Vorte...
Satellite Image Shows Entry of the Polar Vortex into the Northern U.S. (Photo credit: NASA Goddard Photo and Video)

The recent cold snap in the United States was, apparently, seen by many as undermining the claims of a majority of climate scientists that human activity was gradually – but potentially catastrophically – warming the climate.

But, according to this article from the Associated Press, the most remarkable things about the cold was that it was not all that cold (merely the 55th coldest day since 1900) and that cold days appear, now, to be relatively rare (though, of course, a random element of statistical fluctuation may also have contributed to the length of the period – 17 years – since the last very cold period.)

One other thought – the cold in the US seems to have been matched by a very mild (in temperature, if not much else) winter in Western Eurasia. I still have nasturtiums – usually killed off by frosts long before now – growing in the garden. I would not go so far as to say they were thriving (the last flowers were seen in December) but they are still going…

Enhanced by Zemanta

Universal Credit: back to “agile” and closer to death?

English: 3 Iterations of Agile Development Fra...
English: 3 Iterations of Agile Development Framework (Photo credit: Wikipedia)

Various leaks and briefings have, in the last few days, added to the sense that “Universal Credit” – the UK government’s plan to consolidate all welfare entitlements into a single payment that would then respond, in “real time” to changing claimant circumstances and so do more to “make work pay” – is coming closer than ever to being one of the biggest IT project failures of all time.

This morning’s Guardian reports extensively on a meeting held recently in Whitehall where the Department for Work and Pensions (DWP) – the sponsoring department – were forced to admit that the project has “gone red” which means, assuming that this refers to the cross-government project assessment system:

Successful delivery of the project appears to be unachievable. There are major issues on project definition, schedule, budget, quality and/or benefits delivery, which at this stage do not appear to be manageable or resolvable. The project may need re-scoping and/or its overall viability reassessed.

In other words, the whole sorry thing is on the verge of collapse. In parallel the Cabinet Office’s “government digital service” (GDS) are withdrawing support for the project – seemingly refusing to pour more taxpayers’ money down the Universal Credit drain.

But only a few days ago we got another angle on all this when Computer Weekly reported that the DWP were freezing out its existing contractors and seeking to bring all the work in-house (the Guardian reports that the GDS don’t think the DWP are up to this.)

What is more, it seems that the DWP are again proposing to build the UC system using “Agile Development” – at least the “second stage” (which is in fact what  was meant to have been done by now first time around using agile).

Back in 2010/11 the DWP told us agile was going to solve all their problems and UC was proudly promoted as the world’s biggest agile project (including by many who probably should have known better). Agile flopped, and badly, and the DWP have been forced to return to traditional “waterfall” development methods – which are nominally slower – often much slower – but which guarantee no later stage of a project is begun until the earlier bits are working (hence the analogy of water cascading downhill in a series of waterfalls).

Now agile’s boosters are keen to tell us that “agile and world’s biggest don’t mix” but it seems the DWP haven’t heard and are again telling us (or rather, themselves, all this is through leaks and off-the-record briefings) that agile is the secret sauce that will drive them on to victory over the Cabinet Office and the Treasury.

Enhanced by Zemanta