Menu

[Solved]5 Given 1 Dimensional Board Cell Marked 0 1 Example Suppose Moving Chess Board Subject Fol Q37200240

5. Given a 1 dimensional board. Each cell is marked with 0 or 1.For example:

0 0

Now suppose moving a chess on this board, subject to thefollowing rules:

The chess starts at rightmost cell of the board (marked aspurple in the above example).

Each time, the chess can move to the cell that is 3 or 4locations to its left. But at any time, a chess can only be puttedon a ‘0’ cell.

We can assume that rightmost and the leftmost cell has value‘0’.

The goal is to determine whether we can move the chess to cellindex 0. (Marked as green in the above example)

We would like to solve this problem using DP. Consider thesubproblem F(i), which is a boolean value indicating whether it ispossible to make it to the goal if the starting cell is at index i.(Index starts from 0.) In the above given example of boardconfiguration, F(3) is true, but F(2) and F(5) are false. F(6) isalso considered false, since the starting cell (cell index 6) has a‘1’, and a chess can only be putted on a ‘0’ cell. Write down therecurrence relation and base cases for F(i). Solve the above givenexample instance of the problem by building and filling out the DPtable.

0 0 Show transcribed image text 0 0

Expert Answer


Answer to 5. Given a 1 dimensional board. Each cell is marked with 0 or 1. For example: Now suppose moving a chess on this board, … . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *