2 dimensional matrix, pattern qty?



This matrix is a parity bit matrix that is using 2 dimensional parity check.
So each matrix intersection is a 1 or 0. It turns out that a 2x2 pattern of
errors that are located in adjacent row and column will not be detected as
errors by the parity check.
The patterns looks something like below. So bits located in that pattern
shown by the x will not be detected in either the row or column. They can
be anywhere as long as the intersect to have 2 in a row and 2 in a column.

What is the equation to determine the total number of patterns in a matrix
like this that is K wide and J deep?

1x1x101
0x0x100
1100110
0011001

Any thoughts appreciated as Im at a total loss on how to approach this.
thank you


.