Header tag

Sunday, 15 May 2011

Physics: The Sound Barrier and Sonic Booms

After sobering up from his drunken walk home, Isaac Newton went to see his friend, Mr Science.  However, as Isaac went along, he noticed that the roadway to Mr Science's house was very busy; Mr Science lived in the middle of town, and it was market day, and Isaac found that there were large crowds of people milling around in front of him.  Still, walking was definitely the quickest way to see his friend, as although gravity had been invented, cars were still some way off in the future.

Isaac Newton was quite keen to get to Mr Science's house to discuss his adventures with apples, including his failed attempt to launch it into space, and started jogging and jostling through the crowd, shouting at people to move out of the way, instead of just meandering through it.  He bumped into people more frequently as he did so, but kept on jogging undeterred, and found that the faster he jogged, the more people he bumped into; in the end, he put his arms out in front of him like a wedge and started pushing his way through with more effort.  This continued until he found that crowds of people were gathering together in front of him, despite him shouting at them, they were barely unable to get out of his way before he started ploughing into them.  Finally, he realised he was going that fast, that the people, all bunched up in front him and desperate to get out of his way, were unable to stand aside and he sent the crowds tumbling left and right in front of him.

When he arrived at Mr Science's house, he recounted the strange behaviour of the crowd and the various stages he'd encountered. "That's interesting," commented Mr Science, "That reminds me of an experiment I've just been running."

Isaac's journey through the crowd is very similar to an aircraft (or a car) as it travels at speeds close to the speed of sound.  The atmosphere is made up of gas particles which travel around, silently bouncing off each other and generally behaving randomly (in the real sense of the word), at speeds which are close to - but less than - the speed of sound.  Particles in a gas are extremely small (as all particles are), and by comparison, the spaces between them are relatively large.  This means that there are large gaps between them, and if you move a large, solid object between them (or, for example, start walking through them) then you're able to push them aside and move through the gas.  

Walking at low speeds, you're not likely to notice this effect, but at larger speeds, for example running, you'll feel the air as it rushes past your face.  Cycling through the air, you'll feel this more strongly, and as you increase your speed, you'll begin to feel the effort of pushing through the air - it'll feel as if there's a wind blowing into you, pushing you back.  This is known as 'air resistance' and it increases as your speed increases.  You're pushing more and more air particles aside, as you cut through the air, and this takes more effort.  At these speeds, it becomes more and more important to get into an aerodynamic position - as low down as possible, elbows tucked in, and so on, to cut through the air as economically and as easily as possible.  In Isaac Newton's case, he put his arms out in front of him like a wedge, so that he could push through the crowds of people as easily as possible.

Now, the gas particles in the atmosphere are bouncing around, flying around at close to (but less than) the speed of sound, which is 330 metres per second (or thereabouts).  In an aircraft, it's possible to approach and exceed the speed of sound, but in order to do so, the aircraft has to push through the air particles as if they were a crowd.  At walking and cycling speeds, the air particles can easily move aside as you push through them, but at speeds close to the speed of sound, they particles are unable to get out of the way of an aircraft.  The aircraft has to shove the particles aside - this becomes very difficult at speeds close to the speed of sound - and break through the sound barrier.  


The air particles start to bunch up in front of the nose of the aircraft until eventually (if it continues to accelerate) they are pushed aside in a huge compression wave.  All these particles pushed together in one go produce a loud noise - a sonic boom - as the aircraft exceeds the speed of sound and goes supersonic.  

 This sonic boom continues to travel along the ground and will be heard along the line of the aircraft's flight path - it isn't produced just once and then stops.  Mr Science tried to explain all this to Isaac, but Isaac was extremely pleased with having discovered gravity, and wasn't in the mood to discuss ways of beating it in huge flying machines, let alone ones that could travel faster than sound.  "Maybe some other time," he explained to his friend, "When I've finished with the apples."

Friday, 6 May 2011

Web Analytics: Reporting, Analysing, Testing and Forecasting


Reporting, Forecasting, Testing and Analysing


As a website analyst, my working role means that I will take a large amount of online data, sift it, understand it, sift it again and search for the underlying patterns, changes, trends and reasons for those changes.  It's a bit like panning for gold.  In the same way as there's a small amount of gold in plenty of river, there's plenty of data to look at, it's just a case of finding what's relevant, useful and important, and then telling people about it.  Waving it under people's noses; e-mailing it round; printing it out and so on – that’s reporting.

However, if all I do with the data I have is report it, then all I'm probably doing is something similar to reporting the weather for yesterday.  I can make many, many different measurements about the weather for yesterday, using various instruments, and then report the results of my measurements.  I can report the maximum temperature; the minimum temperature; the amount of cloud coverage in the sky; the rainfall; the wind speed and direction and the sunrise and sunset times.  But, will any of this help me to answer the question, "What will the weather be like tomorrow?" or is it just data?  Perhaps I'll look at the weather the day before, and the day before that.  Are there trends in any of the data?  Is the temperature rising?  Is the cloud cover decreasing?  In this way, I might be able to spot trends or patterns in the data that would lead me to conclude that yes, tomorrow is likely to be warmer and clearer than yesterday.  Already my reporting is moving towards something more useful, namely forecasting.

The key difference between the weather and online data, hopefully, is that when we come to analyse business data (marketing data or web data), I'm in a position to change the inputs of today’s data.  I can't do much today with my measurements to influence tomorrow's weather, but online I can change my website’s content, text, layout or whatever, and hopefully make some changes to my online performance.  No amount of measuring or reporting is going to change anything – not the weather, not sales performance.  Only changes to the site will lead to changes to the results.  Then, I can not only forecast tomorrow's online performance, but also make changes to try to improve it.

No change means that there's no way to determine what works and what doesn't.  I've been asked to try and determine, "What does good look like?" but unless I make some guesses at what good might be, and test them out on the website, I'll never know.  What I should be able to do, though, is forecast what future performance will look like - this is the advantage of having a website that doesn't change much.  Providing most of the external factors (for example traffic sources, marketing spend, product pricing) stay the same, I should be able to forecast what performance will be like next week.  Unfortunately, the external factors rarely stay the same, which will make forecasting tricky - but it'll be easier than forecasting performance for a changing website!

Consider the following situation:  here's my online promotion, and I've simplified it (I've removed the text, and really simplified it) and I've reduced it to a colour and a shape.  So I launch my campaign with Red Triangle, and measurements show that it is worth 500 points per day (I'm not discussing whether that's clicks, sales, quotes, telephone calls or what - it's a success metric and I've scored it 500 points per day).



       500 points per day



If I make no changes to the promotion, then I'll keep using Red Triangle, and theoretically it'll keep scoring 500 points each day.  However, I might change it to something else, for example, I might test Green Circle





300 points per day





Now, Green Circle scores 300 points per day, over a week.  Is that good?  Well, Red Triangle scored 500 points per day, so you might think it'd be worth changing it back.  There's a barrier here, in that if I do change it back to Red Triangle, I have to admit that I made a mistake, and that my ideas weren't as good as I thought they were.  Perhaps I'll decide that I can't face going back to Red Triangle, and I'll try Blue Square instead.
 
 


 200 points per day


But what if Blue Square scores only 200 points each day?  Do I keep running it until I'm sure it's not as good, or do I carry out a test of statistical significance?  Perhaps it'll recover?  One thing is for sure; I know what good looks like (it's a Red Triangle at the moment) but I'll have to admit that my two subsequent versions weren't as good; this is a real mental shift - after all, doesn't optimising something mean making it better?  No, it's not scientific and I should probably start testing Red Circles and Green Triangles, but based on the results I've actually obtained, Red Triangle is the best. 

Maybe I shouldn't have done any testing at all.  After all, Green Circle would cost me 200 points per day, and Blue Square costs me 300 points per day.  And I've had to spend time developing the creative and the text - twice.

Now, I firmly believe that testing is valuable in and of itself.  I’m a scientist, with a strong scientific background, and I know how important testing has been, and will continue to be, to the development of science.  However, one of the major benefits of online marketing and sales is that it's comparatively easy to swap and change - to carry out tests and to learn quickly.  It’s not like changing hundreds of advertising posters at bus stops up and down the country – it’s simply a case of publishing new content on the site.  Even sequential tests (instead of A/B tests) like my example above with the coloured shapes, will provide learning.  What's imperative, though, is that the learning is carried forwards.  Having discovered that Red Triangle is the best of the three shapes tried so far, I would not start the next campaign with a variation of Blue SquareLearning must be remembered, not forgotten.

Having carried out tests like this, it becomes possible to analyse the results.  I’ve done the measuring and reporting, and it looks like this:  Red Triangle = 500 pts/day, Green Circle = 300 pts/day, Blue Square = 200 pts/day.

Analysing the data is the next step.  In this case, there genuinely isn’t much data to analyse, so I would recommend more testing.  I would certainly recommend against Green Circle and Blue Square, and would propose testing Yellow Triangle instead, to see if it’s possible to improve on Red Triangle’s performance.  It all sounds so easy, and I know it isn’t, especially when there’s a development cycle to build Yellow Triangle, when Green Circle is already on the shelf, and Blue Square is already up and running.  However, that’s my role – to review and analyse the data and recommend action.  There are occasions when there are other practical reasons for not following the data, and flexibility is key here.

In fact, for me, I’m always looking at what to do on the website next – the nugget of gold which is often a single sentence that says, “This worked better than that, therefore I recommend this…” or “I recommend doing this, because it provided an uplift of 100 points per day".  That’s always the aim, and the challenge, when I’m analysing data.  Otherwise, why analyse?  My role isn’t to report yesterday’s weather.  At the very least, I’m looking to provide a forecast for tomorrow’s weather, and ideally, I’d be able to recommend if an umbrella will be needed tomorrow afternoon, or sun tan lotion.  Beyond that, I’d also like to be able to suggest where to seed the clouds to make it rain, too!





Tuesday, 3 May 2011

Web Analytics: Pages with Zero Traffic

HOW TO TRACK PAGES THAT GET NO TRAFFIC

In this post, I'm wandering from my usual leisure-time subjects to one that's come up at work, and on some web analytics forums:  how can you tell which pages on a website aren't getting any traffic?

It's an interesting question - how can you tell if a page has zero page views - i.e. no traffic.  We're always interested in the pages that generate the most traffic on our sites; the ones that are our superstars, getting the most visitors and attracting the most attention.  However, the flip side of this is that there may be some pages on our sites that have no traffic at all, and are just taking up space, maintenance time and so on, for no benefit at all.

The issue is that all our analytics tools work when our pages are viewed - when visitors load up our pages, point to our links and visit our site, so identifying the zero-traffic pages is not an easy task, and can't be done directly.  Instead, it must be done by a logical process, and my suggestions would be this.  Firstly, identify any suspect pages, which you can tell by process of elimination - run a report that shows all the pages that have had visits, and then deduce which ones haven't.  Or, alternatively, hit all (and that really means ALL - the better your spidering now, the better your results later) the pages on the site during a visit - go through your site and make sure that you visit every page at least once.  This depends on the size of your site - and although I haven't checked, it might be possible to obtain a manual site spidering tool that will go through your site, firing off the javascript tags on each page.  

Once on each page is sufficient, to fire the tag.  If you're doing this manually, make sure you're not using a PC that has its IP address screened out by any filters you may have set up.

Having done this, go on to run a page report for all pages, for the date that covers your spidering session.  Then use the calendar to compare it against any other time frame - in particular, the time frame that you are actually interested in looking for zero-traffic pages.  Sort the pages by the number of page views they got during the time frame of interest, in ascending order.  By doing this, you should see that all the pages that received visits on the test date, but haven't had any during the time frame of interest, come to the top of
the list.  Note from the quick mock-up below how the pages which had the most traffic in the first time frame come to the top of the list.  By reversing the two time frames, it'd be possible to bring the one-day traffic to the top, and compare with the one-month time frame.






It's not pretty, but it should work, and has the advantage that you only have to visit all the pages once (and make a note of the date that you did your visit, for reference, so that you can run further tests in future, as necessary.

Please let me know if this works for you; I haven't tried it (!) but based on my experience it should work successfully.

Other articles I've written on Website Analytics that you may find relevant:

Web Analytics - Gathering Requirements from Stakeholders

Friday, 29 April 2011

Review of Transformers 2: Revenge of the Fallen


As the trailer for the new Transformers film has been launched today, it seems like a good time to look again at the previous film, Revenge of the Fallen.  After its release, a number of people asked me what I thought of it, and I wasn't really able to answer such people at length and explain exactly what my opinion is, or to say whether or not I really enjoyed watching it.

So, here goes - my first written film review. And it will be detailed, and will contain spoilers. I should explain that I am a very big fan of Transformers, have been since I was about 8 years old, and thoroughly enjoyed the first Transformers movie, in 2007 (and the one in 1985). I can recall when Sideswipe and Ironhide were red, while Jazz and Ratchet were white.

When I settled down to watch the film, I noticed all the credits at the start: Dreamworks this, and Steven Spielberg that, and Michael Bay etc etc, and Hasbro. "Oh yeah," I thought to myself, "The toys - it all started with the toys." And thought nothing more of it at the time. It has crossed my mind several times since.

The film starts with the Autobots tracking down Decepticon activity all over the globe, having formed an alliance with the humans. I had to learn in the first movie that human weapons are effective against Transformers - they certainly never used to be, but okay, we'll accept that they are now. Ironhide leads a team to track down some nameless Decepticon. Now, excuse me for asking, but why don't the Autobots speak when they're in vehicle mode? Or do anything sensible? We do get the full length, ten-second-long Ironhide transformation - we know we'll never see a transformation take that long again - and Ironhide finally starts speaking. (Compare this with the scene in the first movie, just after Starscream's airstrike on the city has taken out Bumblebee's legs... Sam has to tell Jazz, who's still in vehicle mode, to back off and reverse. I'll repeat my earlier question - why don't the Autobots do anything sensible in vehicle mode?).

And yes, it is some nameless Decepticon.  Sadly, this is something that I had to get used to, as it cropped up repeatedly.  I guess here is as good a place as any to cover the new characters in the film. There are loads. In fact, to be quite honest, it's the single greatest issue I have with this film. I loved the explosions, I loved the hardware and the storyline, but the number of new characters was overwhelming. On both sides, but especially the Decepticons. The Autobots - we see them in their hangar, an array of shiny sports cars and motorbikes, a couple of Japanese minicars and an ice cream van. No, I know very few of the names of these characters, and very few of them got personalities - just accents. The purple ice cream van rates as moderately annoying. The two Japanese minicars - one of them was called Skids, which was really disappointing considering the intelligence of the original character - were stupid. I think a professional film reviewer likened them to Jar Jar Binks, which is quite accurate - right down to the racial stereotyping. One Autobot I did pick out was Sideswipe, who was silver, instead of red. Now, he has no feet, just wheels. Nor does he have hands or forearms - just large spikes on his elbows. I was thoroughly unimpressed by this - it strikes me as lazy CGI and I was not happy. But anyways, it was only a fluke that I found out that this particular character was Sideswipe - he could have been anonymous if I'd not been listening closely.

Having mentioned the large number of Autobots, this is nothing compared to the Decepticons. At one point towards the end of the film, it almost literally starts raining Decepticons. A huge army of Decepticons arrives in the desert and start attacking our heroes, and as I watched this, I started to wonder why the existing Decepticons - those already introduced in the story, or even some already on Earth - didn't show up. I'm still not sure, but I think the answer is that Hasbro are named in the credits, and more figures (I can't call them characters - I don't think they have a line of dialogue between them) means more toys. Now, these fresh warriors all look pretty much the same, since they haven't adopted an earth-based vehicle mode. In other words - they don't transform. This is, above and beyond the number of new characters; the stupid accents; the nameless characters, the single most irritating part of this film. Transformers that don't transform? No. Big mistake. Wrong. And wrong from the perspective of the toy makers too. Surely Hasbro should keep in mind that the original series of toys were successful because they were robots and vehicles. I should mention at this point "The Fallen" who also doesn't transform... he could have been any sort of intergalactic weapon - tank, spacecraft - but no.

And if you want further evidence that this is a toy-maker's film, consider Starscream, who is one of the few Decepticons to make it from the first film. Ordinarily, Starscream version 1.0 would be sufficient for most kids, but no. To quote one of the soldiers (I can't recall which), describing Starscream in aircraft mode - "It's got some crazy alien graffiti all over it." That's right, kids, Starscream from the first film is out-of-date, time to go splash out on Starscream version 2.0. And if you thought the original Optimus would suffice... sadly not, as, towards the end, we get Japanese-armoured-style ultra super-powered Optimus with the armour of that poor unfortunate defecting Decepticon, Jetfire. I bet the armour in the toy version either (a) sticks on and doesn't come off, leading to a non-transforming Transformer, or (b) doesn't stay on when it's put on. I'm not sure which is worse.

That's covered most of my ranting about the robots, now let's turn to the humans.

Now - Megan Fox. Oh good grief... I'd heard that she was in the film almost exclusively as eye candy, but the first few scenes with her in, posing on the motorbike, were just too much. Perhaps I'm the wrong side of, say, 14 years old, but it was just a bit too obvious that she was just in the film for the teenage boys.

Sam's parents, who thoroughly annoyed me during the first film, were back on form. Why, why, why do the film makers insist on giving Sam's parents lines, or even screen time? They are the most unnecessary characters in a film that I've ever come across. The "Sam's special time" scene from the first film could have been cut in its entirety and the film would have been greatly improved. In this film, it was the scene where Sam's mum buys a 'herbal rememdy' from a student that could have been left on the cutting room floor. Many people have commented that this film was over-long... I think I've just solved the problem.  I'm with Ironhide, who in the first film commented, "Can't we terminate the humans?  The parents are very irritating."

Speaking of Sam's parents - shortly after (before?) the first Megan Fox scene, we come to the scene with the kitchen critters and Bumblebee blasting the house down. Yes, I enjoyed this one - and in particular the extremely cool kitchen critters (no lines of dialogue, no names) but why, oh why has Bumblebee been reduced to an overgrown guard dog in the garden, with his own kennel? And, okay, perhaps it's a plot contrivance that he's lost his voice, but when did he become an over-exuberant teenager? He used to be a no-messing warrior who protected Sam from Barricade (the police car) and an all-round fighter. A highlight of the film is the scene where Sam has to tell Bumblebee to grow up and remember who he really is.

Now? He can't wait to go to college with Sam? Okay, I'll let it go, but I did think it was particularly stupid that he lived in the garage like a dog. And yes, I thought some of the kitchen critters were cool, but it didn't dawn on me until a little later that they were obvious merchandise, and would probably be in my local Toys R Us store by the end of the movie.

One of the film's biggest redeeming features for me has to be the Sector Seven agent, Simmons. He is brilliant. I loved his archive of antiquated Transformers, Frenzy's head in his office, I liked his panicky but genuine character, and the way he ordered the naval barrage was inspired. I like this character, and hope to see him in the third film.

Finally - Alice, the human who turned out to be a Decepticon. She doesn't Transform... and Decepticons never, ever, took human form. Mind control, yes. Human form? No. "Decepticon Pretender".  Possibly.

Overall, I actually liked this movie. I thought the effects were amazing; the music was outstanding (most of it taken from the first movie, and I was nodding along at various points); the story was actually well written, if a little cheesy in places... the idea of Sam having the power of the Allspark in his head goes back to a comic-book story where Buster Witwicky (yes, that was his name) was given the Creation Matrix by Optimus for safekeeping. Yes, I thought, on the whole, it was enjoyable, possibly overlong but on the whole kept ticking along at a good pace. Did I want the DVD for Christmas? Yes please. Would I watch it repeatedly until I'd learned the script? Possibly.

I think I could some up my views on this film by considering if I would I watch it all the way through; the answer is probably. Although I can quite easily see myself skipping the boring bits (with the humans), there's enough pace to make it watchable, and I'll also like to find out all those Autobots' names!  Overall, I'd recommend watching the DVD with the subtitles turned on - that way, you'll get all the dialogue, character names and all the parts of the plot.

So, I'm looking forward to the new film, and I'll be posting a review here when I've seen it!

Thursday, 28 April 2011

Isaac Newton's Random Walk

Poor Isaac Newton.  He was having a pleasant afternoon nap, but was disturbed by a gravity-driven apple.  His attempts at destroying the apple that fell on his head have almost led to the death of a poor innocent bystander, and he's had to explain his actions to the local constabulary.  After a long and gruelling day, he's visited the local pub, and drunk slightly too much cider (stupid apples).  Now, having stepped out of the pub, he has to get to his house at the end of the street.  Alternatively, he could go to his aunt's house, at the other end of the street.

Conveniently, the pub is located at the middle of the street, which is 20 metres long.  His house is at one end, his aunt's house is at the other end.  Both possible destinations are 10 metres away.  In his slightly tipsy state of mind, the best that Mr Newton can manage is a stride of 1 metre; however, he's so unbalanced (he's also developing an apple-shaped bruise on his head) that it's not guaranteed that he'll keep going in the same direction.  In fact, it's 50/50 each time on which way he'll go.

How many steps will it take him to get home?  And at the rate of one step every 10 seconds, how much time will it take?



There are two ways of solving this one: the pure maths way, or the spreadsheet way (actually do some experiments on a spreadsheet).  Let's do the spreadsheet way first.



Each step is 1 metre long, but can be +1 metre or -1 metre, so we need to randomly produce a +1 or a -1 and add it to the previous distance walked.  This is easy enough in a spreadsheet - with a column of random +1 and -1 and a column which sums the previous column.  The function I've used for the random numbers is:

=(2*ROUNDUP(RANDBETWEEN(0,1),0))-1

I then look down the 'total distance covered' column until I find the first +10 or -10.

I've run the test 20 times, and have obtained the following results for the number of steps it takes Mr Newton:

22, 20, 30, 20, 82, 94, 142, 106, 52, 51, 76, 92, 44, 74, 142, 50, 25, 17, 82 and 16.

What is there to say on this?  Isaac only has to travel a net distance of 10 metres in either direction, and yet in some cases it's taken him over 100 steps to cover the distance (he's not just drunk, he's very drunk).  At his best, he's managed it in 16 steps, with most of them in the same direction!

The results here show how probability (chance) is a key part of this question.  We've not given Isaac any sense of direction at all, and he's at the mercy of probability.  As a result, mathematically, all we can aim for is an approximate, or an average distance that Newton can travel.  Unfortunately for him, the mathematical average of his wanderings is going to be close to zero - for every step he takes to the left, he has an equal chance of taking a step to the right.

Doing it the pure maths way involves probability.  There's a 50% chance that Newton will go to the left (let's call this a step of -1) and a 50% chance he'll go to the right (this is a step of +1).  Let's start him at zero, and assume that he has to reach either +10 (his home) or -10 (his aunt's home).

After his first step, he has a 50% chance of moving even closer to his target, and a 50% chance of returning to his starting position.  So the probability of him making two consecutive steps towards either target is (0.5 x 0.5) x 2 since he has two targets to aim for (one at each end of the street), which is 0.5 - in fact, after two steps, Isaac has either moved two steps towards one target (+1, +1 = +2 or -1, -1 = -2) or moved back to his start position (+1, -1  =0 or -1, +1 = 0).


However, the maths becomes considerably more complex after three steps, and more complicated still if we need Isaac to achieve ten steps in one direction or the other.  I won't do the maths here, but after a large number of steps, it becomes clear that the most probable location after a large number of steps is close to the start point, as mentioned above.  On average, the number of steps in one direction will be balanced by an equal or similar number of steps in the other.  This is known among mathematicians as the random walk problem, and Wikipedia has plenty to say on it (no surprises there).

The question becomes not "When will Mr Newton reach his destination?" but "How likely is he to have reached his destination after 10 or 20 or 30 or 40... steps?" and that's far more complicated than I'd like to cover here - it's why I prefer science to maths!

Other articles I've written with spreadsheet solutions include:


What is smog?

Over the last few days, we've seen in the news how some of the cities in Britain (well, we've had pictures of London, and on the television London = Britain) have been covered in smog.  The word "smog" comes from a combination of smoke and fog, but what causes it and where does it come from?

Smog usually comes from sources like car exhaust fumes, and fumes which have reacted in sunlight to produce other pollutants (called 'secondary pollutants').  Worse still, the primary pollutants (directly from car exhaust fumes or from burning coal) can react with the secondary pollutants to produce a real mix of gases, called photochemical smog.  "Photochemical" reactions are ones that use light to make them go - in the case of smog, it's sunlight that drives the reactions.

Photochemical smog is produced by the chemical reaction of sunlight, nitrogen oxides (NOx) and other organic compounds in the atmosphere.  Smog also contains airborne particles (called particulate matter - bits of dust, ash and smoke) and ground-level ozone.  Ozone is best kept in the upper atmosphere; at ground level it's toxic (despite what you might have heard about invigorating ozone at the seaside - that's just misinformed nonsense).

Nitrogen oxides are formed when nitrogen and oxygen in the air react together under high temperature such as in the engines of cars and trucks, coal power plants, and industrial manufacturing factories.  Nitrogen and oxygen make up about 98% of the atmosphere between them, and when these are drawn into a hot internal combustion engine, they react together to product nitrogen oxide (NO) and nitrogen dioxide (NO2).  Both NO and NO2 are harmful to human health.

So, smog contains ozone (toxic) and NOx (harmful), along with dust, smoke and so on.  It builds up when the air is still - very little wind - and can occur at times when there's high air pressure.  London has suffered serious instances of smog in the past, in particular in 1952.  Work has been done to reduce smog in Britain and in Europe, in particular reducing the sulphur content of fuels - burning fuels that contain sulphur leads to the formation of sulphur oxides which contribute to smog - and also, incidentally, to acid rain.  This is why smog is generally rare in London... that, and the fact that we rarely get the still, sunny weather that's needed to produce it!

Friday, 1 April 2011

Moon's Orbital Radius Increasing

In an unexpected and unprecented move, the European Space Agency announced this morning that their data shows that the Moon has started to increase its mean orbital radius at a rate considerably higher than previously believed.  It's been known for some time that the distance from the Earth to the Moon is increasing, but the rate of increase is worrying.  In other words, the Moon is moving further away from the Earth faster than we thought, and in a few year's time will leave the Earth's orbit completely.  

This finding comes after a series of measurements of the Earth-Moon distance (carried out using a more accurate process than this one), using a laser beam pointed at a network of mirrors which Neil Armstrong placed on the Moon's surface over 40 years ago, during the Apollo 11 mission.  By measuring how long it takes for a beam of light to travel to the Moon and back, ESA scientists have been able to determine that the distance from the Earth to the moon has, over the last three years, increased by an average of 140 metres per year.  




However, more alarming is the fact that the rate of increase is also going up - the Moon is, on average, moving further away at a faster rate with time.  The increase over the last six months is about 1.4% more than the average increase over the previous six months.
 



Exact forecasts vary, but ESA scientists are all agreed that within 14 years the Moon's orbit will have extended so far that it will leave the Earth's gravitational field completely, and head off into space.  The team of scientists have proposed various reasons for the Moon's recent moves, and the most common suggestions are related to the recent tectonic activity on Earth - the tsunami of 2004, the volcano in Iceland during 2009-10, and possibly the recent earthquakes near New Zealand, an in particular Japan, which has left to a shortening of the length of the Earth's day.  The recent earthquakes have coincided with the moon coming towards a particularly close approach (perigee) and the theory proposes that this has caused the moon to increase its speed while making this close approach, which will lead to it reaching a larger distance at its furthest point 14 days later.

Other scientists have yet to confirm the team's findings, which have sparked considerable controversy in astronomical circles.  Teams in the southern hemisphere have carried out measurements into the exact time for the moon's orbit and have not noticed a significant change in this - either an increase or a decrease, and therefore have concluded that the moon's orbital radius has not changed.  Other teams are preparing to carry out their own measurements using Armstrong's mirrors, and will be sharing their results later next week.

Tuesday, 29 March 2011

Maths Puzzle 6: Maximum area for a perimeter

Here's a puzzle I devised, pondered and then worked on solving:  imagine you have a piece of string, tied so that it forms a closed loop exactly 12 cm long.  What's the maximum area that could be contained by the string if the shape that was formed was always a right-angled triangle?


Okay, so it's not a difficult question to describe, but taking it apart leads to some interesting questions.  At one extreme, we have a triangle that's almost exactly 6cm tall with almost no width, and at the other extreme, we have a triangle that's almost exactly 6cm wide with no height.  Somewhere in between we have a triangle with maximum area.


The main formulae that we need to use to help us are the area of a triangle, the perimeter of a triangle, and the relationship between the sides of a right-angled triangle.


The area of a triangle is half times the base times the height.  In our case, let's call the base x and the height y.


A = xy / 2


The perimeter of a triangle is the sum of the three sides, x, y and the third side (which will be the side opposite the right angle), the hypotenuse h.


x + y + h = 12


Finally, the relationship between the sides of a right-angled triangle are set by Pythagoras' Theorem, which says that x2 + y2 = h2


I'm sure there's a complicated expression that connects x, y, h, A and the perimeter, but that's not how I solved this problem.  In other words, I solved the problem by testing various values of x, and using a spreadsheet to determine y and h, and therefore A.


The relationship between x (the height) and A (the area) is shown in the graph and table below.




A few points I noticed about my results:

As I had anticipated, the maximum area is obtained by having an isoceles triangle, with two sides of 3.51, which is 12/ (2 + sqrt 2)), and it isn't 3 1/2.

What surprised me, though, is that the graph is not symmetrical.  I suppose, on reflection, there's no way it can be symmetrical:  if having length x at 0 cm leads to zero area, and having length x at 6 cm also leads to zero area, then for the graph to be symmetrical, the area would have to peak at exactly x=3, and this wouldn't be an isoceles triangle.

I also assumed it would be symmetrical because I was too busy looking at the symmetry of x and y.  For each value of x, there's a corresponding value of y, and the two can be swapped around (so that (x,y) is a valid pair, and so is (y,x).  However, the relationship between x and A, the area, is much more complicated, and it is not symmetrical.

This second graph is perhaps a little confusing, but it represents the way that the two sides x and y, and the area A are connected.  The area of the bubbles or circles represents the area of the triangle which is produced when the sides of the triangle are x (along the bottom) and y (up the side).  I've highlighted the maximum area with a lighter blue.

For those who are interested - no, I haven't calculated A in terms of x alone, and I haven't differentiated either. I've just used Excel to 'goal seek' values of y and h for a given value of x, and worked from there! Some things to note: there are better ways of enclosing area other than using a triangle. For example, by using a square with three sides of 3cm each, we could enclose an area of 9 cm2, which is almost 50% more than with the right-angled triangle. The optimum approach would be to have a circle. For a circumference of 12 cm, the radius of the circle would be 1.91 cm (12 divided by 2 pi) and the area would be 11.46 cm2, which is approaching double the area enclosed by the triangle, and 27% more than the square.

Friday, 18 March 2011

What are Constellations?

Astronomy 2:  Constellations

Constellations are man-made dot-to-dot pictures in the night sky, connecting the stars in the sky into pictures of people, animals and other objects.  The stars we see were grouped into constellations by the Greeks, who made up stories about their gods and then used the characters from these stories as the basis for grouping stars together.  For example, a group of stars might look like two people standing side by side, and so they'd be identified as twins.

The stars that we group into constellations are not always close together in space.  Although two stars might look close together, one could be considerably further away than the other, but might seem to be next to each other because we have no sense of perspective in space.  We can't tell if one star is closer to us than another - and brightness is no help either.  A star that looks bright might be close to us, but a star brighter might be an extremely bright star that's actually further away.

Anyway, treating the stars as points on a flat canvas, the ancient Greeks started to group stars together into pictures, characters, animals and so on.  They didn't have to contend with light pollution, and tended to have clearer skies than we do in Britain (I've missed a number of eclipses due to clouds) so they were able to see more stars at night.  This makes it easier to draw their imaginary dot-to-dot pictures in the sky.

The Greeks got to name the constellations that we talk about today, because they were the first to classify them.  However, there's nothing wrong with devising your own constellations, using the stars that you can see at night.  For example, here's a constellation called Ursa Major (Greek for the "Great Bear").  




This part of the constellation is also known as the Plough.  But they could just as easily be called the Saucepan or the Ladle.




The saucepan...




Or the ladle...


A few things to consider when looking for constellations:  they're not always the same way up.  The Earth is rotating all the time, and this means that the stars (and the constellations) rise in the east and set in the west, in the same way as the Sun (and the moon).  The Earth's axis is tilted - what this means is that the Earth doesn't spin with a vertical axis (like spinning a basketball on your finger), but it's tilted so that it spins with a tilt


The effect of this is that the constellations appear to rotate around a point in the sky - in fact, there's a star in the sky which doesn't rotate.  The earth's axis points directly at it, as it's above the North Pole, and the star is called Polaris.  The photo below was taken near the equator, and shows the stars rotating around the pole star (the dot near the centre of the horizon).




So, although pictures in a book or on a website might show an 'upright' version of a constellation, bear in mind that it might not always look like that in the sky.  It might be at a slightly different angle, and parts of it might be obscured by clouds, and may have fainter stars hidden by light pollution.  One very important consideration is the time of the year; some constellations are only visible at certain times of the year.  I'll explain this some time soon, but as an example, Orion is only visible during the autumn and winter months.

And in all honesty, constellation spotting is sometimes an exercise in imagination.  Some constellations look nothing like the objects or characters that they're meant to represent, and require a serious leap of faith to identify.

Saturday, 12 March 2011

Physics: Gravity vs Sound

Isaac Newton, upset with his failed attempt to discard the apple that woke him from his afternoon nap, decided that it was time to take stronger measures to destroy the apple once and for all.  Deciding that he would give the stupid apple a lesson in gravity, he took it to the top of a tall building, and dropped it, so that it would hit the ground at great speed and disintegrate into lots of tiny pieces of apple sauce.

However, to his horror, he realised at the exact moment that he dropped the apple that there was a poor unfortunate man standing directly underneat the apple, and shouted down at the man to move out of the way of the doomed fruit.

But would the man hear Isaac's shout in time?  Or would he suffer the same fate as our unfortunate father of modern physics?

The question is - which will reach the man first:  the apple, accelerating due to gravity, or the sound of Mr Newton's shout, travelling at the constant speed of sound?

Firstly, the apple.  The apple is accelerating at 9.81 ms-2, getting faster all the time.  Yes, I'm ignoring terminal velocity and air resistance for now.

The formula to use for the apple is   s = ut + 1/2 a t2.
s = distance travelled
u = initial velocity = 0
t = time since apple was dropped
a = acceleration due to gravity

since u = 0, (when the apple was dropped it had zero initial speed), we have a simplified formula:  s = 1/2 a t2
This tells us s (how far the apple has fallen) after so much time has passed (t).  We can rearrange it to tell us how long it will take the apple to fall from a building of height s.  This gives us:

√(2s/a) = t


The formula for the sound of Isaac Newton's shout is simpler:
v = s / t

s = distance
v = velocity = the speed of sound, 330 ms-1
t = time since Isaac shouted

Rearranging gives us t = s / v


Now, suppose the building Isaac standing on was 300 m high, just short of the Chrysler Building's 319m.  No, the buildings in Isaac Newton's time weren't this tall, but let's just suppose he had a time machine and he made the journey.


For the apple: √ (2s/a) = t
Time taken is 7.82 seconds

And for the shout,

t = s / v = 300 m / 330 ms-1 = 0.909 seconds


So, the shout will reach the ground (7.82 - 0.909 = 6.91) seconds before the apple does, giving the potential victim time to move out of the way.



From here, we can go on to work out how high a building would have to be for the apple and the sound to reach the ground at the same time. From any height above this, the apple would always land before the shout (because the apple will keep accelerating - we're still ignoring terminal velocity) and no amount of shouting would save a victim from being hit on the head by the apple.


In order to do the calculation, we simply set the time for the apple and the time for the shout to be equal.  This gives us:

t = √(2s/a) = s / v

√(2s/a) = s / v
2s/a = s2 / v2

2 v2 /a = s

We can now put in (substitute) the values for the speed of sound (330 ms-1) and acceleration due to gravity (9.81 ms-2), and calculate the height of the building (s).  


2 x 3302 / 9.81 = 22,201 metres, whiich is very, very high indeed.  To put it another way:

It's just over 73,200 ft, which is 2.5 times higher than Mount Everest.
It's twice the height on airliner's cruising altitude.


Air resistance will be less of a problem to start with, but sound needs air to travel through, and the air is so thin at those heights that the sound won't travel as well or as fast.  I'm not even going to discuss the lack of air pressure; lack of breathable oxygen; the temperature (frozen apples and frostbite); terminal velocity and air resistance.

When, during an A-level class, my maths teacher posed this question, I don't think she was thinking of such things either.  That's the problem with maths without science - it can give you an answer that is meaningless and useless when you actually consider the real world!

Tuesday, 8 March 2011

Maths Puzzle: How far does the fly fly?

Two boys set off on their bikes, at the same time, to meet each other.  They are 24 miles apart, and the road between them is perfectly straight.  The first boy cycles at 6 mph (he's only a very small boy), and the second boy cycles at 4 mph (because he's even smaller, and can't cycle as quickly).  A fly sets off from the first boy's handlebars at the same time as the boy starts cycling.  It flies in a straight line from the first boy's handlebars until it reaches the second boy's handlebars. It then turns around, and flies back to the first boy's bike, then when it reaches the first boy, it turns around again and back to the second boy's bike, and so on until the two boys meet.  The fly travels at 12 mph.

How far does the fly travel in total, from the moment the boys set off, until the moment they meet?  The time taken for the fly to turn around every time it reaches a boy can be ignored.

I like this type of puzzle - I liked it even more when I spotted an easy way of solving it. 

But first, the long way.


The fly sets off at 12 mph, at the same time as the second boy starts cycling towards it, at 4 mph.  There are 24 miles between them at this point, and the two travellers are approaching at 16 mph.  It will therefore take them


time = distance / speed = 24/16 = 1.5 hours


to meet.  This is the longest single part of the fly's journey, as the boys were at their furthest from each other.


However, in that time, the second boy has cycled 1.50 hrs x 4 mph = 6 miles, and the first boy has cycled 1.5hrs x 6 mph = 9 miles.
The fly has travelled 1.5 hours x 12 mph = 18 miles.  This makes sense - the second boy has cycled 6 miles, and the fly has travelled 18 miles, and 6 + 18 = 24 which was the starting distance between them.


Finally, while the fly has been flying the first leg of its journey, the two boys have reduced the distance between them from 40 miles to 24 - (9 + 6 miles) = 9 miles.



Now, the fly turns around, and starts to fly towards the first boy.  The first boy, remember, is cycling at 6 mph; the fly is still going at 12 mph, so their closing speed is 18 mph.  They have to travel 9 miles (the distance now remaining), so this will take:


time = distance / speed = 9 miles / 18 mph = 0.5 hours (which is 30 minutes).


In that time, the first boy travels 0.5 hours x 6 mph = 3 miles.
The second boy travels 0.5 hours x 4 mph = 2 miles.
And the fly travels 0.5 hours x 12 mph = 6 miles.


This makes sense - note that the first boy and the fly have together covered the nine remaining miles between them, 3 + 6 = 9


So far, the fly has travelled a total of 18 miles + 6 miles = 24 miles.


The distance between the two cyclists is now down to
24 - ((9 + 6) + (3 + 2)) = 4 miles


Continuing for a third leg, our tireless fly starts back from the first boy to the second boy.  The second boy is cycling at 4 mph, the fly is travelling at 12 mph.  Closing speed is 16 mph, and distance to cover is just 4 miles.


4 / 16 = 0.25 hours (15 minutes).


First boy covers 0.25 hours x 6 mph = 1.5 miles
Second boy covers 0.25 hours x 4 mph = 1 mile
Fly travels 0.25 hours x 12 mph = 3 miles


Distance remaining is 24 - (( 9 + 6 ) + (3 + 2) + (1.5 + 1)) = 1.5 miles
Fly has now travelled 18 + 6 + 3 = 27 miles


Clearly, this is going to take a long time to solve through this method.

Here's the shorter way.

The boys have to cover 24 miles.  The first boy cycles at 6 mph, and the second boy at 4 mph.  This means that they are approaching each other with a closing speed of 10 mph, and it will take them 24 miles / 10 mph = 2.4 hours (2 hours and 24 minutes) to complete their journey and meet up. Obviously, there are many different versions of this story, involving trains and so on, but the principle is the same (and you can change the numbers to make them more realistic - I think my boys are pedalling at walking speed!).


The fly, meanwhile, is flying at 12 mph.  This means that in the 2.4 hours it takes the boys to meet, it will fly 2.4 hrs x 12 mph = 28.8 miles.


It really is that easy.  No diagrams, no long complicated adding up then adding up some more.  Sometimes, all that's needed to solve a problem is a different perspective!

If you enjoyed this article, you may like some of my other, more recent posts on puzzles and games that can be solved with a calculator:

Snakes and Ladders (Collatz Conjecture)
Crafty Calculator Calculations (numerical anagrams with five digits)
More Multiplications (numerical anagrams, four digits)
Over and Out (reduce large numbers to zero as rapidly as possible)
Calculator Games: Front to Back
Calculator Games: Up, up and away with Ulam sequences
Calculator Games: The Kaprekar Constant

Monday, 28 February 2011

More pseudoscience in TV adverts

"You use a toothbrush to clean your teeth, so why should your skin be any different?"

Because my teeth are a strong, tough, calcium phosphate compound designed for biting and grinding, while my skin is a soft, flexible material designed to be sensitive.

And so we begin again, although you probably shouldn't get me started on the strange and unintelligent things that advertisers say in TV adverts.  Too late, goes the cry.

Today, I have a little more on pseudoscience, inspired by a television advert I saw a couple of days ago.  I've already complained about the widespread use of hexagons in cosmetics adverts, but the commercial that I saw the other day reminded me of another considerable bug-bear of mine in the field of bad science:  the helix.

Two or three bands of various shades of brown spiral around a 'greatly magnified' strand of hair, before encapsulating it with a flash and a gleam of over-reflective sheen.  Why the helix?  Why the spiral?  I'm guessing that either it all comes down to DNA, or to the long-standing symbol for medicine? 

If it's a not-so-scientific rip-off of the DNA molecule, it might be worth mentioning that hair doesn't contain DNA.  No, despite what they may say on CSI, there's no DNA in hair.  The hair follicle at the base of the hair will contain DNA, but the hair itself won't.  So regenerating, recharging, repleneshing or otherwise repairing hair with DNA won't work.  No, sorry.
On the other hand, if the scientific message that we're meant to get is that the product is medicinal, then perhaps the helices should be snakes, as in the original symbol?  Probably not.  But there's no doubt that the helix is here to stay, at least for now, even if it only 'looks' scientific in the same way as a group of hexagons do. 

Until then, I think we'll have to keep washing our hair in icky goo, rinsing the dirt out of it with hot water and wait until somebody can find some chemically beneficial hexagons and helices; after all, they're all just using made-up names for chemicals.

Have I missed something?  Should I have added something else that keeps showing up in adverts in the name of science?  Let me know!