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

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

Sunday, November 7, 2010

Sudoku - Programming the rectangle strategy

Every now and then I like to solve a sudoku puzzle. There are three things that interest me in sudoku: how to measure the difficulty of puzzles, how to write a program to solve puzzles, and how to write a program to create puzzles.

A program able to create puzzles must first of all be able to solve them, and to grade puzzles it is necessary to have a large number of solved puzzles. Therefore, the first step is to write a sudoku solver. There are many around, but for me part of the fun is to write the program. Years ago, I already wrote at least two sudoku-solving programs in Java. They were OO programs, but I was never particularly happy with the implementation. For this latest attempt, I have decided to ditch OO and use plain old “C” as a programming language.

In this post, I will describe a strategy that I call ‘rectangle’. It is sometimes called ‘hollow rectangle’ (you will later understand why). I intend to describe the strategy and then provide some development notes. To display the examples, I shall use snapshots of the program “Sudoku Training Software 1.1”, which runs under Windows. You can freely download it by clicking here. This is the first program I found on the Web for generating the snapshots. I use it only for that and I have no idea whether its other functions are good or bad. If you would like to suggest some other application, perhaps for the Mac, please tell me.

Sunday, October 31, 2010

The day I was arrested

This post is about what happened to me one early morning of 1977.

Monday, October 25, 2010

I am an apostate

Yesterday, I stumbled onto the blog danein.blog.kataweb.it/2009/07/31/scomuniche/ (warning: it is in Italian). The author, a declared atheist, said (my translation): “Is there anybody who can help me to get a serious excommunication, possibly signed by the Pope?” This motivated me to write this post, because I did get an official letter of excommunication from the Catholic Church, albeit not from the Pope himself. Perhaps, others will be inspired by my action and do the same.