I use this blog as a soap box to preach (ahem... to talk :-) about subjects that interest me.

Monday, March 7, 2011

KenKen - One more case

Here is one more interesting strategy I discovered when solving one of my CleverClever puzzles.

The four-cell cage on the right shows all possible candidates of each cell. We can discard the 1 of (5,8) because the sum must be even and the three other cells only have even candidates. Then, as the 1 of row 5 can only be in (5,1), we can remove all other candidates from that cell and the corresponding candidates in the other cell of the cage.

Sunday, March 6, 2011

KenKen - A non-trivial case

Solving one of my CleverClever puzzles, I encountered the following configuration:


Suppose that the 112x cage is solved by the combination [8 7 2 1]. Then, the 8 must be in (7,5), because there is already an 8 in either (3,6) or (4,6). But if that is the case, then the remaining three cells of the cage, all in column 6, must contain 7, 2, and 1. This leads to a contradiction, because it would force us to remove the 1s in (2,6) and (8,6), thereby leaving both cells with a 9 as the only possible candidate. Therefore, the 112x cage must be solved with [7 4 2 2] (which, incidentally, means that (7,5) must contain a 2).

I don’t have a name for this strategy, but it is a nice example of a technique that does not (and cannot) occur in Sudoku.

Saturday, March 5, 2011

KenKen Strategies

Most of the strategies used to solve Sudoku rely on the interplay of boxes and lines. Therefore, it is not surprising that they are not transferable to KenKen® (registered trademark of Nextoy LLC).

Wednesday, February 23, 2011

KenKen

Some weeks ago, I discovered the Sudoku-like puzzle KenKen® (registered trademark of Nextoy LLC). In Japanese, Ken means ‘clever’. I say ‘Sudoku-like’ because it consists of a grid to be filled with digits. Like with Sudoku, every digit can only appear once within its row and once within its column. But, instead of square boxes, KenKen® contains cages, which can hold between one and seven (the largest cage I have encountered) contiguous cells. There are no initial clues, but for every cage, the puzzle provides a number and an operation with which the number is to be achieved.

Sunday, February 20, 2011

Watch Your Language!

Intelligent Design is an affirmation of a belief, not a scientific theory.  To maintain that Nature is too complex to have evolved on its own and then deduce from such an arbitrary concept that a Creator/Designer must exist is an affirmation of faith, not a scientific statement.

It is important that magazines focussed on popularising Science maintain the highest standards of objectivity, not just in what they say but also in how they say it.  Statements that purport to be scientific but are formulated with elements of superstition can have deleterious effects on the minds of the younger readers.

What prompted this tirade is the article by Lauren Monaghan titled “Grand Delusions” that appeared in Cosmos (self proclaimed “Australia’s #1 Science Magazine”)  Issue 28 of Aug/Sep 2009. On page 46, it contained the following sentence:

“...we always have — and always will — want to believe in the fantastic. In fact, many scientists believe we are even programmed to do so.”  (my italics)

In the same article was also the following statement made by an experimental psychologist:

“Humans are born with brains designed to make sense of the world, and that sometimes leads to beliefs that go beyond natural explanations.”  (again, my italics)

Do you see what I mean?  The words “programmed” and “designed” imply the existence of a Programmer and a Designer.  They should have never appeared in a Science magazine.

Bah...

Sunday, February 6, 2011

GLUT in C with Eclipse on the Mac

For the past couple of months, for my book on Sudoku, I have been writing C programs with Eclipse running under Mac OS.

Friday, January 28, 2011

Multiculturalism

In 1970, the German film director and producer Rosa von Praunheim made the film Die Bettwurst. The word Bettwurst, invented by Rosa, means bed sausage, and refers to somebody who never gets out of bed.

Anyhow, I saw the film decades ago, but I still remember the words of the following little song:

Die ganze Welt ist nur ein Arsch
und wir sind seine Fürze.
Ein Jeder stinkt nach seiner Art.
Das gibt dem Leben Würze.

Here is my best translation of it:

The whole world is just an arse
and we are its farts.
Each one stinks in its own way.
This gives spices to our lives.

Wednesday, January 19, 2011

Sudoku - A Handsome Samurai

I have almost completed my book Sudoku Programming (if I have ever seen a plug...) about how to write C applications that can solve and generate Sudokus. As part of it, I have decided to explain how to generate Samurai Sudokus. I had noticed that they often have the shared boxes completely empty and wanted to do better than that. I am very happy with the result, and would like to share it with you. Here it is:


I can generate as many as I like and not necessarily fully symmetrical, even if I think that they are just beautiful. Each one of the five puzzles I used to ‘assemble’ the Samurai requires some non-trivial strategies like Y-wing, XY-chain, and X-wing. The presence of the intersections might/should reduce the overall difficulty of the puzzle, but I still expect it to be reasonably (whatever that means) difficult.

Obviously, I have got the solution, but you don’t expect me to give it to you, do you?

Tuesday, January 11, 2011

Fortran and Eclipse on the Mac - Addendum

This is about updating Eclipse, PTP, and the Fortran compiler to their latest versions. Beth Tibbitts of the Eclipse Parallel Tools Platform (http://eclipse.org/ptp) told me how to do it via the Photran Information mailing list (photran[a t]eclipse.org).

Tuesday, January 4, 2011

Fortran and Eclipse on the Mac

In this post, I describe how I installed a Fortran compiler within Eclipse on my 64-bit Macintosh running the Snow Leopard system (OS X 10.6.5).

Saturday, January 1, 2011

A New Year's Tale

As soon as the starship enters the solar system, the board AI begins the process of thawing the crew. Despite the powerful zero-point energy propulsion, the trip from Tau Ceti 4 has lasted almost three decades.

Friday, December 24, 2010

Wednesday, December 22, 2010

Silence

For a month now I haven’t written any new posts. The problem is that I have been working at two books and haven’t found time for blogging. I know: if I stop making new posts, I will lose the few readers I have, but...

Monday, November 22, 2010

Marriage for all

This post describes my position concerning gay marriages.

Wednesday, November 17, 2010

Sudoku - Programming the XY-chain strategy

XY-chain is a generalisation of Y-wing. Essentially, instead of looking for a chain of three pairs, you look for longer chains in which the intersection cell of the Y-wing is expanded to a chain. The chain can be surprisingly long (one day, I might try to find out how long...), as shown in the following examples (only the relevant cells are shown).



Friday, November 12, 2010

Sudoku - Programming the Y-wing strategy

On the web there are many explanations of the Y-wing strategy, but none seems to go to the core of the issue. The only clear statement I found was that Y-wing doesn’t solve cells, but only eliminates possible candidates.

Strategy

Look for cells that contain only two candidates each. Among those cells, look for three cells that satisfy the following two conditions:
  1. The arrangement of candidates in the cells is AB, AC, and BC. That is, no two cells have the same pair of candidates.
  1. The cells are in two intersecting groups. This is equivalent to say that the two wing cells cannot share any group and can only happen in two ways: row+column (one of the cells shares the row with one of the other two cells and the column with the third one) and line+square, where ‘line’ stands for either ‘column’ or ‘row’ (one of the cells shares the line (row or column) with one of the other two cells and the square with the third one).