Sound and Fury

Signifying nothing

Archive for August 2008

Comedian doppelgangers.

without comments

Steve Punt

Steve Punt

Eric Idle

Eric Idle

Steve Punt and Eric Idle, another look-a-like pair?

Well, maybe a bit.

Written by Seamus

August 25, 2008 at 6:22 pm

Posted in random

Tagged with

Python and primes

without comments

Today I spent a while reaqcuainting myself with Python and IDLE and trying the first few project Euler challenges. I decided it would be worthwhile to have a list of the first few prime numbers, that would make my job easier for several of the problems. (I don’t care if that’s cheating, I still had to make the list of primes…) So I wrote a program to find primes. It’s tremendously inelegant and probably terrible inefficient, but I’m only going for the primes under 10,000 or so. It doesn’t take long to get them. Then I decided to write something that would find the prime factors of an input. The idea is that if the number to factorise is bigger than the biggest prime in the list, it will run the “find primes” program, until it has big enough primes. Anyway, I haven’t got there yet because it’s late and my brain won’t work properly any more. But I do have a number that will give you prime factors, as long as you give it small enough inputs. To try it out, I ask it for the prime factors of the first number to come into my head: 24. [2,3]. Awesome. Now, try it on something bigger. 2400? [2,3,5] hm. Try something else 24001. Too big. 2401 [7] Whaat? What are the odds of my pick 7^4 to test a prime factorisation program. Anyway, eventually I found a number random enough to satisfy me that the thing was working…

The thing is, the whole thing kind of pulls iteslf up by its bootstraps. So if, somehow, a number that isn’t prime crept into the list or a prime was missed out, the whole thing would be invalid. Because it only checks for divisibility of numbers in the list of primes… I should write some sort of consistency check program to make sure all the numbers in the list are not divisible by any of the smaller numbers in the list.

Written by Seamus

August 24, 2008 at 10:06 pm

Posted in maths, python

Tagged with , , ,

The LaTeX figure environment

without comments

Instead of doing any proper work, I’ve been adding pictures to my dissertation. It’s a fiddly process. First, I find a Creative Commons or other free license picture (normally on wikimedia commons) in SVG format. Then I open it up in inkscape, and save as EPS. then I save another copy ar PDF. This is because latex and pdflatex like different picture formats. So, in the same folder as my mainfile.tex, I have npc.eps and npc.pdf So once I’ve done that I make my figure environment where I want the picture to appear. The environment looks like this:

\begin{figure}
\centering
\includegraphics[width=2in]{npc}
\caption{The nine point circle for a certain scalene triangle}
\label{fig:npc}
\end{figure}

If I latex-ify the document it looks for the EPS file. If I do pdflatex then it looks for the PDF file. I have discovered, through much experimentation and gnashing of teeth, that the order in which the things appear makes a great deal of difference. If the \caption is above the \includegraphics the caption appears above the figure. If below, the caption is below. Fairly straightforward. The \label has to be below the \includegraphics and \caption commands. If you put it anywhere else \ref{fig:npc} will reference the section or subsection containing the figure environment. The “fig:” thing is just a convention, it serves no functional role.

Was all this faffing about really worth it? Probably not, but it sure beats doing proper work!

Written by Seamus

August 21, 2008 at 11:51 am

Posted in LaTeX

Tagged with

I want my 90 minutes back

without comments

Aeon Flux is a dreadful dreadful film. The action is boring, the story uncompelling, the acting unconvincing. The highlight was going “Hey, is that that guy from the green wing and peep show doing an american accent?” It turns out it was. Patterson Joseph. Stick to your British accent thanks. I think what really bothered me about the whole thing was that the society Aeon Flux and her rebel associates are rebelling against didn’t seem that bad. OK, so there’s the odd disappearance, but nothing too worrying. But compared to, say, Star Wars or Equilibrium, it wasn’t a very convincing dystopia. I couldn’t really sympathise with the rebel people, because they didn’t seem to have anything to rebel against.

I watched Serenity yesterday. I had seen it before, but I felt like watching it again. It’s just as mediocre as it was the first time around. But this time I was just extra disappointed because they killed off my favourite characters from Firefly.

I think I might watch Ultraviolet tomorrow. I was fully expecting that to be the worst of the girls-kicking-ass films, but given how shocking Aeon Flux was, I hope I am wrong…

Sigh. But really I want to watch Equilibrium now. That’s how to do some good action. And Boondock Saints. I want to watch that again too. (THERE WAS A FIREFIGHT!)

Written by Seamus

August 11, 2008 at 10:37 pm

Monty Hall, philosophy links and musical look-alikes.

without comments

The solution to the Monty Hall problem (switching wins you 2/3 of a car) depends for its answer on the fact that you know how Monty will act. Other host behaviours are possible. So my question is this: what is the best strategy if you don’t know what Monty’s behaviour is? Is it different in single case vs long run scenarios? In the latter case, what about a strategy that allows you to alter your behaviour depending on Monty’s behaviour? I don’t really know how to answer these questions; I have enough trouble convincing myself of the solution to the original problem!

In other news, a couple of books by D.H. Mellor are available for free online! Matters of Metaphysics and The Matter of Chance. And more philosophy gubbins- Philosophy Bites: Bitesize philosophy podcasts. Wonderful.

One last thing. Tim Minchin and Duke Special look quite similar. They both play piano type music. But Tim Minchin is from Australia and does comedy songs and Mr. Special is from Northern Ireland and plays “proper music.”

Tim Minchin

Tim Minchin

Duke Special

Duke Special

Written by Seamus

August 11, 2008 at 5:08 pm

Why people are irrational and stupid. Part 1

without comments

So this is the first in what I hope will be a regular feature on this blog highlighting some paradoxes and thought experiments that show that people are not very good at thinking rationally. I hope to convince you that people really do suck at probabilistic reasoning and sometimes even simple logical reasoning fails. This is motivated partly by misanthropy- I think people are stupid. And partly by my fascination with these kinds of puzzles. A third motivation is that I think epistemology based on rational degrees of belief (Subjective Bayesianism for example) is flawed. Particularly in cases like quantum mechanics. But more of that in a later post. For now I’ll stick to the Monty Hall problem.

Monty offers you three doors- A,B and C. Behind one door is a car and behind the other two doors are goats. The idea is to pick the door with the car behind it because then you win the car. But if you don’t want a car, or you do want a goat, imagine that behind one door is something you really do want and behind the other two doors are things you don’t want. Like one door could be a treasure chest full of gold doubloons and behind the other two doors are scurvy. Or behind one door is cake and behind the other two doors is death. Or behind one door is Hans Christian Andersen’s The little mermaid and behind the other two doors is Katie Price’s Mermaids and Pirates. Behind one door is Battleship Potemkin and the other two doors the Pokemon movie. You get the idea.

So you pick a door. WLOG assume you picked door A. Monty now opens one of the other two doors and reveals a goat (scurvy, whatever). Now, you are offered the chance to swap doors. Should you swap doors? The answer is that yes you should. The probability of your winning a car by swapping doors is higher than if you stick with your original door. That does seem a little counter-intuitive, does it not? Surely once one of the goat doors has been revealed, there are two doors remaining and one has a car behind it. 50-50? If you are thinking that, then you are irrational and stupid. That’s not how to think about it.

Think about it this way- 2/3 of the time, the first door you pick, door A, will have a goat behind it. In those circumstances, one of door B or C will have the car (doubloons etc) behind it. So Monty won’t be able to open that door, he’ll have to open the other one. Which means switching will give you the car door. That happens 2/3 of the time… So you should always switch.

To make this even clearer, imagine there are 100 doors. 99% of the time you pick a goat door. Now Monty opens 98 goat doors. To leave you with your door and one other door remaining. So switching doors will net you a car 99% of the time.

There are two strategies. Either always switch or never switch. (OK, there are strategies where you randomly switch with probability p, but trust me setting p = 1 is optimal…) So two options. If you decide to never switch, you get the car 1/3 of the time – those times you pick the right door first time. Always switching, you’d think, would get you the car at least 50% of the time. In fact it’s even better than that. It gets you the car 2/3 of the time. Because if the only strategies are switch or don’t switch, and the only outcomes are win or don’t win; if one strategy wins 1/3 of the time, the other strategy has to win the other two thirds of the time.

Why isn’t it 50%? Because having Monty open a door tells you more about the door you haven’t picked than it does about the door you have picked. If you still aren’t convinced and think it is still 1/2, I suggest we meet up and simulate the game with playing cards, or play the card version of Bertrand’s box paradox. For money. I promise you, if we play for long enough, I will be able to buy myself a car with the money I swindle out of you. Except that I can’t drive. So I’d be looking to buy a chest full of gold. YARRR.

Written by Seamus

August 9, 2008 at 5:33 pm

Posted in maths, paradox

Tagged with , ,

Kings, Queens and meta-inbreeding

without comments

Queen Victoria was known as the “grandmother of Europe.” And her son, King Edward VII was known as the “uncle of Europe.” Christian IX of Denmark was known as the “father in law of Europe” so one would assume that his son or daughter had married one of Edward VII’s siblings and that that couple had given birth to Europe. But Christian IX’s daughter, presumably the mother of Europe was married to Edward VII, the uncle! So is she mother or aunt of Europe? Even monarchial nicknames are inbred…

Written by Seamus

August 8, 2008 at 3:19 pm

Posted in random

Tagged with , , ,

Wah wah. The internet knows my dog is called “Leeroy”

without comments

So that last post about words was not at all ranty. Here’s a proper old moan.

There’s something strange about people complaining that facebook has access to all this private data and is cynically selling it on to other evil internet type outfits. Even if you delete your profile all your information stays on their servers and can still be sold on to evil types. There are two things that are so very wrong with all this uproar. The first is that what do you care if someone knows that your favourite film is “Titanic (saw it 6 tiems n tha cinema. im obsessed lol!!!!11″ or that your favourite music is “erm, dont no really.”? So what if the ads you see are tailored to you by your web browsing habits? You’ll just ignore the ads anyway.

The second thing that bothers me about people complaining about privacy on facebook is this: IF YOU DON’T WANT FACEBOOK TO HAVE YOUR DETAILS, DON’T BLOODY WELL PUBLISH THEM ON THE FUCKING INTERNET. I mean, really. You can’t publish your phone number and home address on the internet and then hope the information remains a secret. That’s just stupid. My phone number and email address are not on my facebook profile precisely because I want to have some control over who is privy to that information. I’m happy to advertise that I liked blazing saddles and gladiator and I listen to Weezer and U2. I have put that sort of information up there because I don’t care who knows. Have some bloody common sense.

I also thing there’s a delicious irony in Facebook groups dedicated to complaining about Facebook’s privacy issues. If you’re so outraged, just delete your profile. (And email Facebook asking them to remove all your private data. You can ask them to do that, apparently)

Written by Seamus

August 6, 2008 at 1:08 pm

Posted in annoying, internet

Tagged with , , ,

Some words

without comments

Here, for your delectation is a post entirely free from bitching and moaning.

The English language is full of wonderful words. Try and use as many of these words in conversation in the next week.

  • Stentorian
  • Bellicose
  • Avuncular
  • Phlegmatic
  • Loquacious
  • Defunct
  • Zest
  • Facsimile
  • Palimpest
  • Gusto
  • Whim
  • Feral
  • Simulacrum
  • Verisimilitude
  • Daedalian
  • Crenellated
  • Banjaxed
  • Absquatulate
  • Shenanigans
  • Ragamuffin
  • Tomfoolery
  • Rascal

Some words are harder than others to drop into a normal conversation. How would you ever get to say “crenellated” unless the topic of castles actually came up? Others are easier. Rather than just leaving a pub, you could absquatulate from it. Tomfoolery is appropriate in almost any context…

Written by Seamus

August 5, 2008 at 10:37 pm

Posted in new words, random

Tagged with ,

If frog complexity is high, and bird complexity is high, then physics is doomed.

without comments

The Max Tegmark paper I mentioned in the last post is weird. There is a graph in it on page 12 to the effect that if both frog complexity and bird complexity are high, then physics is doomed. It doesn’t make a whole lot more sense if you actually put it in context either.

But what I really wanted to complain about today is toothpaste. Why are there so many kinds of toothpaste? It’s not like there’s loads of different brands there all competing: the vast majority of toothpastes on offer at my local Sainsbury’s are Colgate. There must be a dozen different kinds of Colgate toothpaste. Do I want total protection or whitening? What about the new once a week fluoride brushing thing? All I want is something that keeps my teeth clean and my breath minty fresh. Is that so much to ask? I am similarly wracked by indecision when I want to buy a toothbrush. They all look pretty similar and all do the same job. Why does there have to be such an overabundance of choice?

I have similar complaints about anti-perspirant, shampoo and shower gel. But you get the picture. Too much choice is bad for you. Fact.

Written by Seamus

August 5, 2008 at 12:38 pm

Posted in annoying

Tagged with , ,