[Archive!] Pure mathematics, physics, chemistry, etc.: brain-training problems not related to trade in any way - page 586

 
Aleksander:
the elephant made into a pawn?
This is the only move in which the previous position is not impossible
 
alsu:

In reality I would make one pass with a copy, but I would not fill it with twos beforehand, but only the middle (remainder), when the pass is already completed

This gives us N read operations, N write operations and 1 memory allocation operation. I can hardly think of anything less))

ps more N increment counter operations)))


I think it would be faster in two passes. Not one if!

void Sort123(int & a[]){
   int c[4];
   ArrayInitialize(c,0);
   int s=ArraySize(a);
      for(int i=0;i<s;i++){
         c[a[i]]++;
      }
      for(i=0;i<c[1];i++){
         a[i]=1;
      }
   c[2]+=c[1];
      for(i=c[1];i<c[2];i++){
         a[i]=2;
      }
      for(i=c[2];i<s;i++){
         a[i]=3;
      }
}
 
alsu:
This is the only move in which the previous position is not impossible

Not the only one. I see three variants:

- bishop from pawn vertically (pawn ate nothing during the transformation)

- bishop on the diagonal (pawn ate something on the 8th horizontal)

- queen from a pawn on the diagonal (also ate something on the 8th).

P.S. And I initially only saw the option with the white king move. But it was pointed out to me that there should have been double check then.

 
So how much would be:
A+B=...
 
Mathemat:

Black surrendered, but what was White's last move?


So, we have defined, that the last move of White was obviously transformation of a pawn into a piece, i.e. before this move White had a pawn on one of the squares a7 or b7. It is not difficult to calculate that in both cases this pawn (it could originally be only on square f2) makes exactly 5 captures during the game. Further, note that the pawns standing on squares a3,b4,c5 also had 5 captures in total. Total, we have 10 captures of black pieces. Black has 6 pieces on the board now, therefore, all 10 of the above mentioned captures were done by white pawns.

However, on the board f8 there is no black bishop which, given the black pawns on e7 and g7, could not be taken by a white pawn and also could not leave his square. Consequently, the black bishop was not taken by a pawn, but by a piece. Thus we have arrived at a contradiction, from which the answer follows: this position is impossible and could not arise according to the rules of chess.

 
Mathemat:

Not the only one. I see three possibilities:

- bishop from pawn vertically (pawn ate nothing during the transformation)

- bishop on the diagonal (pawn ate something on the 8th horizontal)

- queen from a pawn on the diagonal (also ate something on the 8th).

P.S. And I initially only saw the option with the white king move. But it was pointed out to me that there should have been double check then.

the only correct option
 
is if the pawn turned into a bishop... but since that was impossible - you proved it... so the last move is not a pawn... but with white's king... and probably with F3-G3
 
Aleksander:
is if the pawn turned into a bishop... but since that was impossible - you proved it... so the last move is not a pawn... but with white's king... and probably with F3-G3
This is also impossible: on f3 the king was checkmated by the queen and rook, and there could be no opening check, because the queen and rook attack via different squares.
 
alsu:

So, we have determined that white's last move was clearly the transformation of a pawn into a piece,

The premise is wrong ;)

There are really not enough pawns for transformation


Europa:
the only correct option
Alas, not enough pawns either
 
Europa:
the only correct option
The post above explains why any pawn option fails