Friday, August 24, 2007

All odd numbers are prime numbers

There was a joke very popular among graduate students in theoretical physics.
"All odd numbers are prime numbers" someone says.
The mathematician tersely answers: "1 isn't prime. Rule is invalid.". The physicist thinks for a couple of seconds: "Rule is verified for 3, 5 and 7 but breaks for 9. So it is true at the first degree.". The chemist was sitting near the physicist and concludes: "It's true for 3, 5, 7, 11 and 13. So it must be true."
Everyone now turns to the biologist who hesitates: "3 is prime, 5 is prime, err, what was the question again?"

Very unfair joke I agree. Biologists are doing great and hard work. But scientists do study different systems and they have different expectations in term of accuracy.
  • Mathematicians have little tolerance for a proof that has tiny gaps because such demonstrations can yield to a paradox. It is so easy to miss one step and get the end result wrong.
  • Physicists do experiments on very large systems - e.g. they measure the temperature of a gaz that contains huge numbers of atoms of Hydrogen - billions of billions of billions.
  • Biologists observe hundreds of Mitochondria cells under a microscope and adjust the parameters of their model to fit the properties they have measured. Their measurements are statistically less accurate than what physicists typically measure in huge but simple systems - but they are good enough.
  • Pharmaceutical companies and sociologists typically conduct tests on groups of hundreds or thousand of human beings. That's an unacceptably small sample for a physicist. Yet we all come to trust each other. Mathematicians go see their doctor to receive antibiotics or allergy medicine though no one completely and rigorously understands the human immune system.
A good scientist or engineer must know how to do the right approximation. A doctor doesn't care if your temperature is 100.0003 or 99.9997 Fahrenheit. Either way you probably caught your child's flu.

Wednesday, August 22, 2007

Best books and journals about science and computer programming

Our preferred books are listed below. Add your own list in the comments and give your age. Thank you!

Harry Potter and the Deathly Hallows. Err, did we say science?

Journals
Nature
Science


Popular Science
A Brief History of Time

Java programming books
Beginning Programming with Java For Dummies excellent for anyone with no programming experience
Java How to program very thorough - also very big and expensive

Philosophy
Sophie's world

Saturday, August 18, 2007

I agree to the terms and conditions

These days any thing we buy, install, download, assemble, cook and what not, any thing requires approving some lengthy, obscure, legal agreement: I agree to the terms and conditions...

For example sign up for a Nature account. A gmail account. Facebook.

Did you really read and understood every term of the agreement? Do you carefully store a copy in your safety box - just in case? If you do really read the agreement don't you get so scared that you promptly run away from this service?

Could we replace most of these documents with some common chart of the web etiquette?
  1. I will use the services in a manner I judge fair, with common sense - honor's system
  2. I respect other users and would also like not to be harassed
  3. I'll correct my usage or be removed from the service after the owner notifies me of an inappropriate action.
What do you think?

Thursday, August 16, 2007

Edge cases and highways

You are on a highway driving on the fast lane. The middle lane appears free so you signal and shift lane. Switching lane is very common. And when the destination lane is free then everything will go well. Right?
That's right most of the time. In a few rare cases, we are up for the fear of our life. Check the photo. A car in the slow lane moves into the middle lane at the exact same place and time as we do. The two cars get dangerously close to each other and usually both drivers recognize the danger and violently pull back to their respective lanes. Is the other driver doing something wrong? Not at all. He or she also carefully observed the middle lane and it is empty. Only you are still on the fast line. Neither of you saw each other until you both moved into the middle lane.

We call these rare but dramatic situations edge cases. They are rare but the consequences can be severe. Engineers can be tempted to cut the corners and ignore them. If they are very honest they call their product a prototype or a beta. If unexpected the edge case is called a bug or defect. Scientists observe nature and sometimes notice irregularities they can't explain. They discard the results as invalid. A few hundred years later other scientists redo the experiments with better tools and a more open mind - and uncover a new branch of science and series of new natural phenomenas.

Other examples
Which other edge cases have you heard of?

Sunday, August 12, 2007

Fun Science 'Save the Moon' part 2


In part 1 we have watched the Moon in orbit around the Earth at different speeds. The program Space Simulation 3.java draws 10 times per second the Moon and the Earth in accelerated motion - 1 second represents one day. In this second part we verify the speed of the Moon around our planet.

IN PROGRESS

1. Run the program SpaceSimulation4.java. What do you observe?

The Moon does a fairly stable circular orbit around the Earth - as shown in the above screenshot. The speed of the Moon is set to 998 meters per second.

2. How to calculate the speed of the Moon around the Earth

The Moon is in average at 384,400 kms from the Earth. It does a full tour around our planet in 28 days - remember the full Moon shows up every 28 days because it occupies the same position in our sky at this interval. The perimeter of a circle of radius 384,400 is obtained by multiplying 384,400 by two times Pi. So we have the following formula (distance in meters and time in seconds give us the speed in meters per second)

speed = distance / time = 384,400,000 * 2 * 3.14 / ( 28 * 24 * 60 * 60 )

You can use you own calculator or Google's calculator to get the result: 998 meters per second

We have confirmed our simulation. The Moon rotates around the Earth at a speed of one kilometer per second.

Saturday, August 11, 2007

Fun Science 'Save the Moon' part 1

I wrote this experiment 'Save the Moon' for the 2007 EX.I.T.E science summer camp at the IBM Ottawa labs. Try it on your computer with the instructions below.

1. Run the program SpaceSimulation3.java. If it is your first time, learn how to run Java programs. We are going to modify this program to save the Moon...

What happens?

Moon falls onto the Earth! Not a good thing...

2. Search line 80 shown below.

80 | planet2.vy = 400;

Replace the value 400 by any value between 0 and 3000. You are setting the initial speed of the Moon - in meters per second.

3. Run the program again. You have succeeded when the Moon does a nice orbit relatively circular around the Earth. What is the value used then?

We will give the answer and a method to calculate this value in a second part...

The beautiful photo of the Moon above comes from John French at the Michigan State University.

Thursday, August 9, 2007

Marie Curie - Maria Sklodowska

Marie Curie has been for me an inspiration since I read her biography written by her second daughter Irene. Madame Curie - as French people respectfully call her - was born in 1867 in Poland and died in France in 1934. She was an exceptional physicist and chemist. She won two Nobel prices.
Madame Curie purified over two tons of a raw and dirty mineral named pitchblende to extract one gram of a new radioactive element she named radium. We often imagine scientists comfortably looking at a computer screen or at a microscope. Madame Curie worked inside a miserable garage in Paris - France. She was like a worker at a coal mine, breathing radioactive dusts that dangerously contaminated all her equipments and book notes even long after her death.
Madame Curie started the earliest MASH units during World War 1 - she drove a car equipped with portable radiography equipment - using her radium. Surgeons on the front used the radio images to operate wounded soldiers.
Madame Curie is immensely popular in France and in Poland - under her birth name, Maria Sklodowska. All her life she enjoyed working at her laboratory of chemistry - mentoring students and guiding them through delicate experiments. Marie and her husband Pierre both feared and hated public honours. Pierre once told Marie: "I was counting how many laboratories we could open with all the diamonds and jewels the people are wearing at this ceremony."

Wednesday, August 8, 2007

Steve Jobs at war against the buttons

How many buttons does your TV remote control have? And your VCR remote control? Your micro-wave? Cell-phone? Computer keyboard? PDA? Your car? The cockpit of a Boeing 747? The space shuttle? The control room of an old nuclear plant?
Many, many buttons.
One man spent his whole life fighting against the proliferation of buttons. His name is Steve Jobs and he created the iPod, iTunes, iPhone, iMac among many other innovative products. He co-founded the Apple company. Steve Jobs dislikes buttons so much he never wears a shirt with buttons.
Take a device - a remote for example. What do you use it for most of the time? Which functions do you need? Are they easy to perform? Could you use larger and more visible buttons for the most important uses and remove the buttons you never need? Which color, shape, size and location should the buttons have? Can blind people recognize them (shape, surface feeling, location)? Do the buttons fit both children with small hands and Japanese sumos with very large fingers?
Answering these questions makes you a user interface specialist. It is a fascinating task. Adding buttons to add new functions is an easy, unimaginative solution. Too many buttons will confuse beginners doing simple things. Sometimes more is less explains Barry Schwartz at a Google technical talk.

Tuesday, August 7, 2007

What time is it? Check the fuel gauge.

We visited the CERN during the science summer camp. We had been driving for an hour when the radio and the clock in my old car stopped working.
Sarah got worried we would not arrive before the center closes to the visitors at 5pm. She asked: "What time is it?". Turns out neither of us was wearing a watch. I answered: "Check the fuel gauge". Sarah looked at me as if I were not making any sense at all. An explanation was required.
"The fuel gauge was at that position when we entered the highway at 1pm. The car's clock stopped working when the gauge was down to that level, an hour later. We have been driving at constant speed so we can assume the gauge is decreasing at a constant pace. We can use the fuel gauge to estimate the current time."
"It is 3 o'clock and 45 minutes." estimated Mike.

Sarah kept silent for a few moments. If one burns fuel at a constant rate then the fuel gauge is like a clock. There are water clocks, atomic clocks, radio clocks, mechanical clocks, sun dials, star clocks, etc. Alex's clock is based on his fuel tank so it is some sort of water clock.

"How much time before our planet runs out of fuel?"
Sarah then asked. A very good question indeed.

Thursday, August 2, 2007

Terence Tao got a score of 760 on the SAT math at age 8

Terence Tao scored 760 out of 800, at an age the rest of us barely abandoned Sesame Street. Terence's mother is a math teacher and daddy is a pediatrician. Having such a family cannot hurt but it doesn't explain everything...
And that was only the beginning. Terence was awarded the most prestigious recognition in mathematics in 2006: the medal Fields. Maybe Alex can explain to us what did Terence discovered to merit this prize. Terence blogs about his research but it is a little bit over my head with the exception of this entry about his visit at the Royal Society. I thought I knew what a line was until I read what Terence had to say about it.

Mike, I forbid you from revealing my SAT score. Or I will reveal yours.