mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2017-09-01, 08:06   #12
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

5D616 Posts
Default

Quote:
Originally Posted by LaurV View Post
In fact when you send the solution, you may need to specify like "x positions allow fool mate in 2, y positions allow fool mate in 3, z positions allow fool mate in 4", etc(up to you how high you want to go , because if they are not very specific about it, so it can be interpreted one way or the other.
No, you need to count only the Fischer configurations that allows Black giving a checkmate in only 2 steps. (so the total number of moves is 4).
R. Gerbicz is offline   Reply With Quote
Old 2017-09-01, 10:36   #13
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
"name field"
Jun 2011
Thailand

9,787 Posts
Default

I have a more interesting puzzle here. Do you remember the "mate in 4 moves" with (white moves) e3, Qf3, Bc4, then Qf7# that we use to play when you were children?

I just created a piece of code that generates the next position (and shows it to me on board, for easier, manual play) therefore cycling easier through the 960 possible boards, without using the physical wooden stuff.

This is very simple, and it took me less than 15 minutes to write it right now, during the lunch break. It is emulating exactly the "throwing dice" method, but having every time the right die with the right number of faces, therefore every board can be generated by exactly 4 casts (4x4x15x4, note that I place the horses before the queen). Cycling through each cast from 0 to n-1, in a nested for-loop, all boards can be generated and shown in sequence with a key press for each board. For example the position number 0 (all dice fall on 1) will generate the next row of woods: BBNNQRKR, and position number 1 (all dice felt 1, except for the last which felt 2) will put on the table BBNNRQKR (note that I place the horses before placing the queen, I have a reason for it, and this does not affect the puzzle in any way, and the king is placed last, between the rooks). Position 521 is RBQNBKNR etc. The "normal" chess position, RNBQKBNR is position number 390.

There are 4 possibilities to place the first bishop, 4 to place the second, 15 to place the two knights on the remaining 5 squares (combinations of 6 taken by 2), and 4 to place the queen. Remaining squares are filled with RKR in order, as the king must be between rooks. This means generating 4 random numbers, three of them from 0 to 3, the forth from 0 to 14, place the pieces. Except that I do not generate random numbers, but start from (0,0,0,0) to (3,3,14,3) and generate all boards. Wait for a key to generate the next one. And 4x4x15x4=960.

More than that, I will not do... (I mean programming). But looking to these positions for some minutes now, I found that almost all of them allow a fool mate in 4 moves. For example, the first position, BBNNQRKR, if white moves the pawn in front of the king, then black can mate him either with the queen, or bishop, usual way, or (a nicer way) opening the pawn in b7 and coming with the d8 knight in h3 (nice one huh? ) for which 3 moves are needed.

Therefore my puzzle, which I consider a million times nicer than the original (sorry for my modesty hehe ) here:

How many of the 960 positions do NOT allow a fool mate in 4 moves?

This can be solved "analytically" (construct the position), but at least, if the candidate solver is not a good chess player, but a good programmer, he will still need to do some work, as the search space is bigger, and you can't stop earlier...

Last fiddled with by LaurV on 2017-09-01 at 10:44
LaurV is offline   Reply With Quote
Old 2017-09-01, 10:49   #14
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
"name field"
Jun 2011
Thailand

9,787 Posts
Default

Quote:
Originally Posted by R. Gerbicz View Post
No, you need to count only the Fischer configurations that allows Black giving a checkmate in only 2 steps. (so the total number of moves is 4).
Of course, the total number of moves is 2. That was always clear. There are 4 "semimoves".
(otherwise, any position has a fool mate in just few moves, if the player "plays for the adversary", i.e. helping the other one to win).

In which case, the white needs to move both pawns (otherwise the second pawn will temporarily block the mate, in most of the cases). That is why I said the problem is not interesting. But we are moving on the "spoiler" territory right now...

Last fiddled with by LaurV on 2017-09-01 at 11:02
LaurV is offline   Reply With Quote
Old 2017-09-04, 18:02   #15
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

2·32·83 Posts
Default

Quote:
Originally Posted by LaurV View Post
Other (concerning castling, whatever) are not of any concern, because the game will not progress so much, you mate in two.
I have fallen to this trap also. See the update!

"Update (4/9): Update 4/9: Pay attention to the special Castling rules, see also at the Wikipedia link: https://en.wikipedia.org/wiki/Chess960 "
R. Gerbicz is offline   Reply With Quote
Old 2017-09-04, 18:48   #16
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

25×5×37 Posts
Default

For castling to have any effect it must be either possible for the rook and king to switch places at the beginning of the game or it be possible to castle on the second move after a knight move.
henryzz is online now   Reply With Quote
Old 2017-09-05, 05:06   #17
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
"name field"
Jun 2011
Thailand

9,787 Posts
Default

Quote:
Originally Posted by R. Gerbicz View Post
I have fallen to this trap also. See the update!

"Update (4/9): Update 4/9: Pay attention to the special Castling rules, see also at the Wikipedia link: https://en.wikipedia.org/wiki/Chess960 "
This is a straw man. See below.

Quote:
Originally Posted by henryzz View Post
For castling to have any effect it must be either possible for the rook and king to switch places at the beginning of the game or it be possible to castle on the second move after a knight move.
Indeed. To be able to castle in max two moves, either the king and rook are neighbors, or there is a horse in between, that you must move out first.

Moreover, I still do not get it how the rules for castling can influence the fool mate. You play fool chess. This means white makes the worst possible moves (plays for the adversary). You can not castle at the first or the second move, unless this helps the adversary to mate you. You may only castle IF you put yourself in a mate position. You can not use the castling to evade/avoid the mate. Also, if you did not castle already, then you can not castle from a check position, or if you end up in a check position, therefore there is no influence here.

Then, if white wastes a move with castling, it means he didn't move the second pawn, so the only possible mate is that black captures a pawn in row 2 (initial pawn position), or if a white pawn was moved to row 4, captures it with check (in this case, mate from the front). The first can't be done, because there are not enough moves for black to take out a long-range piece that can threat c2 or g2 and still be guarded (otherwise the white king captures it). For the second, say you have xxRKyyyy. One of y's must be a rock, and close to the king or in f1 must be either a queen or bishop, to block the mate from the h side (otherwise, if mate from the h side is possible, you don't care about the castling). Now, you can't put a rook in b1, because the rooks are both in the same side of the king, you can't put a queen or bishop, because they will block the mate (with or without castling) from c2 side or from front, so you must put a knight. Now, you can not mate from the left because the rook will block c2, and you can not mate from the right. If you castle, you can not mate from the right because the rook blocks d2, you can not mate from the left because the horse beats a3. If horse moved out, in either a3 or c2, its square in b1 is free and the king can move there, so no mate. This position has no fool mate, unless one is available without castling (if the yyyy are arranged conveniently, a mate may be possible from the right).

Same reasoning for the other side, when yyyyyKRx. I didn't put the pieces down, so I may be wrong, this is only a "mental exercise". But "i feel" that the castling rules will not influence the outcome of the game, this is my first impression. Well... argh... you used to prove me wrong in the past, so I will not be surprised if...
LaurV is offline   Reply With Quote
Old 2017-09-05, 10:59   #18
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

25×5×37 Posts
Default

Quote:
Originally Posted by LaurV View Post
This is a straw man. See below.



Indeed. To be able to castle in max two moves, either the king and rook are neighbors, or there is a horse in between, that you must move out first.

Moreover, I still do not get it how the rules for castling can influence the fool mate. You play fool chess. This means white makes the worst possible moves (plays for the adversary). You can not castle at the first or the second move, unless this helps the adversary to mate you. You may only castle IF you put yourself in a mate position. You can not use the castling to evade/avoid the mate. Also, if you did not castle already, then you can not castle from a check position, or if you end up in a check position, therefore there is no influence here.

Then, if white wastes a move with castling, it means he didn't move the second pawn, so the only possible mate is that black captures a pawn in row 2 (initial pawn position), or if a white pawn was moved to row 4, captures it with check (in this case, mate from the front). The first can't be done, because there are not enough moves for black to take out a long-range piece that can threat c2 or g2 and still be guarded (otherwise the white king captures it). For the second, say you have xxRKyyyy. One of y's must be a rock, and close to the king or in f1 must be either a queen or bishop, to block the mate from the h side (otherwise, if mate from the h side is possible, you don't care about the castling). Now, you can't put a rook in b1, because the rooks are both in the same side of the king, you can't put a queen or bishop, because they will block the mate (with or without castling) from c2 side or from front, so you must put a knight. Now, you can not mate from the left because the rook will block c2, and you can not mate from the right. If you castle, you can not mate from the right because the rook blocks d2, you can not mate from the left because the horse beats a3. If horse moved out, in either a3 or c2, its square in b1 is free and the king can move there, so no mate. This position has no fool mate, unless one is available without castling (if the yyyy are arranged conveniently, a mate may be possible from the right).

Same reasoning for the other side, when yyyyyKRx. I didn't put the pieces down, so I may be wrong, this is only a "mental exercise". But "i feel" that the castling rules will not influence the outcome of the game, this is my first impression. Well... argh... you used to prove me wrong in the past, so I will not be surprised if...
Now that I think about it again I don't think that a CM could occur after a knight move as there would be no way of checking the king. Swapping the position of the rook and king, however, that basically changes where black is aiming to CM white. That could enable CM when CM wasn't possible before. The other move for white would be a pawn move.

Last fiddled with by henryzz on 2017-09-05 at 11:23 Reason: Muddled colours
henryzz is online now   Reply With Quote
Old 2017-09-16, 21:03   #19
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

2×32×83 Posts
Default

Quote:
Originally Posted by SmartMersenne View Post
I found (removed) solutions that use no castling. Is this correct? Am I too far?
I've already sent to you a pm on that day, but found this forum message only today.
Tricky/harder problem, not the coding, but the testing.

Last fiddled with by R. Gerbicz on 2017-09-19 at 19:48
R. Gerbicz is offline   Reply With Quote
Old 2017-10-08, 01:15   #20
Xyzzy
 
Xyzzy's Avatar
 
Aug 2002

8,311 Posts
Default

https://researchweb.watson.ibm.com/h...ember2017.html
Xyzzy is offline   Reply With Quote
Old 2018-03-08, 06:56   #21
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
"name field"
Jun 2011
Thailand

9,787 Posts
Default

Just to set the tings right...

We did not revisit this thread (no time!) but now, because we went to the site to check the solution for Feb 2018, we remembered about this problem and went there to check for solutions. And we discovered that it is possible to mate after the castling

Well...
LaurV is offline   Reply With Quote
Old 2018-03-17, 13:19   #22
tricky
 
Feb 2018

2 Posts
Default

Here's a lazy way to solve it with the python-chess package.
Attached Files
File Type: txt chess960.txt (512 Bytes, 211 views)
tricky is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
September 2016 Batalov Puzzles 8 2016-10-04 14:10
September 2015 Xyzzy Puzzles 12 2015-10-07 14:43
September 2014 Xyzzy Puzzles 3 2014-11-02 19:04
TPS Record Rally: September 16-21 Oddball Twin Prime Search 11 2011-09-22 06:47
Anyone going to Vienna in September? fivemack Factoring 1 2007-09-07 00:29

All times are UTC. The time now is 14:59.


Sat Oct 23 14:59:20 UTC 2021 up 92 days, 9:28, 0 users, load averages: 2.29, 2.08, 1.82

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.