Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

2. 5 points] In fairy chess, pieces with non-traditional types of moves are used

ID: 3735257 • Letter: 2

Question

2. 5 points] In fairy chess, pieces with non-traditional types of moves are used in place of (or in addition to) the usual pieces. One such piece is called a Major, which can move one squares up the board and one square to the left or right, or (in a single move) one square up and three squares to the left or right in other words, the Major on the square marked . can move directly to any of the squares marked ×. (The Major can also leap over any pieces which are between the square where it starts and the square that it moves to.) Suppose that a Major starts on an infinite board at the square (0,0). Give a recursive definition for the set S of all squares that can be occupied by this Major

Explanation / Answer

let us first see the positional indexes of the board mentioned in the question. It is similar to the coordinate system. left bottom corer is the origin and boz in the left bottom corner is (0 , 0). On moving right we increment the value of second parameter and on moving upwards, we increment the value of forst parameter.

Given below is the examle for position of squares in 4 x 4 board:

There are few thing we need to consider for finding out solution,

1) Major can occupy a position (i , j) if and only of both i and j are non negative integers

2) for any given position (i, j), Major can occupy positions

(i+1 , j-1),

(i+1 , j+1),

(i+2 , j-3) and

(i+2, j+3)

subject to condition specfied in (1)

Let S(i , j) be set of squares that can be occupied by the major starting at position (i , j), then on movin to any of the specified position in (2), we can add the set of squares that can be occupied by the major starting at this new position to position (i , j) to get set of positions that can be occupied by Major starting at (i , j).

Hence we got our recursive solution as

S(i , j) = S(i+1 , j-1) U S(i+1 , j+1) U S(i+2 , j-3) U S(i+2 , j+3) U (i , j)

subject to condition: for S(a,b) to be valid a>=0 and b>=0

U represent union

(3,0) (3,1) (3,2) (3,3) (2,0) (2,1) (2,2) (2,3) (1,0) (1,1) (1,2) (1,3) (0,0) (0,1) (0,2) (0,3)