Olympiad level counting (Generating functions)

Поділитися
Вставка
  • Опубліковано 21 тра 2024
  • A lesson on generating functions, and clever uses of complex numbers for counting
    Help fund future projects: / 3blue1brown
    An equally valuable form of support is to simply share the videos.
    Special thanks: 3b1b.co/lessons/subsets-puzzl...
    Artwork by Kurt Burns
    Music by Vince Rubinetti
    Nice writeup and video giving solutions to the exercises at the end, by Benjamin Hackl
    benjamin-hackl.at/blog/2022/0...
    • Solutions to 3b1b's ge...
    102 Combinatorial problems, by Titu Andreescu and Zuming Feng
    amzn.to/3wAPoNq
    Generatingfunctionology by Herbert Wilf
    amzn.to/3sPJ8Al
    Visualizing the Riemann zeta function
    • But what is the Rieman...
    Fourier series
    • But what is a Fourier ...
    Timestamps
    0:00 - Puzzle statement and motivation
    4:31 - Simpler example
    6:51 - The generating function
    11:52 - Evaluation tricks
    17:24 - Roots of unity
    26:31 - Recap and final trick
    30:13 - Takeaways
    Thanks to these viewers for their contributions to translations
    Hebrew: Omer Tuchfeld
    ------------------
    These animations are largely made using a custom python library, manim. See the FAQ comments here:
    www.3blue1brown.com/faq#manim
    github.com/3b1b/manim
    github.com/ManimCommunity/manim/
    You can find code for specific videos and projects here:
    github.com/3b1b/videos/
    Music by Vincent Rubinetti.
    www.vincentrubinetti.com/
    Download the music on Bandcamp:
    vincerubinetti.bandcamp.com/a...
    Stream the music on Spotify:
    open.spotify.com/album/1dVyjw...
    ------------------
    3blue1brown is a channel about animating math, in all senses of the word animate. And you know the drill with UA-cam, if you want to stay posted on new videos, subscribe: 3b1b.co/subscribe
    Various social media stuffs:
    Website: www.3blue1brown.com
    Twitter: / 3blue1brown
    Reddit: / 3blue1brown
    Instagram: / 3blue1brown
    Patreon: / 3blue1brown
    Facebook: / 3blue1brown

КОМЕНТАРІ • 2,7 тис.

  • @soranuareane
    @soranuareane 2 роки тому +4180

    "There's life before you understand generating functions, and then there's life after you understand generating functions." Having taken those courses, I can 100% agree.

    • @brockobama257
      @brockobama257 2 роки тому +93

      They’re phenomenal, absolutely mind boggling, the math counts for you, who, how?

    • @ketchup2707
      @ketchup2707 2 роки тому +12

      What courses?

    • @ra_XOr
      @ra_XOr 2 роки тому +55

      @@ketchup2707 Combinatorics in Uni I believe :)

    • @Jack_Callcott_AU
      @Jack_Callcott_AU 2 роки тому +8

      @Greg LeJacques Thou art mighty among all created beings!

    • @stanlay204
      @stanlay204 2 роки тому +6

      I guess I will have just one life :D

  • @johnnath4137
    @johnnath4137 2 роки тому +1897

    "The shortest path between two truths in the real domain passes through the complex plane" - Jacques Hadamard. Excellent video!

    • @AstralS7orm
      @AstralS7orm 2 роки тому +18

      Indirect inventor of Hadamard-Rademacher-Walsh also known as Walsh-Fourier transform which can be used to derive the transformed equation with just sign flips and additions. (But there's more of them than in plain discrete Fourier transform which uses multiplications - now he actually devised Hadamard matrix and its properties.)

    • @newchannelverygood162
      @newchannelverygood162 2 роки тому +37

      "The shortest and swiftest path between two galaxies in real vast space, should pass through an imaginary wormhole..."

    • @opticalreticle
      @opticalreticle 2 роки тому +12

      so the easiest way to prove 1 + 1 = 2 uses complex numbers as proof?

    • @vigilantcosmicpenguin8721
      @vigilantcosmicpenguin8721 2 роки тому +24

      @@opticalreticle It's got to be easier than what Russell came up with.

    • @ninosan6619
      @ninosan6619 2 роки тому

      Yes, I'd agree with that

  • @requemao
    @requemao 2 роки тому +1502

    3:54 "To be clear, this lesson is definitely much more about the journey than the destination".
    This is the biggest difference between this channel and other channels that show math problems: it doesn't just show you one correct solution to a specific problem, but it teaches you how to think about a new problem. And that is no small feat. Thank you, Grant.

    • @whatelseison8970
      @whatelseison8970 2 роки тому +24

      Two other excellent channels for that are zetamath and Aleph 0. I only wish they had more videos! It's understandable when you think of how much work has to go into this sort of thing.

    • @fdagpigj
      @fdagpigj Рік тому +5

      So, this is a mathematics channel that teaches people math, ie. how to think in a way that enables you to solve arbitrary problems.

    • @1betrieb1
      @1betrieb1 Рік тому +10

      I think Grant once said, that storytelling is one of the most usefull and motivating things, when teaching maths.

    • @requemao
      @requemao Рік тому +6

      @@1betrieb1 Probably Grant is one of few people who really could teach others how to teach.

    • @leif1075
      @leif1075 Рік тому +1

      That should be true about most lessons if not all of them anyway right so kind of obvious or redundant to say..but maybe even more so about this one.

  • @recreaper1682
    @recreaper1682 Рік тому +425

    As a freshman, I understand only a quarter of the things this man says, but somehow, I still find myself learning. This is mystifying to me.

    • @fleefie
      @fleefie Рік тому +52

      I think that it's because these videos can't really replace actual academia, and Grant, as an academic himself, knows this. Instead of trying to teach you a lesson, he instead tries to instill in you a certain intuition that will help you. In other words : You are given the illusion of learning to keep you hooked onto the video, and while this is happening, he finds ways to still make you remember some interesting facts or methods. I can't get myself to remember every step, but I still understood that you can find functions that act simmilarly to sets, and that every time you have a question that ends up talking about frequency filtering, complex numbers often are a very elegant way to answer. It's not about the actual hard facts learned, it's about the ideas and mindsets that you bring to class next time, while still fostering your inner mathematical curiosity.
      This is where I find that most channels fail, when they don't understand that trying to teach someone a new idea won't always stick, if at all, but that you can absolutely shift someone's mindset over problem-solving.

    • @justalpaca4943
      @justalpaca4943 Рік тому +2

      lol

    • @byFiscus
      @byFiscus 11 місяців тому +1

      I’ve gotten As in every math class through Calc 3 and differential equations and I barely understand half of what he says

    • @spiderjerusalem4009
      @spiderjerusalem4009 11 місяців тому +7

      ​@@byFiscuscalculus and combinatorics are whole different beasts, m8. Calc was merely a preliminary to everything, plug&chug in formulas most of the time, whilst combinatorics & number theory do induce lots of "outside the box" moments. I would heavily recommend "Principle and Techniques in Combinatorics" by Koh-Khee-Meng & Chen Chuan Chong and "Elementary Number Theory" by David M. Burton just in case.

    • @jamiepianist
      @jamiepianist 9 місяців тому

      Keep going!

  • @msachin4885
    @msachin4885 2 роки тому +5491

    There's teaching math, and then there's this channel. This isn't just math education, its a window into the sublime

    • @7p7m7
      @7p7m7 2 роки тому +35

      Well said brother

    • @billymonday8388
      @billymonday8388 2 роки тому +8

      what did you learn?

    • @pvic6959
      @pvic6959 2 роки тому +54

      @@billymonday8388 everything

    • @thatchessguy7072
      @thatchessguy7072 2 роки тому +11

      @@pvic6959 What did it cost?

    • @Shenron557
      @Shenron557 2 роки тому +66

      @@thatchessguy7072 nothing
      (well, almost nothing considering time and electrical energy spent 😆)

  • @patrickwienhoft7987
    @patrickwienhoft7987 2 роки тому +1468

    At exactly 14:31 I realized where you were going. I just love this feeling when it "clicks" and your videos never fail to deliver on that, thank you for this great content!

    • @3blue1brown
      @3blue1brown  2 роки тому +548

      Delightful to hear, that's exactly what I'm aiming for :)

    • @i_cam
      @i_cam 2 роки тому +111

      Same! I was about to say the exact same thing, it was a really good idea to foreshadow complex numbers at the beginning. The moment he said “rotate” i was like WAIT WAIT I GET IT YOOO

    • @shannu_boi
      @shannu_boi 2 роки тому +42

      16:41 for me. And it really is like a CLICK in your head. Almost audible maybe. Weird huh

    • @dummypanda842
      @dummypanda842 2 роки тому +9

      I realised it at 13:10 I sort clicked and everything came into place about where it is headed

    • @jonsh4615
      @jonsh4615 2 роки тому +7

      It took a little longer for me. It was at 22:15 :)

  • @jcantonelli1
    @jcantonelli1 10 місяців тому +25

    For me, this is one of the most challenging 3B1B videos to wrap my mind around.

    • @Theantmang
      @Theantmang 3 місяці тому +1

      lots going on here! to dive into deeper underrstanding you can search up on the topics he mentions! complex numbers are hard to grasp for many, if not most and the rules/shortcuts they come up with in complex analysis seem like magic alot of time. To really get the grasp you have to start diving deep and practice practice practice! lots of cool stuff in this video, makes me miss my pure mathematics major at UC santa cruz

  • @number9football
    @number9football Рік тому +67

    Every time I watch this guys videos I am blown away by how intelligent people can be, how I would never be able to arrive at any of these ideas, and above all the quality of this guy's videos. The production value is through the roof.

    • @theblinkingbrownie4654
      @theblinkingbrownie4654 3 місяці тому +1

      If you feel that you can not arrive at these conclusions then the videos aren't serving their purpose. I'm not trying to be mean - rather asking you to be more confident, the people discovering these have way more experience under their belt and we too might be able to do the same or greater with the same experience.

  • @robyrogo1843
    @robyrogo1843 2 роки тому +655

    Fun fact : Titu Andreescu (the author of the book ) was the coach behind the only perfect win of USA in IMO ( all 6 students got perfect scores )

    • @brominelover6747
      @brominelover6747 2 роки тому +41

      ROMANIA 💪🏻💪🏻🇷🇴🇷🇴💪🏻💪🏻

    • @robyrogo1843
      @robyrogo1843 2 роки тому +16

      @@brominelover6747 dada , Romania❤🇷🇴🙂

    • @rareshika
      @rareshika 2 роки тому +5

      Titu❤️

    • @vladudrea9747
      @vladudrea9747 2 роки тому +8

      peste tot suntem :))

    • @cristianmatei5927
      @cristianmatei5927 2 роки тому +7

      Ce surpriza faina sa gasesti romani pe aici :))

  • @user-ge6cw2ry4f
    @user-ge6cw2ry4f 2 роки тому +583

    This channel does not simply teach math, it shows math in all of it’s beauty. I would’ve never knew that I like math so much if not for these videos

    • @Cs-hp7ru
      @Cs-hp7ru 2 роки тому +3

      Very good point -- I fully agree. But you used the wrong form of "its."

    • @prosperitystar
      @prosperitystar 2 роки тому

      @argon i agree ☝️

    • @user-ge6cw2ry4f
      @user-ge6cw2ry4f 2 роки тому +7

      @argon yup. I am ukrainian plus learning spanish now so i kinda mess up basics from time to time.

    • @lyrimetacurl0
      @lyrimetacurl0 2 роки тому +1

      "One does not simply teach maths."

    • @skylarkesselring6075
      @skylarkesselring6075 2 роки тому +1

      @@user-ge6cw2ry4ftambién aprendo español 😁

  • @rudrasatwik5346
    @rudrasatwik5346 6 днів тому

    I watched this about a year ago and remember having no understanding of anything beyond the generating functions. I watched your lockdown math lectures on complex number fundamentals and have a perfect understanding of the video now. Its a beautiful solution I think it's one of your best yet. Thank you

  • @user-jy9xi4ut3v
    @user-jy9xi4ut3v Рік тому +85

    Grant, I'm sure you've heard this before, but I want to express how much I appreciate the extra special care you take that even a person with zero mathematical training like myself could follow along a complicated exposition like this. It's invaluable to me (and countless others). I humbly thank you.
    Also, lovely illustrations! Add the rhetorical style, and it all comes together in a most gratifying, soulful, and rich experience. Somebody in the comments used the word 'sublime', and that's accurate.

  • @leninpavon7985
    @leninpavon7985 2 роки тому +306

    I'm an Applied Maths major and sometimes is hard to see why I'm learning about complex numbers, analytic geometry and other things and it's harder to see how they are connected. It's truly beautiful to see how it all comes together, thanks.

  • @bugfacedog44
    @bugfacedog44 2 роки тому +477

    I love how this channel embraces the math and ACTUALLY TEACHES. So many channels want to make math/physics fun and approachable but end up sacrificing substantiative content to do so. This channel doesn't compromise and I love it. Keep it coming!!

    • @nasorusvandark69
      @nasorusvandark69 2 роки тому +28

      In the quest of bringing a love of math to uninterested or even antagonistic people towards it, some channels have reduced mathematics to the level of simple party tricks which you just simply were not taught. It does it a huge disservice in that it sacrifices its elegance, genius and truer intuition. 3b1b masterfully circumvents the need for such sacrifice and still does somewhat appeal to the people that are otherwise unenthusiastic about math. Peak teaching.

    • @brockobama257
      @brockobama257 2 роки тому +6

      Nah generating functions are the star here. They literally count for you. They are so much more than just this.

    • @skylarkesselring6075
      @skylarkesselring6075 2 роки тому +2

      @@nasorusvandark69 i think there is value in the approach of those other channels. Back when I thought I hated math those style of videos kept me interested/wanting to learn more. It would help me find math as fascinating, where at the time 3blue1brown videos were just over my head.
      While I think Grant's content is great, especially now, it is a lot more difficult than a lot of other math content. Truthfully they just made me feel stupid when I "hated" math instead of inspiring a yearning for more

    • @nasorusvandark69
      @nasorusvandark69 2 роки тому +1

      @@skylarkesselring6075 I have no problem with math vulgarisation per se, as I myself developed my love of the subject from videos like those. What I don't like is how some videos oversimplify the subject to an almost meaningless defree at times. Though maybe I'm wrong in that that could be perfectly fine, while just aimed towards a different audience, who knows, I might be making a big deal out of nothing. I guess ultimately what I meant is that you absolutely should not make a vulgarisation of something like a millenium problem, as it rids the topix if all its substance, at least in my opinion.

  • @aidanwestfall8177
    @aidanwestfall8177 Рік тому +50

    Having just finished studying some undergraduate level abstract algebra, this video gave me a greater understanding roots of unity and their applications. Your work never fails to both stimulate the creative mathematician in each of us as well as supplement our previous education with new insight. What a gift this channel is, I cannot wait to see what it continues to give in the future. Thank you, Grant, for everything you do.

  • @bretthannigan1581
    @bretthannigan1581 2 роки тому +753

    People with an electrical engineering background might see the roots of unity just like filtering a discrete-time signal in the z-domain. Super cool to see the parallels with the same math used for something seemingly completely different and explained so well!

    • @axelbostrom3606
      @axelbostrom3606 2 роки тому +34

      This is exactly where my mind went as I am taking a discrete time signals cource atm 😄

    • @johnnelcantor4739
      @johnnelcantor4739 2 роки тому +13

      Do you have the name of a book where i could look up for this signal filtering with complex numbers?

    • @alexanderstewart3265
      @alexanderstewart3265 2 роки тому +22

      @@johnnelcantor4739 Pretty much any digital signal processing book will discuss filtering in terms of complex numbers. My personal favorite though is by Proakis and Manolakis. but the most recent revision is by Manolakis and Ingle. Same material in spite of having different authors.

    • @quercusweblecturing
      @quercusweblecturing 2 роки тому +3

      Ah, nice analogy!

    • @Shiniiee
      @Shiniiee 2 роки тому +7

      @@johnnelcantor4739 Oppenheim is GREAT! And it has full lectures on MIT's OCW channel. Look it up!

  • @PowerhouseCell
    @PowerhouseCell 2 роки тому +265

    Once again, 3b1b making math look absolutely beautiful. Viewers should feel lucky at what they're seeing ❤️

    • @hanknew9685
      @hanknew9685 2 роки тому +5

      Oh you're the channel that 3blue1brown shouted out on his website! Awesome to see you here- love seeing Grant showing some love to underrated educational UA-camrs

    • @theodorekim2148
      @theodorekim2148 2 роки тому

      Does anyone know what software he uses to make the animations?

    • @Asterism_Desmos
      @Asterism_Desmos 2 роки тому +5

      @@theodorekim2148 Maniam I think, it’s based on math and I think he made it himself. If anyone else sees this, correct me if I’m wrong.

    • @santhoshsridhar5887
      @santhoshsridhar5887 2 роки тому

      @@theodorekim2148 Premiere Pro from what I've heard.

    • @inyobill
      @inyobill 2 роки тому

      I'm 'gonna quibble: "Illustrating the beauty of Maths". Mathematics is beautiful. A lot of folks sadly have not seen it.

  • @daedrom
    @daedrom 11 місяців тому +7

    I'm not the kind of viewer that pauses and try to solve the problems by myself because I know I'm getting nowhere, but I watch all your videos and come back to watch them again after a while and it's surprising that, even if don't remember the steps to the solution, it gets less magical and starts to sound more like something that I would have come up by myself.
    Thanks!

  • @XThunderBoltFilms
    @XThunderBoltFilms 2 роки тому +28

    When I was doing my undergraduate course in physics, I fell In love with complex analysis. A way to re-think older problems (infinite trig integrals etc.) with seemingly disconnected injections of complex numbers. But the fact that they *arent* at all disconnected is the beauty in it. Its not 'imaginary' but a very real expression of the root of mathematics (ergo, logic). Probably one of the hardest courses I took. And absolutely my favourite. I wish I had more opportunity in my professional life to get back into complex analysis. For now I think I'm going to just dig up my old notebooks.

  • @meiliyinhua7486
    @meiliyinhua7486 2 роки тому +183

    every time grant mimics a student like "why do complex numbers show up in a counting problem?" I remember that I spend more time with group theory than many target viewers, because my immediate thought is "well the roots of unity are a really natural analog for modular arithmetic"

    • @verdiss7487
      @verdiss7487 2 роки тому +40

      You've got an xkcd 2501 situation

    • @viliml2763
      @viliml2763 2 роки тому +43

      The real answer is that complex numbers contain all sorts of structures inside them, and it's simpler for our minds to use complex numbers for everything than to invent the minimal sufficient subset for every task.
      That's the same reason why quarternions are used in 3D geometry - what you really need is rotors, but they're a subalgebra of quarternions so you might as well use quarternions.

    • @fantiscious
      @fantiscious 2 роки тому +3

      Well that's cool, I might study group theory then

    • @WanderTheNomad
      @WanderTheNomad 2 роки тому +1

      Not sure what group theory or modular arithmetic is, but this video combined with the words "natural analog" remind me of Veritasium's videos about analog computers.

    • @OwlyFisher
      @OwlyFisher 2 роки тому +6

      @@WanderTheNomad yeah that's. completely different. analog= comparable to another thing, analogue= continuous signals

  • @waterlubber
    @waterlubber 2 роки тому +128

    I remember a time in math class doing series where I wanted to "filter" only odd numbers for some simple sine series, and ended up using a trick with powers of negative one. It's awesome to learn that not only is that technique actually used in practice, but there's a much cooler version out there as well (and yet another use for Very Cool complex numbers :) )

    • @vinesthemonkey
      @vinesthemonkey 2 роки тому +1

      yeah back in my mathcounts days I even managed to discover up to using powers of i (4th root of unity) but I didn't make the connection to arbitrary roots of unity until later

  • @emotion6260
    @emotion6260 Рік тому +6

    This channel doesn’t make bad videos. The quality is there in every video. You can tell they are not throwing up videos just to put up content. There’s real effort and thought involved in each video.

  • @petitepatate2222
    @petitepatate2222 11 місяців тому +5

    I got convinced to watch this video because of your tiktok. At 1am. This video was great and really clear. Going to sleep now.

  • @youtube.comsucks
    @youtube.comsucks 2 роки тому +63

    It feels almost impossibly beautiful that everything seems to just work out this way, especially with how cleanly complex numbers work in both the factored version and the expanded version. Math really is crazy.

  • @Dezdichado1000
    @Dezdichado1000 2 роки тому +608

    this is one of many, many reasons why getting exposed to math competitions at a young age is both really useful and entertaining. Too bad, most secondary school teachers are not educated nor paid enough to perform at this level.

    • @mclovin3725
      @mclovin3725 2 роки тому +70

      Cos its higher than secondary school bruh

    • @avwhite1076
      @avwhite1076 2 роки тому +51

      @@mclovin3725 The International Math Olympiad is for pre-tertiary education students only.

    • @peterlindsey4178
      @peterlindsey4178 2 роки тому +33

      @@mclovin3725 No it's exactly secondary school. I took part, briefly, but I was nowhere near smart enough. It's true most secondary school teachers can't coach at this kind of level. Thank goodness for the internet and people like Grant producing these videos nowadays.

    • @ffc1a28c7
      @ffc1a28c7 2 роки тому +26

      As someone who has participated and done decently in the USAMO and CMO (top 20 and top 5 respectively), you typically need to broaden your understanding rather than go into everything in depth. You're not expected to use analysis or topology, but you should know tons more algebraic tricks and ideas than what is taught in highschool. I still managed to do quite well despite not knowing calculus at the time that I did them.

    • @krumpy8259
      @krumpy8259 2 роки тому +2

      @@ffc1a28c7 Are you Self taught and how did you know to avoid going in too much depth and rather concentrate usefully on algebraic tricks etc. What resources did/do you use?

  • @anuj7879
    @anuj7879 2 роки тому +8

    @34:11 :: The answer to prob 2 is 3^n .
    This can be easily done by expanding Σ into
    2⁰(nC0)+2¹(nC1)+2²(nC2)+.....+2^n(nCn).
    If you know binomial theorem ,then you may see that it's in the form of (1+x)^n ,where x=2.
    Hence,the required answer is 3^n.

  • @theguyshetellsunottoworryabout
    @theguyshetellsunottoworryabout 9 днів тому

    The complex number method is so brilliant, I don't find words to express how beautiful I find it, thank you for sharing all this with us

  • @leozhu9695
    @leozhu9695 2 роки тому +18

    This might be one of the greatest 3b1b videos of all time. The combination of problem solving and visual beauty is breathtaking.

  • @MrVinky59
    @MrVinky59 2 роки тому +83

    Your videos are like a well narrated detective story where a seemingly difficult problem slowly reveals its solution. It's just mesmerizing.

    • @TryHardNewsletter
      @TryHardNewsletter 2 роки тому +5

      To be fair, I think he over-complicated the beginning. You could ask some pre-algebra students to list all the ways to use the numbers 1,2,3,4,5,6,7 to add up to something like 11 (using each number at most) and put them in a column. And then ask them to list all the terms in the expansion of (1+x)(1+x^2)(1+x^3)(1+x^4)(1+x^5)(1+x^6)(1+x^7) that give you x^11 and put them in a column. Comparing the columns side-by-side makes the correspondence clear.
      Column A Column B
      ---------------- ----------------
      x^(7+4) 7+4
      x^(6+5) 6+5
      x^(7+3+1) 7+3+1
      x^(6+4+1) 6+4+1
      x^(6+3+2) 6+3+2
      x^(5+4+2) 5+4+2
      x^(5+3+2+1) 5+3+2+1
      (not sure if the columns will be aligned correctly after I post)
      The pre-algebra students would not have the knowledge to follow the roots of unity filter for the powers of 5. But they might be able to handle it for powers of 4. Because the 4th roots of unity are just 1, -1, i, -i. Even the final step where you plug the roots of unity into (1+x)(1+x^2)(1+x^3)(1+x^4) becomes a lot more simple because many factors are simply 0 unlike with 5th roots of unity. So if you took this problem and changed it from multiples of 5 to multiples of 4, you would still have a solution that used polynomials and imaginary numbers to solve a problem whose answer is a real integer, so it would maintain the weirdness, but it would be approachable to a much younger audience.

  • @ViviMagri
    @ViviMagri Рік тому +6

    I want to thank you for this channel. A video a saw here last year was the spark that was missing to ignite strongly enough my desire to pursue a master degree and, despite all the fears and challenges I knew I'd have to overcome by going through with this, finally apply.
    And now that I'm here trying to conciliate work with the academic life - and also with having a life -, this is, again, the kind of content that reminds me of the passion I feel for the field and that can feel distant when we're struggling in the routine.

  • @toaster4693
    @toaster4693 2 роки тому +22

    This channel is a true treasure. Thank you so, so much for sharing, educating, and engendering a sense of wonder and discovery in us all. 🌱

  • @flaviusclaudius7510
    @flaviusclaudius7510 2 роки тому +103

    This feels very much like my real analysis class: I can see what you're doing and how you got there, and it's very impressive, but there's no way I could do it myself.

    • @connordavis4766
      @connordavis4766 2 роки тому +28

      You will get there. In a couple years you will look back at the problems you are struggling with now and wonder what the hell was stopping you from seeing what now feels like an braindead obvious idea. It happens to all of us.

    • @ChristAliveForevermore
      @ChristAliveForevermore 2 роки тому +16

      @@connordavis4766 that's how one learns mathematics. Get stumped, let the unconscious mind work-out the details, and in a matter of time the answers seem as obvious as arithmetic.

    • @dmitrydrozdov7649
      @dmitrydrozdov7649 2 роки тому +8

      My math professor once said something that changed the way how I saw math - he said (when discussing a new PDE) - "if this doesn't make sense to you, don't worry about, it's not supposed to, but once you repeat it enough times it will become natural, like 2+2"

  • @sev9042
    @sev9042 2 роки тому +102

    Incredible video - I remember the Fourier transform video about "wrapping" functions around the unit circle (in the complex plane) and the complex part of this video was extremely reminiscent of that. So much so that I was able to follow along exactly where it was heading. That's when I realized that your videos have fundamentally allowed me to learn math and truly enjoy it. You are my favorite YT channel by far. THANK YOU!

    • @KohuGaly
      @KohuGaly 2 роки тому +4

      It should look reminiscent, because it's the exact same technique. What he's actually doing here is, he's evaluating the discrete Fourier transform (DFT). At 17:14 he acknowledges that. If you look at the equation with the sum symbol, and plug the phi into it, it's the formula for DFT (or rather, for its value at carefully chosen frequency).
      The next step in the learning process is to see how this technique generalizes.

    • @sev9042
      @sev9042 2 роки тому +2

      @@KohuGaly Fourier transforms are my favorite... They are just so fascinating. I recognized it was an extremely similar process but I didn't feel fully confident in labelling it as the same because I'm not an expert in any way. Thank you for your explanation! I appreciate it a lot!

    • @FranFerioli
      @FranFerioli 2 роки тому +1

      @@KohuGaly that’s where he got the idea of wrapping frequencies around a circle to explain how the FT works! I feel I should have known it...

  • @vicioms
    @vicioms 2 роки тому +8

    With some friends we mapped this problem to a constrained spin model and the results gives exactly back the polynomial you were talking about.

  • @yvikulov
    @yvikulov 4 дні тому

    Давно дивлюсь цей канал англійською, але дякую тим, хто зробив переклад субтитрів українською. Тільки сьогодні дізнався, що автор каналу почав додавати переклади до своїх відеоматеріалів.
    Thank you very much for the Ukrainian subtitles, @3Blue1Brown. I appreciate your work and educational videos and how much effort you put into them. You're a shiny diamond on the platform.

  • @michaelhaffer5639
    @michaelhaffer5639 Рік тому +52

    When I first encountered this problem (it was in fact the number of subsets of {1 .. 300} whose sum was divisible by 3), I came up with the following solution:
    Generalized question: How many subsets of {0 .. 3n-1} are divisible by 3?
    I will call this number a(n). I will call b(n) the number of subsets of {0 .. 3n-1} whose sum has rest 1 modulo 3. For symmetry reasons this is exactly half of all subsets which have a sum not divisible by 3.
    It follows that a(n)+2*b(n)=2^3n
    We now look at a(n)-b(n):
    Simple case: n=1. We consider subsets of U={0..2}
    Let f(x):=(x+1) mod 3. Then for each subset s let f(s)={f(x)|x€s}. It's easy to see that f³(s)=s for each subset s of U and that exactly one of s, f(s) and f²(s) has a sum divisible by 3 for any s - except s=U and s={}.
    So of the 8 subsets of U, four subsets have a sum divisible by 3, two have a sum =1 mod 3 and two have a sum =2 mod 3.
    We see that a(1)=4 and b(1)=2, so a(1)-b(1)=2.
    We now assume that we know a(n) und b(n) for a specific n.
    Let s be a subset of {0 .. 3n-1} and s0 be a subset of {0..2}. Let g(s,s0)=s U {3n+x|x€s0}. The sum of g(s,s0) equals the sum of the sums of s and s0 mod 3.
    It's also easy to see that for every subset t of U={0 .. 3n+2} there is exactly one subset s of {0 .. 3n-1} and one subset s0 of {0..2} with t=g(s,s0).
    A subset g(s,s0) of U has sum divisible by 3 iff either both sums are divisible by 3 or both sums are not divisible by 3 and have different rests mod 3. This leads to a(n+1)=a(1)*a(n)+2*b(1)*b(n) and b(n+1)=a(1)*b(n)+b(1)*a(n)+b(1)*b(n).
    From this follows that a(n)-b(n)=2^n for every n.
    Conclusion: b(n)=(2^(3n)-2^n)/3 and a(n)=(2^(3n)-2^n)/3+2^n
    It's obviously irrelevant whether we look at the subsets of {0 .. 3n-1} or of {1 .. 3n}
    The same reasoning also works for primes other than 3 and leads to
    Let a(k,n) be the number of subsets of {1 .. k*n} whose sum is divisible by k. Let b(k,n) be the number of subsets of {1 .. k*n} whose sum has rest 1 mod k.
    Then a(k,n) + (k-1)*b(k,n) = 2^(kn) and a(k,n) - b(k,n) = 2n,
    so a(k,n) = (2^(kn)-2n)/k + 2n which in this case means there are (2^2000-2^400)/5 + 2^400 subsets of {1 .. 2000} whose sum is divisible by 5.
    Seems I am more Bob than Alice.

    • @michaelhaffer5639
      @michaelhaffer5639 Рік тому +1

      The last two paragraphs preceding the final sentence should read as follows:
      Then a(k,n) + (k-1)*b(k,n) = 2^(kn) and a(k,n) - b(k,n) = 2^n,
      so a(k,n) = (2^(kn)-2n)/k + 2^n which in this case means there are (2^2000-2^400)/5 + 2^400 subsets of {1 .. 2000} whose sum is divisible by 5.

    • @MrNygiz
      @MrNygiz 9 місяців тому

      I can see the symmetry case for n=3 but for any prime larger then 3 how do we know that the subsets whose size equals 1,2,3,4, , , p-1 modulo p are of equal amount?@@michaelhaffer5639

  • @greeshka4751
    @greeshka4751 2 роки тому +168

    What I really like about this is that literally anyone who understands the problem can come up with a pretty accurate guess. The error would only be 1/2^1598 of the real answer!

    • @Sciencedoneright
      @Sciencedoneright 2 роки тому +27

      You mean 1/2^1798, but that's even better!

    • @balam314
      @balam314 Рік тому +8

      ​@@Sciencedoneright Isn't it 1/2^1598?
      The answer is (1/5) * (2^2000 + 4*2^400) which is the same as (1/5) * (2^2000 + 2^402)
      The difference between the guess and the correct answer is (1/5) * 2^402
      so the fraction of the final answer would be (1/5) * 2^402 / (1/5) * (2^2000 + 2^402)
      which is approximately 2^402 / 2^2000
      which is 1 / 2^1598, right? Is the approximation wrong?

    • @ronald3836
      @ronald3836 9 місяців тому

      If you consider that the 400 numbers divisible by 5 make no contribution to the sum, you can see that the answer has to be divisible by 2^400. If you then minimise the error, you get the correct answer: 2^400 x ((2^1600-1)/5 +1).

  • @BaAl-Alex
    @BaAl-Alex 2 роки тому +7

    I'm a math student and teacher (10-14y/o students). This was one amazing presentation of a "simple" question and a solution I could follow seamlessly even though I'm not a genius nor a professional mathematician. Love the simplicity in the design choices and the passion that was put into this!
    Always a blast listening to your work!!
    Love from Austria ;)

  • @UniversoNarrado
    @UniversoNarrado 2 роки тому +738

    Man, that was a wild solution!
    Congrats for the presentention, it was astonishing!
    Thanks for the video!

    • @miguelmochizuki494
      @miguelmochizuki494 2 роки тому +8

      Good to see another Brazilian here. Love your videos!!!

    • @akz7389
      @akz7389 2 роки тому +6

      AYOOOO o grande

    • @pedronobre3898
      @pedronobre3898 2 роки тому +5

      O Bruxo no seu tempo livre.

    • @MTheoOA
      @MTheoOA 2 роки тому +2

      A lenda do pão de queijo de proporções áureas chegou

    • @TheLukeLsd
      @TheLukeLsd 2 роки тому

      Tu por aqui

  • @reesespieces5386
    @reesespieces5386 Рік тому +4

    This is actually insane! When I first watched this video, I was so captivated by generating series and I looked for them in the descriptions of all the math classes at my uni. I found out a class that I was going to take in the Fall introduced them. It ended up being my favourite class so far and we also covered finding the closed form expression for recurrence relations like Fibonacci. I actually love this channel so much

  • @jonvonnoobman2823
    @jonvonnoobman2823 2 роки тому +30

    This makes me nostalgic. Remembering my high school days in the IMO training camp, solving these problems. Didn't make it to the team by a few marks, but enjoyed the experience a lot. Those were the days.....

  • @baguettegott3409
    @baguettegott3409 2 роки тому +21

    I'm so excited for that Riemann zeta function video - the old one on analytic continuation is one of my all time favourites on this channel, I watched it just after learning what complex numbers even are. And now look how far we've come... I've even come to actually _like_ complex numbers in the mean time...

  • @govinddwivedi582
    @govinddwivedi582 Рік тому +4

    I am really filled with lots of gratitude for you, Grant. This channel is really a boon. You tell us how to see it differently.

  • @dariaivanova1707
    @dariaivanova1707 2 роки тому +2

    Another fun way to get g(x)=2 would be to return to the simplified problem about {1,2,3,4,5} [where g(x)=(1+x)(1+x^2)...(1+x^5)]. We know the answer in this smaller case is 8. Therefore, (g(ζ)+g(ζ^2)+...+g(ζ^5))/5=8. From here we get g(ζ)=(40-2^5)/4=2.
    Thanks for your stunning show, and a special thanks for the puzzles at the end!

  • @016tristan
    @016tristan 2 роки тому +34

    Here's another way to solve this problem, which also gives us the number of subsets whose sum is 1,2,3,4 mod 5 respectively too. The idea is taken from the book titled 'Problems From The Book', co-authored by Titu Andreescu as well:
    Denote c₀, c₁, c₂, c₃, c₄ as the number of subsets whose sum is 0,1,2,3,4 mod 5 respectively, then taking f(x) = (1+x)(1+x²)...(1+x²⁰⁰⁰) evaluated at ζ, we have, by compiling coefficients congruent mod 5,
    f(ζ) = c₀ + c₁ ζ + c₂ ζ² + c₃ ζ³ + c₄ ζ⁴.
    But we know f(ζ)=2⁴⁰⁰ (The video has covered this). Therefore c₀ + c₁ ζ + c₂ ζ² + c₃ ζ³ + c₄ ζ⁴ = 2⁴⁰⁰, or equivalently
    (c₀-2⁴⁰⁰) + c₁ ζ + c₂ ζ² + c₃ ζ³ + c₄ ζ⁴ = 0.
    In the field of rational numbers, the polynomial 1+x+x²+x³+x⁴ is the minimal polynomial of ζ, so whenever ζ is a root of some a₀ + a₁x + a₂x² + a₃x³ + a₄x⁴ =0 where aᵢ are rational, then 1 + x + x² + x³ + x⁴ divides a₀ + a₁ x + a₂ x² + a₃ x³ + a₄ x⁴, or simply a₀=a₁=a₂=a₃=a₄.
    Therefore c₀-2⁴⁰⁰=c₁=c₂=c₃=c₄. Since c₀+c₁+c₂+c₃+c₄=2²⁰⁰⁰, we get that
    c₀=(2²⁰⁰⁰+4×2⁴⁰⁰)/5
    c₁=(2²⁰⁰⁰-2⁴⁰⁰)/5
    c₂=(2²⁰⁰⁰-2⁴⁰⁰)/5
    c₃=(2²⁰⁰⁰-2⁴⁰⁰)/5
    c₄=(2²⁰⁰⁰-2⁴⁰⁰)/5
    So, not only have we found the number of subsets that have sum divisible by 5, we also found the number of subsets that sum up to other remainders modulo 5 too, and they are surprisingly evenly distributed! (However, take note that this method only works because 5 is prime, whereby we've used the fact that 1+x+x²+x³+x⁴ is irreducible in Q.)

    • @quirtt
      @quirtt 2 роки тому +2

      yooo where are the pftb fans at?

    • @michamiskiewicz4036
      @michamiskiewicz4036 2 роки тому

      Nice, thanks for sharing!
      For anyone reading this: one should replace "real" with "rational" (minor nitpicking).

    • @016tristan
      @016tristan 2 роки тому

      @@michamiskiewicz4036 Ah yes! Thanks for spotting my mistake.

    • @piperboy98
      @piperboy98 Рік тому

      We can always find all the other sums modulo 5 because f(ζ^n) = sum k=1->N of c_k ζ^nk are exactly the DFT coefficients of the sequence (well, up to some choice of convention for the scaling and sign of the powers). The inverse DFT in this case is then c_n = 1/N sum k=0->N-1 of f(ζ^k) ζ^-nk. For n=0, ζ^-nk = 1 for all the terms and we get the straight sum, but for the others we get something else. Actually, because our coefficients are real f(ζ^k) = f(conj(ζ^k)) = f(ζ^-k), and with the identity e^ix+e^-ix=2cos(x), we can actually say that c_n = f(1)/5 + 2/5 sum k=1->(N-1)/2 of f(ζ^k) cos(nk2pi/N). For this case that works out to c_n=/=0 = 2^2000/5 + 2/5*2^400*(cos(2pi/5) + cos(4pi/5)). Those cosines sum to -1/2, which gets the required c_n=/=0 = (2^2000-2^400)/5.

  • @Marieadams.little.love.handles
    @Marieadams.little.love.handles 2 роки тому +3

    26:30 His breath of relief when it all comes together

  • @LorenzoWTartari
    @LorenzoWTartari Рік тому +4

    I've been watching this channel since i was in my second last year of highschool, I'm now in my third year of my bachelor's in pure math and this channel still amazes me every time, the videos are accessible even to people with hither to no background in mathematics and yet are full of insights that even three years after embarking on a formal education journey in pure maths, the quality and entertainment value of the videos on this channel never ceases to amaze me

  • @andrewkyriakou6385
    @andrewkyriakou6385 2 роки тому +32

    I might have stumbled upon generating functions, when I attempted to generalise some board game dice probabilities, but I was left at a standstill not knowing where to go... This has given me some Ideas for possibly solving a month long nightmare I had stuck in my head! thank you so much!

  • @jianhongsong6140
    @jianhongsong6140 2 роки тому +88

    I literally cried seeing the solution finally works out. It is so satisfying. Math will never die. Thank you for making this video, for preserving knowledge and stimulating curiosity.

    • @austinmchaney
      @austinmchaney 2 роки тому +7

      your funny lol

    • @dpage446
      @dpage446 2 роки тому +11

      @@austinmchaney what about their funny

    • @cheebengyeap9390
      @cheebengyeap9390 2 роки тому +4

      @@dpage446 why would you cry when you can watch the video again?

    • @jamalan7195
      @jamalan7195 2 роки тому +2

      @@austinmchaney what did his funny do?

    • @stevves4647
      @stevves4647 Рік тому

      what

  • @migueldomingos4570
    @migueldomingos4570 2 роки тому +15

    Yeah! New 3blue1brown video= 5 hours of enjoyment and math pondering

    • @3blue1brown
      @3blue1brown  2 роки тому +12

      That's what I love to hear, sounds like you'll be doing the homework from the end?

    • @elonitram
      @elonitram 2 роки тому

      I saw the first problem, and noticed that I've solved it earlier by monte carlo simulation, but I've never thought about doing it in another way! Now I'm really pondering about it

    • @migueldomingos4570
      @migueldomingos4570 2 роки тому

      @@3blue1brown Yeah definitely! Except maybe problem 1 since I haven't learnt yet calculus in a formal way

  • @Orionrobots
    @Orionrobots 2 роки тому

    Loved this - I began to get a Fourier-related hunch as soon as I saw frequency on a circle. This video made the "e-to-the-2-i-pi" stuff really pop into view properly for me - revealing more about circle equations, and the relationship between trig functions and exponents - an area I've been interested in understanding for a while.

  • @MsMangoChan
    @MsMangoChan Рік тому +1

    Hugely appreciate the retrospective of what is implied and learned from solving this puzzle! It's one thing to solve it, but it's another to take away learnings from the solution :)

  • @sebastiansimon7557
    @sebastiansimon7557 2 роки тому +36

    16:19 - The reasoning of this “trick” is just perfect. This makes this whole process much more intuitive.

  • @michaelf8221
    @michaelf8221 2 роки тому +40

    Fantastic explanation. You took me from "I have no idea" to "oooooohhhh I could have come up with that" in 20 minutes!

    • @TimothyZhou0
      @TimothyZhou0 2 роки тому +11

      and then when I actually try to come up with it on another olympiad problem, everything feels difficult again :') but it's nice to be able to follow the arguments haha

  •  Рік тому +28

    Quick note on the side, this puzzle is also an interesting way to practice dynamic programming, a very important technique in the design and analysis of algorithms. The approach shown in the video is certainly more profound and beautiful.

    • @lintstudios3072
      @lintstudios3072 Рік тому +3

      How exactly would you make a dynamic programming algorithm to solve this puzzle? What I would think to do is
      for a given number i (since the numbers are in order) the number of subsets up to 5 is just
      dp [ i - 1 ] [5 - (i mod 5) mod 5 ]
      where dp [ i ] [ j ] denotes the number of terms up to i that sum up to j (mod 5)

    • @paulstelian97
      @paulstelian97 Рік тому +2

      @@lintstudios3072 There's a tiny optimization, namely you don't need to keep as much history behind. You only need the previous and the current array of 5 elements.
      Since the relation is linear there's another more important optimization of using matrices to skip through and lead to large amounts of i, but j must be fixed in that case.

    • @ProfessorMario
      @ProfessorMario Рік тому

      @@lintstudios3072 My idea was basically what you described :)

  • @Mityno_
    @Mityno_ 2 роки тому

    As always, really loved it ! The quality just keeps improving beyond what I would've expected. One of my teachers recently had show me the complex roots of z^n=1 and their circular representation, didn't expect to see that in use so quickly. Thanks for the great contents you're making !

  • @busTedOaS
    @busTedOaS 2 роки тому +4

    The problem was hard enough. Explaining it in such a thorough yet engaging way is even harder. Hats off to 3Blue1Brown for this one.

  • @bmdragon
    @bmdragon 2 роки тому +42

    This reminds me a lot of Burnside's theorem, without having to go through understanding groups, orbits, or stabilizers. Amazing video!

    • @gammakay521
      @gammakay521 2 роки тому

      The lemma formerly known as Burnsides

    • @combinatorialplay2429
      @combinatorialplay2429 2 роки тому

      It can be solved this way. I added a comment elsewhere with an outline of how it can be done. Let me know if you can’t find it and I’ll explain again.

  • @AnExPor
    @AnExPor Рік тому +4

    This was one of the tougher videos for me to get through. It took a few attempts, however, my final watch through I feel like I unlocked a bit of knowledge for myself. Thanks. :)

  • @anthonyc2412
    @anthonyc2412 Рік тому +1

    greatly appreciate the art, the cool pointer, the recaps, and all

  • @ThatBenKraft
    @ThatBenKraft 2 роки тому +6

    Thank you so much for coming to Tufts! It was so great seeing your work and meeting you! I also love how you’re incorporate the “live” elements where you can see the use of a cursor like in a more traditional lecture to expand and clarify elements. Such a great style!

  • @jacobsteinebronn2966
    @jacobsteinebronn2966 2 роки тому +212

    There’s another nice way of solving this problem in log(n), where n is the size of the set (in this case, 2000) by exponentiating a 5x5 matrix! Generating functions are fun as well :)

    • @goblin5003
      @goblin5003 2 роки тому +14

      Do you have a link for this method? I’d love to see how they do it

    • @OmnipotentEntity
      @OmnipotentEntity 2 роки тому +55

      @@goblin5003 It's the matrix that transforms the vector containing the mod 5 totals after considering the first n numbers, into the mod 5 totals after considering the first n+5 numbers. Consider for example the totals at 5: 0 mod 5 will have 4 subsets: {}, {1,4}, {2,3}, {5}, 1 mod 5 has 3: {1}, {1, 5}, {2, 4}, and so on. Now consider the effect of adding just 6. We can either include or not include 6, which is 1 mod 5, which means that the entry in this vector for (as an example) 0 mod 5 up to n = 6 is the entry for 0 mod 5 when n=5 + the entry for 4 mod 5 when n=5. You can make a matrix for adding a number 0-4 mod 5, then multiply the matrix together to get the one that brings you from n to n+5. While all of the other matrices are different, this one is always the same, so you can repeatedly apply it. (From there, you can get an explicit formula again to solve it in O(1) time by using eigendecomposition/Jordan Normal Form. It's another, albeit less general, method of solving recurrence relations.)

    • @OmnipotentEntity
      @OmnipotentEntity 2 роки тому +36

      I apologize if it's a bit confusing. UA-cam comments are not the best place to communicate complex math ideas.

    • @zaek2144
      @zaek2144 2 роки тому +3

      @@OmnipotentEntity do you have any link/reference to a webpage, book or video where this kind of procedure is applied? I didn't quite understand the logic behind it with just the comment :(

    • @rubberduck2078
      @rubberduck2078 2 роки тому +3

      You can reduce the 5x5 matrix to 2x2

  • @kartiksunaad
    @kartiksunaad 2 роки тому +3

    Every new video this man releases is an absolute treat!
    Thank you 3b1b for bringing such amazing content to the public.

  • @wazupchief4522
    @wazupchief4522 2 роки тому +19

    This channel is so underrated. The way you make something like this so interesting and so fun and easy to watch is so fascinating. Never thought I'd watch 32 minutes of complex math, understand it, and feel entertained while doing so. Thank you sir.

    • @jacobshirley3457
      @jacobshirley3457 2 роки тому +9

      What do you mean by "underrated"? The channel has 5 million subscribers, despite being about math and usually diving deep into the topic. That's basically a miracle.
      It's even surpassed Numberphile, despite being much less accessible (albeit, more beautiful).

  • @ppaxlu
    @ppaxlu 2 роки тому +201

    Watching this while taking a course on groups, rings and fields ended up surprising me in the similarities between this and the Galois groups of field extensions. I think a video on abstract algebra could end up very interesting

    • @limepie3025
      @limepie3025 2 роки тому

      literally same here

    • @marcellomarianetti1770
      @marcellomarianetti1770 2 роки тому

      same

    • @dhruv1614
      @dhruv1614 2 роки тому

      Can you please tell me more about courses

    • @FranFerioli
      @FranFerioli 2 роки тому +21

      Screw the video. The world need “the essence of abstract algebra” series!

    • @someperson9052
      @someperson9052 2 роки тому

      @@dhruv1614 what do you want to know?

  • @thomashoffmann8857
    @thomashoffmann8857 2 роки тому +59

    "Root of unity filter" is the technique which was used

  • @jordanweir7187
    @jordanweir7187 2 роки тому +8

    This has to be among the highest forms of education ever made, amazing content as always dude

  • @joeg451
    @joeg451 2 роки тому +2

    The cycling behaviour where things destructively interfere or constructively interfere to filter out coefficients reminds me of the Fourier transform

  • @combinatorialplay2429
    @combinatorialplay2429 2 роки тому +11

    Beautiful video. The answer is striking and as another poster mentioned, it is reminiscent of Burnside's theorem. I'll outline a solution below.
    Imagine 400 "concentric" pentagons. Label the vertices of the innermost pentagon 1-5, with 1 at the top, proceeding clockwise. On the next largest pentagon, label the vertices 6-10, 6 at the top, proceeding clockwise again. Now, color the vertices with one of 2 colors, say red or green. If the pentagon is fixed, there are 2^2000 ways to do this. When vertex is green, include it in the subset, exclude if it's red. Consider two colorings equivalent if one can be obtained from the other by a rotation of 0, 72, 144, 216, or 288 degrees. By Polya's enumeration/Burnside, there are (1/5)*(2^2000 + 4*2^400) ways to color the vertices. The catch is that in each group of equivalent colorings, one and only one set of green-colored vertices will be a multiple of 5. Thus, the number of colorings is equal to the number of subsets whose sum is a multiple of 5.
    To see this a bit better, for the simpler {1,2,3,4,5} case, consider just one pentagon and suppose three consecutive vertices are colored green, the other two red. This corresponds to the five 3-element subsets {1,2,3}, {2,3,4}, {3,4,5}, {4,5,1}, and {5,1,2}. Only one of these, {4,5,1}, has a sum that is a multiple of 5.
    Edit: Spelling

    • @Simon-ts9fu
      @Simon-ts9fu 2 роки тому +1

      I don’t see how this is correct.
      Consider the colouring {1,6,11,16,21} which sums to 55. Rotated this gives {2,7,12,17,22} which sums to 60, and so on. So all sets in this group of equivalent colourings sum to a multiple of 5.

    • @combinatorialplay2429
      @combinatorialplay2429 2 роки тому

      @@Simon-ts9fu Right! Back to the drawing board for me. I was looking for something with 5-fold symmetry and at first, I was thinking of a 2000-gon, but then this idea of nested pentagons came to mind. I'll give this some thought and if (when!) I think of a different way to interpret this, I'll reply again.

    • @combinatorialplay2429
      @combinatorialplay2429 2 роки тому

      @@Simon-ts9fu I think I have a fix for my original argument. If the size of the set is not a multiple of 5, it should still work. If it is a multiple of 5, then either every pentagon is uniformly colored (in each pentagon, all are red or all are green) or there is some pentagon that has a mixture of red and green vertices. If all are uniformly colored, all rotations produce the same sets. If there is some pentagon that has a mixture of red and green vertices, find the pentagon of this type closest to the center. When the pentagon is rotated, rotate all labels except for this special pentagon. In your example, the 1 in the set {1,6,11,16,21} would remain unchanged, so the next set would be {1,7,12,17,22}. The argument isn’t as elegant as I would like it to be, but it works.

  • @headcrab4
    @headcrab4 2 роки тому +3

    Your ability to explain math in such a visual way is unparalleled. Even if I don't understand the explicit math behind the solution, the visuals help me intuit how the numbers and whatnot play together to create the solution we want. Beautiful job!

  • @dustyspace8388
    @dustyspace8388 Рік тому

    I just felt down the chair listening to you. Wonderful, I never got in touch with generating function and the (generic) usefulness of the complex plane for extracting the correct coefficients of a polynomial function ... and now I have a *visual* of this all. Thanks a lot I learned a lot.

  • @Szynkaa
    @Szynkaa Рік тому

    honestly this video not only teaches math, but also teaches how to teach math. Everything you present is so elegant, every smallest detail is done with perfection which is just a cherry on top of a beautiful problem and solution you presented.

  • @bakedbean2221
    @bakedbean2221 2 роки тому +4

    Consistently blown away by this channel, thank you again for explaining something I didn't know I wanted to know.

  • @DynestiGTI
    @DynestiGTI 2 роки тому +3

    The production quality of your videos is so good... I feel so privileged to be able to watch this for free! The quick Python animations, the cutesy drawn animations, the beautiful music, and the math. You've seriously outdone yourself with this one. There's teaching math, and then there's making people absolutely love math and want to pursue it further in the future, this does the latter to such a high degree.

  • @Sharpgamingvideos
    @Sharpgamingvideos 2 роки тому

    Just taught generating functions to a student the other day! Prior to watching this video, my favorite example of a generating function approach providing extra value in counting problems was in the study of the integer partitions (because the associated generating function can be simplified like a geometric series), but this complex numbers idea might be just as awesome!

  • @V1N1V
    @V1N1V 2 роки тому +1

    I don't have enough words in my knowledge to describe how awesome math is and how it always finds ways to make me love it even more. Thank you for this gift.

  • @adamantmist9394
    @adamantmist9394 2 роки тому +5

    Absolutely astonished by the visual style of this video and how it differs from others in the channel, it embodies a form of storytelling and the math parts are presented much more like a DIY thing than a "let the screen do the math" which was absolutely perfect for this kind of problem-solving video, looking forward to other beautiful ways you can present math but also more of this kind of style. These type of videos are what embodies my love for math and education and I'm completely thrilled for what other ways of story telling and teaching math you can scheme. Thanks as always Grant, this was amazing.

  • @allanjmcpherson
    @allanjmcpherson 2 роки тому +15

    This was really cool! I learned about the roots of unity in my engineering program, but we never saw any applications of them. They were just an exercise in complex numbers. It's cool to see how they can be useful!

    • @Alex_Deam
      @Alex_Deam 2 роки тому +7

      Another fun application: 19 year old Gauss used similar tricks with roots of unity to show that a regular 17-gon can be constructed with compass and straight edge, the first advance since the time of Euclid

  • @feorge4972
    @feorge4972 2 роки тому +2

    I went from not understanding generating functions to understanding them not so long ago, and I think the way they were introduced to me was very natural.
    Generating functions for me started out as just a way to represent sequences of numbers which has very simple rules of addition and multiplication (just as you characterised them). It makes perfect sense if you want to evaluate the function at a point x, just the same for a polynomial. But when you consider representing combinatorial objects with generating functions, it turns out that construction of a combinatorial class using disjoint unions and cartesian products alligns beautifully with construction of generating functions using addition and multiplication.
    To me introducing generating functions to a combinatorial problem is something like introducing calculations with algebra to geometrical problems. It's groundbreaking and very insightful, which is why I find the title of the video to be an understatement. It's not just the olympiad level counting, it's simply the most awesome way of counting!
    I also appreciate the addition links. Thank you so much for the video!

  • @bentrolley4316
    @bentrolley4316 Рік тому +1

    Watching that genuinely felt like a hallucinatory experience. Incredible. Beautifully made as always, too.

  • @adamplace1414
    @adamplace1414 2 роки тому +44

    Grant, as much as anyone, has changed how I view what education should be. And as valuable as the visuals are here, I'm sure he could do a reasonable facsimile with a whiteboard and lectern. It's all in the mystery.
    And yes, I'm just ripping off the points he made in his TED talk. But he sure does walk the walk.

  • @MeetaJoshiArtsCrafts
    @MeetaJoshiArtsCrafts 2 роки тому +4

    This video is absolutely beautiful. It explains all concepts clearly and I love them.

  • @redandblue1013
    @redandblue1013 Рік тому +1

    Art this time, and your normal visualisations seem even better
    Man you never stop, amazing!

  • @nathanieltan3569
    @nathanieltan3569 2 роки тому +1

    Just sent this to my former discrete math professor. I did an independent study with her on error correction codes where generating functions and roots of unity came up so I was so excited to share.

  • @emilnavod67
    @emilnavod67 2 роки тому +34

    I'm proud to say that just when grant said what about negative 1 I immediately figured out how complex numbers come into play

  • @theplasmawolf
    @theplasmawolf 2 роки тому +3

    I love the roots of unity. They have a way of making things that seem difficult in their own right, very easy to solve, and also understand. It allows you to make connections between different mathematical subjects.

  • @sandeepjnv13
    @sandeepjnv13 Рік тому

    Your explanations are gem and should be preserved and used till end of time.

  • @MeWhenTheVids
    @MeWhenTheVids 22 дні тому

    Idk why its so fun to watch these. I have no math understanding outside of skipping algebra in highschool. Yet somehow this makes it fun

  • @Elnadrius
    @Elnadrius 2 роки тому +8

    Generation function is a great and kinda magical tool. They always different, but still the same. Would be wonderfull to see more videos with them!

  • @PersonaRandomNumbers
    @PersonaRandomNumbers 2 роки тому +3

    Thanks for the extra puzzles at the end! That last one stumped me for a while. I ended up stumbling on the idea of _multiplying_ by 1-x instead, and that really cracked it open for me.
    That, and I lost all my practice on differential equations. Took me three tries to get the right coefficients! But it was fun getting to the closed form solution.

  • @ms070965
    @ms070965 2 роки тому

    Each of your video is a wonderful journey. Thank you so much for those marvelous moments

  • @2Sor2Fig
    @2Sor2Fig 9 місяців тому

    You're my favorite mathematician, thank you for doing all this. I never understood why people thought math was beautiful, to me it was mostly just a tool I used reluctantly. Now I do and I like that you make it accessible enough to make that possible.

  • @Aj-fz7on
    @Aj-fz7on 2 роки тому +13

    Your animation makes understanding these things sooo much more easier , thanks for sharing

  • @xgozulx
    @xgozulx 2 роки тому

    I actually could follow along, the explanations where great, but the visuals are just insanely useful in understanding and even seeing what could came after. I specially liked how you insisted in those 180 rotations, when you link them to the answer for the 2 complex numbers showed in my head as the necessary next step. so nice :D

  • @adityaruplaha
    @adityaruplaha 2 роки тому +12

    This is a trick that I've used countless times in high school math, yet I never imagined the connection between generating functions, the Riemann hypothesis and Fourier series. Truly marvellous.
    I also wanted to thank you. It is because of educational creators of you, that I am now in one of the premiere mathematical institutions in my country. I never even imagined that I would get selected, I only gave the exam because I find math beautiful, and you, along with many other creators, I believe, are to thank for that. Love your vids.

    • @3blue1brown
      @3blue1brown  2 роки тому +2

      Congratulations, I hope you enjoy your studies!

    • @adityaruplaha
      @adityaruplaha 2 роки тому

      @@3blue1brown Thank you! :D

  • @terrylewis5786
    @terrylewis5786 2 роки тому +58

    I am not done watching but I can tell this took a lot of effort to produce. I love your content. TY

  • @anon_commentator
    @anon_commentator 5 місяців тому

    3b1b наверняка далеко не самый сильный математик, но то, как он способен преподавать и вдохновлять своим энтузиазмом других заслуживает уважения. Конечно я глубоко признателен любому "поставщику задач", будь то из интернета или из реальности который к тому же в интересной форме всё это объяснит. Но только 3b1b способен зажечь этот же необъяснимый огонь любопытства и саморазвития у миллионов других людей по всему миру. Вероятно, это пример одного из лучших учителей, которых знало человечество.
    Урок очень полезный. Связь сложения и умножения, как и решение несколько замороченных уравнений через комплексную функцию - просто гениальные ходы решения. Мне определённо нужно какое-то время, чтобы как-следует над этим подумать. Спасибо за источник в начале видео, теперь я чувствую необходимость почитать этот сборник комбинаторных задач

  • @thomasnb2
    @thomasnb2 2 роки тому +1

    This was a fun video! Thank you again :)
    I've been playing around with roots of unity back at uni, and what you normally learn is the general expression z^n = 1, and then some equations so that for a given integer n you can find the solutions z. I wanted to go further, and generalized the expression to z^n = w, but I allowed both w and n to be complex numbers. The solutions z that pop out of it are absolutely beautiful, as they sit on an infinite spiral rather than a circle! I remember it as an amazing realization as I sat through the algebra during my bachelor in chemistry when I discovered this. I also haven't found any references to it on the internet. I would recommend those interested to try to sit through the algebra and come to the expressions yourself, and maybe set up some code to visualize the solutions. It's worth it!

  • @jakeman5825
    @jakeman5825 Рік тому +7

    In my set of discrete math courses in college, I was fortunate enough to learn about generating functions, and had the wonderful opportunity to explore them more in my senior thesis. My favorite generating functions are the rook polynomials! When you introduced the problem, I was immediately thinking “Hm, how would I make a generating function for that?” Awesome video as always!

    • @Theantmang
      @Theantmang 3 місяці тому +1

      yeah once you know the trick for generating function, for like huge huge sets or so, you kinda intuitively want to make a function with coefficients that are countable or reduce it by a margin! its really neat! i wish i could study more math for school, so expensive and cant right now, maybe one day ill be fortunate to finish my pure maths degree and get a masters after!

  • @manishprasad1298
    @manishprasad1298 2 роки тому +3

    This was a wonderful video! I really loved it. Since I was a free, I tried out the problems at the end and here are my solutions.
    Solutions to the problems:
    Q1:
    1/(1-x) = Sum[n=0 to inf] (x^n)
    1/(1-x)^2 = Sum[n=1 to inf] n*(x^(n-1)) = Sum[n=0 to inf] (n+1)*(x^n)
    Let p=1/6 (probability of getting 1 in a fair dice) and q=5/6 (Probablity of not getting 1)
    E[X] = 1*p + 2*(q^1)*p + 3*(q^2)*p + ....
    = p* Sum[n=0 to inf] (n+1)*(q^n)
    Using the derivative from before,
    E[X] = p*(1/((1-q)^2) = p*(1/p^2) = 1/p = 6
    Q2:
    (1+x)^n = nC0 + nC1*x + nC2*x^2 + ....
    Put x=2: nC0 + nC1*2 + nC2*2^2 + .... = Sum[k=0 to n] (2^k)nCk = (1+2)^n = 3^n
    Q3:
    F(x) = Sum[n=0 to inf] fn*(x^n)/n!
    F'(x)= Sum[n=1 to inf] n*fn*(x^(n-1))/n! = Sum[n=0 to inf] f(n+1)*(x^n)/n!
    F"(x)= Sum[n=0 to inf] f(n+2)*(x^n)/n!
    Since f(n+2) = f(n+1) + f(n) (Fibonacci Numbers)
    F"(x) = F'(x) + F(x)
    For the fibonacci sequence f(n+2) = f(n+1) + f(n), the "characteristic equation" of above differential equation would give the general solution.
    The roots of the "characteristic equation": x^2 - x - 1 = 0 are phi=(1+sqrt(5))/2 and phi*=(1-sqrt(5))/2
    Hence the general solution would be:
    fn = a*(phi^n) + b(phi*^n)
    Since f0 = 0 and f1 = 1,
    0 = a+b
    1 = a*phi + b*(phi*)
    Solving the above two equations and substituting the values of phi and phi*, we get: a=1/sqrt(5) and b=-1/sqrt(5). Hence:
    fn = (phi^n - phi*^n)/sqrt(5)
    Q4:
    Since 1/(1-x) = Sum[n=0 to inf] (x^n),
    f(x)*1/(1-x) = (Sum[n=0 to inf] (an * x^n)) * (Sum[n=0 to inf] (x^n))
    = (a0 + a1*x + a2*x^2...)*(1 + x + x^2...)
    = a0 + (a0+a1)*x + (a0+a1+a2)*x^2 + ....
    = Sum[n=0 to inf]( (Sum[k=0 to n] ak) * x^n )
    Hence, the coefficients of the nth term f(x)*1/(1-x) give the sum of all the ak's from a0 to an