An archived instance of a Discrete forum

Counting kings

mark

(10 pts)

In this problem, you’re going to modified the code in this Observable notebook to compute the number ways non-attacking kings can be placed on an m\times n board. To get your precise problem statement, choose your name from the following list:

audrey

My board is 5\times4 so there are 1213 possible chessboards, according to the following computation:

board_cnt = math.multiply(
  math.ones(13),
  math.pow(math.matrix(kings_matrix(5)), 3),
  math.ones(13)
)
ksimmon1

My board is 3\times9 there are 16717 possible chessboards, according to the following computation:

board_cnt = math.multiply(
math.ones(89),
math.pow(math.matrix(kings_matrix(9)), 2),
math.ones(89)
)

board_cnt = 16717

Eli

My board is 5 x 8, so there are 795611 possible chessboards, according to the following computation:

board_cnt = math.multiply(
math.ones(55),
math.pow(math.matrix(kings_matrix(8)), 4),
math.ones(55)
)

Patt

My board is 9\times4 and there are 221799 possible chessboards, according to the following code:

board_cnt = math.multiply(
  math.ones(89),
  math.pow(math.matrix(kings_matrix(9)), 3),
  math.ones(89)
)
athach

My board is 5 x 7 so there are 159651 possible chessboards, according to the following computation:

board_cnt = math.multiply(
  math.ones(34),
  math.pow(math.matrix(kings_matrix(7)), 4),
  math.ones(34)

)

athach1

My board is 7 x 5 so there are 159651 possible chessboards, according to the following computation:

board_cnt = math.multiply(
  math.ones(34),
  math.pow(math.matrix(kings_matrix(7)), 4),
  math.ones(34)

)

csluder2

My board is 7\times 4 so there are 16334 possible chessboards, according to the following computation:

board_cnt = math.multiply(
math.ones(34),
math.pow(math.matrix(kings_matrix(7)), 3),
math.ones(34)
)

bshambli

My chessboard is 3×7 and there are 2115 possible chessboards, here is the code that’s derived from:

board_cnt = math.multiply(
  math.ones(34),
  math.pow(math.matrix(kings_matrix(7)), 2),
  math.ones(34)
)
nhowe

My board is 4×6, so there are 4375 possible chessboards according to the following code:

board_cnt = math.multiply(
  math.ones(21),
  math.pow(math.matrix(kings_matrix(6)), 3),
  math.ones(21)
)
Jared

My board is 8 × 6 so there are 135112200 possible chessboards, according to the following:

board_cnt = math.multiply(
  math.ones(13),
  math.pow(math.matrix(kings_matrix(8, 6)), 3),
  math.ones(13)
)
mark