返回题库

3×3 填数

Grid Filling II

专题
Probability / 概率
难度
L4

题目详情

将整数 1 到 9 随机放入一个 3×3 方格中(每格一个数且每个数恰好用一次)。

求:每一行与每一列的和都为奇数的概率。

英文原题

The integers 1 through 9 are randomly placed into the 9 squares of a 3 x 3 grid such that each square has one integer and each integer is used once. What is the probability that the sum of each row and each column is odd?

解析

只看奇偶性:1..9 中有 5 个奇数、4 个偶数。

令某格为 1 表示放奇数,为 0 表示放偶数,则要求每行、每列的 1 的个数为奇数。

在满足“每行每列奇数”的 3×3 奇偶矩阵中,恰好含 5 个 1 的可行奇偶形状共有 9 种。

每种形状下,把 5 个奇数放入 5 个 1 格有 5!5! 种,把 4 个偶数放入 4 个 0 格有 4!4! 种。

总排列数为 9!9!,因此概率为

95!4!9!=114.\frac{9\cdot 5!\cdot 4!}{9!}=\frac{1}{14}.

英文解析

Just look at parity: there are 5 odd numbers and 4 even numbers in 1.. 9.

If a cell is 1 for an odd number and 0 for an even number, the number of 1s per row and column is required to be odd.

In a 3 × 3 parity matrix that satisfies the "odd numbers per row and per column", there are exactly 9 feasible parity shapes with 5 1s.

For each shape, put 5 odd numbers into 5 1s of 5!5! and 4 even numbers into 4 0s of 4!4!.

The total number of permutations is 9!9!, so the probability is

95!4!9!=114.\frac{9\cdot 5!\cdot 4!}{9!}=\frac{1}{14}.