偶数乘积
连乘偶数
题目详情
量化面试题:证明乘积为偶数。
英文原题
Let denote a permutation of . Show that the product is even when is odd.
解析
若存在某个 使得 与 同奇偶,则 为偶数,从而整个乘积为偶数。
反证:假设对所有 , 与 奇偶相反。
当 为奇数时, 中奇数有 个、偶数有 个。
若每个奇数位置 都对应偶数 ,则需要 个偶数值,但集合中偶数只有 个,矛盾。
因此必存在 使 与 同奇偶,故对应因子为偶数,乘积为偶数。
英文解析
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 is even is equivalent to saying that at least one of the 's is even, . In other words our task is to show that one of the terms , is even when is odd.
When is odd, we have odd numbers and even numbers amongst the 's (and hence amongst the numbers ) 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 's than there are even numbers in .