document.write( "Question 1210235: Let S be a set of distinct integers. What is the smallest number of elements that S must contain, to ensure that S has a nonempty subset, where the sum of the elements in the subset is divisible by 2? \n" ); document.write( "
Algebra.Com's Answer #851716 by CPhill(1959)![]() ![]() You can put this solution on YOUR website! That's an interesting problem involving divisibility! Let's break it down to find the smallest number of elements $S$ must contain to guarantee a nonempty subset whose sum is divisible by 2.\r \n" ); document.write( "\n" ); document.write( "Consider the remainders when an integer is divided by 2. There are only two possibilities: 0 (for even numbers) or 1 (for odd numbers).\r \n" ); document.write( "\n" ); document.write( "Now, let's think about the sums of subsets:\r \n" ); document.write( "\n" ); document.write( "* If a subset contains only even numbers, their sum will always be even (divisible by 2). \n" ); document.write( "* If a subset contains an even number of odd numbers, their sum will be even. \n" ); document.write( "* If a subset contains an odd number of odd numbers, their sum will be odd.\r \n" ); document.write( "\n" ); document.write( "To *ensure* we have a nonempty subset with a sum divisible by 2, we need to consider the worst-case scenario where we try to avoid such a subset.\r \n" ); document.write( "\n" ); document.write( "Suppose we pick elements for our set $S$. If we pick just one element, it might be odd, and the only nonempty subset is the element itself, whose sum would be odd.\r \n" ); document.write( "\n" ); document.write( "If we pick two elements, say $a$ and $b$. \n" ); document.write( "* If both are even, then $\{a\}$ has an even sum, and $\{b\}$ has an even sum. \n" ); document.write( "* If both are odd, then the subset $\{a, b\}$ has an even sum ($odd + odd = even$). \n" ); document.write( "* If one is even and one is odd, then $\{a\}$ (if $a$ is even) or $\{b\}$ (if $b$ is even) has an even sum.\r \n" ); document.write( "\n" ); document.write( "It seems that with just two elements, we can always find a nonempty subset with a sum divisible by 2. Let's formalize this using the Pigeonhole Principle.\r \n" ); document.write( "\n" ); document.write( "Consider the remainders of the elements of $S$ when divided by 2. Each element can have a remainder of 0 or 1.\r \n" ); document.write( "\n" ); document.write( "If we have two elements in $S$, say $s_1$ and $s_2$, there are a few possibilities for their remainders modulo 2:\r \n" ); document.write( "\n" ); document.write( "1. Remainder of $s_1$ is 0, remainder of $s_2$ is 0. Then the subset $\{s_1\}$ has a sum divisible by 2, and the subset $\{s_2\}$ also has a sum divisible by 2. \n" ); document.write( "2. Remainder of $s_1$ is 1, remainder of $s_2$ is 1. Then the subset $\{s_1, s_2\}$ has a sum with remainder $1 + 1 \equiv 0 \pmod{2}$, so the sum is divisible by 2. \n" ); document.write( "3. Remainder of $s_1$ is 0, remainder of $s_2$ is 1 (or vice versa). Then the subset $\{s_1\}$ has a sum divisible by 2.\r \n" ); document.write( "\n" ); document.write( "In all cases with two elements, we can find a nonempty subset whose sum is divisible by 2.\r \n" ); document.write( "\n" ); document.write( "Now, what if $S$ only has one element? If that element is odd, then the only nonempty subset has an odd sum.\r \n" ); document.write( "\n" ); document.write( "Therefore, the smallest number of elements that $S$ must contain to ensure that $S$ has a nonempty subset where the sum of the elements in the subset is divisible by 2 is 2. \n" ); document.write( " |