Tuesday, May 25, 2010

World Cup 2010 Friendly: Greece 2 – North Korea 2

The second World Cup friendly for Greece and this time around the result is a bit better. At least offensively. However, a draw with North Korea is not exactly a major achievement.

Both goals for Greece were scored from set pieces. Being able to achieve that is very important, especially against South Korea since they have some trouble defending set pieces.

Defensively there still a lot of work to do. If we do not exhibit the kind of tenacious defending, tactical discipline, and strength that we showed in 2004 then we will play 3 games and then go home. So far we have not shown much on the defensive side of the ball. In today’s game we could not contain the North Korean forwards.

In other games:

  • Nigeria 0 – Saudi Arabia 0: Not a very good performance from Nigeria under the guidance of their brand new coach.
  • Argentina 5 – Canada 0: ‘Nough said!

Next (and final) World Cup warm-up game for Greece is on June 2 against Paraguay (which lost 2-1 to the Republic of Ireland today.)

Reports:

GOAL.com: Greece 2-2 North Korea: Rapid-Fire Greeks Held

FIFA.com: Draws all around for finalists

IN.gr: Φιλική ισοπαλία της εθνικής ομάδας με τη Βόρεια Κορέα

Monday, May 24, 2010

MATLAB & C++: Car Talk 1016 Puzzler

Car Talk is a weekly call-in radio show about cars and car repairs on National Public Radio. The hosts, Tom and Ray Magliozzi, are extremely funny and very knowledgeable about the subject. I tend to listen to the show by downloading the podcasts of ‘classic’ episodes (which means ‘old’, ‘previously aired’!)

Among other things the two brothers discuss is the weekly puzzler. That is, every week they hold a contest with a puzzle (brain-teaser) with the winners announced during the following episode (a week later.)

The puzzler on April 19th (I am a few episodes behind) is called Stevie and his Moto and in brief, it asked listeners to find (the) two temperatures in Fahrenheit and Celsius that have the digits ‘exactly reversed.’

For example, [one of the big signs that display the time and temperature] might have read 31 degrees Fahrenheit, and when it showed the centigrade reading it said "13."

Though the contest is now about a month old I decided to spend a few minutes to code a solution in MATLAB and then for kicks re-coded the solution in C++.

MATLAB

The algorithm is straight forward:

  1. Define array of values for temperature in degrees Fahrenheit – no decimals.
  2. Calculate equivalent temperature in degrees Celsius – rounded towards the nearest integer.
  3. Compare 1st digit of degrees F with 2nd digit of degrees C AND 2nd digit of degrees F with 1st digit of degrees C.
  4. If-and-only-if BOTH are equal then we have a match.

For this algorithm to work the range of Fahrenheit values needs to be restricted to the ones that would result in positive Celsius values that also have two digits (which was set as a requirement when the puzzler was explained.) If the range is not restricted then there would be a match for 40F and 4C. And since I like to play around with ideas I added on more test to make sure that the algorithm is more correct: count the digits of the integer.

For integers a quick solution is to count the number of digits for both degrees F and C and compare. For positive non-zero numbers we can use:

>> floor( log10( number) ) + 1;

This works because for positive non-zero numbers the base-10 logarithm provides the exponent of the base that would result in the number. That is:

x = 10^y then y = log10(x)

E.g.

1000 = 10^3 then log10(1000) = 3

Therefore, if the exponent is known the number of digits if the number can be calculated.

The snapshots of the code and output are shown below:

cartalk mfile

cartalk mfile out

C++

The idea is exactly the same. The only difference is that I had to code my own rounding function which is straight forward (even for me!)

 cartalk c   01

The rounding function might not very elegant but works!

cartalk c   02

The output is shown below.

cartalk c   03

Saturday, May 22, 2010

Half Life 2: Lost Coast

I bought Half Life 2: Episode Pack back in 2007 but did not play the game much. Recently, I found it again and decided to give it one more try. This time around I played and finished Episode One (after 12 hours) and Episode Two (after 11 hours) and then I played a small level available as a separate free download called Lost Coast.

It seems that Valve had that level as part of the regular game but decided not to include it. The level is quick (took 33 minutes with a lot of looking around!), easy to complete, and a lot of fun. However, the most amazing aspect of the Lost Coast is the level of detailed graphics. The textures, shadows, and colors are so realistic that it looks like a real world! And it was released 5 years ago!

half life 2 lost coast 02 half life 2 lost coast 03

Just beautiful!

BTW, I think that the original Half Life was a more interesting game than Half Life 2. The pace was faster, and the scenario made more sense. Either that or I am tired of fighting zombies and alien robots!

Tuesday, May 18, 2010

World Cup 2010: Team Bus Slogans

Hyundai sponsored a competition to come up with creative and inspirational slogans that will adorn the bus of each team participating in the World Cup in South Africa. A few days ago the winning slogans were selected. I guess ‘creative’ is a word that can be used to describe them. ‘Inspirational’ might be a bit of a stretch.

I am not sure who came with these slogans but most of them read like bad inspirational posters. The use words like dream (mentioned in 4 slogans), victory (6 slogans), hope, glory and combinations thereof. They make the ultimate football competition sound like a church sermon.

In my opinion:

Top 5 Good Slogans:

1. New Zealand: Kickin’ it Kiwi style.

Comment: A fun slogan from a laid back country.

2. Brazil: Lotado! O Brasil inteiro está aqui dentro! (Translation: The whole of Brazil is in here!)

Comment: Perfectly true.

3. Netherlands: Let niet op de grote 5, maar pas op voor de oranje 11. (Translation: Don't fear the big five, fear the Orange eleven)

Comment: Finally: Bravado! A winning attitude.

4. Cameroon: Les lions indomptables sont de retour. (Translation:The Indomitable Lions are back)

Comment: More attitude!

5. Greece: Η Ελλάδα είναι παντού! (Translation: Greece is everywhere!)

Comment: Naturally! (Have you checked the newspapers lately?)

Top 3 Lame Slogans:

1. England: Playing with Pride and Glory.

Comment: As inspirational as the movie ‘Pride and Glory.’

2. USA: Life, Liberty, and the Pursuit of Victory!

Comment: In case of trouble use a line from the Declaration of Independence!

3. Spain: Ilusión es mi camino, Victoria mi destino. (Translation: Hope is my road, victory my destiny)

Comment: Hope + destiny; Next they will hire Miley Cyrus for inspirational pep talks.

4. France: Tous ensemble vers un nouveau rêve bleu. (Translation: All together for a new dream in blue)

Comment: Keep dreaming!

5. Australia: Dare to Dream, Advance Australia.

Comment: More dreaming! 

For the full list of bus slogans see article ‘Winning team bus slogans announced’ posted at the FIFA website.

Friday, May 14, 2010

World Cup 2010: Probability & Odds for Greece

Assuming that each of the 8 groups is an independent microcosm (I think a valid assumption) then the relative probabilities (based on FIFA ranking points per team) that each of the teams will go through the group stage are:

Group A
P(France) = 0.321 
P(Mexico) = 0.288
P(Uruguay) = 0.278
P(South Africa) = 0.113
Group B
P(Argentina) = 0.305
P(Greece) = 0.272
P(Nigeria) = 0.249
P(South Korea) = 0.174
Group C
P(England) = 0.289
P(United States) = 0.257
P(Slovenia) = 0.232
P(Algeria) = 0.222
Group D
P(Germany) = 0.296
P(Serbia) = 0.253
P(Australia) = 0.236
P(Ghana) = 0.215
Group E
P(Netherlands) = 0.344
P(Cameroon) = 0.250
P(Denmark) = 0.216
P(Japan) = 0.190
Group F
P(Italy) = 0.375
P(Paraguay) = 0.260
P(Slovakia) = 0.235
P(New Zealand) = 0.130
Group G
P(Brazil) = 0.403
P(Portugal) = 0.312
P(Ivory Coast) = 0.212
P(North Korea) = 0.073
Group H
P(Spain) = 0.382
P(Chile) = 0.232
P(Switzerland) = 0.209
P(Honduras) = 0.178

The odds that Greece will go through the group stage are:

0.272 / (1 - 0.272) = 0.374 or about 3:8

The odds against are 8:3.

In general, Group B is difficult but it seems that the most competitive groups are C and D. And although Group G is the group of death, the probability that Brazil and Portugal will advance to the round of 16 is very high.

Wednesday, May 12, 2010

FIFA World Ranking Top 20: May 2010

Rank (previous) Team Points Comment
1 (2) Brazil 1611 Group G
2 (1) Spain 1565 Group H
3 (4) Portugal 1249 Group G
4 (3) Netherlands 1221 Group E
5 (5) Italy 1184 Group F
6 (6) Germany 1107 Group D
7 (9) Argentina 1084 Group B
8 (7) England 1068 Group C
9 (10) Croatia 1052 N/A
10 (8) France 1044 Group A
11 (12) Russia 1003 N/A
12 (11) Greece 968 Group B
13 (14) Egypt 967 N/A
14 (16) USA 950 Group C
15 (13) Chile 948 Group H
16 (15) Serbia 944 Group D
17 (17) Mexico 936 Group A
18 (18) Uruguay 902 Group A
19 (20) Cameroon 887 Group E
20 (21) Nigeria 883 Group B
20 (19) Australia 883 Group D

Point adjustments for all teams, resulting in Brazil returning to the top spot. Last time Brazil was ranked #1 was November 2009. Spain dropped to #2 while Portugal is now #3 (unjustified.) Argentine also moved up a couple of spots (justified.)

Based on the current ranking, just one month before the start of the World Cup, Groups A, B, and D each have 3 teams in the top 20. Groups C, E, G, and H each have 2 teams in the top 20. Group F is the only group that has only one top 20 team (Italy…)

The next game for Greece is a World Cup friendly against Korea DPR at home on May 25.

The latest full table can be found at the FIFA World Ranking website.

Monday, May 10, 2010

Best Places to Live 2010: Reading, MA

According to an article about the Best Places to Live 2010 that appeared in Boston Magazine Reading is the ‘more-affordable option’ to the Gold Standard Winchester!! According to the published blurb, Reading has ‘similarly strong schools’ and it is less expensive. (GK edit: A lot less expensive!)

Actually, Reading is a nice town that is close to ‘civilization’ (i.e. Boston), on major arteries (I-93 and I-95), has good schools that have been awarded the Blue Ribbon award (highest government honor for American schools – not sure about the real meaning of that one yet), has very good services, and is well kept (it better be with all the taxes that go to the town!)