Factorials and the Gamma Function (Geogebra and Python builds) - for Stand Up Maths - Matt Parker

Поділитися
Вставка
  • Опубліковано 2 січ 2025

КОМЕНТАРІ • 46

  • @noostroi
    @noostroi 3 роки тому +6

    "The internet exists, go look it up" truer words were never spoken!

  • @timothywalsh866
    @timothywalsh866 3 роки тому +4

    That's great. I didn't realise you have your own channel. Thanks for sending me, Matt

  • @JBLewis
    @JBLewis 3 роки тому +20

    I like the phrase that I've seen some other content creators use, "This is a 'what did', not a 'how to'"

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

      Thanks JBLewis! I like this. Mentioned it in the next vid (and in the notes, but it won't let me tag you for some reason...)

  • @ericgoldman7533
    @ericgoldman7533 3 роки тому +26

    As a senior software engineer who enjoys helping more people learn to code, I appreciate python's accessibility and ease.
    Side note- I'm pretty sure 'j' is python's default imaginary value indicator, rather than just what that package uses. Additionally, I suspect 'j' is used because 'i' is commonly used as a incrementor/indexing variable.

    • @eefaaf
      @eefaaf 3 роки тому +6

      In electrical engineering, j is often used instead of i, as i is used for current.

    • @empireempire3545
      @empireempire3545 3 роки тому

      how do you make python accessible with all this mutable/immutable craziness? How do you explain the available data structures? As a Fortran/C/C++/Perl programmer i find Python to be the definition of unintuitive : ( I've tried three times, each time with different resources, each time i bounced back like a ball from a wall.

    • @ericgoldman7533
      @ericgoldman7533 3 роки тому +7

      @@empireempire3545 By "accessible", I mean-
      1) you don't need special software to compile and run python scripts,
      2) you don't have to rely on external assemblies being present/intalled just to get started, and
      3) it is truly cross platform- there's no need to re-compile your program/script for different platforms/architectures.
      By the same token, I appreciate the accessibility of JavaScript, but I'm not overly fond of how "loose" it allows developers to be. I've had to resolve problems, and re-educate devs, due to bad practices they've gotten used to thanks to how loose JS can be.

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

      To add a little to your explanation for the choice of _j_ over _i_ ; I presume the reason it insists on _1j_ rather than simply _j_ is syntax: variable names can't start with a digit, so it eliminates any ambiguity (for example, _j_ might be chosen as an index variable for a nested loop).
      The solution is a compromise between what's familiar from maths notation and what's practical for the interpreter to parse.

    • @empireempire3545
      @empireempire3545 3 роки тому +1

      @@ericgoldman7533
      I fail to understand point 1 and 2. Either you're on linux, in which case the same is true for c/c++/fortran/perl/younameit or you're on windows in which case it isnt true for anything.
      Besides, its just one time standard setup. Usually i just guide people through it step by step and we're done very quickly.
      The problems most people new to programming have are, in most experience, shit ton of mental constructs one has to assimilate.
      I have no idea how a person new to programming can not get lost in all the weirdness with which python slaps you from the beginning.

  • @gregbell2117
    @gregbell2117 3 роки тому +3

    Professional software dev here... there's nothing wrong with that code Ben!
    Lots of the "ceremony" (tests, comments) depends on the intended audience, and in this case that was you.
    Also, nothing wrong with a "no tools" development process. There's always a balance between tools/setup and getting things done, just like there's always a balance between spending time on theory vs. actually building something. Seems like you nailed it - neat results in record time.

  • @pi1234
    @pi1234 3 роки тому +7

    Hi Ben, you get my thumbs up, because you are not asking for it. Clearly, you very much enjoy what you do! Keep sharing your passion for math!

  • @martinwhitworth3989
    @martinwhitworth3989 3 роки тому +8

    Hi Ben, I love these videos - so natural. You're clearly a Geogebra expert but when it comes to Python, I think we're in a similar situation: neither of us are experts, but it enables us to do useful stuff with the aid of some Googling. You're a braver man than I to show your efforts online, but well done. For those seeking careers in STEM, make sure you understand the maths, but proficiency in Python (or R) will be a valuable additional skill. I'd definitely value that as an employer.

    • @SparksMaths
      @SparksMaths  3 роки тому +7

      I'm glad, and relieved. It's important for us to show that this stuff is a human (and sometimes slow and frustrating, if also exciting) endeavour!

    • @TheJamesM
      @TheJamesM 3 роки тому +3

      @@SparksMaths That's something I really enjoy about the channel Coding Train - the host Daniel is working it out as he goes along (though he does sometimes have notes), which gives people a more realistic idea of what it's like to code (at least for someone like me). If things are too perfectly prepared beforehand it make an inexperienced viewer feel totally hopeless in comparison.

  • @p.j.882
    @p.j.882 3 роки тому +3

    Factorial, Gamma, and double factorial (factdouble) are used in SERIESSUM function of Taylor or Maclaurin series expansion which you can also find in UA-cam.

  • @rewrose2838
    @rewrose2838 3 роки тому +20

    Y'know what Ben, I'll sleep easy thinking back to this video and knowing that I'm not the only botching code together 😅 thank you for easing my imposter syndrome

  • @munjee2
    @munjee2 3 роки тому +6

    Ben, I've been doing "actual" coding for 7-8 years now and when I see these programs on UA-cam I too feel like I don't know anything it's perfectly normal to feel that way

  • @nxpnsv
    @nxpnsv 3 роки тому +1

    This is a very clear and easy to follow geogebra tutorial. You rock!

  • @totlyepic
    @totlyepic 3 роки тому +16

    I've worked in data science and done some viz work, and I don't think you should be at all ashamed of just throwing together things until they work. It's infinitely better than spinning your wheels while you fret about problems you'll never encounter. As long as you grasp the math enough to know what sort of erroneous results to look out for (i.e. realizing what it gives you has something wrong with it that you need to figure out and correct), the rest doesn't matter so much. It seems to me like you've got that.

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

    I came here for the colors because I read that matplotlib changed default from 'jet' to something they called 'viridis' and this is the first time I saw it in the wild. As you said at 12:13 it's easy to add a colormap, you just need to add an import and a parameter to plot_surface()
    from matplotlib import cm
    surf = ax.plot_surface(X, Y, Z, cmap=cm.viridis)

  • @TesserId
    @TesserId 3 роки тому +3

    Pro(-ish) Tip: When you have to fight the brackets, split things across multiple lines... ... either as multiple intermediate formulas, or one (or more) multi-line expressions.
    Consider:
    Z = np.clip(
    abs(
    gamma( X + 1j * Y )
    ),
    0,
    10
    )
    Books have been written on writhing solid code (in fact, I have a book with that as a title). There are many ways to guard yourself from the pitfalls of misplace punctuation. There have to be; misplaced punctuation can be quite painful. Oh, and then there are editors that highlight and make it easy to jump between matching brackets.

  • @kenhaley4
    @kenhaley4 3 роки тому +8

    Wonderful video. Thanks!!
    FYI: Another way to write a+bi in python is complex(a,b). You can write any constant followed by j (like 4j) to get the imaginary part of a number, but you can't put a variable there, because bj would be a different variable name.

  • @poweruser64
    @poweruser64 3 роки тому +3

    "If I cannot build it, I don't understand it."
    - Richard Furman
    Thank you so much for this. Where did you hear it?

    • @SparksMaths
      @SparksMaths  3 роки тому +1

      It's from Richard Feynman (it was left written on his office blackboard after he died). I actually slightly misquoted: "What I cannot create, I do not understand" - a quick google will find the image of his blackboard - e.g. www.quora.com/What-did-Richard-Feynman-mean-when-he-said-What-I-cannot-create-I-do-not-understand

  • @KerryHallPhD
    @KerryHallPhD 3 роки тому +4

    I've rarely started code from scratch in practice. I usually open something related in some way and edit it down and copy paste it up. That's also how I write homework and exams :p

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

      Yes, when I started recording the python bit I was realising it was probably the first (and likely only) time I ever typed in the import commands, rather than copying them from another file...

  • @ooloncolluphid9975
    @ooloncolluphid9975 3 роки тому +3

    AFAIK meshgrid is like a cartesian product so you get all the different xy pairs, which you can then use as inputs to your function.

  • @darraght6528
    @darraght6528 3 роки тому +1

    Thanks Ben, great video

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

    Omg learned so much. Thanks!!!

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

    Nice work as always 😊

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

    Very interesting and insightful video!

  • @munjee2
    @munjee2 3 роки тому +1

    19:25 that's a third of all pros

  • @TesserId
    @TesserId 3 роки тому +1

    People think I'm crazy, but I came to Perl from the Bash world, and the two overlap. So, I do my math stuff in Perl (Mandelbrot lately), which people think is nutz. But, so be it. Cheers.

  • @reddcube
    @reddcube 3 роки тому +8

    In engineering, imaginary numbers use 'j' and not i, because 'i' is for electrical current.

    • @ericgoldman7533
      @ericgoldman7533 3 роки тому

      Nice little info nugget!

    • @alicewyan
      @alicewyan 3 роки тому

      And in physics, we use 'j' for electrical current because 'i' is the imaginary unit!

    • @nikolausluhrs
      @nikolausluhrs 3 роки тому +1

      Engineering is cursed with traditions like this, similar to the fact that we consider current to flow opposite the direction of electron movement

    • @ericgoldman7533
      @ericgoldman7533 3 роки тому

      @@nikolausluhrs I think "cursed" is the wrong word, but I get what you mean.

  • @ooloncolluphid9975
    @ooloncolluphid9975 3 роки тому +3

    madlad Ben writing python on IDLE lol

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

      Wha'chu got against IDLE? I've written C# and SQL in notepad before xD

  • @munjee2
    @munjee2 3 роки тому +3

    Ben sparks has his own channel and only now finding out ? Disgraceful!

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

    Don't apologise for your (working!) code. I don't apologise for my (working!) noob math.