[rules-users] Drools Puzzle #1: Ages of the sons

Ellen Zhao enzhao at gmail.com
Fri Jul 27 18:46:58 EDT 2007


Hallo all!

I talked about running a periodic puzzle solving contest in the user
mailing list to some people in the drools team. They have never done
it before so did not know how this contest will come out. However, I
was allowed to make the first try. If no body is interested, there
won't be any Drools Puzzle #2. Sorry for the spam if you do not like
this at all. In the end of this email you can see how I came up with
this idea.

So, here is the puzzle for round No. 1:

------------------------------------------------------------------------------------------------------------------------------------
Difficulty level: settler

An old man asked a mathematician to guess the ages of his three sons.

Old man said: "The product of their ages is 36."
Mathematician said: "I need more information."

Old man said:"Over there you can see a building. The sum of their ages
equals the number of the windows in that building."
After a short while the mathematician said: "I need more information."

Old man said: "The oldest son has blue eyes."
Mathematician said: "I got it."
------------------------------------------------------------------------------------------------------------------------------------

This is a simple puzzle, you may not need any computer to solve it.
But here are the rules:

1. Solution (the core algorithm) must be written in drools. Any
dialect is allowed. Any DSL is allowed.

2. Any kind of user interface is allowed.

3. Make your program as easy to test as possible. Please attach a
simple and short readme file about how to build/test/deploy it.

4. The drools team will measure the performance of all submissions on
a same computer.

3. The winner will be allowed to post the next puzzle.

4. Any participator, no matter finally win or not, will get points for
each participation. Drools team will run a global ranking system and
build a hall of fame for all participators. At the end of the year,
the one who has most points will be awarded with ( Drools team please
fill here, something like a T-shirt or ?). Top ten people in the hall
of fame will be awarded with (Drools team please fill here).

5. If there are many, many participators, the Drools team might
consider things like "shortest run-time award", "least memory-usage
award", "best UI award", "shortest code award", etc. for each puzzle.

6. Currently the puzzle will come once half month. Submission deadline
of this round is August 15th, 2007.

7. Please do not post your solution to the user mailing list, since
everybody can see your program before the deadline. Drools team please
specify an email account to which participators can post solutions.

8. Best/inspiring solutions will be disclosed when next round is on.

9. If any Drools bug is caught during your solving of the puzzle,  the
Drools team will award you with (Drools team please fill here).

-----------------------------------------------------------------------------------------------------------------------------------

Any constructive advice and suggestion about the rules of Drools
Puzzle is welcome.

Here is guideline for posting puzzles:

1. You do not want to scare people away with too difficult puzzles or
bore people with questions like 1+1=?, so please consider a proper
difficulty level for the puzzle.

2. NP-complete or NP-hard is okay. For some NP-hard problems,
sub-optimal solutions can be achieved efficiently. But do please tag
the difficulty level as something like "veteran", "guru", etc.

3. Complexity aside, there is still scope and testability
consideration. Puzzles like "How to integrate my 15 different kind of
services objects and my entity home with Drools?" might be
algorithmically not difficult, but the application-building can really
take a lot of time and energy,  and it is not straightforward to test
the solution.

4. The purposes of this contest are:
  4.1 To learn from each other, enhance our programming skill and
learn good algorithms, good implementations.
  4.2 To encourage people to explore features of Drools.
  4.3 For fun.
  So your puzzle should not take too much work to solve. It should not
mentally or physically torture participators.

---------------------------------------------------------------------------------------------------------------------------------

This idea was inspired by a "Weekly Challenge" running on dpreview.com
user forum and GOTM from http://gotm.civfanatics.net/

On dpreview.com, a subject is posted by the winner of the prior week,
people can post their photos to compete. On civfanatics.net, an
initial configuration file is posted each month, and gamers submit
their end results for ranking. Both of these two non-official contests
are running very well, I hope Drools Puzzle will turn out a fun thing
too.



Regards and nice weekend,
Ellen



More information about the rules-users mailing list