表达式或算法,用于获取每行和每列中出现特定值的奇数的矩阵数

  • 本文关键字:算法 用于 获取 表达式 algorithm matrix
  • 更新时间 :
  • 英文 :


我必须找到可以满足给定条件的矩阵总数。
条件-

  • 每个矩阵只填充 2 个元素:(x( 和 (-x(,其中 x 是任意 整数。[x 来自我们的网络应用程序]
  • 现在,这种填充矩阵仅在 (-x( 出现奇数次时才有效 每一行,同时在每列中。

例-

  1. 矩阵 (2x1( - 有效矩阵 = 0
x 
-x
    矩阵
  1. (2x2( - 有效矩阵 = 2
-x  x      x -x
x -x     -x  x
    矩阵
  1. (3x3( - 有效矩阵 = 22
6 combinations when -x appears once per row as well as once per column 
3 combinations when -x appears trice per row but once per column
9 combinations when -x appears trice for 1 row and trice for 1 column (shape L,T,+ mirror images)
3 combinations when -x appears trice per column but once per row 
1 combinations when -x appears at all positions

我应该如何计算满足给定条件的矩阵数量 - 在这种情况下是否有任何算法或公式?

我们称 n 为行数,将 m 称为列数。

你会得到 (n-1((m-1( 个自由度,对应于上部 (n-1((m-1( 子矩阵。

然后,您必须计算最后一行和最后一列,以满足条件的方式。

计算最后一个[n][m]值时存在潜在问题。如果 n 和 m 具有不同的奇偶校验,则不可能解。

在其他地方,你会得到 2^{(n-1((m-1(} 组合。

编辑

请注意,行和列的奇偶校验约束对应于 Z/2Z 中的线性方程。因此,向量空间中的一组解以 Z/2Z 为单位,其大小为 2^{something} 或 0。

最新更新