返回题库

偶数乘积

连乘偶数

专题
Discrete Math / 离散数学
难度
L4

题目详情

量化面试题:证明乘积为偶数。

英文原题

Let A1,A2,,AnA_1, A_2, \ldots , A_n denote a permutation of 1,2,,n1, 2, \ldots , n . Show that the product (A11)(A22)(Ann)(A_1 - 1)(A_2 - 2) \ldots (A_n - n) is even when nn is odd.

解析

若存在某个 ii 使得 AiA_iii 同奇偶,则 AiiA_i-i 为偶数,从而整个乘积为偶数。

反证:假设对所有 iiAiA_iii 奇偶相反。

nn 为奇数时,{1,,n}\{1,\ldots,n\} 中奇数有 (n+1)/2(n+1)/2 个、偶数有 (n1)/2(n-1)/2 个。

若每个奇数位置 ii 都对应偶数 AiA_i,则需要 (n+1)/2(n+1)/2 个偶数值,但集合中偶数只有 (n1)/2(n-1)/2 个,矛盾。

因此必存在 ii 使 AiA_iii 同奇偶,故对应因子为偶数,乘积为偶数。


英文解析

We begin by recalling some rules regarding subtraction and multiplication of odd and even integers: odd×odd even, odd×even odd, even×even even, odd×odd odd, odd×even=even, even×even=even.

Observing this, we can see that the statement B1×B2××BnB_1 \times B_2 \times \dots \times B_n is even is equivalent to saying that at least one of the BiB_i 's is even, 1in1 \leq i \leq n . In other words our task is to show that one of the terms (Aii),1in(A_i - i), 1 \leq i \leq n , is even when nn is odd.

When nn is odd, we have (n+1)/2(n + 1) / 2 odd numbers and (n1)/2(n - 1) / 2 even numbers amongst the AiA_i 's (and hence amongst the numbers 1,2,1, 2, \ldots ) which we subtract from

them). However to avoid having any even numbers, we must subtract from each odd number an even number (and from each even an odd, but we can ignore this). This is clearly not possible since there are more odd AiA_{i} 's than there are even numbers in 1,2,,n1, 2, \ldots , n .