Price Elasticity of Demand

June 27, 2009

I remember ranting about the failures of the model of price elasticity of demand. I finally found some time to have a look at the maths of it, and actually it turns out that it works rather nicely.

Taking a standard PED of -0.8, Wolfram Alpha (which I affectionately call ‘Walfa’) kindly plots the graphs for me (click to view the Wolfram Alpha page):

It makes sense: asymptotes at the axes are a theoretical assumption. On the other hand it completely wrecks any assumptions about straight lines.

In other news, I’m away for the next week on a walking trip in Snowdonia which should be immensely good fun (and photographic).


Inovazone

June 25, 2009

It suddenly strikes me that I haven’t been blogging much recently. Exams finished several weeks ago but I have been somewhat busy.

In particular I’ve been working on a new site for a client, Inovazone. In the words of the site’s inventor, Alastair Darwood:

How does an invention go from a scribble on a page to a world-changing product that advances humanity? The answer is that at the heart of the invention there lies a set of distinct and crucial necessities that the invention is addressing … Until now, the only way in which necessities were discovered was through large companies carrying out expensive research, or a spark of genius from someone who suddenly sees one and thinks of a solution. Inovazone is designed to change this. The idea is that users of the site post their ‘necessities’ (short explanations of problems, ‘necessities’, they think need to be solved to benefit them (or humanity)), or rough outlines of inventions they would like to see and anyone can browse the necessities if they want to and look for interesting problems to try to solve through innovation. This could be in the form of an invention or simply a quick online response to the post on our comments system.

Interestingly enough, there doesn’t actually yet exist a site or system available to the general public that serves this particular function by providing a framework within which ideas for inventions are openly submitted and accessed, so I agreed to work on it, especially considering the core of submitting and displaying necessities is a relatively simple PHP/SQL project.

Submitting a necessity

Submitting a necessity. Click to embiggen

What I found particularly compelling was that, according to Alastair, everyone with whom he’s discussed the site has expressed enormous enthusiasm for it, and even a seasoned inventor he’d talked to had described the idea as long overdue and predicted huge success. Although I originally liked the idea and somehow felt it would do pretty well owing to its novelty, I for some reason assumed one would obtain mixed reactions in discussions.

Original image at http://rockstartemplate.com/wp-content/uploads/2008/12/social-bookmark-icon.jpg

Original image at http://rockstartemplate.com/wp-content/uploads/2008/12/social-bookmark-icon.jpg

In terms of the hard sell, we’re employing several different methods to publicise Inovazone. We’ve created a Facebook fan page and a Twitter account – feel free to follow us (@inovazone). One.com also kindly provide adwords coupons so with some SEO we might be able to appear in ads on relevant Google searches.

The site is currently about to go into beta testing. From wiki:

Beta testing comes after alpha testing. Versions of the software, known as beta versions, are released to a limited audience outside of the programming team. The software is released to groups of people so that further testing can ensure the product has few faults or bugs. Sometimes, beta versions are made available to the open public to increase the feedback field to a maximal number of future users.

The idea of this is simply to fine-tune what we already have rather than to add more features, though both these are desirable outcomes from this round of testing; though for me personally the primary objective is to see whether the system works well with a large user base. So for that to happen we need some willing volunteers to go test out the site: anyone reading this is welcome to join the test group. Go ahead and post as many necessities as you deem reasonable, and comment on existing ones. Try out creating new subcategories and send us feedback about features that you think should be created or made better via the awesome uservoice-powered feedback utility. I’m especially interested in bugs and vulnerabilities you find; if you somehow work out how to delete posted necessities or spam the site with adverts, or if the site spews out a series of errors while you’re using it under normal circumstances, get in touch (there is a contact page). Chances are the database will be reverted to its initial (more or less empty) state before the site is released in a few weeks’ time, so disasters should be recoverable.

Before you (readers) go, I’d be interested to hear your feedback on the idea of the site – do you think it has potential? Will it be useful?

That’s all from me for now. The site will get a working and hopefully regularly-updated blog pretty soon for general status information and news so you probably won’t be hearing much more about it from me.

๏̯͡๏﴿


Automatic Email Reminders

June 22, 2009

Many services seem to provide automatic email reminders these days – notably Google Calendar; however what I need is something that can send me daily reminders about things, and setting up a Google calendar with daily repeats seems an altogether inelegant solution. Virgin Media operates a throttling policy in which downloading is limited between 10am and 3pm, and again between 4pm and 9pm. As far as I’m concerned, all this means is I need to make sure I’m not downloading much between those times. I thought of setting up my various alarm clocks and watches to ring at 10am, 3pm, 4pm and 9pm to remind me – but considering I’d have to use four different devices (none of my alarm clocks support multiple alarms) and the fact that it would all be useless if I’m not at home, the best solution is to use a daily email reminder which would alert me even if I’m working off my laptop at school (for example).

I also jumped at the opportunity to find out more about Linux and PHP; besides I didn’t want to sign up for several free email reminder services hunting for a good one so opted simply to write my own. For the sake of anyone attempting to implement any of the features of PHP and Linux I used, here is my solution which can essentially be broken down into four parts:

1. Emailing script

It was fairly easy to find out how to send an email via SMTP in PHP so I set up a script to connect to my gmail and send an email from there to myself. After turning it all into a function, in accordance with the modular approach to development, I was ready to proceed.

2. Scheduler

This was more difficult. PHP can’t by itself do anything on a schedule so it was necessary to delve into Debian’s scheduling system. I tried to look up how to make the damn thing work and eventually found (amongst other irrelevant info – hurry up Wolfram Alpha and add support for coders!) how to use it. It seems like cron is already pre-installed upon Debian installation, and is constantly running as a daemon. It checks a file every minute to check whether it should be executing a scheduled task. To edit this file you type ‘crontab -e’ and get a plaintext editing interface (looks like vi). The format of the file is a list of lines, each one representing a scheduled task. Each line’s format is:

[minute : int] [hour : int] [day of month : int] [month of year : int] [year : int] [script pathname : string]

So to run the program ‘rtorrent’ at 17:30 every 3rd of the month, you go:

30 17 3 * * rtorrent

Asterisks are, as always, wildcards. To execute a process every minute, the first 5 terms look like ‘* * * * *’. There is a slight problem with this: you can’t use vi from a PHP script (at least it’s not possible using exec). It turns out there’s an alternative way of using crontab – by importing a file. So the command looks like:

crontab foo.txt

Great. So the PHP script creates a text file containing the new line then executes a command to add that file to the cron file. Eventually I set it to run the script every minute and have the script itself check for whether it should be doing anything by referencing a MySQL database.

So in the end the PHP looked like this:

$fh = fopen(”foo.txt”, ‘w’) or die(”can’t open file”);
$stringData = “* * * * * /opt/lampp/bin/php /opt/lampp/htdocs/php/ereminders/s_mail.php &> /dev/null\n”;
fwrite($fh, $stringData);
fclose($fh);
exec(”crontab foo.txt” . ‘ 2>&1′, $output);

The &> /dev/null is just to stop it ‘helpfully’ sending email to root every time it runs (i.e. every minute) containing a log of exactly what happened.

3. Database

It’s a fairly simple MySQL thing – nothing fancy. I wrote a nice function in PHP to tabulate the results of a query which I use in my screenshot. It’s a single table and I haven’t bothered to normalise it or anything. Nothing to see here. Move on.

4. Admin panel

This was, like with most good things, the final stage of development. I was also getting lazy and bored so it’s pretty rudimentary; I wrote it just so I don’t have to go into PHPMyAdmin to change things. It makes use of that rather neat ‘tabulate’ function that I had written which tabulates the MySQL query. The var_dump is the contents of the cron file.

Final thoughts

In hindsight, this is pretty good for two hours’ work, especially considering about half an hour was spent writing scripts to automate things from an admin panel. I’ve also actually found it quite useful (pardon the surprise) – the other day I wanted to download an episode of Lost Windows 7 but the throttling period had already started and that one download would probably have pushed me over the download limit. At exactly 9pm I got an email reminding me to download so was able to watch the episode install the OS that very night. Though I doubt it’ll be much use to anyone other than me since there exist systems out there that do the same thing, just much better (probably).

๏̯͡๏﴿


Why not to do AS Economics

June 4, 2009

Before I start I’d like to make it very clear that despite the failure of the AS Economics syllabus and examination to present Economics as what it is: a science, I personally still consider it one of the most interesting and useful subjects to learn. The Mathematics of game theory in particular leads to surprising and deep conclusions about human beings, and nothing, not even UK examinations, can change that. In addition my dislike of the subject at AS has nothing to do with my teachers – the actual lessons and discussions were invariably absorbing and relevant to current affairs, which made the unfortunate syllabus some ‘genius’ working for the government came up with so much more tolerable.

So, the exam is finally over, and it’s time for an elucidation of why doing it at AS is such a bad idea. I’ll split it into two parts: why Economics is taught wrongly at AS, and why not to do it at AS, which are arguably two different things.

Why it’s taught wrongly

My primary concern is the fact that it is treated explicitly as an essay subject rather than a highly mathematical and scientific subject. The natural language of Economics is maths and logic – Economics is about allocation of resources and decisions. This inevitably invokes game theory which was developed by von Neumann explicitly for decision making. Insulting the poor guy and choosing to waffle about market failure instead of putting to use the tool he spent is life creating just seems a waste of time to me.

The models that are taught seem, after thinking about them for a bit, either completely useless or completely nonsensical. Firstly uselessness: almost all the models that are taught at AS involve graphs with straight lines which seem to go extremely fuzzy at the axes. Even the shape of these lines is unclear, so to extrapolate that if a certain line shifts, with the fallacious and limiting assumption of ceteris paribus, then price will rise, which luckily coincides with what you’d conclude from common sense, is just bad practice. So much time and effort is put into learning and understanding how these graphs work, and ultimately the same problem can be easily solved by common sense, and a more complex problem would be more efficiently and more accurately solved using Maths rather than graphically. In real life, as my teacher pointed out, the government wouldn’t sit there poring over a diagram of SRAS shifting to help them set fiscal policy. Secondly nonsensical: (this will only make enough sense to be nonsensical to those who have done AS economics, if you know what I mean…) consider a rightwards shift in the Keynesian LRAS: long-term economic growth:

Since the flat part of the curve represents mass unemployment, economic growth appears to have caused mass unemployment! At one point I asked my teacher about it, and his response was something like ‘the model is basically a lie, so don’t read too much into it’.

Why not to do it

The Mark Scheme is the key deterrent. Doing the exams feels like pretending to be a psychic – even though you might write something that is completely correct and answers a perfectly reasonable interpretation of the question, you could still fail to pick up a single mark because you haven’t read the examiner’s mind and your answer isn’t compatible with the rigid mark scheme he has written.

The structured answer required of candidates to a long essay answer typically consists of a definition, some explanation of why the process works, and evaluation. For the past six months, evaluation has been the bane of my existence: it is basically explaining at great length why your answer is wrong and/or inadequate. Evaluation is basically saying ‘the answer could be different if the initial conditions were different’. In the words of KPZ: No spit Sherlock! A typical evaluation might be ‘the significance of this factor that I have just painstakingly described is actually completely negligible because the quantities involved are so small’ or ‘I do not know the size of the multiplier so I have just wasted my time writing half a page on why the multiplier augments the increase in aggregate demand’. This is perhaps a function of the essay style of the exam, and the lack of calculation, making the entire affair a hand-wavey vague generalisation of how a generic economy might behave if only one thing is permitted to change at a time.

A structured answer in my opinion to a question like ‘evaluate the likely success of supply-side policies’ is to begin with assumptions and at that point determine the likely precision of these assumptions; in effect setting initial conditions for the solution of a differential equation with error bars. For example giving some formula for the probability density of the value of a constant, e.g. ‘The size of the multiplier M ~ N (1.3, 0.3)’ or ‘M = 1.6 +/- 0.2′. Now that all this is empirically established, there’s no real need to evaluate: it would be pointless afterwards saying ‘the result could be wrong if the multiplier had a different value’ since you’ve already quantitatively given an explicit formula for the probability that the multiplier is different. The next step would be to set about using a model to calculate the precise effect of various supply-side policies, taking into account the uncertainties in initial conditions set out in the assumption, and also taking into account the potential innacuracy of the model. Now you have a very secure answer with already inbuilt evaluation. Such an answer would probably receive an extremely low mark because it contains no evaluation, and the discounted cash flow model and Black-Scholes probably don’t feature in the mark scheme. And I haven’t written a definition of a supply-side policy.

Another ridiculous feature of the exam is the number of marks: a question requiring merely a bog standard definition can be worth up to 6 marks. To make things worse the number of marks available per paper has doubled since last year so a previously 4 mark question would be worth 8 marks. All this means it is extremely stressful taking the exam: only a single line of question is sufficient to inflict four pages and thirty marks of suffering upon a candidate. To make things worse it’s almost impossible to guess how the marks are allocated, and exactly what the question requires.

Probably the hardest part of the exam for me was the supported multiple choice, a feature of the microeconomics module. This is the most blatantly exam technique-oriented part of the exam in my opinion, as it is possible to gain marks by explaining why some of the other alternatives are incorrect – the so-called knock-out marks. Multiple choice is actually in itself an excellent way to test knowledge, and having to jump through hoops and explain in depth something that you already clearly understand from having chosen the correct answer in the first place strikes me as woefully torturous to the candidate. To make things worse, the amount of stating the obvious required in these questions is insufferable.

Final thoughts

So in conclusion, AS Economics should not be called AS Economics. It should instead be called something like AS Exam Technique, or AS Mark Scheme guessing. The amount of correct or accurate or useful economics contained in the course is truly minimal, and the exam almost killed me (and my hand). The only reason I can give for anyone to actually do AS Economics is if they want to do it at university, where the true elegance and beauty of the subject is really done justice (or so I hear). Otherwise you’re in for a year of hating examiners and their awkwardly constructed mark schemes.

On a lighter note, this is what was on the actual mark scheme of a past paper, word for word:

Q: With the aid of a diagram, explain how high guaranteed prices resulted in milk surpluses (Extract 2, lines 9-10) [6 marks]

A: High guaranteed prices encourage farmers to increase output because they know that there is a ready market for their produce. Therefore, they will use more fertiliser, better seeds etc to ensure higher output.

Hmmmm…

๏̯͡๏﴿


SPS Q Festival

May 24, 2009

The blogosphere and indeed local media are probably all over this thing, with sentiments ranging from high praise and celebration to bitter complaints about noise pollution and propaganda. But hey, I might as well make my own (very) little contribution.

I have to admit I was originally highly sceptical about the whole thing. The previous day I was dragged straight from Core 2 into a rehearsal, spent half an hour laying out deckchairs, and was immediately plunged into a three-hour rehearsal (about which I had known nothing until I was ‘reminded’ about it that morning) which ended at six. And I somehow managed to survive all that on breakfast: two pains au chocolat (or however you choose to pluralise the French expression) and a cup of tea (lunch was out of the question. Apparently). The information I had, as a performer, received beforehand, also gave me the impression the entire event’s organisation left much to be desired; I was until the eve of the Q Festival unsure as to the colour of the suit I was to wear (conflicting data manifested itself in several different letters I had received). Rehearsals denied me the latter half of Apposition (= prizegiving) lunch which cost me an excellent dessert and also barred me from the chance of helping out with the open day, something I had dearly wanted to do since I had first been told about it. I also hate having to turn down offers to help blow up things (Chemistry); in fact I had to turn down every subject teacher who asked me to help, which was not particularly pleasant. And to cap it all it transpired at about 6pm of the actual day that they had somehow either forgotten or ignored the fact that musicians, like most other people, require dinner. And apparently all the musicians grabbed from the outside world were being paid, including old Paulines, while pupils like me who had been non-optionally drafted in were being treated essentially as unpaid trained monkeys. In other words I was not immensely impressed with the entire proceedings.

But when the actual concert started after a major emergency involving a lost bag, absent music scores and instruments locked in inaccessible (and inconspicuous) locations, I actually started to feel good about it. The crowd was relaxed and the Prokofiev sextet of which I was a member actually went quite well. Interestingly, although I quite literally had a microphone pressed against my head and an enormous high-resolution camera that resembled the Hubble Telescope pointing directly at my fingerboard, I felt much more at ease than playing for a small concert in the Wathen Hall. Perhaps it was the physical distance from the audience, but it just seemed really relaxed and unstressful. Or maybe it was just the champagne. And after that were the orchestra pieces. The incredibly boring passages that we had rehearsed to death in a hot cluttered hall with an insufficient caffeine supply for eternity and a day (i.e. 4 hours) suddenly came alive with the choir and, needless to say, Katherine Jenkins. The entire jubilant feeling of the celebration did start to affect me and wearing a ridiculous, sweaty, unnecessarily insulating outfit with a bow tie and white dinner jacket started actually to feel rather good and for a moment made me feel proud to be a Pauline. There’s for some reason a certain amount of self-confidence that a bow tie and excessively formal suit gives one. And right at the end when the drunk and high members of the crowd thronged around the stage to touch the one and only Katherine Jenkins and scream demands for an encore it felt good sitting on the stage pretending to have played everything correctly.

I have never been involved in anything of this magnitude before, and it was really quite a wonderful experience to take part. One thing that really struck me was the quality of the orchestra. The school orchestra is relatively good, depending on your interpretation of ‘relatively’ and ‘good’, and we tend to work for quite a long time on each piece before it even begins to make sense. The orchestra I was playing in was composed mostly of professionals and extremely good musicians and it truly made a huge difference – each of the five or so pieces was conquered in half an hour of rehearsal, and everyone *actually* played in time (which for the Carmen and Gershwin was quite a feat)!

I was also somewhat surprised by the police presence – while our rehearsal was in mid-swing, three police vans pulled up and a hoard of crowd control officers began patrolling the empty deckchairs.

Anyways in summary:

Apposition: Very interesting declamations, awesome lunch

Open Day: CompSoc was mostly us pissing around with SSH and MacOS’s text to speech functionality. And of course playing games. Chemistry smelt like some combination of pyridine, ammonia and chlorine. I also saw some old friends at Physics (building a trebuchet).

Concert: Brilliant.

Nutrition: High-quality Sodexo stuff for lunch, champagne and white wine to see me through the concert, Tesco pasta as a substitute for dinner, and a nice Stella Artois to conclude the evening.

Oh. That wasn’t brief at all. Never mind.

And finally, a word of apology for lack of activity. It’s exam period right now and I’m stressing over Economics. So you probably won’t hear much from me until 16 June (the day after my last exam). Meanwhile, good luck to all those other unfortunate souls with exams, and to all relevant parties, have a good half term!

More photos can be found here

๏̯͡๏﴿


Solution to GL’s ‘Sangaku’

May 5, 2009

GL decided to set us an optional prep in the form of a past A-level question. I now see that the adults who sat these papers last time really have a very good point about dumbing down – the difficulty of some of these questions is completely off the scale compared to anything any of us have done before in routine syllabus work (i.e. not BMO etc).

Anyways the thing was on parabolas and I’ve attached my solution for anyone who particularly wants to see it. The reason it’s called ’solution to sangaku’ is because GL mentioned after drawing it on the board that it looked like it belonged to a genre of Japanese circle puzzles called sangakus which were apparently put on display in temples or some such public area for the amusement (and frustration) of anyone willing to sacrifice an hour or two to solving problems.

Linky for download of solution [docx]

The original question was something like:
Given a parabola with parametric equation [where the focus of the parabola is (a, 0)]:

x = at^2
y = 2at

and circles drawn as shown in the diagram I drew, prove that R – r = 4a. We were also given the equation of normals to the parabola at a point specified by t:

tx + y = at^3 + 2at

GL did mention as he was elucidating the inner workings of this subset of conic sections that the results and proofs and general maths tend often to end up rather beautiful. The solution to this particular one just seems to require a bit of luck (i.e. somehow having the instinct to take the difference of both formulae) and a whole load of cancelling at the end which made me want to shout something like “W00T” before realising any such exhortation would be inappropriate and probably unwelcome at 2 in the morning… Anyways the solution speaks for itself really – it’s especially awesome if you’ve had a go at the question. Enjoy ;)


Songbird v Foobar

April 29, 2009

Interestingly enough I switched away from iTunes 7 and haven’t touched it ever since their highly hyped update to 8. I switched to foobar2000 which is actually a pretty awesome bit of software. I have however been constantly hearing about Songbird and its amazing features so I’ve now finally got round to installing it and testing it out. Here are my thoughts.

Foobar > Songbird

One of the reasons I switched away from iTunes in the first place was obscene memory usage. I’m not sure how iTunes 8 is with memory but I had many grievances about the performance of iTunes 7 when I used it. Testing Songbird on a decent laptop (3GB RAM, Intel Core2 Duo T8100 @ 2.10 GHz, a processor that benchmarks faster than most in its clock speed range), it took 5 seconds for the program to start up fully while foobar loaded instantly. Foobar’s memory footprint was absolutely miniscule at 10MB while Songbird required a hefty 80MB, though that’s fairly unsurprising considering its capabilities as a browser.

In terms of usability, as a foobar2000 user, I miss features like Cursor Follows Playback (and more importantly Playback Follows Cursor), complete ID3 tag control, advanced syntactical filters and fully customisable shortcut keys, for which I have yet to find Songbird extensions. Whatever the case these are minor concerns and are bound to be ironed out / provided in the long run by extensions or built in natively. However my concern is that Songbird seems directed more at less savvy / control-freak users who don’t necessarily want to use something like a RegEx string or SQL query to perform operations or filter their music – the functionality is based more around forms and buttons rather than console, debug window and command prompt. While most people probably welcome this user-friendly approach, I personally enjoy the ‘hackability’ and almost complete controllability of foobar. Of course, since Songbird is open-source a real hardcore user may prefer to hard code in mods, though I for one prefer not to have to recompile software to make it do what I want.

There are also several components which come natively with foobar (or as pre-installed plugins) such as ReplayGain (very important; Songbird’s equivalent is the ‘VolumeProfiles’ addon); minimise to tray (again critical [to me]; Songbird has the ‘MinimizeToTray’ addon); and a ‘resume playback after restart’ option (a nice touch to foobar; Songbird has an addon called ‘last track resume’).

This demonstrates the syntax of a Foobar preference element - a lot of the preferences are like this. Theres just so much control

This demonstrates the syntax of a Foobar preference element - a lot of the preferences are like this. There's just so much control

You can even control exactly what text is in the window title, status bar and system tray tooltip

You can even control exactly what text is in the window title, status bar and system tray tooltip

Songbird > Foobar

Enough nitpicking. Songbird really does have some really awesome features. Its integration with the web is very nciely done – I get the impression more or less every online music service is supported to some extent, and the whole browser integration is a brilliant idea. Foobar’s web integration comes in the form of ‘freedb’ which I assume is some sort of tags downloader though it’s never given me any vaguely sensible suggestions so isn’t very good. There’s also a mini player built in which foobar doesn’t seem to have without resorting to skinning. Ratings are native which foobar is critically missing – you have to use ‘quick tagger’ [addon]. The default iTunes interface was offputting at first but the browse library by artist/genre/album etc at the top is another feature foobar lacks but Songbird has. And, of course, Songbird is open source.

It’s interesting that Songbird was developed as an open source project thus appealing to the techies while also being amazingly pleasant to use with some of the most useful and critial features built in and vast extensionability. Someone commented Songbird is like the Firefox of media players. I can’t say I disagree.

I find the way theyve built a media player around a browser quite cool and certainly in line with the whole web integration thing

I find the way they've built a media player around a browser quite cool and certainly in line with the whole web integration thing

Songbird has a clear iTunes-like interface and the mashTape (web integration with artist/song info, reviews, even youtube) is a pretty cool feature IMHO

Songbird has a clear iTunes-like interface and the mashTape (web integration with artist/song info, reviews, even youtube) is a pretty cool feature IMHO

Songbird, Foobar > iTunes

Despite a slow load time, Songbird wipes the floor with iTunes when it comes to performance. There was a problem with iTunes 7 in which scrolling through a large library was a misery owing to the intense slowness of just about everything. Songbird on the other hand is actually pretty snappy. And of course Foobar runs like lighting.
Both are extensionable. I know there are iTunes addons etc. but both these alternatives take extensionability to a much higher level. Songbird probably uses extensions about as much as Firefox while Foobar takes extensionability to an extreme by more or less requiring them to function normally (hence the pre-installed ones).
And of course neither associates itself with a store that sells DRM music ;) So it’s all good.

Overall, based on my experience of them so far, both are far more than adequate replacements for iTunes (unless you’re a fool and actually use the iTunes store in which case your music is useless if played by anything but Apple products). Foobar even has support for iPods (not sure about Songbird). Neither has performance issues, and both are more or less customisable enough for the standard user. If you’re after an easy and pleasant-to-use player with an automatically decent-looking interface with truly wonderful web integration, go download Songbird. If you’re a control-freak in search of hackability and control almost to the extent of writing your own RegEx (and also a completely no-nonsense player), foobar’s the one for you. On the other hand if you want a program that is slow, memory-hogging and defaults to buying music from a store with hideous DRM, go ahead and download iTunes.

๏̯͡๏﴿


Antimatter Lecture at UCL

April 25, 2009

On Friday (24 April) I attended an open lecture at UCL on antimatter (”Antimatter in the Laboratory and beyond”). The lecturer was Dr Dan Murtagh from the Department of Physics and Astronomy, UCL, who is currently working on antimatter. The talk was split up into several main areas: the prediction of antimatter, creating, harnessing and detecting it, and applications for it, both current and future. My memory is poor and I only wrote down bits that I thought were interesting / useful to me, so I shan’t attempt to give a comprehensive summary; rather I’ll just put into a coherent and legible form my scribbles.

Discovery

Antimatter was originally proposed by Paul Dirac as it came out of his equations. Originally he thought the antimatter equivalent of an electron would be like a proton and therefore have the same mass; eventually the positron was discovered by someone who noticed what seemed like a positively charged electron in his bubble chamber (a rudimentary particle detector). Thus was antimatter born.

Detection of Positrons

Positrons are created from Sodium-22, an artificial isotope which for some reason is only produced in one place in the world (somewhere in South Africa), and is also in relatively high demand owing to increased research on it. The situation appears to have some money-making potential… But anyway, when the positron stream is created, the positrons have mostly far too high an energy to be useful. So, like in nuclear power plants, a moderator is used in an attempt to slow down the positrons.

Moderators (mostly made out of tungsten) tend to have several problems. Positrons go into the metal and interact with matter, presumably mostly via EM forces, and can end up doing one of four things: they can end up coming back out the way they came as ‘thermal positrons’ (whatever they are; not very useful); they might get stuck in a hole where a tungsten ion is absent and end up annihilating, creating gamma photons (useless); they could come out the other side and somehow have gained energy or not lost enough (useless) or they might lose sufficient energy to be useful in most experiments (useful). Once they come out the other side they follow a complicated path through some apparatus as illustrated, guided by magnetic forces in a very similar way to the LHC.

(click to enlarge)

Essentially the positrons get channelled through various filters to clean up the beam (most of the process consists of getting rid of electrons) which itself ends up in a gas cell where various detection instruments (ion detectors, positron detectors and photonmultiplier tubes).

Positron Interactions

Positrons interact with normal matter in three different ways:

Positron Impact Annihilation

In other words:

This is however a rare occurrence – it requires a positron to occupy the exact same position as an electron and the probability of this happening makes annihilation almost negligible.

Positronium Ionisation

In other words:

A positronium is essentially a Hydrogen atom in which the proton is replaced with a positron – it’s an electron-positron pair. It has an average life of 143ns before the pair annihilates. Fortunately (from what I inferred) most positronium ‘atoms’ are moving fast enough to be relativistic, so scientists have just about enough time experiment with them, and, as discussed later, even in the Ps’ frame of reference, 143ns is enough time to do chemistry.

Speaking of atoms, there is some research called ATHENA taking place at CERN to attempt to create anti-hydrogen: an anti-proton/positron pair, an experiment which was discussed to some depth in the questions and which made another appearance when the lecturer was discussing traps.

The third interaction is impact ionisation, when the positron knocks the electron out of orbit:

Harnessing Positrons

As an aside, I was discussing the possibility of work experience at Imperial with a reader in Quantum Optics, and he showed me round the lab. As it turns out, his PhD students were/are also working on ion traps, though instead of with antimatter with entangled ions.

Anyway, onto positron traps. As it turns out, the method for trapping them involves cylinders held at different voltages. As shown in the diagram, the trap consists of a series of cylinders laid end-to-end, held at different voltages. The positrons are repelled by the walls of the cylinders by different amounts. Since E = QV, the positrons will be at lowest energy (preferred) when the cylinder voltage is 1V. An energy diagram is shown below the schematic showing clearly how positrons get trapped. The voltages shown are arbitrary and are there just to give an idea…

These traps are very effective but unfortunately occupy a substantial amount of room, thus are unfeasible for antimatter storage.

Returning to ATHENA, their method of creating anti-Hydrogen consists of using ion traps. Using a potential diagram, the idea is to trap anti-protons and anti-positrons in the same place. Positrons chase low potential while anti-protons chase high potential.

So positrons are being pulled up, trapped by the underside of the potential curve, while anti-protons are being pulled down, trapped by the top of the curve. Eventually the two types of particles interact to form anti-hydrogen. Unfortunately the anti-atoms produced are higly excited and since they are neutral, cannot be trapped by electro-magnetic means and end up hitting the side of the apparatus where they annihilate.

Uses of Antimatter

PET scanners (Positron Emission Tomography) bombard the subject with positrons (essentially like beta-plus radioactivity) and when annihilation takes place, the photons can be detected with gamma-ray detectors. It’s apparently used for detecting cancer and beta-plus emitters can be bonded to sugars which is also apparently useful. This strikes me as a somewhat dangerous procedure – bombarding a patient’s brain with beta-plus ionising radiation which itself produces enough gamma radiation to be imaged.

A futuristic and probably impractical use involves using antimatter as rocket fuel, something NASA are working on. And rather than producing antimatter, the rockets would need an antimatter harvester in the form of a massive satellite with rings of 30Km diameter positioned near Saturn’s rings which uses strong magnetic fields to gather antimatter. It all sounds rather … unlikely.

Questions

Anti-proton production involves colliding protons (a 2GeV beam) with metal which results in pair production, producing a proton/anti-proton pair.

I wondered how antimatter is supposed to interact with gravity. What I thought (as a sort of wild guess) was that if the Feynman model of antimatter as matter going backwards in time is correct, antimatter should attract itself going backwards in time, thus be observed by us as repelling itself going forwards in time. There’s also a theory that it doesn’t interact at all. As it turns out, a research group at CERN fired a (very long) anti-proton beam and found antimatter does indeed fall towards the earth; antimatter is attracted by matter.

I had read in the New Scientist about how lasers work – the interaction of electrons with holes and subsequent production of positronium which ends up annihilating if a photon passes releasing a coherent photon (stimulated emission). Apparently some scientists have managed to stabilise that Ps, turning it into ‘excitons’ which have a much longer life. I asked if this may be a potential form of storage. Since positronium is like an atom, it has a first ionisation energy (of about 6.8eV) which means if it were possible to somehow store Ps it would probably be feasible as positronium storage.

There were quite a lot of questions and it all ended up as a big discussion about ‘anti-chemistry’ (a research group at Riverside, CA are investigating that) and the possibility of antimatter galaxies.

All in all, the talk was, to me at least, highly interesting and thought-provoking. My friend had advised me that most of the actual talks, since they are public and pre-university students are in the audience, tend to be relatively non-mathematical and simple (and I was horrified at first when he declared E=mc2 was to be the only equation in the talk); but I felt that the talk itself probed the subject quite deeply and the experimental side was very new to most of us. And of course, the questions were an invaluable part of the experience.

๏̯͡๏﴿


How to Download Youtube Video/Audio

April 21, 2009

There are lots of tools out there claiming they can stream Youtube video and audio to file. I’ve tried to use many different ones but most seem to fail either at the downloading stage or the playback stage, i.e. they produce unreadable output files. Even worse is when you end up with an FLV file which only seems playable in VLC. I think I’ve found the perfect solution which can stream Youtube to an AVI file (properly, using a standard algorithm and producing a fully legitimate file) which can subsequently be converted into any format at all, be it audio, video or whatever.

1. Download

The best solution in my opinion is VDownloader. It provides a no-nonsense interface with settings for the use of a proxy, AVI codec, and download directory. It’s freeware of course, with a small encouragement at the bottom of the window to donate. To use it, simply paste the Youtube URL into the URL box and hit download. It first downloads it as a file without extension before converting it to AVI.

A potential alternative is Orbit Downloader with Grab++ which can grab streamed flash off any website. While it will work without fail, you end up with a FLV file which for some reason only VLC media player seems to be able to play and recognise as any sort of legitimate video file, preventing the next step from working. I thus never managed to get VLC to stream anything to a file. Perhaps it uses an outdated / incorrect .flv format.

2. Convert

If you feel the need to convert it from AVI to, say, an audio format like MP3 (some very rare classical recordings only exist on Youtube for some reason, but I’m not sure about the legality of downloading them to local storage), by far the best all-purpose media converter I’ve come across is SUPER. Frankly I find the interface revolting but the functionality is truly wonderful and more than makes up for looks – just take a look at their site to see what features are on offer (the site is also not very pretty…). Again, it’s all free.

To use it, first install then run the program. You’ll be confronted with a hideous UI. Select the top-left drop down menu and select the target format (e.g. mp3). If necessary change the codec (top right drop-down). In the blue ‘Audio’ rounded rectangle set your preferences for the output stream. Drag and drop the AVI you downloaded with VDownloader into the grey file list box near the bottom. Tick the file you want converted and press ‘Encode’. It might take a while (and the window sometimes freezes) but chances are it’ll complete and you’ll have an mp3 waiting in the output folder. The default is C:\Program Files\SUPER\OutPut\

So there you have it – that’s the best way I’ve found to download youtube content and convert it into any format desired. I’ll leave the legality of this for you to decide / work out / research – if you download music from Youtube and it turns out to be illegal, don’t blame me!

Good hunting ;)

๏̯͡๏﴿


The Pirate Bay Situation

April 19, 2009

It’s big (and by now fairly vintage) news in the torrenting and general technology community that a verdict has been reached for the lawsuit against The Pirate Bay’s four founders. I won’t say much about the gory details of the trials – there are plenty of articles on good websites that will give you all sorts of facts; I’m just going to state some of my opinions on the matter. In case you don’t already know, the verdict was a jail sentence and a $3.6M fine.

Firstly my thoughts on file sharing in general. BitTorrent is used for a whole host of good things – I’ve used it on multiple occasions to grab up-to-date linux distributions and it’s a fantastic way to download without limitations on server upload speeds (private trackers have exceptionally high ratios and speeds but linux and other open source stuff tends to download fast as well even on public trackers). There’s also the whole debate about whether or not piracy really does harm the economy as much as Sony would like us to think. But personally I think there’s no hope for companies trying to shut down piracy because it stems directly from the entire point of the internet: sharing information. If torrenting somehow gets shut down (an incredibly unlikely scenario), an alternative P2P system will immediately spring up to replace it, and there are a great many out there waiting to be exploited. But basically what I’m saying is that an attempt to target the infrastructure of filesharing is just a pathetic way for companies to seek some sort of revenge for probably mostly imagined and definitely largely over-hyped and bloated losses.

It is transparently obvious that the trial is much bigger than just The Pirate Bay – the verdict poses a threat to the entire community of file sharing. The Pirate Bay may have had certain special circumstances that made this verdict even vaguely plausible: something to do with Sweden possibly. But the verdict has set an incredibly dangerous precedent – if the team really end up facing significant jail time and massive fines, it would serve as a massive deterrant to anyone even considering starting up a novel platform for sharing, be it open-source software, ideas or whatever. My opinion is that the entire spirit of a collaborative internet is being broken apart piece by piece, while the pirates will still always find a method of sharing illegally obtained and distributed material. The supposedly illegal side always tends to be far more determined to keep sharing than the average supposedly law-abiding person who is probably fairly ambivalent anyway about whether or not to share those photos on Flickr.

There’s also a huge amount of wastage. I noticed Isohunt have put a notice on their front page linking to some legal material. I wouldn’t be surprised if other trackers are calling their lawyers right now, preparing for a legal assault on their communities. I’m not saying lawyers’ pay is waste, but the sheer amount of effort and time going into nit-picking against a multi-corporate legal mob in front of an unconvinced and generally non-tech-savvy jury seems to me at least a somewhat inefficient use of resources.

And to keep everything in perspective, the recording industry are fighting against a phenomenon they themselves are helping to create. The measures being adopted to prevent piracy such as music DRM make life a misery for law-abiding citizens who pay for their music; for example iTunes forced all its customers to re-download and thus re-buy all their music just to (supposedly) remove one layer of DRM from audio files. All this hassle actually makes pirated music of higher quality than purchased music, a ridiculous situation created by companies like Apple. How can anyone blame me if I decide to download a torrent of a few songs (which I’ve already paid for) just to be able to play them in something other than iTunes?

In my opinion, it will become increasingly difficult in the future to download plain DRM-free music and films, and indeed the risk of being caught doing so will probably increase, as will the penalty. The current trend is that more and more companies are getting involved – once it was just bodies such as the MPAA and RIAA who were targeting file sharers. Then more private companies joined in for the money such as MediaDefender, and now even ISPs and governments have joined the witch-hunt. If you want my take on this, I suggest that if you already download and share pirated material, do so while you can and max out on it; the window of opportunity to get hold of clean untrackable media may well be closing.

Good hunting ;)

๏̯͡๏﴿