07 January 2012

Fact Mining and the Weekly Logic Quiz (10983)

In addition to the PL/SQL, SQL and APEX quizzes, the PL/SQL Challenge offers a weekly logic puzzle, modeled on the Mastermind game.

In the puzzle for the first week of 2012, the second choice (9084) stated:

"If 1 is in the solution, then 7 cannot be in solution."

This was scored as correct and offered a step-by-step logical "proof" of why this was so.

Unfortunately, as several players pointed out, my logic was flawed from the very start - because 1 could not be in the solution at all. As Jennifer explained so clearly:

"We know from the clues that 1 cannot be in the solution. Based on the 3rd clue that only one of the set '2143' is in the solution, we know that 5,6, and 7 must be in the solution. Therefore 1 cannot be in the solution because the 2nd clue states that only 2 of '1456' is in the solution. We know that 5 and 6 must be so 1 and 4 cannot be."

I will change that choice to incorrect; everyone's scores will be updated within the next 24 hours.

While I am unhappy with my error and the need to issue a correction, I am delighted that several players analyzed the puzzle closely enough to uncover the problem - and also because this process reinforces what is to me one of the most important lessons for programmers when playing Mastermind (and similar games):

Make sure that you fully "mine" all "clues" (results from tests of your code) for all possible information.

All too often we (I!) barely look at the results of a test, or the report of a bug, before we rush to the source code and scramble (flail around?)  to apply a fix. In doing so, we (I) often overlook critical information, and this oversight can lead to lots of time lost and even the introduction of new bugs.

In this puzzle, I did not perform enough analysis to conclude that 1 could not be in the solution. By missing this fact, I then introduced a mistake into the quiz.

Lesson learned: before you start messing around with your code, make sure you have extracted all possible conclusions from tests and specifications. Then apply that knowledge in a systematic fashion.

Thanks to Jennifer, DKennedy, Bobby and Pavel for identifying this problem!

Steven

Hapy New Year and Participants in Q4 2011 Playoff

I hope you enjoyed some relaxing and joyful times with family and friends...ah, but it is all over so fast. Fortunately, at least in Chicago, it doesn't seem like winter has actually arrived. Today, 5 January, the temperature is in the 50s (Fahrenheit; 10 degrees Celsius). I tore myself away from my beloved laptop to spend time on my bicycle. Ah, that was very nice...

Well, regardless of the temperature, it's time to get back to work - and fun: back to answering PL/SQL, SQL and APEX quizzes...and it's also time for the Q4 2011 championship playoff.

You will find below the list of players who have qualified, either through ranking, correctness or wildcard. The number in parentheses are the number of playoffs in which the player has previously participated. Which means 11 players have never participated in a playoff before. Watch out, seasoned players, for some hot competition.

Congratulations to everyone on the list and best of luck in the playoff!

We will soon announce the date of the playoff, after confirming availability with players.

Warm regards to all,
Steven Feuerstein

Players in the Q4 2011 Championship Playoff

Name Rank Qualification Country
Alain Boulianne (1)1Top 25French Republic
Stelios Vlasopoulos (1)2Top 25Greece
Frank Schrader (5)3Top 25Germany
Valentin Nikotin (3)**4Top 25Russia
Syed Ariful Bari (1)5Top 25Bangladesh
Ninoslav Čerkez (1)6Top 25Croatia
Viacheslav Stepanov (3)7Top 25Russia
Chris Saxon (2)8Top 25United Kingdom
mentzel.iudith (4)9Top 25Israel
kowido (3)10Top 25No Country Set
Chad Lee (2)11Top 25United States
monpara.sanjay (0)12Top 25India
Mike Pargeter (4)13Top 25United Kingdom
Jeff Kemp (6)14Top 25Australia
Janis Baiza (3)15Top 25Latvia
Kevan Gelling (3)16Top 25Isle of Man
Hrvoje Torbašinović (2)17Top 25Croatia
Randy Gettman (4)18Top 25United States
Siim Kask (4)19Top 25Estonia
Dejan Topalovic (1)20Top 25Austria
Jerry Bull (2)21Top 25United States
Anna Onishchuk (3)22Top 25Ireland
_tiki_4_ (0)23Top 25Germany
james su (3)24Top 25Canada
Niels Hecker (5)25Top 25Germany
Andre van der Put (0)26WildcardNetherlands
John Hall (3)27CorrectnessUnited States
Yuan Tschang (1)29CorrectnessUnited States
Justin Michael Raj (0)56WildcardIndia
Nina (0)58WildcardRussia
Joaquin Gonzalez (3)60CorrectnessSpain
Dalibor Kovač (3)61CorrectnessCroatia
Frank Schmitt (0)82WildcardGermany
ZoltanKekes (1)83CorrectnessUnited States
Gideon Bruggink (0)103CorrectnessNetherlands
Vincent Malgrat (0)108CorrectnessFrench Republic
sbramhe (2)123WildcardNo Country Set
Dennis Klemme (5)146WildcardGermany
andrewc (0)206CorrectnessNew Zealand
dsinagl (0)313CorrectnessNo Country Set
Pedro Bravet (0)436CorrectnessSpain

**Valentin Nikotin was incorrectly left off the initial list of participants because in Q1 2012, he changed to non-competitive play so that he could help the PL/SQL Challenge by writing lots of quizzes. Due to a bug in our algorithms, that left him out of the qualifying process for the playoff. So we have added him into the playoff, and also kept Andre van der Put in the playoff (he is now ranked 26th) as a Wildcard player.