Friday 29 April, 2005

Post number 200: significant?

Filed under: Numbers and stuff

My 200th post since going live on 6 July, 2004, which is only significant as we work in base 10. Roll-on my 32nd birthday :)

Robbo's in top form again with his analysis of Peter Ebdon's stall tactics against Ronnie O'Sullivan earlier in the week, along with some amusing football chit-chat.

To the extent that I can be, I've been enjoying following the progress of this year's world snooker championships, and today I discovered that the high quality of the BBC's broadband streaming makes it worthy of watching online, albeit through a VPN until Uncle Rob sorts out the long-awaited UK-based strategic solution.

Meanwhile, Pete Clifton reminded me in his weekly post of the pride I felt earlier in the week for being British (and European) at the successful test flight of the Airbus A380. The video footage was quite impressive.


Posted by dan at 4:23pm | Permalink | Comments (2) | Trackbacks (0)
Thursday 28 April, 2005

Bush's primetime address

Filed under: General

Tonight, George W. held his fourth primetime address of the nation since coming to power. His address reinforced some of the major problems faced by this country. The main purpose of the address was twofold:

- To reassure the American people that he would deal with the astronomically high gas prices
- To present a high-level plan for addressing the future deficit that social security would face.

The former of these frustrates the hell out of me. Petrol (gas) hit a record price of $2.06 in the US last May. At today's exchange rate, that equates to £1.08 per gallon, or £0.28 per litre. The current price in the UK is £0.84 per litre, 200% greater. So US fuel is in a crisis despite costing a third the price of that in the UK.

While Bush talked about renewable energy sources, by far his main focus was on working with the oil-controlling countries to increase supply to address the price crisis. Very few of the 45 minutes' questioning focused on the matters raised in the prior 10 minute address. Instead, they focused more on Iraq, North Korea, Bush's troubles among colleagues in the Washington D.C. area and the like.

On foreign policy, he never fails to disappoint me with his insular approach. He always mentions the need to address terror on foreign shores before it affects his home nation. Although Blair has his faults, I can't imagine him contemplating such a line. Meanwhile, Bush's lack of an exit strategy from Iraq was justified by proposing that having one would give the enemy an edge. This simply isn't worthy of a comment.

Finally, having talked about the need to continue to deliver against the No Child Left Behind policy, he still seems unable to pronounce nuclear.


Posted by dan at 4:59pm | Permalink | Comments (2) | Trackbacks (0)
Wednesday 27 April, 2005

American Idol

Filed under: General

I didn't watch last night's singing bit of American Idol, but just watched tonight's voting section, which featured a little bit of singing. In the main, it was dreadful.

There are now five potential idols left, following tonight's departure of New York's Constantine Maroulis. Good riddance. A B-rate soft-rock singer you might find performing on a cruise. So, who's left?

- Anthony Fedorov: the Aled Jones of the competition. He'd be a rubbish winner - weak!
- Bo Bice: real name? Can't be. The only remaining rocker following Constantine's somewhat overdue departure. Meatloaf wannabe who shouldn't be winning American Idol
- Carrie Underwood: she gets my vote. Great voice and a worthy winner; kinda sexy too, which is a bonus
- Scott Savol: absolutely dreadful. And I mean dreadful. He's now turned to wearing a baseball cap high on the head and baggy pants (American version) to appeal to the youth market, but it's just cringe-worthy from this 28-year-old. The worrying thing is that this week, he was in the top three!
- Vonzell Solomon: not bad, but not quite there - second of the bunch.

Now I know this assessment sounds sexist, but for whatever reason, the guys are just appalling. It's either Aled Jones, Meatloaf or a podgy, geeky Brian Harvey. So hopefully Carrie will pull through


Posted by dan at 4:33pm | Permalink | Comments (0) | Trackbacks (0)
Sunday 24 April, 2005

Impressive arithmetic

Filed under: Numbers and stuff

Below is an extract from an article in The Telegraph sent by my Mum. Quite impressive, although his last quote is phenomenally pretentious.

"A French computer science student has stunned the world of mathematics by working out the 13th root of a 200-digit number in his head in under nine minutes. By arriving at the 16-digit answer from 390 trillion possibilities, Alexis Lemaire, 24, pulled off the most difficult feat of mental arithmetic ever attempted. Mr Lemaire was presented with a random 200-digit sprawl on a computer and asked to work out its 13th root. The answer, multiplied by itself 13 times, would match the figure on the screen.

"Thirteenth roots are a yardstick in mental arithmetic, because 13 is a prime number whose roots cannot be obtained by combining those of other numbers. Yet Mr Lemaire appeared only mildly satisfied by his feat. At his next record attempt, he said, his brain would work even faster. 'As this was my first attempt, I was cautious.' On June 3, he will try to find the right answer in less than three minutes. In a few months, he believes that he will break the one-minute barrier. 'If I do that, without being pretentious, it will probably be the best piece of mental calculation ever,' he said."


Posted by dan at 2:32pm | Permalink | Comments (0) | Trackbacks (0)

Brothers gonna work it out

Filed under: Life

Below is a great picture, courtesy of Andy, of Ben and I at the Mets game ten days ago. I like it - a lot.

Ben and Dan at Shea Stadium to see the Mets vs. the Astros, 14 April 2005

And here's one of Elizabeth, Penny and I on Pen's birthday the following night:

Dan, Elizabeth & Penny at the Hotel Gansevoort, 15 April 2005


Posted by dan at 2:24pm | Permalink | Comments (2) | Trackbacks (0)

Me vs. Christopher John Francis Boone

Filed under: Numbers and stuff

With all of the comparisons between myself and the lead character in The Curious Incident of the Dog in the Night-Time, I decided to re-read the book yesterday, particularly given the iffy weather that has hit us this weekend. Below are the similarities, fewer than I'd imagined given the ribbing I've received.

- He knows all prime numbers up to and including 7,057. My limit is 100. Well, 97 actually
- "I like prime numbers." Me too, Christopher
- "Prime numbers are like life. They are very logical but you could never work out the rules, even if you spent all your time thinking about them." I agree, and this is one of the properties that makes them so special
- Christopher's dad goes up stairs two at a time. At school, I used to know how many steps their were in each set, across the entire school. I too took steps two at a time. However, when I went up a set of stairs (and sometimes, but not always, on the way down), I had to finish with my right foot. So if there were 4n steps in the flight, then I would start with a double-step with my left foot. If there were 4n-1 steps, I'd start with a single step with my left; 4n-2, I'd start with a double-step with my right foot; 4n-3, single step with my right. If I did that, then I ensured that by taking the rest of the steps two at a time, I hit the top with my right foot on a double-step. For some reason, my favourites were 4n-1 (usually 15)
- In the book, he refers to a system where he assigns each letter of the alphabet a number (A=1, B=2, ... , Y=25, Z=26). He then calculates a number for people's names by adding up the associated numbers. Jesus Christ (151), Scooby-Doo (113), Sherlock Holmes (163) and Doctor Watson (167) all result in primes. So does my full name (211)
- His love of the Monty Hall problem is shared by me
- When he gets uncomfortable, he calculates 2^n as far as he can go, in his head. His best effort was 2^45, but on this occasion he only got to 2^25 = 33,554,432. I used to do this too. My best effort in my head was 2^20 which is 1,048,576. On paper, I once went up to 2^100 and then came back down to 2. I remember hitting the number 33,554,432 as it seemed so regular
- He refers to seemingly random markings on London Underground trains, specifically the abbreviations BRV and Con. IC on the Bakerloo line. I remember these too - Con. IC appears on a stainless steel plate up by the air vents, if I remember rightly. I always wondered what they stood for.

They're the only similarities.


Posted by dan at 4:48am | Permalink | Comments (1) | Trackbacks (0)
Saturday 23 April, 2005

The Hudson

Filed under: Life

As of Monday, I will not be responding to email or phone calls after reading this article.

Great to see that Alan was successful in the London Marathon last Sunday, both in terms of getting round the course and the amount of money raised. As Spencer rightly pointed out, I'm somewhat dismayed that there weren't regular blog updates every mile, on the mile, given his penchant for technology. The lack of an update until late Tuesday prompted me to get the information myself.

It's been quite a quiet week, following a week of revelry associated with Ben's visit and Penny and Patrik coming over too.

It seems that the Queen Mary 2 is a little more reliable than the subway trains, it making its third passing (to my knowledge) yesterday evening. It sets sail from the west side at 5pm each Friday, getting down to our place around 6.30pm. Earlier in the week (Monday), the Norwegian Dawn sailed past the office (which is on the other side of the river from our apartment) at a similar time, following the freak storms that had hit her the previous Saturday.

It's nice having a view over the river. Sail boats, canoes, rowing boats (of the Oxford vs. Cambridge genre) water taxis, ocean liners, tugs, ocean-going barges all wend their way past our window, up and down the Hudson. Meanwhile, light aircraft, helicopters and once in a while the Goodyear Blimp fly above them. It's pleasing to see the river being used so much, and it's soothing to watch the various craft as they ferry tourists, workers, funseekers and the like from A to B.


Posted by dan at 5:39am | Permalink | Comments (0) | Trackbacks (0)
Thursday 21 April, 2005

Free iTunes with Pepsi

Filed under: General

Pepsi has signed up with Apple to offer a free iTune (is that the singular?) with every third bottle of Pepsi, Diet Pepsi and Mountain Dew. Simply open the bottle, and check under the cap to see if you've won. Or else, tilt the bottle at the correct angle before purchasing, and buy a winning bottle. I've won seven so far.


Posted by dan at 2:20pm | Permalink | Comments (0) | Trackbacks (0)
Monday 18 April, 2005

Pope Idol?

Filed under: Random thoughts

I was thinking the other night - instead of the cardinals all going off into the Sistine Chapel to decide which one of them should be the next pope, why not get Cowell involved?

The branding is all there - just add an E to the original Pop Idol. Maybe the cardinals could sing a little hymn before getting slated by Simon. Catholics across the world would then text in with their choice, generating money for the church and ensuring a democratic election process.

Thoughts? Am I going to be excommunicated?


Posted by dan at 12:25pm | Permalink | Comments (2) | Trackbacks (0)
Sunday 17 April, 2005

High-functioning autism

Filed under: Life

Today, my wife mentioned that she was thinking about the book The Curious Incident of the Dog in the Night-time, about a boy with high-functioning autism. I asked her whether it was because of me (given the traits that have been commented upon all too often on this site). Her somewhat witty response was "You're not high-functioning". I think she missed the point. Ho hum.


Posted by dan at 1:30pm | Permalink | Comments (0) | Trackbacks (0)
Saturday 16 April, 2005

Mets and friends

Filed under: Life

We went to see the Mets on Thursday night, which was great, albeit ridiculously cold. The weather has certainly taken a turn for the better over the last few weeks, but sat in Shea Stadium for over three hours was brass monkeys cold. Thanks to Andy, and in turn his employers, for the tickets.

The Mets looked like they were going to lose, but took control in the 7th giving them a 4-3 win over the Houston Astros.

I love style guides. The peripheries of the English language are subject to a certain degree of interpretation, and a style guide intends to define how this interpretation should be made in a consistent manner. Here is a link to a portion of the BBC News style guide, linked to from Pete Clifton's regular post. The references to the Simpsons remind me of the article written by Joel Spolsky about writing specs.

Style guides could be construed as being dull, but using interesting examples that people enjoy relating to makes them more readable, digestible and memorable. As for this making them less professional in the meantime, it's a poor argument. The document (either the style guide or the spec.) is meant to be read. Make it dull, and it won't be read. Make it entertaining, and there's half a chance.

I went into a card shop to buy a card for Penny's 30th yesterday, to find out that 27 April will be Administrative Professionals Day and 6 May will be Nurses Day (both lacking apostrophes). To celebrate the foremost of these, we had a great night, starting off at the Hotel Gansevoort on Ninth Avenue and 14th Street and then moving on to a club called N/A on 14th between Seventh and Eighth. Great night, and fantastic to catch up with Penny and Patrik once again. Also good to catch up with Elizabeth after so long.


Posted by dan at 6:56am | Permalink | Comments (0) | Trackbacks (0)
Thursday 14 April, 2005

Serial iPod-filling

Filed under: Random thoughts

I saw a lady this morning eating her morning donuts on the subway out of a bag branded Twin Donuts: World's Best Coffee. I wondered where to find it. I must pop along some time. There don't seem to be the same laws here about superlative advertising, and comparative advertising is commonplace - Subway's big deal at the moment is comparing the grams of fat with McDonald's.

As everyone will be aware, there's a whole hoo-ha (sp.) going on at the moment about downloading and sharing music. Yesterday there was an article on the BBC's site about this Sunday's UK music chart including download statistics, which I see as a good thing. However, I've often wondered what the legal situation is for people who move from one relationship to another. Generally, when you're in a relationship, there's a lot of CD-sharing that goes on, but as CDs are physical items, they could easily be returned if the relationship were to end, the result being that only one of the two parties would end up with the CD. iPods and the like throw this up in the air.

It's certainly perceivable that during a relationship, each party uploads a bunch of the other's choons to their iPod, thus duplicating the music. As far as I'm aware, this is entirely legal. (Andy?) If the relationship turns sour, is each party obliged to remove all of their ex's tracks from said iPod? Are there people out there who move from relationship to relationship filling up the 10,000 tracks at their disposal as they go? I was just wondering.

One annoying thing about the 1.0 upgrade is that for some reason, two spaces are deemed to be a user error and one is deleted. This is annoying, as I actively put two spaces after full stops. Rob - anything you can do about this?


Posted by dan at 3:22am | Permalink | Comments (2) | Trackbacks (0)
Wednesday 13 April, 2005

Chumley's, James Lipton, plog upgrade

Filed under: Life

We went to Chumley's last night with Ben, Andy and Jem, a prohibition bar set back from Bedford Street near the junction with Grove Street, in the area of New York that really confuses me with its street layout - Greenwich. Quite a cool place, surprisingly busy given the obscure entrance. Spotted James Lipton leaving shortly after our arrival, famed for the horribly sycophantic, if quite amusing, Inside the Actors Studio. The other notable spot of the night, apart from Andy's earlier alleged sighting of Maria Carey, was the corner of Bedford Street and Grove Street, purportedly the corner on which the Friends' apartments are situated.

Rob kindly upgraded me to Plog 1.0 last night. One small bug with images (thanks to Mr. Johnston for the spot) has been resolved by some nifty footwork by the boy Rainton. The delivery side sees few changes, as far as I can tell, but the content management interface is a lot slicker - take my word for it. Still a shame that the typeface that appears in the rich text editor into which I'm currently typing is Times New Roman, possibly the worst web-based font known to man - if they outlawed it tomorrow, I wouldn't blink! Apart from a more seamless user interface, it allows me to assign posts to more than one category, which is nice.

There was a slight difference of opinion (as Tarby would've said in Winner Takes All) the other day, with respect to the spelling of skeptical (sp.). My mum was adamant that it was sceptical. While I don't disagree, I'm of the view that it's an either/or. Not sure whether there is an American/English slant on this one?


Posted by dan at 4:44pm | Permalink | Comments (0) | Trackbacks (0)
Monday 11 April, 2005

Pictures...at last

Filed under: Life

I've received a few complaints during my nine months' blogging about the lack of pictures. The main reason for this is my lack of a digital camera. The most vocal of the complainers has been Rob, who generally spanks off a few hundred seemingly identical shots and proceeds to post them all. My favourite such examples are when the alt tags are identical for each photo. The alt tags (which appear when you hover over the picture) cleverly tell you what the picture is and what the next picture will be, which becomes redundant, albeit quite amusing, in the likes of this example.

Anyway, by popular demand, here are some photos. Unfortunately, they're pretty grainy. I'm going to take the disc back to the developers to see whether they can improve the quality, as the originals are way better. In the meantime, enjoy. Click on the photo to see a larger version.

Up the Westside highwayQueen Mary 2 at sunset on the HudsonAn old pier on the Hudson

Ice on the HudsonIce and The Gates in Central ParkNo skateboarding, no 'blading

The Queen Mary 2 was taken yesterday evening, as she sailed majestically past our window for the second time in as many weeks. Quite a beautiful ship, and it's an honour for her to sail past our window.


Posted by dan at 4:13pm | Permalink | Comments (2) | Trackbacks (0)
Sunday 10 April, 2005

Conversations with Rob

Filed under: Life

Conversations with my ISP (Rob) are phenomenally frustrating, but also, quite amusing.  Below are some edited highlights of tonight's bout (expletives have been removed) for your amusement.  In French, the you (tu vs. vous) defines how many people you're referring to (one or more than one).  In English, it's nice that I don't have to assume my audience size.

Topic: Sudoku spreadsheet
Rob:
U fixed your spreadsheet yet?
Rob: It's riddled with bugs
Rob: Clearly not written by a developer
Me: it's not riddled with bugs
Rob: Sure it is
Me: give me one bug!
Rob: No input validation
Me: that's not a bug - it's a feature that is not there
Me: a bug is something that was meant to be there that either isn't there or doesn't work properly
Rob: The spec should have said, 'The user is to enter a number between 1-9'
Rob: Any decent coder would have implemented a check
Me: it's an enhancement, not a bug
Rob: Either way - you are responsible for both spec and code, so it's all your fault!
Me: w-h-a-t-e-v-e-r
Rob: No pride in your work.... tut, tut
Me: I'm proud of it
Me: u should do motivational speaking
Rob: LOL

Topic: some 100k bike race in Australia
Rob:
I did this: http://www.maxadventure.com.au/dirtworksclassic/
Rob: 100Ks... 2100m vertical 7:27 in the computer, 8:40 elapsed :)
Me: what?
Rob: It's a mountain bike race... kind of like a marathon... over 100Kms
Rob: There's 2100m of vertical climbs in there for fun
Me: so what does "7:27 in the computer..." mean?
Rob: Up as well as down... that's like cycling up Ben Nevis and back 1.5 times
Rob: 7:27 on the computer... the time the wheels were moving
Me: u mean 7:27:00, right?
Rob: No... I cycled 100Kms in 7 minutes
Rob: I had a jet in my ass
Me: so how am i meant to know what 7:27 means - i read it as 7m27s and thought: "he's a retard"
Rob: I thought you would realise I can't be talking about minutes and seconds in relation to going 100Kms
Me: get your time units right - don't blame me - communication problems are almost always the fault of the communicator (as opposed to the listener) - especially when you use inconsistent time units
Rob: LOL
Rob: How on earth is 7:27 not 7 hours just 'cos there's no :00 on the end
Rob: Your interpritation [sic] is wrong 'cos you can't comprehend context of the conversation
Rob: It's like, you can ask someone the time, they say, '20 past'
Rob: You are assumed to be on the same planet and realise what hour it is
Me: so if u swam somewhere in 7m27s, how would you write that?
Rob: Hmmmm... no... I would say I can swim about 400m in 7:27
Rob: 'cos it's clearly not hours when we're takling about 400m
Me: oh, so u can swim somewhere in 7:27 and cycle somewhere in 7:27, but these mean different things.  i get it - u're a moron!
Rob: No... it's your interpritation [sic]
Rob: And I know that's spelt incorrectly
Rob: But I don't give a hoot [editor: changed so as not to offend limited readership]
Me: so leave nothing to interpretation
Rob: When you talk to baboons clearly this is not a good idea
Me: have u ever been wrong in your life?  ever?
Rob: Not in a conversation with you
Me: i'm meant to know what "100Ks... 2100m vertical 7:27 in the computer, 8:40 elapsed" means - you're having a laugh!
Rob: Well... I explained it's a mountain bike race, and not a knitting pattern


Posted by dan at 5:12pm | Permalink | Comments (4) | Trackbacks (0)

Fiery Furnaces

Filed under: Life

Went to see the Fiery Furnaces last night at Webster Hall on 11th Street with Ben, Andy, Sarah and Jem.  I think I'd heard of them before, but wasn't sure what to expect.  So we listened to a couple of their tracks back at Andy and Sarah's place by way of introduction in advance of the concert.  At first I was skeptical.  The first track played started off very similar to Ross's experimental keyboard work in Friends - not in a good way.

Anyway, although we arrived a little late, I have to say it was a great gig.  Good venue, busy but not heaving, and even though some of the tracks were a little odd, on the whole I thought the music was great.  Eleanor Friedberger, the lead singer, was enthralling, both with her unusual vocals and her slightly haunting stare.  She also came across as being really nervous, which I felt went towards bettering her performance, oddly enough.

While trying to find a cab to take me home, I was asked by a bunch of drunken girls whether I'd like to drive a cab for them.  A slightly odd proposition, but there certainly was a driverless Town Car idling at the side of the road, towards which they were beckoning me.  Not sure where they were headed, but I felt it better for them to wait for a more suitable driver, one comfortable with an automatic left-hand drive, and one sufficiently sober to get them where they needed to go.

It was great to see Ben again, complete with Samsonian hair - his hairdresser's maternity leave has meant that he has not had a haircut since May 2004.  It seems that the weather has broken just in time for his arrival - blue skies and temperatures in the 60s all weekend, with a similar forecast throughout next week.

While walking down Chambers Street this morning, there was a Ford Mustang sat at the lights ready to go north up the Westside Highway.  With the windows down and a lone guy in the car, Irene Cara's Flashdance was blaring out of the stereo.  Somewhat surreal.


Posted by dan at 7:33am | Permalink | Comments (3) | Trackbacks (0)
Friday 8 April, 2005

Lock your lockers - solution

Filed under: Numbers and stuff

So, yesterday I posed a little conundrum, inviting readers to comment to solve it. Either my audience base is (a) too small to generate a single comment, (b) too low-brow for such fripperies or (c) scuppered, such is the lack of feedback shown. Anyway, here's the solution.

With 100 lockers and students, the answer is 10. If there were 10,000 lockers and students, then 100 lockers would be open at the end, although trying to coordinate so many students and making sure there were no renegades flouting their responsibilities may affect the outcome.

It took me a while (and a bit of prompting) to figure it out, but I finally got there. You see, each locker has its state changed by every one of its divisors. So locker twelve's state is changed by students one, two, three, four, six and twelve. For the majority of numbers, their divisors can be paired off: in this case 1 x 12, 2 x 6, 3 x 4. The only numbers for which this isn't the case are perfect squares. Take 36, for example. 1 x 36, 2 x 18, 3 x 12, 4 x 9, 6 x 6. And here's the beauty. Because the six multiplies by itself, it only counts once as a divisor - it has no partner, bar itself. So, 36 has nine divisors (odd) as opposed to twelve which has six (even). The broader lemma is that perfect squares have an odd number of divisors; all other numbers have an even number. Poetry.

So going back to the 100 lockers, those that are perfect squares (1, 4, 9, 16, 25, 36, 49, 64, 81, 100) will be opened/closed an odd number of times (and thus end up open), while all others will be opened/closed an even number of times (ending up closed).

The square root of a number indicates how many perfect squares there are up to and including that number. So if there are X students and X lockers, then at the end of the day, there will be rounddown(X^0.5) lockers open - i.e. the square root of the total, rounded down to the nearest integer. If there are 10,000 lockers, then there'll be 100 open at the end. 10,010 will yield the same result.

I like the puzzle, because at first, it seems pretty complicated. But applying some maths to it shows that the answer's pretty simple.


Posted by dan at 6:13pm | Permalink | Comments (1) | Trackbacks (0)
Thursday 7 April, 2005

iPod batteries and buses

Filed under: Random thoughts

Occasionally, I forget to charge my iPod overnight, and have to rely on the battery to get me through a second day's listening. The alternative would be to take my charger-the-size-of-a-small-house-what-with-the-UK/US-adaptor-and-all into the office, which would do my back in.

In the main, the battery will fail me somewhere on the way home on day 2. As I've mentioned previously, my listening behaviour has changed a little since suffering the battery issues, as I rely more on playlists than my preferred "let's see what random has to offer". However, there's an awkward conundrum that goes through my head. When a tune that I'm not that bothered about comes on, at what point (if at all) does it become more expensive (battery-wise) to press "next" than listening to the song in its entirety. (I'm pretty sure that skipping within the first 10 seconds of a track is expensive, btw, as the iPod hasn't had a chance to cache any of the subsequent track.) I also have to weight up the trauma of listening to the track against the alternative of skipping it only to find that my battery dies as a result.

It reminds me of the bus conundrum. If you're sitting at a bus stop, should you start walking towards the next/previous bus stop to get some exercise/increase your likelihood of getting a seat (at the risk of a bus zipping past you on the way) or should you stay put? Often the decision (both on this and on the iPod scenario) to move on is made too late to be beneficial. By delaying the decision, the battery life has seeped in the meantime and the bus is more likely to disappoint you. Imagine the disappointment of being wrong on both fronts at once!

On a separate note, the best "proud to be British" walking in New York songs are (in no specific order):

- Blur: Girls and Boys
- Charlatans: North Country Boy
- Seahorses: Love is the Law.


Posted by dan at 11:03am | Permalink | Comments (4) | Trackbacks (0)

Lock your lockers

Filed under: Numbers and stuff

Assume there are 100 lockers lining one wall of your traditional American high-school corridor. All of them are closed. Now you have 100 students. Student number 1 goes along the wall opening every locker whose number is divisible by 1 - i.e. all of them. Student 2 then follows him/her, closing all of the lockers whose numbers are divisible by 2 (i.e. every other locker). And each student follows in turn, changing the state of the lockers whose numbers are divisible by their name-tags (opening any that are closed, and closing any that are open).

How many will be open when the 100th student is done. What would be the answer if there were 10,000 students and 10,000 lockers?

Answer tomorrow, unless someone posts the response beforehand...


Posted by dan at 9:17am | Permalink | Comments (0) | Trackbacks (0)
Wednesday 6 April, 2005

Sudoku - solved

Filed under: Numbers and stuff

A couple of days ago, my dad sent me a Sudoku puzzle by email. My mum had previously sent a few in the mail, but I never got round to doing them. Anyway, second time of asking, I tried it. Here's the deal. You're given a partially complete 9x9 grid. A number, between 1 and 9, needs to go in each of the 81 squares. Each column must contain one instance of each of the numbers 1 through 9. The same is true for the rows. And each of the nine mini-3x3 grids must also contain one instance of each of the nine numbers. For those of you who buy the Sunday Telegraph, it's a numerical answer to the Nonogram (née Griddler). Below is the one my dad gave me:

* 7 * 9 * 8 6 1 *
* * * * * 3 * * 2
9 * * * * * 3 * 7
* 9 * 3 * * 7 6 *
* * * * 9 * * * *
* 5 4 * * 1 * 9 *
2 * 9 * * * * * 3
8 * * 5 * * * * *
* 1 6 2 * 4 * 7 *

As is my wont, I resorted to Excel, rather than scrawling all over a piece of paper - no coding, it just has a handy grid system, don't you know. I did it in about 40 minutes total, having made a mistake first time around. Then I decided that it would be a fun challenge to write a program to do them for you. Here it is. And you guessed it, Excel again!

Basically, you type in the numbers that you know in the top grid (starting with the ones that you're given). The bottom grid tells you what the alternatives are for the remaining blank cells. (Initially, they all show all of the numbers, as the top grid is blank.) When there's a dead cert., the cell goes orange, prompting you to enter the number in the top grid.

In the above example, there was only one moment when the logic wasn't enough. To get beyond this point, you had to play out a couple of moves forward in your head to see which alternative didn't break the above rules. Before and after that, it was plain sailing all the way. As you put more data in the top grid, the bottom one prompts you with more dead certs.

If anyone wins what is undoubtedly a Du Pont pen (the standard Telegraph prize) off the back of this, please send it my way :)


Posted by dan at 4:59pm | Permalink | Comments (4) | Trackbacks (0)
Sunday 3 April, 2005

vi and dates

Filed under: Tech. stuff

Sorry Joost, but vi sucks.  I just asked my ISP (Rob) how to edit the date field that appears just below the title of each 'blog entry.  For a long while, it didn't appear at all - it wasn't included in the template I downloaded.  So I asked Rob to add it.  Being a tech., he followed the directions perfectly, but being a tech., he also didn't care so much about the date format - it appeared as "Posted by dan @ Sunday April 3 2005 12:34" - just a long string of unpunctuated text and numbers, the @ sign being incongruous with the subsequent date.  So, I decided that I needed to change it.

Directed through putty and puttygen, I eventually got a Unix command line prompt.  How do I edit the file?, I asked, eliciting the response Use vi.  For those not in the know, vi is a weak Unix-based text editor.  Joost used to use it (may still do) to edit the controller files for the search engine that we used to use for Directgov and DH.  Having become used to PC-based editors (my favourite being UltraEdit), vi is akin to a secretary having to resort to Word Perfect or myself having to resort to Lotus-1-2-3 for DOS.  After around 12 attempts (when I went wrong, my only safe course of action was to type :q! in order to back out and start again), I finally sorted it out, the date now appearing as follows: "Posted by dan on Sunday 3 April 2005, 12:34".

American dates really confuse me.  At first, I thought that the abbreviation of 11 September 2001 as 9/11 (said nine-eleven) was a one-off, giving a convenient tag to this horrific event.  (I once heard a woman on a talk-show refer to it as 9-1-1 which I thought despicable.)  This is not the case.  In business life, people refer to dates in exactly the same way - six-one is 1 June, my birthday would be seven-nineteen.  It's particularly confusing at the end of the month when people refer to 3/30 and you look at your watch.  For me, dates where the day is less than or equal to twelve are cumbersome to process.  When someone says 4/6, my immediate reaction is to think of 4 June as opposed to the 6 April that they meant.  The fact that they flip the month and day around has been the single-most difficult adjustment I've had to make in the business world.

When they do write the date in full, they put the month first, followed by the day and then the year.  April 3, 2005, for instance.  The fact that the two numbers appear together grates with me hugely.  There's something beautiful about the month separating the two numeric fields, in my humble opinion (3 April 2005).  While I have no option but to accommodate people giving me dates in the M/D form, whenever I publish them, I always use the longhand, using the month as the separator for its neighbouring numbers.  That way, I'm happy and no one is confused, least of all myself.


Posted by dan at 3:21pm | Permalink | Comments (6) | Trackbacks (0)
Saturday 2 April, 2005

Work, pool, football

Filed under: Life

It's been a frustrating and tough week at work. The EDT analogy of a little man pushing a big rock up a never-ending hill sprung to mind a number of times. Sometimes, doing the right thing appears to be the wrong thing to do.

It appeared that the wintry weather had broken, as temperatures have become positively balmy over the last few days. However, just as the weekend kicked in, the heavens opened. A weekend of rain is forecast. Fortunately, it held off last night when I went out with Andy to play some pool at Corner on Fourth Avenue and 11th Street. I welched out early with a kicking headache which has drifted into Saturday, but enjoyed some good pool on a great table in the meantime.

The Schiavo case and the Pope's imminent death have dominated the headlines here this week. George W. Bush (read point six in the link) and his brother Jeb getting involved in the former was out of order; similar, I feel, to the UK Home Secretary getting involved in sentencing decisions on high profile cases. The law of the land is there to deal with these situations, and the appointment of legal professionals to ensure that this law is followed is only undermined by interference from the centre. It's somewhat ironic that the religious angle of the Schiavo case has stressed that human life should be maintained at all costs. Meanwhile, with the Pope suffering organ failure, he has opted not to go back to hospital for further treatment. Unfortunately, Terri Schiavo did not have the luxury of making that decision herself.

Keiron Dyer and Lee Bowyer bolstered the hypothesis that all footballers are thugs today. Both playing for Newcastle, they came to blows during their 3-0 defeat at the hands of Aston Villa, the result being a nine-man team. More significantly, both will miss the FA Cup semi-final against Man. Utd. in two weeks' time.


Posted by dan at 7:09am | Permalink | Comments (0) | Trackbacks (0)
Thursday 31 March, 2005

March - top search strings

Filed under: Random thoughts

I wanted to share three strings that people typed into search engines in March before being directed to this site:

- 2005 news a new born baby being born with teeth hair and weight
- did jacqueline onassis write two books from her dog's' [sic] point of view
- duodecimal excel

Not surprisingly, none of these was searched on more than once, but all directed people to my site...


Posted by dan at 4:49pm | Permalink | Comments (0) | Trackbacks (0)