It’s been over a year and I still feel the urge to hop on the 84 whenever I see one.
(from Twitter, by txt)
I'm Rory Parle, an Irish software engineer living in London.
It’s been over a year and I still feel the urge to hop on the 84 whenever I see one.
(from Twitter, by txt)
If you watched the video of Randall Munroe at Google you might have heard him mention a site called Project Euler. It’s a cool collection of short but interesting mathematical problems that are intended to be solved with a computer. That said, there’s nothing stopping you from using good old practical mathematics.
The most solved puzzle on the site is this one:
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.
Now, this didn’t look to me like a computer was required to solve it, so I nibbled the end of my pencil for a second and came up with the following solution:
There will be 333 numbers in that range which are divisible by three (every third number, so a third of the total). There will be 199 numbers in that range that are divisible by five (every fifth number, and a fifth of the total—it’s 199 rather than 200 because the top number, 1000, is excluded).
Now I don’t know offhand a way to calculate the sum of the first 333 numbers divisible by three. But I do know offhand a way to calculate the sum of the first 333 numbers. It’s 333 × 334 ÷ 2. Is that any help? It turns out it is. Consider the first five multiples of three: 3, 6, 9, 12, 15. The sum is 3 + 6 + 9 + 12 + 15 = (3 × 1) + (3 × 2) + (3 × 3) + (3 × 4) + (3 × 5) = 3 × (1 + 2 + 3 + 4 + 5). That is, it’s three times the sum of the first five numbers. By the same reasoning, the sum of the first 333 multiples of three is equal to three times the sum of the numbers from one to 333, or 3 × 333 × 334 ÷ 2.
Applying the same reasoning again, the sum of the first 199 multiples of five is five times the sum of the first 199 numbers, or 5 × 199 × 200 ÷ 2.
There’s one more piece: in adding up all the multiples of three, and all the multiples of five, I’ve included some numbers twice. There are some numbers that are divisible by both three and five, i.e., those numbers divisible by fifteen. There are 66 of these, from 15 to 990 (again, by taking 1000 ÷ 15 and rounding down you get 66). So the total has to be reduced by 15 × 66 × 67 ÷ 2.
The final answer is: (3 × 333 × 334 ÷ 2) + (5 × 199 × 200 ÷ 2) – (15 × 66 × 67 ÷ 2) = 233168.
The easy way, of course, is:
$> python
>>> sum([i for i in range(1,1000) if i % 5 == 0 or i % 3 == 0])
233168
My attention has been drawn to the Bibliochaise, a chair with convenient enclaves capable of holding (I would guess) hundreds of books. Build in a mini fridge and a commode and I’d never have to leave it.
Now to figure out a complicated sorting system that keeps my favourite books as accessible as possible but separated enough that My arms don’t collide while reaching for them.
Randall Munroe, creator of the world’s best web comic xkcd, visited the Googleplex in Mountain View recently. Apparently they baked him a cake shaped like the Internet. Watch it all, but especially check out the Google Doodle he does at the end.
If Ireland had cool people like this they might come visit me in Dublin…
When you’re asked to “keep things cheerful” by someone who’s brought as much joy to your life as Terry Pratchett has to mine, you damn well keep things cheerful. So there will be no solemn post here lamenting his recent diagnosis with early onset Alzheimer’s. Instead, a celebration of the fact that “there’s time for at least a few more books yet.”
Was that Rémy the rat from Ratatouille that you saw in the background of Toy Story 2? Well… probably not. But there are plenty of callbacks and cameos in the collective works of Pixar, from the overt to the barely visible. Jim Hill has quite a comprehensive (or at least very long) investigation of the studio’s self-reference.
Hill goes into impressive detail, even citing the appearance of the birds from For the Birds in Cars. Said appearance lasts only a tenth of a second.
Monday, 10 December 2007 was Human Rights Day, the beginning of a year-long celebration (of sorts) leading up to 60th anniversary of the Universal Declaration of Human Rights on 10 December next year. Celebrate. Go out and enjoy your life, liberty and security of person.
A quote from Merlin Mann:
It seems like people start out with the idea that they are going to make stuff for the Internet and then they kind of figure out what the content is gonna be. This is not dissimilar from what I’m doing.
How true is this of almost any of us on the Web? We’ve pushed ourselves up onto the stage and now we’re standing about wondering what it was we were so desperate to talk about.
The quote comes from The Merlin Show, episode 19.
Worried that the Writers Guild of America strike is going to impact the quality of movies next year? Relieve your fears with this list of finished scripts that have yet to be made: the hottest unproduced screenplays of 2007.
I like the sound of I Want To F— Your Sister:
Lawyer-turned-screenwriter Melissa Stack’s high-concept comedic spec screenplay about “a young man goes to great lengths to protect his younger sister from guys just like him.”
It’s probably going to have to see a name change before it actually becomes a finished film though. There are some classier ideas on the list too if you’re into that sort of thing.
I guess Malcolm Gladwell’s new book is coming along nicely, as he’s back blogging intermittently. Today he continues a recent theme of the relationship between race and intelligence quotient, though the post is more about economic status than race. He quotes the psychologist Richard Nisbett:
Most estimates of heritability have been based almost exclusively on studies of middle-class groups. For the poor, a group that includes a substantial proportion of minorities, heritability of I.Q. is very low, in the range of 10 percent to 20 percent.
This is a fascinating point, which I expect man people (me included) wouldn’t have thought to look for. Here’s what it means, to my understanding:
Inheritance is a strong component of IQ for most middle class people (the article suggests 60–80%), indicating that most of us will measure around the same IQ as our parents. There’s still an important percentage that’s going to be determined by our environment, but for the most part we’re going to achieve something close to what our parents did. This is reversed for poorer people. For them the strongest determining factor is environment, with inheritance making up the smaller portion.
This result would seem to imply that we have all the more reason to focus educational support on the disadvantaged areas of society. That’s where we get the most bang for our buck.