Notes on the 3b1b video "Counting Problems at the Olympiad Level"

This article is a note on the video [official bilingual] Olympiad-level counting questions released by 3Blue1Brown on station B.


Question : Set S = { 1 , 2 , 3 , ⋯ , 2000 } S=\{1,2,3,\cdots,2000\}S={ 1,2,3,,2000 } How many subsets have the sum of5 5Multiples of 5 ? Empty sets are also included. For example, the subset{ 2 , 3 , 5 } \{2,3,5\}{ 2,3,The sum of 5 } is2 + 3 + 5 = 10 2+3+5=102+3+5=10 , yes5 5Multiples of 5 .

Solution : Consider the polynomial f ( x ) = ( 1 + x 1 ) ( 1 + x 2 ) ( 1 + x 3 ) ⋯ ( 1 + x 2000 ) \begin{equation} f(x)=(1+x^1 )(1+x^2)(1+x^3)\cdots(1+x^{2000}) \end{equation}f(x)=(1+x1)(1+x2)(1+x3)(1+x2000)Expand it, f ( x ) = 1 + x + x 2 + 2 x 3 + 2 x 4 + 3 x 5 + ⋯ + x 2001000 \begin{equation} f(x)=1+x+x^2 +2x^3+2x^4+3x^5+\cdots+x^{2001000} \end{equation}f(x)=1+x+x2+2x _3+2x _4+3x _5++x2001000 x 5 k   ( k ∈ N ) x^{5k}\,(k\in\mathbb{N}) x5k(kThe sum of the coefficients of the N ) items is the answer we require. The principle is very simple, consider the expansion(2) (2)( 2 ) is how to get, we need in the product formula( 1 ) (1)Each product term in ( 1 ) selects one item ( 1 11 orxmx^mxm ) multiplied, egx 3 x^3x3 can be chosen like this( 1 + x 1 ) ( 1 + x 2 ) ( 1 + x 3 ) ⋯ ( 1 + x 2001000 ) (1+\textcolor{red}{x^1})(1+\textcolor{red }{x^2})(\textcolor{red}{1}+x^3)\cdots(\textcolor{red}{1}+x^{2001000})(1+x1)(1+x2)(1+x3)(1+x2001000 )can also be selected like this( 1 + x 1 ) ( 1 + x 2 ) ( 1 + x 3 ) ⋯ ( 1 + x 2001000 ) (\textcolor{red}{1}+x^1)(\textcolor{red }{1}+x^2)(1+\textcolor{red}{x^3})\cdots(\textcolor{red}{1}+x^{2001000})(1+x1)(1+x2)(1+x3)(1+x2001000 ),there are two selection methods, so the expansion formula( 2 ) (2)( 2 ) inx 3 x^3xThe coefficient of 3 terms is2 22 . These two selection methods correspond to the setSSTwo subsets of S { 1 , 2 } \{1,2\}{ 1,2 } and{ 3 } \{3\}{ 3 } , where the elements of the set arexxThe exponent of x , the sum of both sets is3 33 , soSSThe sum of two subsets of S is 3 33

The problem is that it is impossible for us to hard calculate the expansion, so how to find x 5 k ( k ∈ N ) x^{5k}\,(k\in\mathbb{N})x5k(kWhat about the sum of the coefficients of the N ) term? Consider introducing5 55th timeω = e 2 π i 5 = cos ⁡ 2 π 5 + i sin ⁡ 2 π 5 \omega=e^{\frac{2\pi i}{5}}=\cos\frac{2\ pi}{5}+i\sin\frac{2\pi}{5}oh=e52πi=cos52 p.m+isin52 p.m(The letters used in the original video are ζ \zetaζ , but in China it is generally customary to useω \omegaω,则ω 5 = 1 \omega^5=1oh5=1( ω 2 ) 5 {(\omega^2)}^5( oh2)5( ω 3 ) 5 {(\omega^3)}^5( oh3)5( ω 4 ) 5 {(\omega^4)}^5( oh4)5 is also equal to1 11 . The unit root also has a very good property, letsss is an integer, consider the sum( ω 0 ) s + ( ω 1 ) s + ( ω 2 ) s + ( ω 0 ) s + ( ω 4 ) s {(\omega^0)}^s+{(\omega^ 1)}^s+{(\omega^2)}^s+{(\omega^0)}^s+{(\omega^4)}^s( oh0)s+( oh1)s+( oh2)s+( oh0)s+( oh4)s , whensss is5 5When multiples of 5 , each item is 1 11 , the sum is obviously5 55 ; whensss is not5 55的倍数时, ( ω 0 ) s + ( ω 1 ) s + ( ω 2 ) s + ( ω 0 ) s + ( ω 4 ) s = ( ω 0 ) s 1 − ( ω s ) 5 1 − ω s = 1 − 1 1 − ω = 0 \begin{aligned} {(\omega^0)}^s+{(\omega^1)}^s+{(\omega^2)}^s+{(\omega^ 0)}^s+{(\omega^4)}^s&={(\omega^0)}^s\frac{1-{(\omega^s)}^5}{1-\omega^s} \\ &=\frac{1-1}{1-\omega}\\ &=0 \end{aligned}( oh0)s+( oh1)s+( oh2)s+( oh0)s+( oh4)s=( oh0)s1ohs1( ohs)5=1oh11=0So, ( ω 0 ) s + ( ω 1 ) s + ( ω 2 ) s + ( ω 0 ) s + ( ω 4 ) s = { 0 , s is not a multiple of 5 5 , s is a multiple of 5 {( \omega^0)}^s+{(\omega^1)}^s+{(\omega^2)}^s+{(\omega^0)}^s+{(\omega^4)}^s=\ begin{cases}0, &s\text{is not a multiple of}5\text{}\\5, &s\text{is a multiple of}5\text{}\end{cases}( oh0)s+( oh1)s+( oh2)s+( oh0)s+( oh4)s={ 0,5,s is not a multiple of 5s is a multiple of 5.
Now we will f ( x ) f(x)f(x)表示成 f ( x ) = c 0 + c 1 x 1 + c 2 x 2 + c 3 x 3 + ⋯ + c 2001000 x 2001000 f(x)=c_0+c_1x^1+c_2x^2+c_3x^3+\cdots+c_{2001000}x^{2001000} f(x)=c0+c1x1+c2x2+c3x3++c2001000x2001000 whereck c_kckis xkx^kxCoefficient of k term. Willω 0 , ω 1 , ω 2 , ω 3 , ω 4 \omega^0,\omega^1,\omega^2,\omega^3,\omega^4oh0,oh1,oh2,oh3,oh4 Substitute intof ( x ) f(x)f ( x ) getsf ( ω 0 ) = c 0 + c 1 ( ω 0 ) 1 + c 2 ( ω 0 ) 2 + c 3 ( ω 0 ) 3 + c 4 ( ω 0 ) 4 + c 5 ( ω 0 ) 5 + ⋯ + c 2001000 ( ω 0 ) 2001000 f ( ω 1 ) = c 0 + c 1 ( ω 1 ) 1 + c 2 ( ω 1 ) 2 + c 3 ( ω 1 ) 3 + c 4 ( ω 1 ) 4 + c 5 ( ω 1 ) 5 + ⋯ + c 2001000 ( ω 1 ) 2001000 f ( ω 2 ) = c 0 + c 1 ( ω 2 ) 1 + c 2 ( ω 2 ) 2 + c 3 ( ω 2 ) 3 + c 4 ( ω 2 ) 4 + c 5 ( ω 2 ) 5 + ⋯ + c 2001000 ( ω 2 ) 2001000 f ( ω 3 ) = c 0 + c 1 ( ω 3 ) 1 + c 2 ( ω 3 ) 2 + c 3 ( ω 3 ) 3 + c 4 ( ω 3 ) 4 + c 5 ( ω 3 ) 5 + ⋯ + c 2001000 ( ω 3 ) 2001000 f ( ω 4 ) = c 0 + c 1 ( ω 4 ) 1 + c 2 ( ω 4 ) 2 + c 3 ( ω 4 ) 3 + c 4 ( ω 4 ) 4 + c 5 ( ω 4 ) 5 + ⋯ + c 2001000 ( ω 4 ) 2001000 \begin{aligned} f(\omega^ 0)&=c_0+c_1{(\omega^0)}^1+c_2{(\omega^0)}^2+c_3{(\omega^0)}^3+c_4{(\omega^0) }^4+c_5{(\omega^0)}^5+\cdots+c_{2001000}{(\omega^0)}^{2001000}\\ f(\omega^1)&=c_0+c_1{(\omega^1)}^1+c_2{(\omega^1)}^2+c_3{(\omega^1)}^3+c_4{(\omega^1)}^4 +c_5{(\omega^1)}^5+\cdots+c_{2001000}{(\omega^1)}^{2001000}\\ f(\omega^2)&=c_0+c_1{(\omega ^2)}^1+c_2{(\omega^2)}^2+c_3{(\omega^2)}^3+c_4{(\omega^2)}^4+c_5{(\omega^2 )}^5+\cdots+c_{2001000}{(\omega^2)}^{2001000}\\ f(\omega^3)&=c_0+c_1{(\omega^3)}^1+c_2 {(\omega^3)}^2+c_3{(\omega^3)}^3+c_4{(\omega^3)}^4+c_5{(\omega^3)}^5+\cdots+ c_{2001000}{(\omega^3)}^{2001000}\\ f(\omega^4)&=c_0+c_1{(\omega^4)}^1+c_2{(\omega^4)} ^2+c_3{(\omega^4)}^3+c_4{(\omega^4)}^4+c_5{(\omega^4)}^5+\cdots+c_{2001000}{(\omega ^4)}^{2001000} \end{aligned}=c_0+c_1{(\omega^2)}^1+c_2{(\omega^2)}^2+c_3{(\omega^2)}^3+c_4{(\omega^2)}^4 +c_5{(\omega^2)}^5+\cdots+c_{2001000}{(\omega^2)}^{2001000}\\ f(\omega^3)&=c_0+c_1{(\omega ^3)}^1+c_2{(\omega^3)}^2+c_3{(\omega^3)}^3+c_4{(\omega^3)}^4+c_5{(\omega^3 )}^5+\cdots+c_{2001000}{(\omega^3)}^{2001000}\\ f(\omega^4)&=c_0+c_1{(\omega^4)}^1+c_2 {(\omega^4)}^2+c_3{(\omega^4)}^3+c_4{(\omega^4)}^4+c_5{(\omega^4)}^5+\cdots+ c_{2001000}{(\omega^4)}^{2001000} \end{aligned}=c_0+c_1{(\omega^2)}^1+c_2{(\omega^2)}^2+c_3{(\omega^2)}^3+c_4{(\omega^2)}^4 +c_5{(\omega^2)}^5+\cdots+c_{2001000}{(\omega^2)}^{2001000}\\ f(\omega^3)&=c_0+c_1{(\omega ^3)}^1+c_2{(\omega^3)}^2+c_3{(\omega^3)}^3+c_4{(\omega^3)}^4+c_5{(\omega^3 )}^5+\cdots+c_{2001000}{(\omega^3)}^{2001000}\\ f(\omega^4)&=c_0+c_1{(\omega^4)}^1+c_2 {(\omega^4)}^2+c_3{(\omega^4)}^3+c_4{(\omega^4)}^4+c_5{(\omega^4)}^5+\cdots+ c_{2001000}{(\omega^4)}^{2001000} \end{aligned}f ( oh0)f ( oh1)f ( oh2)f ( oh3)f ( oh4)=c0+c1( oh0)1+c2( oh0)2+c3( oh0)3+c4( oh0)4+c5( oh0)5++c2001000( oh0)2001000=c0+c1( oh1)1+c2( oh1)2+c3( oh1)3+c4( oh1)4+c5( oh1)5++c2001000( oh1)2001000=c0+c1( oh2)1+c2( oh2)2+c3( oh2)3+c4( oh2)4+c5( oh2)5++c2001000( oh2)2001000=c0+c1( oh3)1+c2( oh3)2+c3( oh3)3+c4( oh3)4+c5( oh3)5++c2001000( oh3)2001000=c0+c1( oh4)1+c2( oh4)2+c3( oh4)3+c4( oh4)4+c5( oh4)5++c2001000( oh4)2001000Add them up and notice only xxThe exponent of x is5 5Only items that are multiples of 5 can be left, and the rest are eliminated, so we have f ( ω 0 ) + f ( ω 1 ) + f ( ω 2 ) + f ( ω 3 ) + f ( ω 4 ) = 5 ( c 0 + c 5 + c 10 + ⋯ + c 2001000 ) \begin{equation} f(\omega^0)+f(\omega^1)+f(\omega^2)+f(\omega^ 3)+f(\omega^4)=5(c_0+c_5+c_{10}+\cdots+c_{2001000}) \end{equation}f ( oh0)+f ( oh1)+f ( oh2)+f ( oh3)+f ( oh4)=5(c0+c5+c10++c2001000)So what we want is c 0 + c 5 + c 10 + ⋯ + c 2001000 = f ( ω 0 ) + f ( ω 1 ) + f ( ω 2 ) + f ( ω 3 ) + f ( ω 4 ) 5 c_0+c_5+c_{10}+\cdots+c_{2001000}=\frac{f(\omega^0)+f(\omega^1)+f(\omega^2)+f(\omega^3 )+f(\omega^4)}{5}c0+c5+c10++c2001000=5f ( oh0 )+f(o1 )+f(o2 )+f(o3 )+f(o4)

Obviously, f ( ω 0 ) = f ( 1 ) = 2 2000 f(\omega_0)=f(1)=2^{2000}f ( oh0)=f(1)=22000。 considerf( ω 1 ) = ( 1 + ω ) ( 1 + ω 2 ) ( 1 + ω 3 ) ( 1 + ω 4 ) ( 1 + ω 5 ) ( 1 + ω 6 ) ⋯ ( 1 + ω 2000 ) f(\omega^1)=\textcolor{orange}{(1+\omega)(1+\omega^2)(1+\omega^3)(1+\omega^4)(1+\omega ^5)}(1+\omega^6)\cdots(1+\omega^{2000})f ( oh1)=(1+o ) ( 1+oh2)(1+oh3)(1+oh4)(1+oh5)(1+oh6)(1+oh2000 ),thenω 5 k + r = ω r \omega^{5k+r}=\omega^roh5k+r=ohr , so it justrepeats theorange400 400400次,即f ( ω 1 ) = [ ( 1 + ω ) ( 1 + ω 2 ) ( 1 + ω 3 ) ( 1 + ω 4 ) ( 1 + ω 5 ) ] 400 f(\omega^1)= \textcolor{orange}{\left[(1+\omega)(1+\omega^2)(1+\omega^3)(1+\omega^4)(1+\omega^5)\right] }^{400}f ( oh1)=[(1+o ) ( 1+oh2)(1+oh3)(1+oh4)(1+oh5)]The 400 question is how to findthe orangepart. Don't forget, the root of unit is called the root of unit becauseω 0 , ω 1 , ω 2 , ω 3 , ω 4 \omega^0,\omega^1,\omega^2,\omega^3,\ omega^4oh0,oh1,oh2,oh3,oh4 is the equationx 5 − 1 = 0 x^5-1=0x51=0 in the field of complex numbers5 55 roots, so according to the factor theorem, x 5 − 1 = ( x − ω 0 ) ( x − ω 1 ) ( x − ω 2 ) ( x − ω 3 ) ( x − ω 4 ) x^5-1 =(x-\omega^0)(x-\omega^1)(x-\omega^2)(x-\omega^3)(x-\omega^4)x51=(xoh0)(xoh1)(xoh2)(xoh3)(xoh4 )Putx = −1 x=-1x=1代入得− 2 = ( − 1 − ω 0 ) ( − 1 − ω 1 ) ( − 1 − ω 2 ) ( − 1 − ω 3 ) ( − 1 − ω 4 ) -2=(-1-\ omega^0)(-1-\omega^1)(-1-\omega^2)(-1-\omega^3)(-1-\omega^4)2=(1oh0)(1oh1)(1oh2)(1oh3)(1oh4 )and the right end is exactlythe orangepart, sothe value of theorange2 22 f ( ω 1 ) = 2 400 f(\omega^1)=2^{400} f ( oh1)=2400

vs for ω 2 , ω 3 , ω 4 \omega^2,\omega^3,\omega^4oh2,oh3,oh4 , we think like this: Forω j ( j = 2 , 3 , 4 ) \omega^j\,(j=2,3,4)ohj(j=2,3,4 )( ω j ) 1 , ( ω j ) 2 , ( ω j ) 3 , ( ω j ) 4 , ( ω j ) 5 (\omega^j)^1,(\omega^j)^2, (\omega^j)^3,(\omega^j)^4,(\omega^j)^5( ohj)1,( ohj)2,( ohj)3,( ohj)4,( ohj)5 of5 5The 5th power is also equal to1 11(即 [ ( ω j ) k ] 5 = 1 \left[(\omega^j)^k\right]^5=1 [ ( ohj)k]5=1 k = 1 , 2 , 3 , 4 , 5 k=1,2,3,4,5 k=1,2,3,4,5),所以( ω j ) 1 , ( ω j ) 2 , ( ω j ) 3 , ( ω j ) 4 , ( ω j ) 5 (\omega^j)^1,(\omega^j)^2 ,(\omega^j)^3,(\omega^j)^4,(\omega^j)^5( ohj)1,( ohj)2,( ohj)3,( ohj)4,( ohj)5 is also the equationx 5 − 1 = 0 x^5-1=0x51=The five roots of 0 , in fact they areω 0 , ω 1 , ω 2 , ω 3 , ω 4 \omega^0,\omega^1,\omega^2,\omega^3,\omega^4oh0,oh1,oh2,oh3,ohJust another permutation of 4 . Therefore corresponding tof ( ω j ) f(\omega^j)f ( ohThe value of the orangepartof j )2 22 For example, f ( ω 0 ) = 2 2000 f ( ω 1 ) = f ( ω 2 ) = f ( ω 3 ) = 2 400 \begin{aligned} f(\omega^0)&=2^{2 }\\ f(\omega^1)&=f(\omega^2)=f(\omega^3)=2^{400}\end{aligned}f ( oh0)f ( oh1)=22000=f ( oh2)=f ( oh3)=2400 c 0 + c 5 + c 10 + ⋯ + c 2001000 = 2 2000 + 4 × 2 400 5 c_0+c_5+c_{10}+\cdots+c_{2001000}=\frac{2^{2000}+4\times 2^{400}}{5} c0+c5+c10++c2001000=522000+4×2400, ie SSThe sum of S is5 5The number of subsets of multiples of 5 is 2 2000 + 4 × 2 400 5 \frac{2^{2000}+4\times 2^{400}}{5}522000+4×2400

Guess you like

Origin blog.csdn.net/qaqwqaqwq/article/details/128451440