New Site…

July 12, 2010

N.B. This blog has moved to

arctanb.wordpress.com

I’ve been through several different usernames but I think I’ll settle with arctanb. Which means goodbye gedanken451.

Advertisements

This year in retrospect

June 30, 2010

Caution: [abnormally] high levels of egocentricity are present in this blog post and it’s therefore probably not of interest to anyone but myself :P

My last set of secondary school exams

Academics

In approximate descending order of success:

Computing

Despite doing this outside the timetable, I feel computing has been my greatest success this year. I learnt the entire syllabus over the course of a day from a book and managed to do every question on the paper (the proportion of my answers that were correct is a whole different matter), became the lead developer of Firefly’s secondary product and used that work for the A2 computing project, did some really cool (theory-based) personal projects (1, 2), was invited to the next round of the British Informatics Olympiad (which I unwillingly turned down for Chemistry) and got a Google internship offer (which I was also forced unwillingly to reject by time constraints).

Physics

The olympiad was a complete disaster, but I had the best physics teacher in the world teaching me (CAPS), and in terms of learning stuff and inspiration, this has by far been my best year for Physics. The sheer amount, level and depth of material we went through this year is incredible. And I now have a beautiful, high-quality set of notes which I will probably be using as reference material throughout my university course and beyond.

Chemistry

I’ve discovered I’m frankly hopeless at this subject – especially the organic side – but by some freak accident managed to get into the second round of the chemistry olympiad. So apart from one success, it’s not been a great year.

Maths

Maths has been an unmitigated disaster for me this year. I attained a ‘certificate of participation’ in the *first* round of the UKMT, needless to say not progressing to BMO. I seem to have got even worse at mental arithmetic and my inability to complete any of the STEP 3 questions from this year is a fitting end to my ‘career’ (as TCIM put it) in the subject.

Academics dash (mathmos will get this)

Work aside, it’s been a fantastic year. In the first term I revived my interest in sailing by taking the games half. I also started juggling again, made some youtube vids, shifted my bouldering red point from V0 to V4 and onsighted a couple of V3s, co-developed universityinterviews.com (and am collaborating on something else with the same developer), finally started on Bach’s Ciaconne (from the second partita for solo violin in Dmin), performed the 2nd mvt of the Franck Sonata, made a piano arrangement of Bohemian Rhapsody, picked up scottish dancing, ceroc and catapulting (with a Barnett Black Widow), and discovered the wonders of G&T and tweed. It’s a fitting end to my time at St Paul’s and hopefully a taste of years to come!

EDIT: Oh yeah, and I also met Jimmy Wales and Tim Hunt :P

Summer

I’ll be hiking in the Skye Mountains (the furthest north I’ll have ever been), driving to Spain with my parents, doing some more work for Firefly, going to Florida to watch a NASA rocket launch (hopefully), travelling even further north to Norway to launch a CanSat, then finally flying to Stanford to start a new life (kinda). I’m really looking forward to all that; it should be an amazing summer and I’ll probably wear out the shutter button on my camera :)

Pax


Magnetic Breakfast Cereal

June 8, 2010

According to Brainiac S01E03, cereal is magnetic. According to Wikipedia, iron is added to breakfast cereal as a dietary supplement in the form of elemental iron powder. I couldn’t resist trying it out for myself, and it’s true (see video below)!

Further, this iron can be extracted by grinding the cereal, adding the resultant powder to water to dissolve small saccharides etc that might be trapping the iron in the cereal, and then using a magnet to pick up particles of iron. Supposedly this iron reacts with HCl in the stomach to form soluble iron salts that can be absorbed into the body.


Exam Rant

May 19, 2010

I’m about to sit my last ever batch of secondary school exams (A2 modules), so it’s past paper season and a rant is called for.

In fact, I’m generally happy with the exams that we’re sitting. The Maths syllabus and exams are interesting and cover extremely useful and interesting topics, particularly differential equations and a massive amount of Newtonian mechanics, with some quasi-Lagrangian stuff thrown in at M4; my only major qualms are that the course is weak on linear algebra (a personal interest) and contains nothing on vector calculus, an enormous topic which would have been enormously useful for getting a handle on understanding the extra-curricular physics and fluid dynamics we were shown in lessons (rather than just commenting on the shapes of the symbols). Most importantly the exams do the subject justice; for the further maths modules, it is necessary to be proficient at the subject to do well, which, from my experience so far, for UK exams based on the national curriculum, is almost unique. And of course there’s always STEP which I fail at due to lack of ability rather than lack of exam technique which suggests it’s a good exam.

Physics and computing are similar; the exams are mathematical, quantitative and logical in nature, requiring few wordy answers, of which almost all are worth few marks and have entirely reasonable mark schemes. Though CAPS has been giving us questions from past A level and Oxbridge physics papers throughout the year, and not only are the questions from those demanding – both mathematically and conceptually – but they are also genuinely interesting and by doing them, candidates develop a deep understanding of aspects of some of the topics involved; the rainbow made beautiful in the style of Lilley’s ‘Discovering Relativity for Yourself’ – through working out the answers to a series of exquisitely well-thought-out questions. The current physics exams are almost entirely uninteresting slogs in comparison, though still good.

And now we come to chemistry, and the body of my rant. Perhaps I’m simply biased because I’m not a good chemist in the first place (or at least I’m even worse at chemistry than I am at all my other subjects). Or maybe I just want to blame the fact that I scored a low B on both chemistry mocks on something (which is by today’s standards terrible; according to CAPS last time a C was a perfectly respectable grade owing to the difficulty of the exams). Either way, I maintain that it isn’t entirely my fault that my marks are atrocious (though I concede that it is to a large extent).

It’s an old and possibly overused complaint that mark schemes / exams are badly written, and is consequently often taken lightly. Unfortunately I really do think think it’s gotten to such a stage that the Monster Raving Loony Party’s idea about education wouldn’t be that much worse than how it is currently: “It is proposed that, before the beginning of exams, the exam board will select a certain obscure phrase which will be kept secret. If any pupil inadvertently writes this phrase in any exam, he/she will automatically receive straight A* grades, and a free teddy.”

I’ll cite what I think are some of the worst examples of chemistry exam madness:
1. The mark scheme insisted that one E0 value was ‘more positive than’ another, but specifically rejected ‘greater than’.
2. To obtain the mark for one question, it was necessary to specify movement of *electron* lone pairs, not just lone pairs. Though personally I’ve never heard of lone pairs of anything other than electrons in any context.
3. The ‘Quality of Written Communication’ (QWC) mark is normally awarded for writing ‘two complete sentences’. But if you write a single long complicated sentence containing many subclauses with impeccable grammar that conveys meaning effectively and efficiently, you wouldn’t get that mark. Also, why on earth is grammar being tested in a chemistry exam? And more importantly, why does the government (or whoever it is whose fault this is) deem it necessary to test the ability of 18 year olds to construct cogent sentences!? (I admit my proficiency at written and spoken English is evidently imperfect but even the stuff I write makes sense. Doesn’t it? DOESN’T IT?)
4. Displayed formulae. Nobody uses them. Ever. Everything is skeletal. Also, the OH group is a single atom and should always be depicted as one…
5. Questions like “Discuss isomerism in complex ions” for 12 marks. They invariably have a really tight accompanying mark scheme with exactly 12 scoring points. One could conceivably (and entirely legitimately given the vagueness of the question) write an engaging paper on group theory or electronic orbitals in response and only receive the single QWC mark…

Allow me at this stage to cite Bill Watterson.

This image was taken from a fantastic blog post which more or less summarises why I love Calvin & Hobbes. Anyways, suffice it say Calvin’s words, “You’ve taught me nothing except how to cynically manipulate the system”, form an accurate representation of the national curriculum: learn answers to questions, rather than be educated.

But maybe all this is good preparation for the real world after all. Today I sat the ‘Life in the UK test’, one of the critical stages on the way to becoming a British citizen (apparently wearing tweed, drinking G&T and occasional Scottish dancing isn’t enough; trust me, I asked), for which I had to study (read: flick through Schott’s half an hour before leaving). And it can mostly be frankly and truthfully summarised as b/s: memorising dates (e.g. the precise year women were first allowed to divorce their husbands [1857 or something]), statistics and numbers (some of which as obscure and inconsequential as the percentage of Christians in the UK who are Roman Catholic [10%], some of which are required to be known to an unreasonable degree of accuracy such as the percentage of the UK’s population that is Muslim to 2sf [2.7% as of a few years ago, probably now different], and some of which don’t even make sense such as the coastline of Britain [infinite by my {and Mandelbrot’s} reckoning but that wasn’t an option]), and mundane facts (e.g. that 1941 was the only year the UK didn’t have a census). They might as well have asked ‘who put Gordon with the bigoted woman?’ [definitely Sue]. There was also what might be described as ‘jack all’ about geography, particularly mountains and weather, information which I personally consider much more central to Britain than the ethnicity of the bus drivers employed in the 1950’s [West Indies and Carribbean] (or even important things like the number of seats in the Commons).

So it seems that even after the horrors of OCR (“Recognising Achievement”) are over, life continues to be dominated by ‘cynically manipulating the system’; learning useless facts or effecting pointless tasks to satisfy some criterion for something really important. I guess that’s just what life is about and I’ll have to learn to live with it, willingly or not; if you can’t fight it, join it. Sucks to be human…

Anyways, rant over, and it’ll probably be the last before the end of June when my exams end…


My Google Saga

April 30, 2010

Google is an amazing place to work; they have the best projects, employ the best people and have the best decor. In fact I was at Google HQ in London at the end of last summer for Young Rewired State, a hack day for 15-18 year olds, and we even got food with Google logos on it! So I applied earlier this term for a summer job / internship / work experience (how synonymous are these terms anyway?) at Google HQ at Mountain View, CA.

There’s a great deal of mystery surrounding the Google selection process, but having gone through Cambridge and Stanford applications, from my point of view it wasn’t anywhere near as baffling. It was made clear what qualities are expected of candidates (I inferred that these are primarily programming and algorithmic fluency and an interest in at least one of the company’s projects), the decision process at Google’s end was surprising in speed (a weekend) and Google made sure to keep paperwork to a minimum (a mere few PDFs); more than I can say for any of my university applications!

The process was also pretty simple in comparison. Since, from what I can tell, Google normally only recruit interns from the pool of compsci students currently attending university and I’m still at secondary school, I had to contact them directly via email (with the help of a contact) to get started. I was bounced around a bit and sent my CV and cover letter to a number of different departments until I was given instructions to fill in some application forms. A couple of days afterwards I received an email informing me Google want to interview me (technical interviews) and requesting a list of dates and times I’m available. Just over two weeks later I got a reply informing me I had two interviews at 10 and 11 pm GMT (!) with some links to advice about what to brush up on. Google technical interviews are conducted by phone from the US with the help of Google Docs (interviewees code directly into the google doc – no IDE / debugger!) and are entirely about algorithms and programming. From what I read leading up to my interviews, data structures (esp. linked lists and binary trees) come up in pretty much every interview. C++ seems to be the language of choice of most Googlers, though I was allowed to use C# (whose syntax pretty much identical to C++ anyway and almost literally identical to java) when I admitted that I’m crap with pointers :P. I’m not at liberty to disclose interview details, but to cut a long story short I did a few retarded things and failed an algorithm question but was complimented on my speed of coding in both interviews.

Of course, it wasn’t over yet. “I have good news for you.” quoth an email that arrived days later. They wanted to move forward with the next step and identify a project (including a further interview), and warned that there are no guarantees. As it turned out, I got the job after this (non-technical) interview with the potential project manager but didn’t have the mandatory 11 weeks’ contiguous holiday to spare, and consequently had to (very reluctantly) turn down the offer – accepting would have meant missing hiking in the Skye Mountains, watching the penultimate NASA space shuttle launch in Florida and launching a CanSat from the Andoya Rocket Range in Norway (Skye and Norway being the furthest North I’ll have ever gone).

But anyways, I’ve now survived literally the two toughest interviews of my life (I definitely struggled a lot more with these than my Cambridge ones – but then I’m a bit crap at inventing clever algorithms and know nothing compared to an actual compsci student) and I’ll have a better idea of what to expect next time when I apply again next summer!


British Chemistry Olympiad Round 2

March 29, 2010

It’s been a pretty epic weekend. Keeping it brief:

Friday: Journey to Cambridge

I actually went up with a friend who was going to the Informatics Olympiad (BIO2) to which I had been invited but clashed (to the hour) with the chemistry one – I chose chemistry as I did BIO2 last year and sought variety. After my customary meal at Wagamama I dropped my stuff at St Cats (where BChO2 was to be held) and started wandering round Cambridge. When I got back I met up with some of the people from last Summer’s training week who had made it to round 2 this year. We were all standing around in a circle when the inevitable titration jokes started <- actually true ;)

All 20 of us were taken out to dinner at Pizza Express by the olympiad committee (which itself consisted of over 10 members), an event which lasted about four hours due to slowness of cooking / service (…) but was great fun. We planned the pub trip for the next day and went to bed with the knowledge that we would wake up to six hours of chemistry.

A curious tradition of the olympiad, enforced to prevent bias, is for each person to be randomly assigned an element as a pseudonym and for us to use those throughout the competition for written work. I was Phosphorus, which I think I might have spelt wrong…

Saturday: The hardest exam I have done / will ever do

There was a practical exam in the morning which I had been dreading slightly owing to my invariably highly chaotic past lab experiences. As it turns out there was nothing impossibly demanding that we had to do and I managed not to emerge awash with pyridine / phenol / some other nasty reagent, and we all did a TLC, learning on the job, which was completely new to me and cool to do; they seemed to like my TLC plate (woo!). I was really impressed with the facilities (in comparison to St Paul’s anyways – to me having a fume hood each is a luxury) though it was impossible to tap whiz the burettes (an invention of NAL: turning the burette tap 180° letting through about 0.5 cm3)! I even managed to get excited about the pipette fillers (get me…) – squeezy rubber things that suck automatically with virtually no effort on the experimentalist’s part, rather than the really annoying cylindrical plastic ones we get at school that you have to crank with your thumb and never work / fit. It was also the first time I’d ever worn a lab coat.

We had been promised that we would sit a particularly difficult theoretical paper, and it was revealed just before we started that it was in fact the hardest paper they had ever set. Being the worst organic chemist you’ll ever meet, I think I just about managed to get through the ones that would have looked plausible in a physics paper and drew some structures for the organic questions that would certainly have made my teachers cry from despair (if not laughter)…

Walking dazedly through the streets of Cambridge and making conscious and desperate attempts not to talk about anything related to electron movement, we filed into a pub. At some point there was a formal dinner where we each got a glass of each of three different wines, including a rather exquisite dessert wine which was discussed in great detail in terms of aldehydes, esters and hexane (…)

The rest of the evening can probably be found on Facebook.

Chemists are good fun

Sunday: The aftermath

We basically got sat in a room after breakfast, got given goodie bags (including RSC Sigg bottles, a book of Chemistry cryptic crosswords, scientist-shaped memory sticks, safety specs, and a T-shirt) and certificates, and the team was announced. Congrats to those who got in, especially to David Edey for having got through while still in the year below!

It goes without saying that I didn’t get through, but it was an enjoyable weekend and I met some awesome people (who I will be seeing next year)!

Pax


Group table completion program

March 5, 2010

The Further Maths syllabus incorporates group theory, a fairly useful but abstract concept. It’s all very interesting and somewhat reminiscent of our semi-formal introduction to set theory and functions with GL last year. Unfortunately, interesting as groups may be, exam questions can ask you to fill out a group table, a task whose tedium is comparable with plotting graphs with pen and paper. While completing a group table in class, after remarking that it’s somewhat similar to doing a SuDoku (each element appears exactly once in each column and row), I pointed out writing a computer program to do this would be interesting and much more fulfilling than bashing through a group table completion. And that’s exactly what I did.

The code is fairly self-explanatory but probably full of bad habits and other rubbish; the only reason I’m making a blog post about it is because it’s the first time I’ve ever implemented (albeit quite messily) a Breadth-First-Search-type algorithm for a vaguely realistic problem, making it particularly interesting (to me).

The algorithm for finding the value for a cell (derived from elements i and j, e.g. ij if the group is multiplicative) is basically this, in really loose structured English:

Concatenate i, j. Call this concatenation c.
Look up if c is an element of the group.
If so, done.
   Set c as the table’s value at (i,j).
Else: Add this expression to a previously empty list.
   Repeatedly:
      For each expression in the list:
         Find character sequences which can be simplified by examining the existing table
         For each of these simplifications
            Add the mono-simplified expression (simplified once) to the end of the list
            If this simplification is an element of the group, we’re done.
         Remove the expression from the list

In other words the simplification algorithm systematically takes the expression, finds lots of equivalent expressions (by looking up simplifications in the half-completed group table) and chooses the equivalent expression that happens to be an element of the group. This obviously requires closure, or the algorithm will keep searching forever and never complete. For this reason I implemented a counter-measure to infinite runtime – it’s a bit of a hack but hey…

The program prompts for input. The first line is N, the number of elements in the group. The next N lines are string representations of the elements, e.g. a, aa, ab, bba etc. The next N^2 lines are the existing table – the program needs something to start with to simplify anything.

Here’s my example test data:

6
e
a
aa
b
ab
aab
e
a
aa
b
ab
aab
a
-
e
aab
-
-
aa
e
-
ab
-
-
b
-
-
e
-
-
ab
-
-
-
-
-
aab
-
-
-
-
-

This represents the following group table:

e   a   aa  b   ab  aab
a   -   e   aab -   -
aa  e   -   ab  -   -
b   -   -   e   -   -
ab  -   -   -   -   -
aab -   -   -   -   -

The program’s output is:

e   a   aa  b   ab  aab
a   aa  e   aab b   ab
aa  e   a   ab  aab b
b   ab  aab e   a   aa
ab  aab b   aa  e   a
aab b   ab  a   aa  e

Incidentally this is (hopefully) the answer to one of the questions set for this week’s homework.

Here’s the C#.NET code:

using System;
using System.Collections;
using System.Linq;
using System.Text;

namespace Groups
{
    class Program
    {
        public static string[] elements;
        public static int[,] table;
        public static int N;
        public static int depth;
        public static ArrayList simplifications = new ArrayList();

        static void Main(string[] args)
        {
            Console.WriteLine("Size of group");
            N = Convert.ToInt32(Console.ReadLine());

            elements = new string[N];
            Console.WriteLine("Group elements");
            for (int n = 0; n < N; n++) elements[n] = Console.ReadLine();

            table = new int[N,N];
            Console.WriteLine("Existing group table:");
            for (int j = 0; j < N; j++)
            {
                Console.WriteLine("row " + j.ToString());
                for (int i = 0; i < N; i++)
                    table[i, j] = str2index(Console.ReadLine());
            }

            PrintTable();

            while (true)
            {
                Console.ReadKey();

                FillTable();
                PrintTable();
            }
        }

        public static void PrintTable()
        {
            for (int j = 0; j < N; j++)
            {
                Console.WriteLine();
                for (int i = 0; i < N; i++)
                {
                    if (table[i, j] == -1) Console.Write("-   ");
                    else
                    {
                        Console.Write(elements[table[i, j]]);
                        for (int a = 0; a < 4 - elements[table[i, j]].ToString().Length; a++) Console.Write(" ");
                    }
                }
            }
            Console.WriteLine();
        }

        public static void FillTable()
        {
            // for each thing:
                // concatenate strings
                // look up if concatenation is an element. If so, done.
                // else look up from table if part of concatenation simplifies.
                // search through all simplifications until one which is an elment is found

            for (int i = 0; i < N; i++)
            {
                Console.WriteLine("now doing row " + i);
                for (int j = 0; j < N; j++)
                {
                    if (table[i, j] == -1)
                    {
                        string s = elements[i] + elements[j];
                        if (str2index(s) != -1)
                        {
                            table[i, j] = str2index(s);
                        }
                        else
                        {
                            simplifications = new ArrayList();
                            simplifications.Add(s);
                            depth = 0;
                            Simplify();
                            table[i, j] = str2index((string)simplifications[0]);
                        }
                    }
                }
            }

        }

        /// <summary>
        /// Simplifies the single element in simplifications.
        /// When done, will leave a single element simplifications[0] in simplifications.
        /// That will be the simplified string, which is hopefully an element.
        /// Told you it's a messy implementation
        /// </summary>
        public static void Simplify()
        {
            depth++;

            if (depth > 20 || simplifications.Count > 1000)
            {
                simplifications = new ArrayList();
                simplifications.Add("-");
                return;
            }

            int origsize = simplifications.Count;
            Console.WriteLine(origsize);
            string ret = "!";

            for (int q=0; q<origsize; q++)
            {
                string[] simps = simplify((string)simplifications[q]);
                foreach (string t in simps)
                    if (str2index(t) != -1) ret = t;
                foreach (string t in simps)
                {
                    if (!simplifications.Contains(t)) simplifications.Add(t);
                }
            }

            for (int a = 0; a < origsize; a++) simplifications.RemoveAt(0);
            if (ret != "!")
            {
                simplifications = new ArrayList();
                simplifications.Add(ret);
            }
            else Simplify();
        }

        /// <summary>
        /// Finds all single-step simplifications of a string
        /// </summary>
        /// <param name="s"></param>
        /// <returns></returns>
        public static string[] simplify(string s)
        {
            string[] ret = new string[1000];
            int n = 0;
            for (int startat = 0; startat < s.Length - 1; startat++)
            {
                for (int a = 0; a < N; a++) // first element
                {
                    if (s.Length >= startat + elements[a].Length)
                    {
                        if (s.Substring(startat, elements[a].Length) == elements[a])
                        {
                            for (int b = 0; b < N; b++) // second element
                            {
                                if (s.Length >= startat + elements[a].Length + elements[b].Length)
                                {
                                    if (s.Substring(startat + elements[a].Length, elements[b].Length) == elements[b])
                                    {
                                        if (table[a, b] != -1)
                                        {
                                            ret[n++] = s.Substring(0, startat) +  elements[table[a, b]] + s.Substring(startat + elements[a].Length + elements[b].Length);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            string[] realret = new string[n];
            for (int a = 0; a < n; a++) realret[a] = ret[a];
            return realret;
        }

        public static int str2index(string str)
        {
            for (int a=0; a<elements.Length; a++)
            {
                if (elements[a] == str) return a;
            }
            return -1;
        }
    }
}