Saturday, June 13, 2009

Steg - a game for people who love words and puzzles

Summer is almost there, at least if you live in the northern hemisphere. Time for a little fun with your web browser!

Steg is a game for people who love words and puzzles. Your objective is to empty the screen of all its letters.

Go to the Steg Game. If you are a Facebook fan get Steg here!). Press 'Start' to begin. Letters fill up the screen. You must form valid words by mixing the letters appearing on a row or on a column.

You enter the words using the keyboard and press 'Enter'. If the word is valid the corresponding letters are removed from the rows and columns they appear in. Letters fall down till there is no empty space left.

You win when you empty the screen entirely - that's called 'doing a Steg'. Doing a Steg is challenging. However you also score by finding words at your own pace so just go and have fun!

The first time you play the Steg game, it will take a few moments to read and learn all the valid english words and variations (e.g. 'eat' 'ate' 'eaten'). So while waiting for that, have a peek at the screenshots below.


  1. You enter the word 'gala'. These letters get highlighted in the game.
  2. You press the key 'enter'. The letters forming the word 'gala' disappear. Excellent!
  3. Good luck, 48 more letters to remove!

Steg can be played with english words. Steg can also be played with french words. If you are bilingual, it is a fun way to test which language you are better at.

Have a fun summer! With or without computer...

Monday, December 29, 2008

Why are you left-handed?

Are you left-handed? I.e. do you do the following things with your left hand.
  1. Hold a pen
  2. Throw a ball, play tennis or tennis table
Most likely, you are a right-handed person. Left-handed persons are believed to be about 10% of the population only.

But why is it that way? Why this ratio? Why not 50% ?

That is a question science doesn't currently know the answer.

Our brain is used to control our body. As we grow up, the left part and right part of our brain specialize into different functions. A left-handed person's brain can be seen as the symmetric (mirror image) of a right-handed person. Have we answered our question? Not really.

We know the organization of the brain explains a person's preference for one hand over another. We don't know why the brain develops 90% of the time to make a right-handed person and 10% to give a left-handed person. Some of us believe it ought to be a very simple mechanism, in the early stages of the embryo development. Maybe one day a scientist will publish an image showing the cellular development of the brain responsible for this ratio. Maybe some stem cells get pushed into a blood vessel that divides into two extremities - one large, and a second one that is a tenth of the first one. Something at some microscopic level ought to be responsible for this particular ratio.

Maybe you want to be a scientist yourself to research this area. Please post a comment when your article has been accepted by Nature. I am a left-handed person myself and I am very very interested in the answer...

Monday, September 1, 2008

Sending photons between 2 villages in Switzerland

We often imagine scientists hiding in the basement of some mysterious building, working with weird machines and not paying much attention of what happens outside. Wrong! A very curious experiment took place between two villages in Switzerland.
The experiment was conducted by five scientists named Daniel Salart, Augustin Baas, Cyril Branciard, Nicolas Gisin and Hugo Zbinden. It was published in Nature Aug. 14th 2008. The scientists used a network of optical fiber connecting two villages distant from 18 kms. They vehiculed light back and forth and verified a property called 'entanglement'. We won't go in detail about that phenomena here. We will focus on the geography of the villages.
Swiss villages Satigny and Jussy are aligned along the east-west direction. Why is that interesting? Well the earth rotates around the north-south axis in one day, as you know - that's why we have day and night every 24 hours, right! The scientists repeated their experiment throughout the day and verified they obtained the same result!
You are not surprised? No, we expect things to work the same regardless of the time of the day - our cell phones, cars, dish washers, etc. Most machines work regardless of their orientation in SPACE. The experiment verified it is also the case for 'entangled photons' with a very good accuracy. It showed that Albert Einstein's spooky action either does not exist or needs to be faster than 10,000 times the speed of light.
Do you know other weird experiments? I.e. experiments that require measuring small things between very weird or distant locations?

Monday, December 17, 2007

Massive winter storm in north america and radar imagery

Ottawa - Canada's capital city - has been hit today with a snow storm. 42 cms of snow have fallen in the last 24 hours!
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

In part 1 we have played a simplified version of Professor Matsuzawa's experiment. Remembering the position of 5 numbers is easy. Let's try with 9 numbers.

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

1. Run the program SmartMonkey.java. If it is your first time, learn how to run Java programs.

Numbers 1 to 5 appear at random positions on the screen. After a few seconds the numbers disappear. Point your mouse and click to the square you remember to be '0'. If you are correct it will go away. Now try to click on square '1' - etc.

When you are done, the computer will tell you if you are a human or a smart monkey. Err, what is that supposed to mean?

If you really do well the program assumes you must be a monkey. Professor Matsuzawa of Kyoto University has compared the performance of young monkeys to human students with a computer program similar to the one you ran. The monkeys do much better than us particularly when the numbers are shown less than a fraction of a second. Their memory seems to work differently than ours.

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

You have probably heard of the OLPC - one laptop per child - initiative by now. Their XO laptop is so well thought it could reconcile children and teenagers with technology. First let's review a few popular devices and what people know about their construction.
  1. 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.
  2. 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.
  3. 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.
  4. PC's, 1990s. Installing a second hard drive, more memory and extra cards was everyone favourite past-time back then.
  5. 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.
The XO laptop amazes me with its Develop feature. Press the View Source key and you can jump into the program code that you are currently running. You can edit and then run your modified version as simply as possible. Compare this with the steps you need to follow to install and edit Java programs on your PC. The XO sounds so great, may it inspire Microsoft to return to the simplicity of the Apple ][ and its Basic from the 80s - Microsoft should hire Steve Wosniak. I'm tempted to give up Java I used for the book Fun Science With Your Computer - and switch to the scripted language Python chosen by XO instead. But Java is so popular and so well tested on many types of computers I just wished it were easier to install by complete beginners.

Saturday, December 8, 2007

Why are eBooks overpriced?

I was intrigued by a review of the book Programming the universe in the New York Times. I decided I would like to read it over the christmas vacations on my notebook. The paperback version is going for about $17 at Amazon. The eBook version (pdf)? $17. Just at the same price.
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

Scientists love to measure, compare, rank. E.g. order the planets by size, how bright stars are in reference to our sun, etc. They also created ways to measure, compare, rank themselves. At the top you get nobel laureates. Before getting there a researcher publishes prestigious articles into Nature or Science. These articles must have a lot of influence over other scientists i.e. many other articles reference them. The same idea is used by Google to rank popular websites. If this blog is referenced by CNN's home page it will suddenly become much more important - at least until CNN switches to another major topic a few hours later. Note that my post referring to CNN does not do much to increase CNN's site ranking because this blog isn't considered an important referrer at this point...
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

Voting machines used in Florida during the previous presidential elections were not trusted by many electors. How can we verify the results of a voting machine and keep each elector's choice private?

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

Examine a tool you frequently use. How would you reinvent it so it is a lot easier to operate?

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?
  1. 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.


  2. 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.


  3. 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.


And we now have my perfect microwave. Nothing complicated or expensive. How would be yours? What about your perfect cell phone, mp3 player, remote control, alarm clock, etc. ? And how do they differ from popular products such as iPhone, iPod?

Sunday, November 11, 2007

Remembrance day, born in the twenty first century


This blog has been quiet for a while. It may remain so for some more time. I am on parental leave to take care of our newborn child. And today is special. It is a day of remembrance.

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

Give 256 color pencils and a piece of blank paper to a monkey. Teach him or her how to fill each square of the paper with a random color. What are the chances the monkey draws this portrait of the Queen of England?

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.

For every pixel our monkey has one chance to pick the right pen out of the 256 ones. Every time our monkey draws a pixel he or she has 255 chances out of 256 to ruin it - even if every prior pixels were by any luck all correct.

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

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."