Subject: Re: [xsl] n-queens? From: Hermann Stamm-Wilbrandt <STAMMW@xxxxxxxxxx> Date: Mon, 23 Apr 2012 10:34:41 +0200 |
> This puzzle, although interesting, is commonly given to beginning > programming students. > Yes, but I posted here because of "XSLT 1.0 + exslt:node-set()" solution and the two questions I have (Muenchian grouping / functional style). > I remember facing it myself. One I have never seen solved > are the number of boards where less than eight queens is the maximum. > Please be more precise on what you count as "a board". Does the board contain less than 8 queens for your problem? Or does the board always contain 8 queens, some threatening another? In the latter case the answer is: (64 choose 8) - 92 = 4426165368 Long ago I posted some queen-puzzles on a (German language) chess forum. Here you can see a position with 5 queens threatening all fields: http://www.schachmatt.de/69-schachraetsel/2764-3xdamen-uberdeckung.html#post2 2269 It is not possible to threaten all fields with only 4 queens. So for the first problem the count of all positions with 5, 6 and 7 queens threatening all fields seem to be what you are interested in, right? Mit besten Gruessen / Best wishes, Hermann Stamm-Wilbrandt Level 3 support for XML Compiler team and Fixpack team lead WebSphere DataPower SOA Appliances https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/ ---------------------------------------------------------------------- IBM Deutschland Research & Development GmbH Vorsitzende des Aufsichtsrats: Martina Koederitz Geschaeftsfuehrung: Dirk Wittkopp Sitz der Gesellschaft: Boeblingen Registergericht: Amtsgericht Stuttgart, HRB 243294 From: "Mark" <mark@xxxxxxxxxxxx> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>, Date: 04/21/2012 08:25 PM Subject: Re: [xsl] n-queens? This puzzle, although interesting, is commonly given to beginning programming students. I remember facing it myself. One I have never seen solved are the number of boards where less than eight queens is the maximum. Mark -----Original Message----- From: Ivan Shmakov Sent: Saturday, April 21, 2012 8:26 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Cc: Ivan Shmakov Subject: Re: [xsl] n-queens? >>>>> Michael Hopwood <michael@xxxxxxxxxxx> writes: > I'm no chess OR maths expert but - surely they are not actually chess > queens if any two of the same colour can threaten each other? The > puzzle using actual chess queens, at least one of which is of the > other colour, would look quite different... AIUI, for the purposes of this puzzle, /each/ of the queens is assumed to be of its own distinct colour. --cut: http://en.wikipedia.org/wiki/Eight_queens_puzzle -- The eight queens puzzle is the problem of placing eight chess queens on an 8W8 chessboard so that no two queens attack each other. Thus, a solution requires that no two queens share the same row, column, or diagonal. The eight queens puzzle is an example of the more general n-queens problem of placing n queens on an nWn chessboard, where solutions exist for all natural numbers n with the exception of 2 and 3. --cut: http://en.wikipedia.org/wiki/Eight_queens_puzzle -- -- FSF associate member #7257
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] n-queens?, Mark | Thread | Re: [xsl] n-queens?, Hermann Stamm-Wilbra |
Re: [xsl] Output < and > in the att, Michael Kay | Date | Re: [xsl] format-number round is no, henry human |
Month |