Number of ways to move the king across chess board

  • Thread starter Thread starter gruba
  • Start date Start date
  • Tags Tags
    Board Chess
Click For Summary
SUMMARY

The discussion focuses on calculating the number of ways a king can move from the bottom left to the upper right corner of an 8x8 chessboard, ensuring each move brings it closer to the destination. The solution involves combinatorial methods, specifically recurrence relations and generating functions. The key formula derived is G(x,y) = xy(1-x-y-xy)-1, which allows for the computation of the number of paths by finding coefficients in the power series expansion. The conversation emphasizes the importance of understanding boundary conditions and the recurrence relation Nr,s = Nr,s-1 + Nr-1,s + Nr-1,s-1.

PREREQUISITES
  • Understanding of combinatorial mathematics
  • Familiarity with recurrence relations
  • Knowledge of generating functions
  • Basic programming skills for coding solutions
NEXT STEPS
  • Study the principles of combinatorial mathematics in depth
  • Learn about recurrence relations and their applications in combinatorics
  • Explore generating functions and their role in solving combinatorial problems
  • Implement a program to compute paths on a chessboard using the derived formulas
USEFUL FOR

Mathematicians, computer scientists, educators, and students interested in combinatorial problem-solving and algorithm development.

gruba
Messages
203
Reaction score
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 8\times 8 matrix.
Is there some strict method in combinatorics (exclusion-inclusion, generating functions,...) to prove this?
 
Physics news on Phys.org
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   Reactions: gruba
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.
 
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).
 
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 8\times 8 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.
 
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.
 
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.
 
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 (1-x-y-xy)^{-1}?
 
gruba said:
Could you elaborate on your method with recurrences and generation functions? How did you get the expansion (1-x-y-xy)^{-1}?
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   Reactions: gruba

Similar threads

  • · Replies 64 ·
3
Replies
64
Views
25K
  • · Replies 25 ·
Replies
25
Views
5K
Replies
8
Views
3K
  • · Replies 17 ·
Replies
17
Views
7K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 83 ·
3
Replies
83
Views
22K
  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 27 ·
Replies
27
Views
4K