Please visit my new campsite listing site ukcampingmap.co.uk


Archive for the ‘Vaguely highbrow’ Category

Junior’s a programmer now

Saturday, April 11th, 2009

I didn’t take the traditional route to my present career. After graduating in maths I knew I didn’t want to take the obvious route of becoming an actuary or accountant as maths, contrary to popular belief, is nothing remotely to do with adding up (although, in hindsight I reckon being an actuary might be fairly interesting, but you still have to mix with graduate training scheme types).

So many years later, after leaning web-wards through a series of charities and lower jobs, I find myself a reasonably competent web-developer.

But I still have a lot to learn and the book I’m reading (Deep Simplicity by John Gribbin) is proving to be a great source of ideas to stretch my programming legs. Making websites is all well and good, but the examples of complex systems emerging from simple rules, and the constant talk of computer models, has given me the impetus to stretch my abilities to making convoluted programs to model certain behaviours.

The first one I’ve attempted is the following scenario:

You have N buttons and an unlimited number of threads. You pick up 2 buttons and connect them with a thread, and then do this repeatedly.

So I wrote something to produce a graph of interesting things to keep track of during this process.

It’s also given me the idea for a jQuery plugin

The Da Vinci formula

Friday, April 3rd, 2009

I’m a little bit of a literary snob. Not the full-blown version that will name drop obscure french authors into conversations about chips, but I do take a certain pride in picking books that are stimulating and not just light entertainment.

The Gaudi KeyA few months ago I was at Victoria train station when I came across  a table full of books called The Gaudi Key. I have no idea how similar to The Da Vinci Code the book’s plot or characters are, but I could hardly believe the unashamedly formulaic title, not to mention the cover design. The Da Vinci Formula seems to be:

Call the book “The [insert mediterranean artist (or Teenage Mutant Ninja Turtle) name] [insert synonym for mystery or puzzle]“, and try and make the cover look a bit like an old manuscript.

Confirmed today by my finding a book called The Trudeau Vector. Now, Trudeau isn’t a renaissance figure, and a vector isn’t a synonym for riddle so I’ve had to modify the rule a little to:

Call the book “The [insert renaissance figure (or Teenage Mutant Ninja Turtle) name, or anyone who people might vaguely have heard but not from Big Brother] [insert synonym for mystery or puzzle, or any sort of impressive cerebral sounding activity]“, but do make sure the cover looks a bit like an old manuscript as this is the important bit.

Needless to say I rejected it in favour of an excellent popular science book called Deep Simplicity (which could, quite reasonably, have been titled “The Poincare Formula”. I’ve read it before, but I just fancied some light entertainment during this balmy Dutch heatwave.

How to spot an obvious idea when you’ve got one

Wednesday, April 1st, 2009

I did say, and I quote:

Now, somebody has probably already done this, but I’ll throw in my twopenneth anyway.

with respect to finding analytical function for the logic gates. But, lo and behold, I’m the top result in Google for it, and no-one else seems to have thought of exploring this before.

So maybe it’s not so obvious as I thought.

Front paged on Google…

Monday, March 30th, 2009

for “Where’s the maths”

Haha

Also somebody got here, probably on a serious search, looking for an analytical function for xor gate.

Finally, this is an unrelated rant, but I just found out from a guy I was hoping to sublet from has had to turn me down as the girls he lives with wanted another girl. This despite the fact that they hadn’t met me, and he told me the only girl to view the room seemed a bit weird, and he would recommend the girls plump for me.

Well screw them* – I hope they get a bunny-boiler.

* I’ve been watching rather a lot of South Park lately. For free. online. legitimately. What nice people.

Logic 2.1.1

Tuesday, March 24th, 2009

Further discussion on the logic functions with my good friend Matt, specifically regarding what they could mean, has landed on the idea that a value of, say, 2 or 3 for the truth of a statement X could equate to “X is sooooo true”.

Bearing this in mind, Matt wasn’t happy with the shape of the graph of =>, and further thought has led to the following necessary conditions for a function =>(x,y) (I’ll call it f from now on for ease of typing) which works well with the notion that something can be soooo true:

  • f(x,1) –> 0.5 as x –> infinityx (so if something very true implies something else is true to a normal level, this means the implication is less a preserver of truth: more a diluter (though I set the asymptote as 0.5 as we thought it shouldn’t get closer to falsity than to truth)
  • f(x,0) < 0 for all x > 1 (if x gets more true but y is still not true, then teh implication is, again, less of a truth preserver, though this is debatable. Maybe eqality with zero would be more appropriate.)
  • f(1,y) –> infinity as y –> infinty (similar to the case where x varies and y = 1,  if 1 is immensely true despite x only being a little bit true then the implication is very strongly true)
  • f(0,y) = 1/y for all y > 1 (the thinking here being that if y contiinues to get more and more true, despite no change in x, then the link between y and x should accordingly be weakened)

logic 2.1

Monday, March 23rd, 2009

I have, as promised, found a better form for XOR:

  • XOR(x,y) = x + y -2xy

As I sit here chomping on a chicken wing, I can’t help but feel a touch of disappointment alongside the inevitable satisfaction at completing my mission. The previous solution – XOR(x.y) = (1-xy)(x + y) – was, I feel, more elegabt; the fact we were dealing with x/y symmetry, and that x and y could take only the values 1 and 0, seemed to almost leap out.

Talking of symmetry – I’ve just realised that I didn’t cover x => y, the only asymmetric elemental* logical operator.

So here, deduced by trial and error is the formula:

  • =>(x,y) = xy + 1 – x

I lied though. Because, of course, => is not as elemental as one would hope, so:

x => y <–> NOT (x AND NOT(y)) = NOT(x AND (1-y)) = NOT(x(1-y)) = 1-(x-xy) = xy +1 -x

Thus demonstrating the usefulness of being able to represent logical operators analytically.

Logic 2.0

Saturday, March 21st, 2009

Now, somebody has probably already done this, but I’ll throw in my twopenneth anyway.

Yesterday morning I woke feeling strangely alert, so decided to do some maths. Namely, finding analytical functions of the real numbers taht agree with the logical operators NOT, AND, OR and XOR on the values of 0 and 1, and here they are:

  • NOT(x) = 1-x
  • AND(x,y) = xy
  • OR(x,y) = 1-(x-1)(y-1)
  • XOR(x,y) = (1-xy)(x+y)

Now, the above begs a few questions

  1. Are they any use? Well, I think so. They can be combined and recombined to form an polynomial function LP: {1,0}^n —> {1,0} to represent any logical proposition, where n is the number of elementary propositions. So given the truth or falsity of all these propositions the truth or falsity of the compound statement can easily be deduced
  2. Are these the simplest analytical functions that agree with the logical operators on 1 and 0? Probably NOT, OR and AND are; they’re all quadratic or less. But XOR is a cubic expression, which is unexpected. I can’t help thinking a hyberbolic parabola – quadratic – with the relevant constants shoudl work. Will have a think. *edit – success!
  3. Can they be extended over the reals? Well, yes – they’re analytical! But a good question is ‘What is the real world interpretation of a function like this?’ Extending the factorial function over the reals has proved useful, but would extending logic to things being doubly true, trebly true, negatively true, make any sense? Search me. The functions above could withstand the insertion of a few square/cube roots here and there, thus making the graphs more linear, and maybe they would be more likely to lend themselves to a real world interpretation. But the shapes of the graphs for the non-rooted functions (and probably ones with roots taken) (see below) defy interpretation I think.
  4. What do these functions look like?

Michael Moore: Stupid white man

Monday, March 2nd, 2009

My good friend Matt has always had Michael Moore down as a bit of an idiot, but then again, he often thinks people are idiots. Sometimes for such trivial offences as not thinking.

Anyway, I took this with a pinch of salt. Bowling for Columbine is pretty decent, and what I saw of TV nation was generally both funny and right on. But it turns out that on this occasion Matt is right!

In the flat I was staying in lately there were two copies of Stupid White Men… so I took one. It’s one of the worst books I’ve ever read. Not only is the style brash, squanderingly antagonistic towards the sympathetic ear of the reader, and ineloquent, but much of the substance is… well… lacking in substance. Below are three of the most egregious examples.

New York’s water supply … is collected and stored in twenty-two open-air reservoirs in the Catskills…

an acquaintance remarked … how wonderful it is to boat on the reservoir.

“Boat?” I cried. “You’re boating in my drinking water?”

That was when the cases of Evian began entering my apartment

How much of an idiot is he? Had he presumed there existed several hermetically sealed huge lakes in the hills. And why does he care so much about people boating but not fish dying. Does this man not have reflective capacity? This extract of the book is, in fact, a  pretty good example of the short-sighted, “me me me” rich American idiocy he rails against in the rest of the book.

After the Soviet Union lost over twenty million citizens in World War II, it’s no surprise that they sought insurance against future invasion by seizing and dominating nearly every country that bordered them

Has he not heard of the non-aggression pact between Nazi Germany and Stalinist Russia which saw Russia occupy the Baltics and half of Poland right at the start of the second world war, before they lost the 20 million, and actually purely as an aggressive expansionist measure? The man’s wilful misinterpretation of history makes you wonder about his research into and manipulation of present day facts.

Thirdly, virtually the whole of the “We’re number one” chapter is idiotic and often offensive. I laugh a lot at offensive jokes, but they must justify themselves by either being hilarious or insightful. His are neither. What is the point of writing a chapter which jokingly suggests all protestants in Northern Ireland convert to catholicism, and seriously lays out high school level manifestos for creation of peace in the Balkans and the Middle East.

At the end of the book I felt appalled that, at it’s time of publication, it was seen as a provocative shining light for the American left. Thank god for the rise of the Daily Show.

Something I finally understand

Wednesday, December 31st, 2008

I’ve heard of the question about the probabililty of a second child being a boy before – it’s a standard mathematical puzzle to get you to think about conditional probabilities (similar to the Monty Hall problem)

Finally I think I understand it. I always knew there were two candidate answers – 50/50 or 2/3 – but despit eknowing 2/3 was right (or so I thought) was never completely comfortable with it. So here goes:

It’s either 50/50 or 2/3 depending on whether the parent picked the child they told you the sex of randomly or not.

If they picked it randomly and then said “hey look – it’s a girl” then the probability of a boy being left is 50-50, as the picking of the first child was independent of the sex of the second child.

However, if they deliberately picked a girl to tell you the sex of, then they are skewing the probabilities in favour of leaving a boy behind (as they have removed the possibility of picking a boy from the probability space), hence increasing the probability to 2/3.