Menu

[Solved]Given Checkerboard 4 Rows N Columns Integer Written Irn Square Also Given Set 2n Pebbles W Q37100813

We are given a checkerboard which has 4 rows and n columns, and has an integer written irn each square. We are also given a s

We are given a checkerboard which has 4 rows and n columns, and has an integer written irn each square. We are also given a set of 2n pebbles, and we want to place some or all of these on the checkerboard (each pebble can be placed on exactly one square) so as to maximize the sum of the integers in the squares that are covered by pebbles. There is one constraint: for a placement of pebbles to be legal, no two of them can be on horizontally or vertically adjacent squares (diagonal adjacency is fine) (a) Determine the number of legal patterns that can occur in any column (in isolation, ignoring the pebbles in adjacent columns) and describe these patternis Call two patterns compatible if they can be placed on adjacent columns to form a legal placement. Let us consider sub-problems consisting of the first k columns 1 < k < n. Each sub-problem can be assigned a type, which is the pattern occurring in the last column (b) Using the notions of compatibility and type, give an O(n)-time algorithm for computing an optimal placement. Show transcribed image text We are given a checkerboard which has 4 rows and n columns, and has an integer written irn each square. We are also given a set of 2n pebbles, and we want to place some or all of these on the checkerboard (each pebble can be placed on exactly one square) so as to maximize the sum of the integers in the squares that are covered by pebbles. There is one constraint: for a placement of pebbles to be legal, no two of them can be on horizontally or vertically adjacent squares (diagonal adjacency is fine) (a) Determine the number of legal patterns that can occur in any column (in isolation, ignoring the pebbles in adjacent columns) and describe these patternis Call two patterns compatible if they can be placed on adjacent columns to form a legal placement. Let us consider sub-problems consisting of the first k columns 1

Expert Answer


Answer to We are given a checkerboard which has 4 rows and n columns, and has an integer written irn each square. We are also give… . . .

OR


Leave a Reply

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