The PL/SQL Challenge (www.plsqlchallenge.com) offers a daily quiz on the PL/SQL language, through which thousands of Oracle technologists demonstrate and deepen their knowledge of PL/SQL. This blog contains posts by the PL/SQL Challenge founder, Steven Feuerstein, as well as comments from players.

07 January 2012

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!

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)

1

Top 25

French Republic

Stelios Vlasopoulos (1)

2

Top 25

Greece

Frank Schrader (5)

3

Top 25

Germany

Valentin Nikotin (3)**

4

Top 25

Russia

Syed Ariful Bari (1)

5

Top 25

Bangladesh

Ninoslav Čerkez (1)

6

Top 25

Croatia

Viacheslav Stepanov (3)

7

Top 25

Russia

Chris Saxon (2)

8

Top 25

United Kingdom

mentzel.iudith (4)

9

Top 25

Israel

kowido (3)

10

Top 25

No Country Set

Chad Lee (2)

11

Top 25

United States

monpara.sanjay (0)

12

Top 25

India

Mike Pargeter (4)

13

Top 25

United Kingdom

Jeff Kemp (6)

14

Top 25

Australia

Janis Baiza (3)

15

Top 25

Latvia

Kevan Gelling (3)

16

Top 25

Isle of Man

Hrvoje Torbašinović (2)

17

Top 25

Croatia

Randy Gettman (4)

18

Top 25

United States

Siim Kask (4)

19

Top 25

Estonia

Dejan Topalovic (1)

20

Top 25

Austria

Jerry Bull (2)

21

Top 25

United States

Anna Onishchuk (3)

22

Top 25

Ireland

_tiki_4_ (0)

23

Top 25

Germany

james su (3)

24

Top 25

Canada

Niels Hecker (5)

25

Top 25

Germany

Andre van der Put (0)

26

Wildcard

Netherlands

John Hall (3)

27

Correctness

United States

Yuan Tschang (1)

29

Correctness

United States

Justin Michael Raj (0)

56

Wildcard

India

Nina (0)

58

Wildcard

Russia

Joaquin Gonzalez (3)

60

Correctness

Spain

Dalibor Kovač (3)

61

Correctness

Croatia

Frank Schmitt (0)

82

Wildcard

Germany

ZoltanKekes (1)

83

Correctness

United States

Gideon Bruggink (0)

103

Correctness

Netherlands

Vincent Malgrat (0)

108

Correctness

French Republic

sbramhe (2)

123

Wildcard

No Country Set

Dennis Klemme (5)

146

Wildcard

Germany

andrewc (0)

206

Correctness

New Zealand

dsinagl (0)

313

Correctness

No Country Set

Pedro Bravet (0)

436

Correctness

Spain

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