Monday 30 June, 2008

Confidence is a preference of the habitual voyeur of what is known as...

Filed under: General, Numbers and stuff

Recently, I've started asking for people's confidence levels (from 0% to 100%) of project-related events happening. And although in its early stages, I've been disappointed by the results thus far, confidence generally being way higher than the reality.

Richard Feynman beautifully exposed the flawed methodology behind risk assessment at Nasa in his role on the commission to investigate the 1986 Challenger disaster. Nasa failed to realise (admit?) that if there are lots of uncorrelated bits of the Shuttle each with a near 100% probability of surviving the mission, each of which is critical to avoid disaster, then the probability of the Shuttle returning safely to Earth can fall unacceptably short of 100%.

The realisation of risks in projects I manage has a lesser impact. But an impact nonetheless. So I intend to keep a log of all the confidence estimates I receive (column B), together with the person whose confidence is being shared (column A) and the binary outcome of the event in which they have confidence (column C, 1 meaning the predicted event happened, 0 meaning it didn't). I figure that if people's confidence levels are true reflections of reality, then the sum of column B will equal the sum of column C. And sumifs based on people's names will identify the optimists, realists and pessimists.

=SUMIF(A:A,"John Smith",B:B)/SUMIF(A:A,"John Smith",C:C) will give me an optimism quotient for John. I can then divide any confidence percentage I receive from him by the quotient to get a more realistic view of whether the event will happen.


Posted by dan at 10:21pm | Permalink | Comments (3) | Trackbacks (0)
Saturday 31 May, 2008

Bus number

Filed under: Numbers and stuff

Is there an integer that is the unique representation of n other integers, where n is greater than or equal to 1? I guess the answer is no. If the criterion is narrowed to a number rather than an integer, would it become possible? Don't ask why—even I've forgotten why, genuinely—but I'm trying to represent sequential bus journeys in a single number. In this scenario, it could be obtained by merely stringing together three-digit strings, left-padding with zeros where necessary, given that London bus numbers are always three digits or less. And these would even be comma-separated, such is our penchant for separating numbers into three-digit chunks. But what if they weren't?


Posted by dan at 7:34am | Permalink | Comments (2) | Trackbacks (0)
Thursday 15 May, 2008

Stop the clock!

Filed under: Life, Numbers and stuff

Yesterday marked a major milestone: I finished all three The London Paper sudokus on the 87 bus journey home.

For those not familiar, each edition brings with it a simple, medium and difficult puzzle alongside one another. If I pick up a copy, I often set myself a personal challenge of finishing all three before hitting my bus stop, solving them in that order.

To gauge progress, I set myself mile stones (of the traditional roadside variety) by which I feel I have to solve each one. I try to get the easy one completed by the time I pass Brian Haw in Parliament Square (0.6km), the medium one before Vauxhall Station (a further 1.9km) and the difficult one before the end of my road (another 2.3km).

If it's touch-and-go on Wandsworth Road, it can get as exciting as Anneka Rice or Annabel Croft running from their helicopter towards a small castle watched by bewildered, aged onlookers to shouts of encouragement from Wincey Willis and words of ambivolence from Kenneth Kendall, all while a clock ticks down in the corner of the screen. Quite literally.


Posted by dan at 6:59am | Permalink | Comments (3) | Trackbacks (0)
Sunday 11 May, 2008

C to F

Filed under: General, Numbers and stuff

Whenever I need to convert Celsius to Fahrenheit, a few numbers go through my head. Five in total, including the source and the outcome. Let's call these C and F respectively.

The five numbers are as follows:

  • C
  • round(C,5)/5
  • 9*round(C,5)/5
  • 9*round(C,5)/5+32
  • 9*round(C,5)/5+32+(C-round(C,5))*2, Or F, if you like.

It's way easier than it sounds, and takes less than two seconds from start to finish. Take 16 for example

  • 16
  • 3. That's taken by rounding 16 to the nearest five (15) and dividing this by 5
  • 27. That's taking that three and multiplying it by nine
  • 59. That's adding 32 to the 27
  • 61. The 16 was bigger than its rounded equivalent (15) by 1. Times this by 2 and add it to the 59. If it was less than its rounded equivalent, then reduce it accordingly.

Its results are perfect (always correct to the nearest degree Fahrenheit), and it's a lot more reliable than the double it and add 30 estimate that works quite well for balmy weather, but gets unreliable for very hot and cold spells, and is downright wrong for oven temperatures.

  • 30C gives you 90F instead of 86F
  • 25C gives you 80F instead of 77F
  • 16C gives you 62F instead of 61F
  • 0C gives you 30F instead of 32F
  • 200C gives you 430F instead of 390F

Posted by dan at 8:15am | Permalink | Comments (4) | Trackbacks (0)
Friday 18 April, 2008

Mathematical genius

Filed under: Life, Numbers and stuff

Imagine my surprise in walking into the room to find that my daughter had arranged her new bricks in her toddle truck such:


Posted by dan at 5:58pm | Permalink | Comments (4) | Trackbacks (0)
Monday 14 April, 2008

Significant decimal "birthdays"

Filed under: Numbers and stuff

David Blaine's latest stunt is to stay awake for 1 million seconds, or a little over eleven days. It triggered me to work out other decimal birthdays.

If you're very, very lucky, you'll get 41 significant birthdays in your lifetime. Significant here means a power of ten, in either seconds, minutes, hours, days, weeks, months or years.

Your first twelve occured during your first day on the planet (one second, minute, hour, day; ten seconds, minutes, hours; 100 seconds, minutes, 1,000 seconds, minutes, 10,000 seconds), another seven before you were a month old, and a further seven up to and including your one year birthday.

Another seven takes you to your ten year birthday, including 100m seconds shortly after you're three years and two months old. Another five take you to your billionth second, at 31 years and eight months.

Thereafter, you've got to wait until you're a little over 83 years old to celebrate your 1,000th month alive. After the queen marks your trivial 100 year birthday with a telegram (or does she send an email nowadays?), you'll be lucky to hit your millionth hour, at 114 years and one month. Only six men have ever lived to that age, and only two living people, both women, have made it that far. The third, Gertrude Baines of Los Angeles, will reach that milestone on 4 May. Next up would be 100m minutes, aged 190. No one's made it quite that far.


Posted by dan at 7:49am | Permalink | Comments (0) | Trackbacks (0)
Wednesday 19 March, 2008

Many wrongs make a right

Let's assume you have some analogue clocks, all of which are set at a random time. Assuming they're all wrong by the minimum amount (i.e. if the clock is set at eleven o'clock and the actual time is 4am, it's five hours slow rather than being seven hours fast), the average of all the clocks' times will tend to the correct time as the number of clocks tends to infinity.

Nice.


Posted by dan at 3:07am | Permalink | Comments (8) | Trackbacks (0)
Saturday 8 March, 2008

Who wins the intelligent vote: Obama or Clinton?

Filed under: Politics, Numbers and stuff

Four years ago, I did some analysis of the voting of US states by their average IQ. It found that John Kerry won the 16 most "intelligent" US states, while George W. won the 26 least intelligent.

A similar analysis of the Democratic voting this time around is less conclusive. Of the 25 states that Barack Obama has won to date, the average IQ ranking is 24.6, compared to 21.7 for the 16 that Hillary Clinton has won. (The averages for Bush and Kerry were 34.7 and 10.5 respectively in 2004.)

Obama won Connecticut, the "most intelligent" state, the next four intelligent states being taken by Clinton (Massachusetts, Jersey, New York and Rhode Island). The top ten for which elections have taken place have been evenly divided between the two candidates.

At the bottom end, of the states whose elections have taken place, Obama has won the four least intelligent states (Utah, Idaho, Wyoming, South Carolina) and seven of the bottom ten.

Obama now needs to walk away with at least 44.5% of the remaining delegates to reach the 2,025 winning post, this being the lowest this figure has been in the entire election. Should be an exciting run home.


Posted by dan at 5:43pm | Permalink | Comments (2) | Trackbacks (0)
Tuesday 4 March, 2008

The Tenby Ten

Filed under: General, Numbers and stuff

A friend from work today pointed me to tenbyten.org, a site designed to surface 100 identically-sized pictures every hour (displayed in a ten by ten rectangle) that best summarise the news of that hour, each with a short news snippet available on clicking the picture. (On first reading the url, I thought it might be a site dedicated to ten wrongly tried people from South Wales.)

His proposal to me was to develop an algorithm that could use the relative traffic of the pictures to determine their relative size, and to display them similarly as a continuous rectangle, complete with edges smoth as a jigsaw.

It's a conundrum that I've often thought about, sparked by puzzles popular with children and indeed the Krypton Factor, where you have to fit various shapes into a fixed, two-dimensional square. But those puzzles were designed for the pieces to fit neatly into the solution. The problem posed is open to the vagueries caused by pictures whose relative sizes are beyond our control. Unless you're willing to accept some undesirable gaps, or similarly unacceptable raggedy edges, it can't be done I'm afraid. Unless you're very lucky with your traffic volumes.


Posted by dan at 9:03am | Permalink | Comments (1) | Trackbacks (0)
Thursday 7 February, 2008

Email sorting odds

Filed under: Numbers and stuff

Assume I have 65 emails in my Inbox, unfortunately a hugely invalid assumption. And now assume they're sorted by date received. The probability of me re-sorting by a different, unrelated column (size, for example) and the items appearing in the same order is way less than the probability of you and I each selecting an atom at random from the universe and happening upon the same one.

If my Inbox is reduced to 13 items, then the probability increases noticeably. It's more comparable to the odds of us each selecting the same living human at random.


Posted by dan at 6:55am | Permalink | Comments (0) | Trackbacks (0)
Friday 1 February, 2008

(c - cy) + (y + ε)(c - cy) < c, where ε > 0

Filed under: Numbers and stuff

Yahoo!'s share price has plummeted 45% from its recent high in October of 34.08. And despite a modest increase to 19.40 in the ensuing months, yesterday's 47% increase on news of Microsoft's takeover offer was not enough for the share price to surpass the October high, and it closed the day at 28.60. So how come a 45% fall followed by a more than 47% rise leaves the stock short of its original value?

It's a similar conundrum to the one I alluded to in my post two and a half years ago about the area of the Guardian's Berliner compared to its broadsheet and tabloid competitors. The two percentages are of different things, so can't be compared against one another.

Let's take apples. If you have ten apples and I take away 40% of them, you're left with six. If I then add 50% more apples to your fruit bowl, you're left with nine. The 40% was applied to the ten apples you started with, but the 50% was applied to the six you were left with after the snatch.

If Yahoo!'s stock was measured against an index, with its October peak being pegged at 100, then it dropped to 55 and then rallied Friday to 84: a 45 point drop followed by a 29 point rise.

Taking the above inequality:

(c - cy) + (y + ε)(c - cy) < c
c - cy + cy - cy2 + εc - cyε < c
y2 - ε + yε > 0

In the apples example, y is your 40% reduction, ε is 10%, the absolute difference between the 50% drop and the 40% rise.

0.16 - 0.1 + 0.04 is 0.1, which is greater than zero, so you end up with a lower value than that with which you started. To bridge the gap exactly, you'd need to add 67% of the remaining apples, which would make the inequality into an equation: 0.16 - 0.27 + 0.11 = 0.


Posted by dan at 9:52pm | Permalink | Comments (0) | Trackbacks (0)

Sudoku update

Filed under: Numbers and stuff

Following my recent post on measuring queue-lengths by Sudoku, I have some revised statistics to share, which may affect the positioning of the queue markers.

Tonights simple, medium and difficult sudokus took four, seven and 21 minutes respectively, taking the average sudoku time for the two nights down to 12m 34s. So the Post Office's "One sudoku to go" sign needs to be moved to stand beside the 20th queue occupant.


Posted by dan at 5:50am | Permalink | Comments (0) | Trackbacks (0)
Thursday 31 January, 2008

You are currently 1.59 Sudokus away

Filed under: Life, Numbers and stuff

Instead of measuring queue time at Alton Towers and the Post Office, for example, in hours and minutes, they should do so in Sudokus. My 23 minutes in the queue of the Trafalgar Square Post Office this evening were occupied completing 2.06 Sudokus. The two were the Simple and Medium ones that appear in The London Paper. The extra 0.06 was down to the first four cells being completed of the 66 empty cells of the Difficult one, upon which Cashier Number Eight was free. Given that 37 people that made up the queue on my arival, that equates to 0.056 Sudokus per person in the queue.

Update: Jon is right in his comment, something that I thought about at the time, but didn't have either the time or the inclination to allow for. Assuming the Simple Sudoku takes 50% less time than the Medium, and the Difficult one takes 50% longer, then my Medium Sudoku took an estimated 14m 28s. So I was 1.59 Medium Sudokus from the front of the queue, as opposed to my estimate of 2.06. Or else 3.18 Simples.


Posted by dan at 4:47am | Permalink | Comments (5) | Trackbacks (0)
Tuesday 29 January, 2008

Easter x

Filed under: Numbers and stuff

I was going to write a post about how the date on which Easter Sunday falls is calculated. But having researched it, I've decided it's way too complex; and annoyingly unscientific. So here's a link to Computus, the calculation procedure itself.

This year, it will fall on 23 March, the second earliest day possible. (It last fell on 22 March in 1818. Remember? Next time will be in 2285.) The latest it can fall is 25 April, this last happening in 1943; next time will be in 2038.

Finally, the weekday on which Easter most commonly falls is a Sunday, an outlier that is statistically significant.

I wonder if Jesus was aware of the rigmarole that people would have to follow in his wake (in the water sense of the word, of course).


Posted by dan at 8:19am | Permalink | Comments (0) | Trackbacks (0)

Stat. of the day

Filed under: Numbers and stuff

In recognition of Rob's trip to Statistic Shell, I thought it timely to share a statistic of the day:

53% of Two Ronnies jokes/quips were based entirely on either a speech impediment or a homophonic misunderstanding.


Posted by dan at 8:11am | Permalink | Comments (0) | Trackbacks (0)
Monday 28 January, 2008

The Snail, the Whale and the memory of an elephant

Filed under: Life, Numbers and stuff

The Snail and the Whale was the first book I bought for my daughter, and what a great book it is too. My only regret was not buying the board book, instead going for the easily-chewable paperback.

I've realised recently that I can now recite the entire book off by heart, all 695 words, or 3,450 characters. Which will be a blessing when we're out and about and she needs a story.

I am only able to recite 22 digits of pi, each being a choice of only ten, compared to 695 words, each having so many more choices. But sentence structure, coupled with the associated rhymes and the memorable storyline, make the challenge a different kettle of fish altogether. If only pi had some order to it...


Posted by dan at 8:01am | Permalink | Comments (1) | Trackbacks (0)
Sunday 6 January, 2008

Duralex numbers

Filed under: Life, Numbers and stuff

Among other things, my brother bought us six Duralex Picardie drinking glasses for Christmas which we were given today, not having managed to meet over Christmas. One of them had a chip on the rim (despite their spiel marketing them as chip-resistant), so we left them for him to exchange.

I have no idea why, but I completely forgot to look on the base of the glass that I adoringly inspected for the circled number that identifies each one. He's since confirmed by text that the glasses do indeed sport the numbers, which makes me yet more giddy about the present.

For those unaware, Duralex glasses were used to hold the water that accompanied my infant and primary school dinners. I have fond memories of them, and always checked the base of the glass to see which number I'd been given that day.


Posted by dan at 7:37am | Permalink | Comments (0) | Trackbacks (0)

Lies, damned lies etc.

Filed under: Politics, Numbers and stuff

The BBC yesterday reported the Tories' claim that the number of children in schools of more than 2,000 pupils has trebled in the last ten years, the Tories linking such schools to discipline problems.

It's certainly a headline grabber, but the truth behind it is unlikely to be as significant as the headline suggests.

Having an arbitrary cut-off of 2,000 pupils defining a large school is dangerously powerful. There were 12,650 such pupils in 1997, rising to 47,540 in 2007. Such an increase could be explained by 18 schools each increasing their register by two pupils, from 1,999 to 2,001 pupils. It's doubtful that this extreme scenario is indeed what has happened, but the reality is also unlikely to be as momentous as the highlighted statistics suggest.


Posted by dan at 6:54am | Permalink | Comments (2) | Trackbacks (0)
Saturday 5 January, 2008

The injustice of volumes

Filed under: Numbers and stuff

Yesterday, I pumped up an exercise ball that I bought my wife for Christmas. Much like leaf-sucking, it's a thankless, seemingly endless task.

The ball pumps to 75cm in diameter, a step up from the 65cm ball we had previously. (I can only measure progress by wrapping something around the ball and dividing that length by two pi. I'm figuring that it would be easier if they'd printed two dots on the ball that would be 10cm apart when the ball was pumped to the right size.)

I'm using the 15cm-long hand-pump that came with the ball. I figured that to exercise the mind while pumping, I'd work out the amount of extra air the 75cm ball would need over the 65cm ball. It turns out that the extra 10cm (15%) of diameter increases the volume by 53%. And when I'd reached a diameter of 60cm (80%), I was only half way through the pumping. Seems unjust.


Posted by dan at 5:15pm | Permalink | Comments (0) | Trackbacks (0)
Tuesday 13 November, 2007

Rising sea level

If the entire world's population jumped into the ocean at the same time totally submerging themselves, sea level would rise by 0.0014mm, the thickness of a plastic bag. Here's my logic.

The average male weighs 82kg; female 70kg. Assuming a body density the same as water (hence why we float, but only just), that gives us 1g/cm3, or respective body volumes of 0.082 and 0.070 cubic metres.

With 1.01 males per female and a world population of 6.6bn, we have 3,316,417,910 males and 3,283,582,090 females with combined body volumes of 502,686,567 cubic metres. The world's oceans and seas occupy 361 million square kilometres of the world's surface, so evenly applying the volume to that area gives you 0.0014mm.

Jump in on your tod, and the water level will rise by a fifth of the width of an atom's nucleus.

Feel small?



Posted by dan at 8:23am | Permalink | Comments (5) | Trackbacks (0)
Thursday 8 November, 2007

Happy 1000th Birthday, little blog

Congratulations little blog of mine. This is your thousandth post. I thought we'd celebrate (or celibrate as Holly Golightly says at the end of the White Stripes' Well It's True That We Love One Another) by combining two of my loves: numbers and words. So here's a potted statistical history of the first 999 posts. (This one's not included because I've not finished it yet.) Here goes!

There have been 999 posts in 1,220 days, attracting a total of 1,301 comments. That's 1.30 comments per post, 0.82 posts per day, 1.07 comments per day.

The 999 posts are made up of 168,016 words, 758,040 characters (excluding spaces), making an average of 168 words per post; 4.51 characters per word. In total, there were 16,299 unique words and numbers, including hyphenated constructs and spelt-out URLs. My most populous word was the, its 10,703 occurrences accounting for 6.37% of the total, followed by to (2.90%), of (2.65%), a (2.56%), and and (1.78%). The most prevalent 123 words accounted for 50% of all words.

There were 625 instances of it's, but only 402 of its, all 1,027 used correctly, I hope. 525 theres, 409 theirs and only 92 they'res. Beer and wine were mentioned seven times each. 58 footballs compared to eleven soccers and 17 baseballs. 167 Yorks (most of them preceded with New, I expect) compared to 151 Londons. And 140 Googles compare to 15 mentions of Yahoo! Four fucks and three wanks.

The most populous non-trivial word was people, with 284 occurrences, followed by great (225), day (217), little (193), good (181) and number (180). Excel, its capitalised and non-capitalised forms combined, warranted 89 mentions. Twelve was graced with 43; Seinfeld with 14.

α, β, γ and δ got a single mention each. The 4,300 occurrences of a were equal first alphabetically, zoomy rounding us off with a single mention. My longest word was plimpplampplettere, the beautiful Dutch word meaning to skim stones. Compartmentalised won the English record together with indistinguishable, both with 17 letters.

During the 105,282,240 seconds between the first and 999th post, I have married my lovely wife, moved country twice and had a beautiful daughter. Roll on another thousand posts.


Posted by dan at 7:15am | Permalink | Comments (2) | Trackbacks (0)
Wednesday 24 October, 2007

Call yourself a dev.?

I have a colleague. For the sake of argument, let's call him Neil. (His real name is Neil.) He sent me an email today asking why the following Excel formula wasn't working.

=IF(F648=1, 10, IF(F648=2, 8, IF(F648=3, 7, IF(F648=4, 6, IF(F648=5, 5, IF(F648=6, 4, IF(F648=7, 3, IF(F648=8, 2, IF(F648=9, 1, 0)))))))))

[Note: I've added spaces after each comma to allow the for inevitable word-wrapping issues.]

My immediate response was that Excel can only cope with eight nested ifs. (The last argument in his email was red, and this was indeed the straw that was breaking the proverbial camel's back.)

I then asked what business problem he was trying to solve. He had a column of data containing values between 0 and 10. And he wanted to invert them, so that 0 became 10, 1 became 9, 5 stayed 5, 8 became 2 etc.

I suggested he instead used the following formula:

=10-F648.

There was a short pause on the other end of the line. Bless.


Posted by dan at 4:15am | Permalink | Comments (6) | Trackbacks (0)
Saturday 25 August, 2007

How can you miss it?

Filed under: Numbers and stuff

Astronomers have found a void in space measuring one billion light-years across. That's 9,460,528,000,000,000,000,000 kilometres. Let's put that into context.

Count the number of square millimetres on the earth's surface, including the oceans. (Before you start counting, there are 6 billion billion of them, a billion for each person in the world.) Now, tick them off one at a time, taking a flight each time you do. For the first one, fly from London to Naples, Italy. For the second, fly back to London. For the third, fly back to Naples, and so on, flying from London to Naples on the odd numbers and back to London on the evens. By the time you've ticked off all of the square millimetres on the earth's surface, you'll have covered the same distance as the void is wide.

For completeness, assuming you don't have to waste any time checking in, waiting for your bags etc., your journeys would take you 125,000 times longer than the universe has existed to date.

It's quite a big void.


Posted by dan at 7:07am | Permalink | Comments (1) | Trackbacks (0)
Thursday 23 August, 2007

What's your carbon volume?

Filed under: Numbers and stuff

A few car adverts are currently boasting a low carbon emission of 120g of CO2 per kilometre of driving. That still sounds like a lot.

At 15°C, CO2 weighs 1.977kg per cubic metre, so 120g equates to 60,700 cubic centimetres, or a 39 centimetre cube, full of carbon dioxide. So a trip to Yorkshire and back for me would equate to 41 cubic metres of CO2 or a 3.43 metre cube. Quite a chunk. If it's cold, then the carbon footprint is reduced, I guess.


Posted by dan at 7:59am | Permalink | Comments (0) | Trackbacks (0)
Thursday 16 August, 2007

Newcastle still top

Filed under: Sport, Numbers and stuff

After last night's games, Newcastle are still top of the table (average points 3, average goals 3, average difference 2), followed by Everton (3, 2.5, 1.5) and Chelsea (3, 2.5, 1), Arsenal (3, 2, 1), Blackburn (3, 2, 1) and Liverpool (3, 2, 1) taking the remaining European spots. I was wrong in suggesting that Spurs (0, 0.5, -1.5) were bottom of the Premiership under this new sorting algorithm—West Ham (0, 0, -2) prop up the division, with Spurs and Middlesbrough (0, 0.5, -1) joining them in the relegation zone.

The biggest beneficiaries from the revised sorting are Newcastle, jumping four places, while Man. City are crying with a five place demotion from second to seventh.


Posted by dan at 5:14am | Permalink | Comments (0) | Trackbacks (0)
Sunday 5 August, 2007

Law of averages

Filed under: Numbers and stuff

The BBC reported this morning that according to research, "the price of an average house in England will break through the £300,000 barrier by 2012." That's an average, run of the mill house (not Millhouse). And only one. So by 2012, one or more bog standard homes in England will have sold for £300,000 Hasn't that already happened?


Posted by dan at 6:50pm | Permalink | Comments (0) | Trackbacks (0)
Tuesday 17 July, 2007

Post 10^x

Sympathies to Jon for his recent faux pas (and subsequent retraction) thinking he'd reached his 100th post. I've been pondering my somewhat distant 1,000th post (this is number 924), for a while thinking I was closer than I actually am. The url suggests that this is post 994, but test posts and mistaken duplicates (click the submit button twice used to generate two identical posts) has resulted in a 7% deletion rate, the urls incrementing without any associated content.

Oddly enough, the dearth of posts in April (twelve, equalled only once in May 2005) attracted more traffic than ever (115,622 hits from 23,988 visits). Maybe less is more.


Posted by dan at 7:49am | Permalink | Comments (2) | Trackbacks (0)
Tuesday 10 July, 2007

Fact of the day: cow-a-bunger

Filed under: Numbers and stuff

Seven percent of greenhouse gases produced in Wales come from cattle's collective arses.


Posted by dan at 8:17am | Permalink | Comments (5) | Trackbacks (0)
Sunday 1 July, 2007

round(pi(),21) and 2^7

Filed under: Life, Numbers and stuff

Parents will be all too familiar with walking backwards and forwards in the nursery, cradling their baby to sleep while wearing out a specific area of the carpet. I spent the best part of three hours doing exactly this the other night, and most nights involve at least some time walking the line, from one corner of the nursery to the other, while the little one hopefully falls asleep.

In an aim to try and assist with the onset of sleep, I often whisper pi to her, to the 21 decimal places of which I am capable, over and over again. It seems to work. If nothing else, later in life she'll be able to calculate the volume of earth to the nearest tenth of a cubic metre. Or its circumference to the nearest four attometers. Or the circumference of the universe to the nearest 1.26 metres.

Once asleep, she's rocked left to right, right to left, 128 times, which is aimed at settling her into a deeper sleep before being put down. Sometimes it works, sometimes it doesn't. Maybe I need to up it to 256.


Posted by dan at 12:39am | Permalink | Comments (3) | Trackbacks (0)
Thursday 7 June, 2007

Pi to 110,100 binary places

Filed under: Numbers and stuff

11.0010010000111111011010101000100010000101101000111001

I was bored.


Posted by dan at 8:10am | Permalink | Comments (11) | Trackbacks (0)
Friday 1 June, 2007

More pi?

Filed under: Numbers and stuff

Some more information about the Oregon pi anomaly. In no way conclusive about what or why. But a bit of information nonetheless.


Posted by dan at 7:48am | Permalink | Comments (2) | Trackbacks (0)
Saturday 26 May, 2007

Slices of pi

Filed under: Numbers and stuff

Francis has done very well to work out what's going on with the Oregon pi sculpture that I commented about. I do think he's harsh in "stick[ing] it to [me]", though.

In my post, I told you that:

  • It's not pi to 106 decimal places: correct
  • The second row should read 897932384626, assuming it's intended to continue where the first row finished: correct
  • After offering a couple of possibilities as to what it might be (pi in a random order, a pi word-search-style number search), I hypothesised "maybe it's just wrong. Seems like a lot of effort, and a lot of accuracy for something that's so wrong, though." Again, correct

At no point in the post did I call the sculpture a numpty for his seeming amateurish knowledge of pi. I didn't say the sculptor was wrong, but did indicate my lack of understanding for what he was portraying. And even reading Francis' explanation, I maintain this view—unless there's a more poetic story to explain the rationale, it seems bizarre to me.

Francis' post does show the high number of characters/numbers that a cell can hold in Excel 12, though.

As an aside, I was thinking today that I'd like to build a house with a digit of pi pre-engraved on each brick. The leading 3 would appear in the top left corner, and the decimal expansion would continue from left to right, top to bottom down the house. It'd take some accurate brick planning, though.

Good work on working out what's going on, Francis. I'm still perplexed, though.

Update:

So, I've taken Francis' analysis to the next level now that he's given the hint, and below's what I've found.

Here's the original sculpture, with some colour-coding.

Pi square

And here's where it appears in pi's decimal expansion.

Pi square 2

Here and here are links to bigger versions of the two images.

The number down the left plus the number at the top gives the decimal place number of each digit. So decimal place 305 is an eight.

Essentially, the cyan area has been picked up, shifted down a row and plonked to the left of the yellow bit, shunting it off to the right so that everything lines up. And the purple has done the same with the cyan. The only weird exception is the 897932 string which has been put on the right hand side of the top row, occuping positions 11–16.

It's very strange. Very strange indeed.


Posted by dan at 5:25am | Permalink | Comments (3) | Trackbacks (0)
Wednesday 23 May, 2007

Eat humble pi

Filed under: Numbers and stuff

My friend Jon kindly went down to the Oregon Zoo MAX Light Rail station to take a picture for me of an engraving that he spotted on the wall. An engraving of pi, by all accounts.

Here's the picture.

Pi engraving

Now, that'd be pi to 106 decimal places, I hear you cry. But let me tell you, and let Rob echo me in telling you, that you'd be wrong.

It looks like pi, and the first row is pretty darned good. Whoopy do. Any eleven-digit calculator will tell you that much. (I only had an eight digit one at school, and could never understand why my dad needed a twelve-digit one in his office. To calculate the national debt? I digress.) But then it goes to cock. The second row should read 897932384626, assuming it's intended to continue where the first row finished.

The weird thing is that the 897932 bit appears in the bottom right hand corner, from left to right.

Maybe it's the first 107 digits of pi in a non-specific order. Or maybe it's like a word search, only with numbers, where the onlooker has to circle certain strings from the first 106 places of pi's infinite decimal tail.

Or maybe it's just wrong. Seems like a lot of effort, and a lot of accuracy for something that's so wrong, though.


Posted by dan at 9:20am | Permalink | Comments (4) | Trackbacks (0)
Tuesday 27 March, 2007

Stat. of the day

Filed under: Numbers and stuff

The richest two Americans have the same total wealth as the poorest 90 million.

Source: tonight's BBC news. For the record, the richest two are Billy G. and Warren Buffett.


Posted by dan at 7:19am | Permalink | Comments (1) | Trackbacks (0)
Sunday 25 March, 2007

1,000th comment

Congratulations, little site. After 992 days in existence and 841 posts, you've have your 1,000th comment.

The momentous comment was from Thomas in response to post 839 at 2.02pm today.

Of course, you're a website, so you deal in 1s and 0s. So you're eagerly awaiting comment 1,024, right? Shouldn't be long now.

For the statistically-obsessed, some averages for you.

  • 1.19 comments per post
  • 0.85 posts per day
  • 1.01 comments per day
  • 204 words per post

That is all.


Posted by dan at 6:08am | Permalink | Comments (1) | Trackbacks (0)
Tuesday 13 March, 2007

Happy pi day

Filed under: Life, Numbers and stuff

"Happy pi day", I said to my wife as I left home this morning.

"Ooh. Is it pie day? I love a pie."

Happy pi/pie day everyone.


Posted by dan at 5:53pm | Permalink | Comments (2) | Trackbacks (0)
Monday 5 March, 2007

String theory

Filed under: Numbers and stuff

My brother posed an interesting puzzle earlier today, one which I knew about and which caused me to search this site to confirm I'd not talked about it before. I hadn't, so here it is.

Get a piece of string and wrap it tightly around a football. Your string will be about 70cm long. Untie it and add a metre to this string, and lay it in a circle on the ground around the football. The string will be about 16 centimetres from the edge of the football.

Now get a longer piece of string and wrap it tightly around the earth. You may need more than one ball of string for this—tie the ends together. Let me know when you're done.

Now take this string and add a metre to it, and make it hover a constant distance above the earth. You may not believe it, but this string will also be about 16 centimetres away from the earth's surface.

The extra metre gives it a full 16cm clearance. The human mind makes you think that an extra metre won't make a jot of difference when you're talking about something as big as the earth; but it does.

The mathematical rationale for this is as follows. c is the smaller circumference, r/R is the smaller/larger radius.

c = 2πr, so r = c/2π

Add 1 to the circumference, so c + 1 = 2πR.

Substitute c with 2πr and you have 2πr + 1 = 2πR

So 2π(R - r) = 1

So R - r = 1/(2π), or else R = r + 1/(2π)

So whatever the radius of your original circle, the new radius will be 16cm longer for that metre of string added.

I suppose the best way to describe the logic behind this is to take evenly-spaced concentric circles, each 16cm apart. The first circle has a radius of 16cm and a circumference of 1m. The next circle has a radius of 32cm and a circumference of 2m. The next, 48cm and 3m [...] a 637,810,000cm radius gives a circumference of 40,074,784.21m, and a radius of 637,810,016cm gives a circumference of 40,074,785.21m.

The last two in that series were the earth and "the earth + 16cm", but you already knew this right, given that you've just tied a piece of string around it?

So there you have it.


Posted by dan at 8:35am | Permalink | Comments (0) | Trackbacks (0)
Wednesday 7 February, 2007

European sevens and zeds

Filed under: Numbers and stuff

When I was about twelve, I decided that my writing was a bit dull. So I made a conscious decision to add a strike-through on both my 7s and by Zs.

I later found out that this was a continental European trait, but I like it.


Posted by dan at 8:03am | Permalink | Comments (1) | Trackbacks (0)
Friday 2 February, 2007

Temperature percentages

Filed under: Numbers and stuff

Tonight, Jon Snow talked of an estimated six per cent rise in temperatures during our children's lifetimes. While I think he was using 0°C as his frame of reference, I find this phenomenally confusing and mathematically incorrect.

From a purist perspective, he should have used zero kelvin as his base, meaning that the six per cent increase would actually be more like 0.4%. (Incidentally, in Fahrenheit the rise is more like three per cent.) But in reality, for something that has no real concept of a minimum in everyday life, changes shouldn't be expressed in percentage terms. If the average global temperature was set to rise from 0.1°C to 1.0°C, would we refer to a 900% increase? Odder still, would a reduction in the global temperature from -5°C to -10°C constitute a doubling in the temperature?

As an aside, while researching whether per cent takes a space in the middle, the Google search:

percent per cent

yielded the following calculation result:

1 percent per U.S. cent = 1 U.S. Dollar-1


Posted by dan at 7:12am | Permalink | Comments (1) | Trackbacks (0)
Monday 29 January, 2007

Time is relative

I find long periods of time quite difficult to visualise. Anything more than about six weeks, and it becomes "a long time", but without a comparator, it's difficult to give it a frame of reference.

I'm looking forward to a big event due in about 75 days' time. A little under eleven weeks. In order to picture this, I work back from today by the same amount of time and imagine a relatively memorable event that took place that many days ago. 67 days ago today, I took a trip to Newcastle on business. I can vividly remember that event, and it doesn't seem that long ago at all, and that's roughly how long I have to wait until the big event.

It would be good if I had a little app. that plucked the nearest such event from my Google Calendar to give me a comparator for any given date I'm eagerly awaiting.


Posted by dan at 8:53am | Permalink | Comments (2) | Trackbacks (0)
Thursday 18 January, 2007

Self-referential formula

Filed under: Numbers and stuff

Thanks to Francis for pointing to this ridiculous stroke of luck/ridiculously contrived inequality.

In the 1,802-byte range where 0 <= x <= 105 and some ridiculously high 17-integer range for y, the formula plots itself. Absolutely phenomenal.

The formula:

1/2 < [mod([y/17]*2^(-17[x]-mod([y],17)),2)]


Posted by dan at 8:38am | Permalink | Comments (1) | Trackbacks (0)
Tuesday 9 January, 2007

The new iPhone

The iPhone has just been unveiled at Macworld in San Francisco. According to Steve Jobs its screen is 3.5" across its diagonal (with a resolution of 160 pixels per inch), and it's only 11.6mm deep. Funny how he mixes his imperial and metric lengths.

He could have gone for 88.9mm across (with 6.3 pixels per mm), or else gone for 0.45" depth.

Incidentally, the iPhone itself looks sweet.

Update: Nasa's going metric, as of today, for moon activity.

Further update: more detail on the iPhone. The phone itself is fricking unbelievable. I love it. The interface is poetry, and 95% of the functionality is beautiful, both in its simplicity and its offering.

The iPod part of the phone has advanced in leaps and bounds. Most of these advances relate to the fact that the whole thing is running OS(X), but I also love its "accelerometer", which is essentially a gravity-detector, orienting your screen according to the way you hold it. That's particularly neat, although I have no idea why they chose that name.

The traditional phone bit is also great. They've taken all of the annoyances with regular phones, and simply addressed them all—switching between calls, accessing contacts and a particularly snazzy visual voicemail, allowing you to listen to specific voicemails rather than trawl through a plethora to listen to the one that you want.

However, there is one area that is dreadful, but which is a symptom of keyless devices: typing. SMS texting and writing emails is cumbersome to say the least. Jobs says "I've got this little keyboard which is phenomenal. [...] It's actually really fast to type on".

He's lying. It took a long time for him to type a one-line text message, which was no doubt rehearsed many times over. With traditional mobile phones, there used to be a comfort factor. The feedback that the keys gave me (a little click with a tangible pressed/released state) confirmed that my press had been recognised, and I could move on to the next letter. Intelligent texting allowed 90% of the QWERTY user experience, without needing the space for all those keys. (When I typed QWERTY just then, I actually touch-typed it, instead of swiping my finger across the top row. Weird.)

My current phone (T-Mobile's MDA) has a slide-out keyboard, which offers similar, vital feedback, although the QWERTY keyboard is a little cumbersome for the two thumbs that remain free (hooray for opposable thumbs!) while my fingers cradle the unit.

The touch-screen for typing doesn't work for me—nor, it seems for Steve, who undeniably had trouble. (This in spite of the whoopings of the notoriously "Apple did it so it must be good" crowd.) It's not as if it's the lack of SMS take-up in the US that has driven the weakness, as the "keyboard" is similarly important for web browsing and email, fundamental offerings of the iPhone, what with its Google and Yahoo! partnerships.

Lastly, Apple's introduction of Safari onto the phone doesn't work too well for me either. It displays the full webpage as it would appear on my 15.4" laptop monitor. It's illegible, but you can zoom in easily. But how do I know what to zoom into? I don't. But I can zip around the screen to try and find what I'm looking for, as long as I know where to zip. I'd prefer a linear view on such a relatively small screen. The whole idea of graceful degradation and the beauty of stylesheets goes out of the window.

But neat nonetheless...


Posted by dan at 7:13am | Permalink | Comments (4) | Trackbacks (0)
Monday 1 January, 2007

A wonderful pi fact

Filed under: Numbers and stuff

If you wanted to calculate the circumference of the known universe to the accuracy equal to the size a proton, you'd only need the first 50 decimal places of pi.

I know the first 20. Just need another 30, then I reckon the benefits are minimal.


Posted by dan at 7:20am | Permalink | Comments (0) | Trackbacks (0)

How many snowflake patterns are there?

Filed under: Numbers and stuff

Someone has commented on my previous post asking whether there is a limit to the number of patterns that can be formed in a snowflake. They have named themselves Jack Frost, although I question the veracity of this.

I always struggled with the idea that was promoted at school, suggesting that no two snowflakes are alike. No one ever offered a proof, so I questioned its truth.

If indeed the proposition is true, then the answer to Jack's question is infinite. Assuming snow keeps falling, and that its rate of descent doesn't slow over time, then the number of flakes that have ever existed will continue to rise, and will not tend to any limit. Under the assumption that each one is different, then the number of different snowflakes will continue unabated towards infinity (and beyond).

I prefer a somewhat simpler scenario. Let's assume that snowflakes are a certain size, and within this volume, each space is filled either with ice or air, and this is what makes snowflakes so different from one another.

I'm imagining a three-dimensional version of a black-and-white favicon, a cube. For the sake of argument, let's assume that it's 16 "pixels" wide, high and deep. So in total, there are 4,096 positions, each of which can take a value of "ice" or "air". That would make about 10^1232 possible snowflakes (10 followed by 1,231 zeros).

Now this would be kerbed somewhat by the fact that I assume all ice particles need to be connected to one another, but even at such a small scale (16x16), the numbers are astronomical. Add in the fact that snowflakes can come in a variety of sizes, and that the 16 could be increased hugely, then there's lots of possibilities.

There's my attempt at solving the problem. Any advance? Anyone? Bueller? Anyone?


Posted by dan at 6:13am | Permalink | Comments (2) | Trackbacks (0)
Sunday 31 December, 2006

The odds were too great

Filed under: Sport, Numbers and stuff

The 36.7% probability came true. Kansas City and the New York Jets won, and Denver just lost in overtime to San Francisco.

The Broncos' season ends with 2006.

Ho hum.


Posted by dan at 11:05am | Permalink | Comments (1) | Trackbacks (0)
Saturday 30 December, 2006

As probability tends to 1

Filed under: Sport, Numbers and stuff

Last night, the New York Giants hailed in Washington in their last game of the regular season. After losing six of their previous seven games, a win was far from certain. It seems that Tiki Barber did quite a bit of damage with 234 rushing yards, more than either he or indeed any Giant in history has ever rushed for previously.

The Giants are now guaranteed a wildcard playoff berth if all of the following nine teams win: Green Bay, Arizona, Detroit, Miami, Minnesota, San Francisco, Cleveland, New Orleans, Seattle.

If you ignore the teams' respective opponents and simply use their season's winning record to date as their probability of winning today, then the probability of all of the above teams winning is 0.0126%. Or 1 in 7,945. In the above scenario, Green Bay would snatch the NFC's sixth playoff berth.

So I guess the Giants will be playing in January. I'm quite confident that they won't be playing in February, though.

With all division titles sealed in the AFC, the race is on between six teams for the two wildcards. Denver is leading the charge, with the New York Jets on the same winning record (96). Four further teams are hot on their heels on 87: Cincinnati, Jacksonville, Tennessee and Kansas City.

With Jacksonville playing at Kansas City, one of them is almost certain to end the season with a 9–7 record, so the pressure is on for Denver to beat San Francisco (6–9) and for the Jets to beat Oakland (213). Both are at home, although Denver's home record (4–3) is far from convincing. It's gonna be a big day.

Focusing on Denver, only Kansas City, Tennessee and the New York Jets can finish above them. If Jacksonville win and Denver lose, then they have no head-to-heads, their division records would be identical, as would be their record against teams that they have both played. Which means it would go down to their conference record, which would favour Denver. As for Cincinnati, Denver's 24–23 win over them on Christmas Eve would put them in the driving seat.

If you apply the same "record to date" logic as was applied to the Giants above, there's a 36.7% chance of Denver losing and at least two of these three winning. Those odds are a little too high for my liking.


Posted by dan at 9:31pm | Permalink | Comments (0) | Trackbacks (0)
Monday 25 December, 2006

Staying close to home

Filed under: Numbers and stuff

As a child, I used to puzzle over a self-made conundrum, which is similar to the taxi problem I set a while ago. Here it is.

Imagine the eight lines that connect the 16 primary points of the compass (N, NNE, NE, ENE, E, ESE, SE, SSE, S, SSW, SW, WSW, W, WNW, NW and NNW). Each line connects two of these sixteen points. So, for instance, the line from N to S constitutes a single line, as does that connecting SSE and NNW.

Each line has the same length: one kilometre, let's say.

You walk each of the lines in succession, but for each line, you can choose which direction to take. So, for the N/S line, you can either walk north or south for one kilometre. After doing so, you take the NNE/SSW line from your previous end point, again in either direction. Etc.

Here's the conundrum: is it possible to end up where you started. And if not, how close to the start can you end up and how do you do this?

I've just worked out the answer, which I'll post as a comment.


Posted by dan at 5:55am | Permalink | Comments (1) | Trackbacks (0)
Saturday 23 December, 2006

Einstein's logic problem

Filed under: Numbers and stuff

I stumbled upon Albert Einstein's apparently famous logic problem today. Here's how it goes.

In a street there are five houses, each painted a different colour. In each house lives a person of a different nationality. These five homeowners each drink a different kind of beverage, smoke a different brand of cigar and keep a different pet.

The question: who owns the fish?

Here are the hints that will help you solve it.

  1. The Brit lives in a red house
  2. The Swede keeps dogs as pets
  3. The Dane drinks tea
  4. The green house is next to, and on the left of the white house
  5. The owner of the green house drinks coffee
  6. The person who smokes Pall Mall rears birds
  7. The owner of the yellow house smokes Dunhill
  8. The man living in the centre house drinks milk
  9. The Norwegian lives in the first house
  10. The man who smokes Blends lives next to the one who keeps cats
  11. The man who keeps horses lives next to the man who smokes Dunhill
  12. The man who smokes Blue Master drinks beer
  13. The German smokes Prince
  14. The Norwegian lives next to the blue house
  15. The man who smokes Blends has a neighbour who drinks water

I used Excel. Purely to organise my thoughts; not for any calculation logic. I reckon you can answer the question (who owns the fish?) without hint 15, but that particular hint gives you a full picture of what everyone drinks.

Let me know how you get on. For those who want to check their answer (against mine at least), go through the following clues, which are hopefully a bit easier.

  • Take the letters at the beginning of each of the five one-word answers to the following clues
    • Popular Japanese number puzzle
    • Keeps the rain off you without the need for a coat
    • French for I
    • A reflected sound
    • Your presents might be put in one of these by Santa
  • Re-arrange these to reveal the name of a historic figure
  • What did he sleep in as a baby?
  • Re-arrange the letters of that word

Posted by dan at 12:48am | Permalink | Comments (7) | Trackbacks (0)
Monday 18 December, 2006

The difference a number makes

There are two shortcuts in Firefox that are too close for comfort:

  • CTRL+F4: close tab
  • CTRL+F5: hard refresh of the page

I use the latter more often than the former. However, I've missed the F5 key on a number of occasions, finding that the tab has disappeared rather than seeing it refreshed.

The two F-ing keys are frustratingly close to one another.


Posted by dan at 10:16pm | Permalink | Comments (7) | Trackbacks (0)
Tuesday 12 December, 2006

The difference between latitude and longitude

Most people know this. Latitude is a measure of how far north or south you are from the equator. And longitude is a measure of how far east or west you are from the Greenwich Meridian.

Sounds simple, doesn't it. In reality, it's a bit more complex.

I've always been slightly bothered that the lines of latitude are completely different in nature to those of longitude. Latitude lines are all different lengths (actually, there are pairs of each length, one in each hemisphere: the tropics of Cancer and Capricorn, for example), while all lines of longitude are the same length as one another.

No two lines of latitude go through the same point as one another, while every line of longitude goes through the two poles.

Basically, the longitude lines cut the globe just as your chocolate orange will come apart this Christmas; the lines of latitude are more comparable to the way you'd slice a hunk of mozzarella. (At least they are like the way I slice mozzarella.)

Yet if you switched the methodologies around, it wouldn't work, because the earth spins on its polar axis. Each 15° wedge of longitude makes a nice one hour segment throughout the latitudes, and in a purist's world, everyone on a single line of longitude should have their watches set at precisely the same time. While everyone on a given line of latitude will experience the same passage of the sun through the sky on a given day.

This division of the world makes beautiful sense, but it's more complicated than you'd first have thought. There may be more on this topic later. But for now, I thought I'd throw my curiosity out there.


Posted by dan at 8:10am | Permalink | Comments (5) | Trackbacks (0)

$16m is the going rate

Filed under: Sport, Numbers and stuff

While we were in the US at the weekend, Andy Pettitte signed for the Yankees for $16m, and Barry Bonds extended his contract with the San Francisco Giants for another year, presumably in a bid to pass Hank Aaron's milestone of 755 career home runs, also for $16m. He needs 22 allegedly-drug-fuelled homers next season to take the record.

Pettitte, previously with the Astros, marks seven straight off-seasons in which the Yankees have bought big, last season's signing being the scrubbed-up Johnny Damon from Boston.

It seems $16m is the magic number.


Posted by dan at 3:02am | Permalink | Comments (0) | Trackbacks (0)
Monday 4 December, 2006

IP addresses of the world

Here's some fascinating analysis highlighted by my friend Alan. It shows the total number of IP addresses per person by country. At the top of the list is the Vatican City with 10.5 IP addresses per person; at the bottom: the Democratic Republic of Congo with 58,140 people per IP address.

That means that the average number of IP addresses per person in the Vatican is 60,659,310% higher than that in DR Congo. Even taking a more statistically sound high (the USA in second, with 4.5 IP addresses per person), it's 262,103 times higher (26,210,272%) than that of DR Congo. If DR Congo's population stayed constant, and its IP address count doubled every year, it would take 18 years to get to th US's current IP saturation.


Posted by dan at 8:06am | Permalink | Comments (1) | Trackbacks (0)
Sunday 3 December, 2006

I'm moving to Corby and retiring

Filed under: General, Numbers and stuff

I saw an advert at Charing Cross station this morning advertising the following:

"Homes in Corby on average cost 154% less than those in London."

It was one of those little adverts alongside the escalator, so I wasn't exposed to it long enough to take a picture, nor to note the idiot company responsible.

Suffice to say that if the assertion is true, then on average, they will pay you £153,900 for every house you buy in Corby (based on the average London house going for £285,000). I'm not sure where Corby is, but I'm planning on buying the whole town up and retiring!


Posted by dan at 6:29pm | Permalink | Comments (5) | Trackbacks (0)
Thursday 30 November, 2006

How to drill square holes

Filed under: General, Numbers and stuff

I've never thought about this before, but here's the logic behind a drill bit that drills square holes.

A piece of geometric poetry.


Posted by dan at 8:07am | Permalink | Comments (1) | Trackbacks (0)
Monday 27 November, 2006

Fractional millions

Filed under: General, Numbers and stuff

Just a point of clarification.

1,500,000 should be read "one and a half million", not "one million and a half". The latter would equate to 1,000,000.5

Thanks.


Posted by dan at 8:25am | Permalink | Comments (0) | Trackbacks (0)
Thursday 16 November, 2006

I don't digg digg

digg has some really cool, and primarily geeky content. But each article is merely a clickable title (which points off to another website that contains the content of interest) along with a short summary paragraph.

Because I access my content through the new version of Google Reader (which I thoroughly recommend, btw), I can tell quite quickly whether I consider it worth reading. If it is, then I click the digg post in Google Reader, which launches a new browser tab. I then wait for it to load enough of the digg page for the title to appear, which I then click on. This brings up the content of interest. In Google Reader, I'm two steps away from the content itself, the first of which takes an age, because digg is a really slow site.

This compares to some other sites (e.g. Engadget) for which I can see everything I need from within Google Reader.

Some digg stuff I found interesting today:

I had to access all this through four very slow browser tabs. When you find lots of stuff, the problem is exacerbated and further exasperates.


Posted by dan at 9:15am | Permalink | Comments (0) | Trackbacks (0)
Saturday 11 November, 2006

Number to text converter

I can't remember why, but I set myself a personal challenge to create a spreadsheet that could convert numbers to text.

Here it is. Type in a number between 1 and 999,999 in the red cell and it will write it out in words in the blue. English style, not American, so the ands are included.

As an aside, the lowest positive integer for which the letter a is required is 101 (one hundred and one). In American, it's 1,001 (one thousand one).


Posted by dan at 9:16am | Permalink | Comments (1) | Trackbacks (0)

More deaths in Iraq than words on this blog

Filed under: Politics, Numbers and stuff

Yesterday, I backed up my blog, albeit in a rather backward way. I changed the setting such that all posts display on the homepage, copied all of the content and pasted it across into Word, without any formatting.

It gave me 270 pages of ten-point text. 675 posts accounting for a total of 141,000 words. Estimates indicate that the number of Iraqi deaths is anywhere between 150,000 and 650,000.

For the next day or so, I'm keeping the settings as they are, to display all posts on the homepage. It will take a little longer for the page to load (1.3Mb), but once it loads, please scroll up and down a little, and think of the fact that every word you see represents at least one innocent death in the conflict.


Posted by dan at 2:00am | Permalink | Comments (1) | Trackbacks (0)
Wednesday 1 November, 2006

Quote of the day

Filed under: Numbers and stuff

Even if this number's 100% out, then it's still big.

No it's not; it's zero.


Posted by dan at 7:48am | Permalink | Comments (4) | Trackbacks (0)

The leap from a grid to lines

Filed under: Life, Numbers and stuff

In Maths at Primary School, we used gridded exercise books to do our sums. I used to see the exercise books of my brother Ben, two years senior, and be frightened, not at the maths involved but at the fact that all of his workings were atop lined paper.

I remember this enforced transition on entering Secondary School being a frightening period in my life at the time, as I genuinely didn't know how I would cope with a freeform space (at least in one dimension) in which to do my sums.

I coped, but the months beforehand were nervous times.


Posted by dan at 7:43am | Permalink | Comments (5) | Trackbacks (0)
Wednesday 25 October, 2006

Abusive commenter: found

The latest comment I received on the current look-and-feel is nothing if not offensive. I had a strong inkling as to who had written it, someone who I would strangely classify as a friend (strange, given the comment), an ex-client indeed.

He denied the comment by IM ("i didn't comment..."), so I investigated further. I found the source IP address and ran it through GeoBytes' IP locator. It found that it came from America, New York, Brooklyn. It estimated that it might be from Ocean Avenue, a mere 2.1 miles from the workplace of the person who formed my original inkling.

The chances of two randomly chosen American points being within 2.1 miles of one another is around 0.00025% (1 in 400,000). Too much of a coincidence in my book.


Posted by dan at 8:01am | Permalink | Comments (5) | Trackbacks (0)
Monday 23 October, 2006

Grapes vs. raisins

Grapes and raisins are up there with the best of the fruit. They didn't make the top five, but they'd certainly be in the top ten. But here's my question: why are raisins so much cheaper than grapes?

Ocado has 500g of raisins (made from Californian seedless grapes) available for £0.75. 500g of green, seedless grapes (a juicy and flavoursome grape) cost £1.99.

The bag of raisins will contain way more raisins than the bunch of grapes will grapes—I'd suggest that five times as many would be a conservative estimate. That would make the relative cost of a raisin 7.5% of that of your grape, and it has to go through a longer lifecycle before arriving in your kitchen.

The only two explanations I can think of for the price differential are:

  • The time criticality of the grape's sale
  • The grape's increased storage requirements.

Both of these suggest that the premium is for the circumstances surrounding their transport, rather than the product itself.


Posted by dan at 7:17am | Permalink | Comments (0) | Trackbacks (0)
Saturday 21 October, 2006

Problems solving my taxi problem

Filed under: Numbers and stuff

I'm having some difficulty solving my own taxi problem. Thomas Viner has commented with a generic solution, suggesting that the driver's expected distance from home is (100n)^0.5, after n 10km journeys.

Currently, I'm simply trying to figure out the expected distance after journey 2. Here's where I've got.

After the first journey, she is 10km from home, by definition. As such, it's immaterial to the puzzle which direction she took in this first journey. After journey 2, she lies on a circle with a radius of 10km and with a centre 10km from home. This circle passes through her home, and at its furthest, through a point 20km from her home.

I've adopted two scenarios: one in which her second journey results in her being in the semicircle nearest home (not necessarily meaning she ends up nearer home, however); another in which she ends up in the more distant semicircle.

Let's take the first of these.

Going through the trig., assuming a is the angle between the direction of her next journey and that of her home (less than 90° in this semicircle), I think that her distance from home after the second journey will be 10*((2−2cos(a))^0.5). If a = 0°, then this is 0km (i.e. at home); if a is 90°, then it's 14.14km. Pythagoras would support this if he were alive: root of 200.

In the farther semicircle (where a is now between 90° and 180°), the equivalent formula is 10*((2+2cos(180-a))^0.5). Again, this equates to 14.14km at 90°, and goes up to 20km at the 180° point. Things seem to be working.

Here's the problem: I don't know how to convert this into an expected value. (Maybe I did once, during my 17 years of maths schooling, but if I did, I don't now.)

What I have done is calculate the average distance from each of the 3,600 0.1° intervals around the circle. This is coming out at 12.73km. Thomas' formula calculates the expected distance as 14.14km. The discrepancy between the two suggests that one of us is most definitely wrong. Currently, I don't know who, but 14.14km certainly seems high.


Posted by dan at 6:50am | Permalink | Comments (3) | Trackbacks (0)
Wednesday 18 October, 2006

My simplified taxi problem

Filed under: Numbers and stuff

Let's assume that taxi journeys are all of an equal distance (10km, say), and that they go straight in a random direction. At the end of one journey, the driver picks up another passenger at that very drop-off spot.

After her first journey, the taxi driver is ten kilometres from her start point. But what is her expected distance from her original start point after a second journey? And is there a generic formula that tells us how far she is from his origin after n journeys?

With regard to the second journey, there is a tiny chance (infinitely small) that she will end up exactly at the start point; and there is an equally miniscule possibility that she'll be 20km from home. But I want the average distance (i.e. the expected distance, given that the angle of journey 2 is random). I have worked out that after the second journey, she has a 35% 33% chance of being closer to home than she was after the first journey.


Posted by dan at 7:15am | Permalink | Comments (5) | Trackbacks (0)
Monday 16 October, 2006

Know your prime factors

A fun little game to make you learn the prime factors of all numbers under 100. And here's another page to help you learn how to do the cube-root of six- and nine-digit numbers.


Posted by dan at 8:13am | Permalink | Comments (0) | Trackbacks (0)
Saturday 14 October, 2006

2^30 seconds old

Filed under: Numbers and stuff

Nine days after my 34th birthday next year, I'll be 2^30 (1,073,741,824) seconds old: 28 July, 2007 at around 6.30pm. My 2^31 "birth-second" will fall on 6 August, 2041, 18 days after my 68th birthday, fingers crossed. Relative to your own birthday, you'll find the same, give or take a day to allow for leap years.


Posted by dan at 10:15am | Permalink | Comments (4) | Trackbacks (0)
Friday 6 October, 2006

Pi

Filed under: Numbers and stuff

There was an article recently about a guy who set a new record by reciting pi to 100,000 decimal places. To check out the scale of the challenge, the digits are given here.

I decided that it was time that I at least made the effort to learn it beyond the seven decimal places that my school calculator displayed (3.1415927). So I've made it up to 20. If I were to learn 20 per day, I'd get to the 100,000 on 14 June, 2020.

Here are the first 20:

3.14159265358979323846


Posted by dan at 9:56am | Permalink | Comments (0) | Trackbacks (0)
Friday 22 September, 2006

Matching birthdays

Filed under: Numbers and stuff

Mat asked me yesterday what the chances were that if 11,000 one-second-long events occurred randomly across the course of a day, two or more would overlap. Even though there are 86,400 seconds in the day to go at, the chances of none of the events overlapping are phenomenally remote.

To make calculations easier, I assumed that events occur on the second rather than starting at the millisecond level. I don't think this simplification affects the calculations greatly, if at all.

To work things out, it's easier to calculate the chances that all events happen in distinct slots, than it is to find out the chances that two or more events happen at the same time; take the former number from 1 and you have the latter.

Anyway, the probability that events will not collide is:

1 - ((86,400!/(86,400 - 11,000)!) * (86,400^11,000))

or generically:

1 - ((X!/(X - Y)!) * (X^Y))

where X is the number of slots and Y is the number of events.

This is so close to 1 that it doesn't bear thinking about. I can't calculate it, as neither my calculator nor Excel can cope with such large factorials.

The puzzle is very similar to quite a famous birthday problem. If you ask random people in the street their birthdays (day and month only), then you only need to ask 23 people before the chance of having two matching birthdays is over 50%, assuming that birthdays are evenly distributed throughout the year. The fact that there are slight deviations in birth rates throughout the year only serves to increase these odds.

If you ask 30 people, your chances go up to 71%, 40 people gives you 89%, 50 people gives you 97%, 69 people gives you a 99.9% chance of matching birthdays. At school, I shared my birthday with someone in my class of 26 (60% chance) at the age of 10, but also shared the same first and middle name. Not sure what the odds of that are!

(As an aside, the reason I can remember the number of people in the class is that I just realised that after 23 years, I can still recite the class register for that year: Allison, Aslam, Bywell, Caunt, Cheema, Chitsabesan, Crann, Cullen, Greenhalgh, Halliday, Harrison, Howarth, Jackman, Khaliq, McNeill, Mahmood, Mene, O'Neill, Pollard, Riley, Saughman (sp.), Sutcliffe, Taylor, Tilney, Troy, Verity.)


Posted by dan at 9:13pm | Permalink | Comments (0) | Trackbacks (0)
Friday 31 March, 2006

March madness

Filed under: General, Numbers and stuff

So, March was a fun month on the blog front! For some reason, I've been post-happy, with 41 posts in March alone, or 1.32 posts per day. The previous high was in January when I posted as often as I took my daily vitamins, an even 31 posts.

Traffic was also high, with the second highest monthly total for page impressions (67,511; 2,177 per day) and by far the highest number of visits (19,764; 637 per day), dwarfing the previous monthly high of 13,846 back in July 2005.

The most popular single post visited in March was Pastas, maybe in part thanks to a direct link from Alan some time ago.

Search terms included the ever-present Beckhams (searches for Brooklyn Beckham directed people here 187 times; Romeo accounted for a further 20), PAS 78, lots of Deal or No Deal formula-related traffic and Karl Pilkington's diary. Also, lots of recent interest in the corn on the cob card, which I'd forgotten about.

And the international community is loving it, the most visiting countries being the US, Costa Rica (?), the UK, Australia, Brazil and Argentina. India, Canada, Japan and Holland complete the top ten, Holland accounting for just over 200 hits.

The total post count has crept up to 432, or 300 if we're working base 12! That's a decimal average of 0.682 posts per day since it all started on 6 July 2004 (0.823 in twelvimal).


Posted by dan at 11:17pm | Permalink | Comments (0) | Trackbacks (0)
Saturday 28 January, 2006

Odds are odd

Filed under: Numbers and stuff

The Monty Hall problem continues to bubble. It's strange how certain scenarios play havoc with your intuition, allowing your mind to jump to conclusions that are mathematically off, sometimes way off.

In trying (and failing) to explain the rationale behind the problem the other day to my hosting provider, we went on to explore a similar scenario. Instead of there being three doors, imagine there are 100. And instead of the host opening only one door, imagine he opens all but two (the one originally chosen plus one other), all opened doors coming with an accompanying bleat.

Even in this scenario, he believed that switching offered no benefit to the contestant. So I upped the ante.

Imagine I've put a red sticker on the shoe sole of one person in the world. Now I ask him to choose anyone in the world (without them lifting their feet). (He chose someone from China, after confirming that he wasn't allowed to choose himself.) I then eliminate 5,999,999,998 people one by one (assuming there are 6bn. people in the world), all of whom are bereft of a red sticker. So there are two people remaining: his original choice and the one remaining person I didn't eliminate.

Even under this scenario, he was of the opinion that switching offered no benefit, even though the reality means that your odds of success increase by 599,999,999,900%. That's 599 billion percent.

It seems that once your mind is convinced of something, it takes a lot of evidence to prove you wrong. Even overwhelming odds failed on this occasion.


Posted by dan at 8:41am | Permalink | Comments (1) | Trackbacks (0)
Monday 23 January, 2006

Rationale behind the Monty Hall problem

Filed under: Numbers and stuff

Yesterday, I was asked for the rationale behind the Monty Hall problem, which I originally referred to back in August 2004. I thought it worth sharing. The original problem involves three doors; I also worked out the logic for four.

The original problem goes like this. There are three doors, behind one of which is a car, behind the other two of which are goats. (Not sure why goats, but that's the version I heard.) The assumption is that you'd like to go home with a car as opposed to a goat.

You're invited (by a game show host, naturally) to pick a door, which you do. Irrespective of which door you pick, the game-show host opens one of the non-picked doors and reveals a goat. He then asks you whether you want to stick with your original choice, or switch to the other unopened door.

The answer is that you should always switch, as this doubles your chances of driving home as opposed to attracting bemused stares while walking home accompanied by a goat.

Let's refer to the doors as A, B and C. For the sake of argument, let's assume you choose door A. (Choosing each of the three doors is equally likely, and therefore the odds you see below can be divided by three and then multiplied by three at the end, with no overall impact. Doing so confuses and adds no value, so I won't.)

There are three potential cases:

- Case 1: car is behind door A
- Case 2: car is behind door B
- Case 3: car is behind door C

If you don't switch doors, then your chances of being correct are 1 in 3, as you ignoring any extra information being given. If you select door A, then in case 1 above, you'll win; in cases 2 and 3, you'll lose. The odds of each case occurring are equal, so the odds of winning the car if you don't switch are 1/3.

In case 1 above, the game show host will open either B or C. Either way, switching will result in a goat.

In case 2, he will open door C (he can't open A because you chose it, and he can't open B, because it hides a car). Switching will give you door B, which will result in a car.

In case 3 he will open door B (he can't open A because you chose it, and he can't open C, because it hides a car). Switching will give you door C, which will result in a car.

So, in equally likely scenarios, (1, 2 and 3), scenarios 2 and 3 give you a car; scenario 1 gives you a goat.

So if you don't switch, you have a 1/3 chance of winning. If you switch, the probability of winning goes up to 2/3 - double.

Now, let's move this up to four doors and see what it does to the odds.

The doors are A, B, C, D. You choose A. Cases 1 through 4 are that the car is behind A, B, C, D respectively.

The chances of winning if you don't switch are 1/4. Now, let's assume you switch.

In case A, if you switch, you'll lose, as you chose the correct door in the first place. In cases B through D, if you switch, there's a 1/2 chance that you'll win. This is because the car is not behind the door originally selected, and there are only two other doors to go for, one of which has a car.

So, your odds of winning are (1/4 * 1/2 * 3) = 3/8. This is:

[a 1/4 chance of one of a specific potentially-successful scenario
happening] *
[a 1/2 chance of success from switching] *
[3 scenarios]

The 3/8 chance of winning having switched is 50% greater than the 1/4 chance you would have had if you'd stuck.


Posted by dan at 11:26pm | Permalink | Comments (8) | Trackbacks (0)
Monday 19 December, 2005

Deal/No Deal

Filed under: Numbers and stuff

I just watched the end of a new gameshow on NBC - Deal or No Deal. (Not the best strategy for NBC's homepage, btw - of course I want their homepage!)

Basically, the contestant is presented with a set of 26 boxes, each containing a sum of cash - anywhere from $0.01 to $1,000,000. Over the course of the show, they are invited to eliminate the boxes, one at a time, with the view of going home with the contents of the one remaining box. However every so often, the "banker" will call them, offering to buy them off with a cash value to walk away.

My dad mentioned that there was a similar show airing in the UK, hosted by the Bransonesque Noel Edmonds who, I'm proud to say, has his own cheesy website. (Now awaiting comment from a certain S. Collier in Mid Glamorgan.)

For what it's worth, the banker is a stereotypical fat guy in a suit, silhouetted with a laptop in an office above the studio floor.

At any time during the show, basic statistics suggest that the contestant's expected take-home pay is the sum of the contents of the remaining boxes divided by the number of boxes remaining. At the start of the show, this equates to $125,736.

Towards the start of the show, the banker's offers come in lower than the expected take-home - having eliminated four