Monday, December 17, 2007
Massive winter storm in north america and radar imagery
Snow storms can be visualized and measured with radar imagery. This photo shows the Ontario southern area - Ottawa is in the middle. It is provided in real time by the weather office's website using data coming from its radar weather stations. It indicates that snow is falling over Ottawa at a rate of 2 cms per hour. After almost a full day of snow we indeed got over 40 cms of snow.
How does the radar work? Station on the ground emits radio waves in different directions. The larger the size of snow or ice pallets, the better they reflect the radio signal back to its source. After a series of measurements a map is generated like the one above.
I very much enjoyed watching the movie The Day After Tomorrow on the TV channel space this afternoon. It was ideally fitted to our own local climate situation!
Saturday, December 15, 2007
Fun Science 'Smart Monkey' part 2
1. Search line 30 shown below in the program SmartMonkey.java
30 | int NBR_BOXES = 5;
Replace the value 5 with the value 9.
3. Run the program again. You will now have to remember the position of 9 numbers. It is a lot more challenging and fun that way. Are you still a smart monkey?
Note the monkeys show their superiority when the numbers are shown for less than a second.
4. Search line 18 shown below.
18 | Thread.sleep(5000);
Replace the value 5000 with the value 1000. You are asking the computer to show the numbers for 1000 milliseconds - that's one second - instead of 5000 milliseconds. It's practically impossible for us now to remember the positions right... To enjoy this little game, we suggest you bring back the value 5000.
Have fun!
Thursday, December 13, 2007
Fun Science 'Smart Monkey' part 1
Does the game sound too easy? Then you are ready for part 2 of this activity. We will edit the program so it now shows 9 numbers instead of 5. And you will learn how to control the time interval used to show the numbers before the game starts.
Sunday, December 9, 2007
One laptop per child 'Develop' feature - the best thing that ever happened since the Apple ][ and Linux
- Radio, 1960s. I remember the one my dad used in the 1960's. He opened it up a few times and showed me the self and magnet used to look up different frequencies - different radio stations. My dad replaced buttons and condensers when they broke down / smoked up. There was a local electrician store down the street where you could find everything you needed.
- TV Set, 1970s. I opened up my black and white TV set when toward the end of its life time the electron beam would randomly flicker as the TV heated up. The beam required precise adjustment to return to the correct path on the screen. Don't do that yourself, it's stupid and very dangerous.
- VCR, 1980s. The VCRs frequently ate your VHS tape and refused to eject it back. Everyone I know once opened up their VCR to physically extract the tape - half of the time ruining the VCR altogether.
- PC's, 1990s. Installing a second hard drive, more memory and extra cards was everyone favourite past-time back then.
- iPods, 2000s. You throw them when the battery or anything else stops working. Why bother? By then a newer and cooler model has arrived anyway. All right, I am pushing it. There is now a black market of specialized shops that will do wonders to repair your latest gadget - but don't even try by yourself.
Saturday, December 8, 2007
Why are eBooks overpriced?
I'm taking more time to think about it. I'd buy the eBook if it were going for the same price as a movie ticket - $9.95 or half the price of the paperback version, I'd say. After all I'd read it on my computer - eBooks do not come printed on paper! Now I understand why eBooks haven't caught up. There are plenty of nice eBooks devices around now - Amazon's Kindle to name a very recent one. But publishers are not comfortable with this new field. We the readers have yet to wait for someone like Apple who started to sell legal music for 99 cents.
Well I've made up my mind. I'll borrow the book at the public library and will go see the movie Enchanted with the money I didn't spent on it. Sigh. I really like being able to read books on my computer and browse them at will - today or years later. When will eBooks be half the price of a paperback version? Or the price of a movie ticket?
Wait a moment. Should I ask Santa for a $399 Kindle this christmas? Mike just pointed to me that Amazon sells a Kindle version of "Programming the Universe" for about $8. That sounds great. Can I get a PDF version for my laptop for that price someday too?
Wednesday, December 5, 2007
The Programme for International Student Assessment
Let's return to our topic of the day. Are you in college? If so you are familiar with evaluations. Is your teacher just as nervous about them as you are? International evaluations compare you to your peers from other countries. And important people will decide how much money to add or cut from the education budget of your schoolboard after they read the PISA executive summary. PISA stands for Programme for International Student Assessment.
There is more to education and science than evaluation tests. Don't discard them alltogether though. Take it as a challenge. Scientists also like - err, should like - to be challenged. One measurement isn't the whole truth but with no measurement there is no science.
All thirty countries are now celebrating or crying over the results of this study. Canada is quite happy. How about yours?
Saturday, November 24, 2007
Imagine an Electronic Voting Machine
Our voting machine creates three different tables containing different kinds of information. Two tables will remain private and stored by a representant of the judiciary authority. One table will be made public after the election is completed.
How does our imaginary electronic voting machine work? Let's try it on the following election with candidates Bush and Kerry. We will limit ourselves to a very small village with only three inhabitants named Mike, Sarah and Zoe.
Mike votes for Bush. Sarah and Zoe for Kerry. The voting machine produces the following three tables.
Example 1 - simple election
Table 1: Mike Sarah Zoe
Table 2: 2 1 3
Table 3: Kerry Bush Kerry
When Mike votes, his name is added somewhere randomly in Table 1 - in first position in our example. His vote is added somewhere randomly in Table 3. In the above case it is in the second position of table 3. The first position of table 2 represents Mike's position of his vote in table 3 - so that position is 2. The machine tells Mike his position is 2. Mike remembers this value and he can verify his vote later by himself when table 3 is made public.
Sarah votes for Kerry. Here Sarah is in position two in table 1. Her vote is stored in position 1 of table 3. So the position two of table 2 contains 1. She remembers the value 1 to verify her vote.
Zoe votes for Kerry. She is in position three in table 1. Her vote is stored in position 3 of table 3. Thus position three of table 2 contains 3. She remembers the value 3.
After the election tables 1 and 2 are kept secret under the justice authority. Table 3 is made public. Everyone can verify how many votes occurred and how many votes each candidate received. Here three people voted, two for Kerry and one for Bush. But we don't know who voted for who so Mike, Sarah and Zoe's vote is kept private.
Mike examines table 3 and can verify that position 2 is for Bush. That's his vote so he is satisfied. Sarah and Zoe can also verify their vote.
If Bush, Kerry, Mike, Zoe or Sarah contest the results, the justice authority can verify the integrity of the tables 1, 2 and 3. They can verify each position in table 3 corresponds to a unique elector. I.e. Mike, Zoe and Sarah voted only once and their votes are counted separately.
Example 2 - simple election with votes from unregistered users
Table 1: Mike Sarah Zoe
Table 2: 2 1 3
Table 3: Kerry Bush Kerry Bush Bush
The justice department verifies nobody voted for Bush in positions 4 and 5 of table 3. The machine made an error or someone tampered the results. The election is invalid.
Example 3 - simple election with votes not counted
Table 1: Mike Sarah Zoe
Table 2: 2 1 1
Table 3: Kerry Bush
The justice department detects position 2 and 3 of table 2 refer to the same position in table 3. Zoe's vote is erroneously counted with Sarah's one. So it looks like Kerry and Bush have the same number of votes when looking at table 3 but that is incorrect. Election is invalid. Machine made a mistake or someone tampered the results.
Conclusion
Did you thought creating an electronic voting machine was easy? There are plenty of additional details to take into account. Note activity 1 from the book Fun Science With Your Computer describes how pseudo random numbers can be created. They would be used to randomly fill up the tables. We would not want Mike to guess Sarah's vote just because she voted right after him and the machine would simply store the votes in the same order...
Tuesday, November 13, 2007
Imagine the perfect microwave, iPhone and iPod
My microwave has the following command panel. To warm up my favourite snack I press the keys [power], [3], [8], and [start]. It takes four commands to warm up my snack for 38 seconds at full power.
When you look at the control panel can you figure out which button to press first? Why not entering the time first? It does not work. You must know - or randomly try. If the microwave is in a public place for everyone to use you'd want any person to rapidly warm up their lunch box. Some microwaves are so absurdly designed we clip a paper with instructions. If you randomly tried you would set the time, date and everything you did not want - but you would not figure out how to heat up your lunch...
Now how would you design your own command panel so it fits your typical use of the machine?
- I'd put the [power] key at the top. User should expect to use commands from top to bottom. I have never used [defrost] anyway.
- If the user directly enters numbers to set the duration, assume maximal power setting. Don't require the user to press [power] first in this common case.
- Add some physical marks to the keys so the fingers can recognize them even if you are in the dark or visually impaired. Something the cell phone Nokia 2125i does very well - and something totally missing from the latest iPhone and iPod Touch.
Sunday, November 11, 2007
Remembrance day, born in the twenty first century
I hope the 21st century will be more peaceful than the one we have left behind us. My heart says it will be, my mind says we should not take it for granted. I imagine someone could have made the exact same naive wish in 1907. I hope we have learnt some lessons along the way. Wish you the best, Alex baby. Yes - one of the main characters in the book was named after you.
Saturday, September 1, 2007
Her Majesty Queen Elizabeth II, monkeys and probabilities
I have been reading about probabilities as I am heading back to school next week. This image is represented by 300 columns and 361 lines. That's 108,300 squares or pixels. Each pixel is filled with one of the 256 colors described in the palette of colors below.
Probability = 1 / 256 * 1 / 256 * 1 / 256 ... for 108,300 times.
That's a really small value - extremely close to zero. That's one reason we haven't observed monkeys drawing the Queen of England till now.
Friday, August 24, 2007
All odd numbers are prime numbers
"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.
Wednesday, August 22, 2007
Best books and journals about science and computer programming
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
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?
- I will use the services in a manner I judge fair, with common sense - honor's system
- I respect other users and would also like not to be harassed
- I'll correct my usage or be removed from the service after the owner notifies me of an inappropriate action.
Thursday, August 16, 2007
Edge cases and highways
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
- Flip a coin. Coin spins on the floor and stops on its edge.
- Solar eclipse - Moon passes between the Sun and the Earth
- Bugs reported today against the open source Mozilla computer programs
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
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
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
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.
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
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.
Sunday, July 29, 2007
Wii, air bags, washing machines and micro-electro-mechanical systems
Sarah has been asking our parents for a console Wii so we can play family games together. The Wii remote detects motions and accelerations. This makes for very natural game play - golf, tennis, etc.
Our car is equipped with air bags. Last winter Dad drove over a frozen bridge covered with black ice and hit a tree. He was safe, thanks to the air bags that instantaneously protected him.
My digital camera correctly orients pictures horizontally or vertically because it knew how I hold it when I took the shot. You've probably seen the demos for the iPhone, the screen automatically rotates when the user holds the device horizontally or vertically.
MEMS are everywhere. These tiny components are hiding in each of the machines discussed above and are no thicker than a piece of hair. They are called electro-mechanical because they contain small mobile parts causing or responding to electrical signals. There are thousands of different kinds - motion sensors, tiny motors to mix fluids, arrays with hundreds of minuscule mirrors to switch Internet signals from one fiber optic to a different one... Even our washing machine uses MEMS to detect rotation imbalance. Humans also carry natural mems. The inner part of our ears contains tiny stones that touch sensitive cells informing our brain about the position of the head and body vibrations - so we retain very good and stable vision even when we move a lot. Sometimes the minuscule stones, called otholiths, get blocked. A person gets nausea and suffers from a helpless feeling of falling down.
To go further
Sarah is too busy with the latest Harry Potter book and she entirely forgot about the Wii.
Tuesday, July 24, 2007
Who are you? Where does the world come from?
Dear Sarah,Who are you?
She had no idea. She was Sophie Amundsen, of course, but who was that? She had not really figured out - yet.Where does the world come from? it said.
For the first time in her life she felt it wasn't right to live in the world without at least inquiring where it came from.Sophie's World, Jostein Gaarder
I hope your travel back to Canada went well. You must be happy to be with your parents and friends again. Alex started this blog after we all returned home, what a great idea. We can keep in touch despite the distance between Europe and North America. I am glad I can take some rest from the science summer camp though I miss all of you.
In the bus taking us to Grenoble, you said how much you liked the Harry Potter's series. You were impatient to receive the last volume. I hope you are enjoying it. I have found the english title of my favourite book: 'Sophie's World'.
This best seller was written by a norwegian philosophy teacher named Jostein Gaarder. I cannot summarize this book. It is so much more than a history of philosophy. It is an extraordinary novel. Sophie is in many ways just as attaching a character as you are. You are about the same age - Sophie is fifteen years old. Maybe you could meet one day. Maybe the two of you have met already if some of the readers of 'Fun Science With Your Computer' have also read 'Sophie's World' - these readers may understand what I mean. This book had a profound influence on me. I decided I would study philosophy at university La Sorbonne. I particularly like epistemology. My copy of the book is in french - 'le monde de Sophie'. You will easily find the english version at your local bookstore. Do not skip the last chapters - they reveal important twists in the story...
Saturday, July 21, 2007
Brad Pitt, Bill Murray and statistical machine translation
You are about to find out after this little detour. Do you read and write chinese? I don't. However I can pretend I do, and that's thanks to the recent english to chinese online translation service provided by Google. A relative from Taiwan asked us to explain the two following english sentences.
1:Grapes of Wrath by John Steinbeck is a classic American novel.
2:Greek island-hopping makes for a very varied vacation.
You can see the transation in chinese in my reply to that email. That's a straight copy and paste from Google Translate. So what is the big deal? Well, I was asked sometimes later by another relative of mine - and native speaker - if it was true that I had simply used a translation made by a machine. Why? Because the translation was surprisingly good.
Current statistical machine translation programs have made amazing progress. Google trains its machines with billions of documents from the United Nations that were translated in many languages by real human translators. Yes this takes our tiny Java program discussed in Activity 4 - Translator to a completely different level.
Can online translation accessed through an iPhone make travel in foreign countries easier? If you answer yes, you may want to watch again the movies Babel figuring Brad Pitt, and Lost in translation with Bill Murray. Cultural shock goes beyond translation issues... Brad Pitt and Bill Murray may still not fit in. They would be able to carry a conversation with a local for a medical emergency in Morroco and visit Tokyo via its many subway lines without actually understanding Kanji characters.
Friday, July 20, 2007
English draughts, Harry Potter and the Fellowship of Scientists
That's one more reason we should continue to enjoy our little Java Chess program from activity 11...
And now, let's move on to the topic of the day. I wish Sarah and all Harry Potter's fans good luck in their quest for the latest volume Harry Potter and the Deathly Hallows. One more hour to go here in Canada eastern time. If only we could find the magical receipe to make books about popular science as appealling. What can we learn from Harry Potter that we could apply to science books? Alchemy and science have long been sisters, see the evidence with this article on Newton the alchemist. Maybe we just have to say the truth about science to make it fun. That is, we need to reveal all the wizardy behind the fragile mathematical interpretations. Science is made by all these wizards in their lab, learning how to master the many steps in mysterious and unexplained experiments. We prefer to call them Nobel laureates, doctors, scientists or engineers. But they know better. They are true wizards in their domain... Just like Harry.
Maybe we should invite Harry to join the summer camp in the book 'Fun Science With Your Computer' and rename its title to 'Harry Potter and the Fellowship of Scientists'... Note I am half serious, half joking. Truth is, I really am impatient to read the latest Harry Potter too!