Number of ways to move the king across chess board

But, for large r and s this is a rather tedious process. If we were clever we could speed things up by observing that we only need the coefficients of x7y7 for our problem. So we really only need to expand G to x7y7 and then we can read off Nr,s for a whole bunch of r and s by back substitution.
  • #1
gruba
206
1

Homework Statement


On how many ways the king can be moved from the bottom left field to the upper right field on the chess board such that such that for every move it is closer to the upper right field?

Homework Equations


-Combinatorics

The Attempt at a Solution


I assume it is diagonal path of [itex]8\times 8[/itex] matrix.
Is there some strict method in combinatorics (exclusion-inclusion, generating functions,...) to prove this?
 
Physics news on Phys.org
  • #2
There's probably more than one way to attack this problem, but I would start with the observation that without diagonal moves, it will take 14 moves, 7 up and 7 across in any order. Then, each time an up is followed by an across or an across is followed by an up, then the move can be replaced by a diagonal move - but only one for each up/across, across/up pair.
If you can program, this would not be difficult to code.

Alternatively: You are computing F(7,7) by walking through each step with an up, diagonal, or across move as follows:

F(X,Y) = F(Y,X)

For any F(X,Y) where X>0 and Y>0:
F(X,Y) = F(X-1,Y) + F(X-1,Y-1) + F(X,Y-1)

F(X,0) = F(0,Y) = 1

So
F(1,1) = F(0,1) + F(0,0) + F(1,0) = 1+1+1 = 3
F(1,2) = F(0,2) + F(0,1) + F(1,1) = 1+1+3 = 5
F(2,1) = F(1,2) = 5
F(2,2) = F(2,1) + F(1,1) + F(1,2) = 5+3+5 = 13
F(3,1) = ...
...
F(7,7) = F(7,6)+F(6,6)+F(6,7) = ...

Not counting the F(X,0) = F(0,Y) = 1, this would require 49 computations. And can also be coded.
 
  • Like
Likes gruba
  • #3
H'mm.
Does 'upper right field' mean 1step beyond the diagonal? On the diagonal?mifncan do one can do the other, but is the question that?
At each step you have 3 choices, if that helps.
I guess you could do it for first row, then second and see what pattern suggests itself.
 
  • #4
epenguin said:
H'mm.
Does 'upper right field' mean 1step beyond the diagonal? On the diagonal?mifncan do one can do the other, but is the question that?
At each step you have 3 choices, if that helps.
I guess you could do it for first row, then second and see what pattern suggests itself.
Upper right field is the top right field of the entire board (the king is at the bottom left).
 
  • #5
gruba said:

Homework Statement


On how many ways the king can be moved from the bottom left field to the upper right field on the chess board such that such that for every move it is closer to the upper right field?

Homework Equations


-Combinatorics

The Attempt at a Solution


I assume it is diagonal path of [itex]8\times 8[/itex] matrix.
Is there some strict method in combinatorics (exclusion-inclusion, generating functions,...) to prove this?

I would consider combinations of ##r, u, d## with the appropriate constraints.
 
  • #6
epenguin said:
H'mm.
Does 'upper right field' mean 1step beyond the diagonal? On the diagonal?mifncan do one can do the other, but is the question that?
At each step you have 3 choices, if that helps.
I guess you could do it for first row, then second and see what pattern suggests itself.
At each step you have 3 choices, until your reach the last column or last row. From then you have only one choice.
 
  • #7
A general approach to the problem involves recurrence relations and generating functions. Are you familiar with these, gruba?
That said, it doesn't make it much easier. You end up having to find the coefficient of x7y7 in the expansion of (1-x-y-xy)-1.
 
  • #8
haruspex said:
A general approach to the problem involves recurrence relations and generating functions. Are you familiar with these, gruba?
That said, it doesn't make it much easier. You end up having to find the coefficient of x7y7 in the expansion of (1-x-y-xy)-1.

Could you elaborate on your method with recurrences and generation functions? How did you get the expansion [itex](1-x-y-xy)^{-1}[/itex]?
 
  • #9
gruba said:
Could you elaborate on your method with recurrences and generation functions? How did you get the expansion [itex](1-x-y-xy)^{-1}[/itex]?
First, consider the more general question of moving from one corner to the far corner on a r x s rectangle. Let the number of ways of doing this be Nr,s. Can you see how to write Nr,s as a combination of Nr,s-1, Nr-1,s and Nr-1,s-1? That's called a recurrence relation.
We need to supply boundary conditions. I would use:
The relation applies for all r, s >=1
N0,0=1, N0,s=0 for s>0, Nr,0=0 for r>0. You can check this produces the right numbers for r=1 etc.
The next step is to define a generating function ##G(x,y)=\Sigma_{r=1,s=1}N_{r,s}x^ry^s##.
Multiplying through the recurrence relation by xrys and summing produces an equation for the generating function. A little careful working through the boundary parts of the sums leads to G=xy(1-x-y-xy)-1.
If we then expand G as a power series in x and y we can read off the values of Nr,s as the coefficients.
 
  • Like
Likes gruba

1. How many squares can the king move to in one turn?

The king can move one square in any direction (up, down, left, right, and diagonally) in one turn.

2. Can the king jump over other pieces?

No, the king cannot jump over other pieces. It can only move to an empty square or capture an opponent's piece.

3. Are there any restrictions on how many times the king can move to the same square?

No, there are no restrictions on how many times the king can move to the same square. However, it cannot stay on the same square for more than one turn.

4. How many possible ways are there to move the king across the chess board?

There are a total of 20 squares that the king can move to on a chess board (8 squares in each direction and 12 squares diagonally). Therefore, there are 20 possible ways for the king to move across the chess board.

5. Can the king move to any square on the chess board?

No, the king cannot move to any square on the chess board. It must stay within the boundaries of the chess board, which is an 8x8 grid of squares.

Similar threads

  • Math Proof Training and Practice
Replies
25
Views
2K
Replies
64
Views
20K
  • Calculus and Beyond Homework Help
Replies
8
Views
2K
  • Introductory Physics Homework Help
Replies
1
Views
198
  • Linear and Abstract Algebra
Replies
17
Views
4K
  • Calculus and Beyond Homework Help
Replies
1
Views
2K
  • General Discussion
Replies
16
Views
2K
  • Math Proof Training and Practice
3
Replies
83
Views
17K
  • Science Fiction and Fantasy Media
Replies
3
Views
2K
Back
Top