back to index

fast.ai APL study session 2


Chapters

0:0
8:27 How Did You Get the Apl Keyboard on Top of Jupiter Notebook
18:51 Complex Numbers
19:26 Complex Number Plane
24:16 The Unit Circle
29:40 Trigonometry
37:11 Basic Math Operators
56:16 Euler's Identity

Whisper Transcript | Transcript Only Page

00:00:00.000 | tell me on the topic of learning new things you mentioned today that your
00:00:05.440 | colleagues are peeved when you spent half of half of the time learning new
00:00:08.920 | things uh-huh how did you how did you stand your ground I don't know just
00:00:17.640 | buddy-minded I don't know was it because you're so productive that didn't matter
00:00:25.420 | no no I mean it matters I mean most of that time I was either the manager of a
00:00:36.260 | management consulting team or I was CEO of a company or whatever so like I mean
00:00:42.280 | my first two startups I wasn't exactly CEO nobody had titles I had co-founders
00:00:47.600 | but yeah in the end it's like this is how I do things you know so but I'm not
00:00:55.880 | gonna say it didn't create friction
00:00:59.200 | I mean I don't know what do you think Hamill like you work with me and you see
00:01:03.280 | how I jump onto totally different things when we're meant to be focused on
00:01:07.960 | something like um I actually don't see you I don't see you getting distracted
00:01:16.560 | that much at least for me like we're talking about apl right now when we're
00:01:21.360 | meant to actually be focused on releasing nb dev and I'm going to be
00:01:25.320 | doing the course you know it's like okay no yeah okay okay yeah like um in in
00:01:30.440 | hindsight it looks like it was all part of a like a genius plan how like while
00:01:37.640 | you're doing it it's like why are we doing this that's how I feel sometimes
00:01:41.160 | but then it's kind of like that thing we did with rich I don't know if you
00:01:46.440 | remember that with a with the GH top with with your old CEO we yeah yeah yeah
00:01:56.400 | this thing using rich yeah like we spent so much time doing that and while we're
00:02:02.560 | doing it I was like why are we you know at some point I was like I don't know if
00:02:05.480 | this is worth it or you know but then like you know Will mentioned that he
00:02:12.440 | started his company based upon this that project and I thought wow that that's a
00:02:17.400 | really big impact it's so like lies yeah yeah so then I just kind of learned over
00:02:24.480 | time that it actually you can pivot these things into something productive
00:02:31.440 | usually yeah so this this company textualized on ao well who created it
00:02:38.440 | said came out of
00:02:43.160 | ammo and I
00:02:46.160 | refactoring
00:02:49.280 | there we go still the most recent one so nobody's touched it since this rather
00:02:56.800 | megapia which yet basically talk rich and
00:03:06.520 | made it do things that we all hadn't exactly expected it to do this is quite
00:03:13.800 | funny because I think yesterday or two days ago I went to this website
00:03:18.160 | textualized that I owe and I was thinking hmm what does this do like how are they
00:03:24.440 | planning on sending it or what's the plan I mean that the website is
00:03:28.640 | beautifully designed so I thought that there must be some business entity
00:03:32.320 | behind it and yeah that's yeah so it's basically you know one guy although I
00:03:40.280 | think he might have he's got some funding so I think he's hired somebody to help
00:03:43.160 | now who loves building CLIs and so what Hamill and I showed with our GH top
00:03:50.800 | thing was that actually you can like use another tool he's created called rich to
00:03:54.880 | kind of get a long way towards building terminal user interfaces and
00:04:01.800 | yeah this is something it's come full circle now now that somebody's using
00:04:08.240 | textualized to build a notebook in the terminal that's true which is great
00:04:15.320 | alright so since I'm on the Mac today let me just check something if I switch
00:04:23.840 | to a different virtual screen you guys can now see my terminal is that correct
00:04:28.640 | yep okay great
00:04:33.040 | yeah so since I'm on the Mac I just downloaded that Jupyter kernel and I
00:04:50.960 | unzipped it in the ran install.sh and it looks like I now have a dialogue APL
00:05:02.200 | thing here so one thing that's happened since yesterday is we now have a GitHub
00:05:17.840 | which let's have a look
00:05:23.120 | APL study there you go so I don't have that over here so let's grab it so I'll
00:05:35.000 | go copy yeah so we've got a fast AI / APL - study and really all this in it at the
00:05:42.640 | moment is my notebook and so I should be able to now get clone that
00:05:56.280 | there we go and so I should now be able to open that good and very I should be
00:06:11.880 | going to run it right okay oh and then the other thing we did was we installed
00:06:27.160 | that toolbar widget thingy oh which I've actually already got here so that's
00:06:31.600 | good so I guess I have to go bookmarks shift Apple B okay APL
00:06:48.880 | great so let's see if I can type back tick - yep that works okay so I'm back up
00:07:01.880 | to where we were on the different computer
00:07:10.800 | so let's do times and divide shall we and I guess I should also run dialogue
00:07:24.520 | and we should also get up our help which was called dialogue language comments
00:07:35.960 | cool all right let's do times so at first it feels a bit weird that times
00:07:55.200 | and divide are actually on - and equals but then you realize that like plus
00:08:01.560 | minus times and divide are all kind of next to each other on the keyboard so
00:08:05.200 | it's not quite that weird I seem to have got used to it pretty quickly so we can
00:08:10.920 | do two times three and so that makes sense
00:08:18.480 | how did you get the APL keyboard on top of chapter notebook it's it's if you go
00:08:33.040 | to the forum oh I think did we discuss it yesterday I don't quite remember
00:08:39.520 | maybe we do it yeah but I just didn't know where to take it from yeah okay so
00:08:47.920 | specifically the steps are you area is the bookmarklet so you click here and
00:09:08.320 | then you as it says you drag this to your bookmarks bar is this link and then
00:09:16.680 | you go to the Jupiter webpage and you click that link in your bookmarks bar
00:09:20.400 | and it will appear okay and this thing is called not surprisingly time sign and
00:09:41.440 | the two forms of it okay direction and multiply obviously called times okay so
00:10:08.760 | obviously we can multiply a scalar by a scalar we can multiply a scalar by a
00:10:16.480 | list and we can multiply a list by a list and remember just because there's
00:10:30.360 | no space here doesn't mean this is one times two this is this list times this
00:10:37.000 | list so space binds more tightly that makes sense so far yep
00:10:59.960 | okay now monadic times is taking us into complex weld again which is fun
00:11:18.600 | let's see what it says direction so again we look over to the top right get
00:11:38.000 | it says our is the result of doing times on y y is any numeric array okay when an
00:11:46.680 | element of y is real the corresponding element of the result is an integer whose
00:11:51.240 | value indicates whether the value is negative 0 or positive so this is what
00:11:55.120 | we'd normally call the sine function and most languages and often in math it's
00:12:02.400 | called that as well and so just to check here 3.1 is positive so that returns 1
00:12:09.120 | negative 2 is negative so that returns negative 1 and 0 is neither so that
00:12:15.680 | returns 0 okay so those ones okay so this is showing us the sign which they
00:12:23.760 | call direction complex numbers the corresponding element is a number with
00:12:31.720 | the same phase but with magnitude of 1
00:12:40.320 | it's equivalent to this so let's find out what this does
00:12:48.240 | I think that'll give you the absolute value yeah magnitude they call it the
00:13:01.880 | absolute value so direction
00:13:21.080 | is what does that mean for complex they're going to give either I or
00:13:30.320 | negative I I guess we should try it is that just a regular bar
00:13:45.920 | it is okay so it's actually something a bit more interesting I think this is
00:13:56.000 | gonna yeah I mean if you visualize it as a vector right it's just gonna normalize
00:14:01.760 | the vector to magnitude 1
00:14:05.120 | yes that's gonna require some drawing I think I just want to get up the
00:14:14.120 | documentation to see how to describe it magnitude of a complex number okay great
00:14:20.120 | so we're going to do some more complex number stuff which is cool
00:14:36.800 | I have a quick question yeah I think so far the gloves for monadic and dyadic
00:14:46.800 | are the same for all the gloves that we've looked at except for Nick and
00:14:51.200 | minus sign which uses a different one do you know why that is no that they're
00:14:56.760 | always the same always the same yeah I think what you might be getting
00:15:01.120 | confused about is the difference between the thing that lets you specify a
00:15:07.880 | negative number which is that versus the function which takes the negative of an
00:15:17.840 | array which is that oh that's not a function this binds more tightly than a
00:15:26.000 | function this is actually this is more like the dot here is not a function
00:15:31.760 | right it's part of the literal number 2.3 is it the same as the negative is not
00:15:37.880 | part of it's not a function it's part of the number negative 2.3 okay thanks no
00:15:47.120 | worries so if I do this this is not saying apply the negative function to
00:15:53.080 | these four things it's saying this is a list containing this negative number and
00:15:57.720 | this and this and this positive number so if I wanted to negate those four
00:16:05.120 | things I would have to do this yeah so hyphen is a function and this upper bar
00:16:12.000 | thing is just part of a number not a function just like dot is part of a
00:16:19.240 | number just like J is part of a number
00:16:23.560 | Jeremy so this JavaScript keyboard it gives when you hover over a symbol it
00:16:35.960 | gives these key bindings that work with a regular keyboard not a PL keyboard but
00:16:43.360 | it would be preferred to use the APL keyboard right no not at all they're the
00:16:51.200 | same this the difference is an APL keyboard has pictures of those letters
00:16:57.400 | on them but they produce the same things you still have to have the same software
00:17:02.400 | whatever so the only reason to have an APL physical keyboard is so that you can
00:17:07.960 | look at the keyboard and see them you know I got it I was thinking about the
00:17:13.000 | APL keyboard in Windows oh in Windows okay these things the JavaScript applet
00:17:20.600 | thing here it gives you other key bindings that work with the regular
00:17:24.280 | keyboard like you know like XX tab is for multiplication yeah oh okay so don't I
00:17:31.640 | suggest not using those instead use at the very bottom it says back tick -
00:17:37.760 | use that one because those are identical to the Windows keyboard so you just use
00:17:44.040 | back tick followed by the same letter you would use in the Windows keyboard and
00:17:50.320 | so here this one is back tick equals yeah I would ignore those tab ones okay
00:17:58.360 | but this also works with just a regular Windows keyboard should I be using the
00:18:04.000 | APL keyboard like yeah you can use the Windows APL keyboard if you want I so
00:18:11.920 | I'm not using that right now because I am not on Windows but be even on Windows I
00:18:16.320 | actually prefer not to use it because it takes away my control key and I like my
00:18:20.760 | control key yes so the back tick notation the one of them on the bottom
00:18:27.360 | here will be the the preferred one it's what I'm liking so far but obviously I'm
00:18:32.600 | very new to this so I don't take my word for it but yeah I like the back tick
00:18:37.880 | approach because it continues that as well that's because copy and paste and
00:18:43.800 | everything in the usual way yeah okay let's talk about complex numbers some
00:18:53.400 | more shall we so yeah this is one of those things I didn't really get into
00:19:04.360 | much University I mean I wish somebody told me how cool they are okay so the
00:19:21.840 | thing I guess we talked about yesterday is how we can create this like complex
00:19:27.480 | number plane right and so along this axis you've got the real number line and
00:19:38.840 | then along this axis you've got the imaginary number line okay
00:19:58.600 | so you can put numbers there for example here's the number 2 and here's the
00:20:09.880 | number minus 3i but you could also create the number here 2 plus 2i okay so
00:20:24.960 | that's the complex number 2 plus 2i okay there and you can think of that as a
00:20:33.240 | vector right it goes from the origin and it goes up to there there's another way
00:20:39.960 | of thinking of 2 plus 2i and that vector has a length and we can calculate its
00:20:48.200 | length because it is we have here a right angle triangle
00:20:56.880 | oh we have a right angle triangle
00:21:02.480 | and its height is 2 and its base is 2 so it's length here we can get from the
00:21:13.200 | Pythagorean theorem that makes sense so far so that is the magnitude of this
00:21:36.640 | complex number so the magnitude of real numbers is easy right because like what's
00:21:42.520 | the magnitude of this number here well it's how far away is it from the origin
00:21:47.000 | and the answer is 3 you know what's the magnitude of this number here well
00:21:53.800 | that's easy it's 1 right this one's also easy 3i what's its magnitude what's
00:22:01.200 | distance from the origin is also 3 right but yeah the ones where you've got a
00:22:07.440 | mixture of imaginary and real you have to use the Pythagorean theorem to find
00:22:16.280 | out their magnitude a single number which is like how big is it and if we
00:22:26.240 | take a number so this number the number we were dealing with here was 2 plus 2i
00:22:35.440 | which APL writes like this it's the same thing and they have this thing called
00:22:48.280 | direction which is basically saying take a number for example like 3 and 3 the
00:23:02.720 | direction of 3 is plus 1 and the direction of negative 3 is negative 1
00:23:08.520 | and basically what we're doing is we're taking the number 3 and dividing it by
00:23:13.920 | its magnitude
00:23:17.480 | and that's another way of thinking about this sine function okay so like what what
00:23:28.320 | do you do in for a complex number well you take the number and divide it by its
00:23:36.480 | magnitude
00:23:39.040 | to do the same thing and so that's going to give you something that is going to
00:23:44.760 | be you know around about here so it's going to be pointing it's going to be
00:23:57.440 | pointing in the same direction no excuse me it's going to be pointing in the same
00:24:03.040 | direction but it's going to be shorter and specifically we can draw this really
00:24:10.600 | important thing
00:24:13.320 | which is called the unit circle and the unit circle is something that has a
00:24:20.880 | radius of 1 right and it's centered on the origin and so the direction any time
00:24:36.640 | we get the direction of a real we're going to get something that points in
00:24:43.840 | the same direction as the original number but is actually sits on the unit
00:24:49.920 | circle it's like will be one does that make sense so we could try it right so
00:24:59.200 | so what's the square root of 8 so we could do 8 to the power of negative 2
00:25:15.000 | that's not right sorry you need to be one half rather okay and so we thought if
00:25:29.520 | we took 2j2 and divide that by 8 the power half
00:25:49.480 | we get that and if we get the direction times of 2j2 array it's the same so and
00:26:08.720 | rather than writing 8 times 5 what I could have written here is magnitude of
00:26:18.720 | 2j2 because that's what magnitude means okay so
00:26:28.280 | does that make sense what it's doing you'll notice that like although complex
00:26:44.120 | numbers are about this by the square root of minus 1 we don't think about that at
00:26:50.040 | all right when we're doing this complex number stuff we we just treat it as a
00:26:58.320 | pair of numbers which therefore can represent a point in Cartesian space
00:27:03.360 | and therefore that can represent a vector and is that 0.7 radians like what
00:27:10.440 | is that value no this is a this is a complex number 0.7 j 0.7 so it's 0.7 plus
00:27:20.000 | 0.7 i because remember 2 plus 2i is written as 2j2 in in APL so this is 0.7
00:27:30.040 | plus 0.7 i so it's a complex number and so it's this it's this point here it's
00:27:40.400 | the complex number that has the same direction as 2j2 but has a magnitude of
00:27:47.440 | 1 and therefore it sits on the unit circle and like we really like to do
00:27:54.760 | things on the unit circle because on the unit circle if we kind of draw that out
00:28:01.560 | a little bit more if we stick to things that are on the unit circle so here's 1
00:28:14.360 | 1 1 - 1 - 1 so these points are nice because you can pick any one of those
00:28:32.600 | points like here right and if you create that triangle then this hypotenuse here
00:28:42.760 | the length of it is one which is really convenient right because if you're doing
00:28:48.640 | like trigonometry or something right you've got like sine theta circuit OA
00:28:54.640 | equals opposite over hypotenuse well that's always one on the unit circle so
00:29:02.880 | we can we can delete that part entirely
00:29:13.080 | instead we get sine theta equals opposite you know so it's it's it's nice
00:29:21.720 | to deal with stuff it's on the unit circle things become more convenient we
00:29:25.200 | can ignore the whole magnitude slash hypotenuse piece entirely trigonometry
00:29:41.360 | coming back huh probably a lot of us haven't seen it since high school all
00:29:49.280 | right so what do we say about monadic times we haven't introduced magnitude
00:29:54.400 | yet so let's put that away down here for later and for now I guess we'll just say
00:30:08.400 | that the magnitude of 3j4 is equal to I guess we don't have a way of even doing
00:30:35.440 | a square root so we'll just have to kind of do it with prose so the magnitude of
00:30:40.720 | 3j4 is equal to the square root of 3 squared plus 4 squared so that's 9 plus
00:30:47.640 | 16 oh yeah of course 3 4 5 is a Pythagorean triple so it's basically
00:30:55.000 | going to be we're going to be dividing by 5 yeah so so basically three 3j4
00:31:17.880 | means 3 plus 4i which has a magnitude of 25 because
00:31:45.280 | it has a magnitude of 5 because 3 times I guess we should use this 3 times 3
00:32:01.000 | plus 4 times 4 equals 5 times 5
00:32:21.520 | so 0.6 j 0.8 represents a vector in the same direction as as 3j4 3j4
00:32:50.720 | but is a magnitude of 5 since it's
00:33:02.440 | 3j4 divided by 5
00:33:13.720 | okay how's that so that's dyadic times now that does mean that we just use
00:33:23.120 | divide and I don't want to use anything until we've introduced it so probably do
00:33:32.680 | divide first and divide I think is actually a bit of an easier one
00:33:41.760 | okay so divide which is on the equals sign on the APL keyboard
00:33:50.820 | but yeah okay so that's quite divide sign divide sign
00:34:07.680 | the magnetic version called reciprocal reciprocal reciprocal reciprocal today
00:34:17.840 | spell that right no reciprocal recall and the dyadic version is called divided
00:34:26.860 | by divided by okay and I guess what we could do is grab all of those and paste
00:34:44.600 | them in here and I wonder if this works can we go find times and replace with
00:34:52.420 | divide oh lovely there we go okay so divided by is easy does anybody here not
00:35:04.560 | know what reciprocal does
00:35:14.160 | maybe we don't oh we can't do zero okay let's change system and as a side note
00:35:24.740 | I found the reciprocal to be kind of handy when I'm doing any square roots or
00:35:30.680 | cube roots or anything like that because then you can do rather than doing 0.5
00:35:36.760 | power you can do 16 to the reciprocal to the power of three reciprocal reach for
00:35:47.280 | example yes or cube root you could do the cube root of 8 like so yeah exactly I
00:35:56.560 | don't think we need the parentheses because first it does it one at a time
00:36:02.320 | right so it's going to do divide so this is going to be the first thing it does
00:36:05.760 | is divide 3 this is reciprocal of 3 and then it's going to be time power of on
00:36:12.960 | the left will be 8 and on the right will be reciprocal 3 which is cool so it's
00:36:18.800 | like function composition yes it it is which is actually a great time to talk
00:36:26.920 | about the hat because we've now got our four basic operators from math and so we
00:36:41.960 | should now talk about precedence
00:36:48.840 | and I think I want to change my headings a little bit back on a rain
00:37:09.000 | going to create a section called basic math operators
00:37:29.780 | right what have I got here I've got plus sign twice I do something weird I had
00:37:38.800 | it - monadic - plus sign monadic plus
00:37:45.600 | okay this
00:37:54.120 | dyadic plus by attic dyadic times monadic dyadic okay precedence so here
00:38:16.680 | is the formula 3 times 2 plus 1 okay so in regular math we would go 3 times 2
00:38:37.800 | first get 6 and then we'd add 1 and get 7 and there's a couple of reasons we do
00:38:42.480 | that the first is that times is a higher precedence than plus and even if it
00:38:47.440 | wasn't we go left to right so is this 7 no it's not and that's because APL makes
00:38:58.440 | things much simpler for us by having no concept of precedence of different
00:39:04.320 | functions they all have the same precedence and the rule is we always go
00:39:09.120 | right to left not left to right so this is the same as this
00:39:15.160 | and that's good because you wouldn't want to remember precedence rules for
00:39:23.080 | all what are these like 50 or 60 or whatever glyphs right so they all have
00:39:27.640 | the same precedence that doesn't mean all symbols have the same precedence
00:39:34.320 | we've learned of a few symbols that have different precedence so for example
00:39:38.480 | space right 3 plus 4 space 2 space between numbers binds more tightly because
00:39:51.720 | this would be better to explain like this this binds more tightly so this is
00:39:55.480 | the list 3 5 added to 4 or the array 3 5 added to 4 which is the same as that so
00:40:06.160 | when I say we're doing things right to left I'm only talking about functions
00:40:09.480 | right and remember that upper bar thing is not a function right that's part of
00:40:18.860 | the number and this space here is not a function that's part of this array so
00:40:26.040 | functions specifically you can tell something's a function because you look
00:40:31.080 | it up in the help and I'll tell you it's a function okay we can see here it's
00:40:41.280 | listed under the section called primitive functions okay so we can tell
00:40:44.660 | that this is a function because in the functions part of the help most of the
00:40:50.760 | things up here are going to be functions as we'll learn shortly some of them are
00:40:55.560 | operators and the rules are different for operators but most of these of
00:40:59.720 | everything we've seen so far in terms of times divide plus and minus are all
00:41:06.320 | functions so that's the rule we go right to left so in this version here right we
00:41:18.240 | go right to left so okay we've got the number three now we've got three divide
00:41:24.040 | okay well that means the reciprocal of three and then we keep going left we
00:41:29.360 | come across this time this power of and it has a right-hand side and it has a
00:41:35.140 | left-hand side and that's why this is eight to the power of a third so it
00:41:40.440 | makes sense
00:41:42.740 | so we could do that with a list and so remember the symbol space finds the most
00:41:55.800 | tightly so this is the list one two three multiplied by two plus one because we go
00:42:03.560 | right to left so we go one plus two times this list that'll be three times
00:42:10.080 | that list
00:42:12.920 | and we could also do this so this will be this list to this array two four six
00:42:24.760 | plus two they're all that in brackets and then multiplied by the array one two
00:42:31.720 | three so two plus two is four two plus four is six two plus six is eight eight
00:42:39.320 | times three is twenty four six times two is twelve four times one is four that
00:42:49.480 | makes sense yes so I'm not sure if that's related but that function for giving us
00:43:00.520 | the magnitude direction it was I think that would offer an array it still works
00:43:08.960 | on each component it it doesn't normalize the whole array right right
00:43:16.120 | basically pretty much all the functions in their normal forms work element wise
00:43:25.880 | like numpy does including power and reciprocal and magnitude and so forth
00:43:33.760 | it's a good point
00:43:37.200 | uh did you go over the power of symbol I don't know okay I thought we might do
00:44:02.560 | that now I think that kind of counts as a basic math operator kind of
00:44:31.080 | yeah so let's do okay so this is confusing this is shift 8 the normal
00:44:38.120 | multiply sign from Python doesn't mean multiply
00:44:44.080 | it means exponential or power so and it's called star
00:45:28.980 | okay and dyadic
00:45:35.380 | power
00:45:56.400 | so exponential means e to the power of so this is e to the power of 0
00:46:04.400 | is 1 e to the power of 1 is 2.718 and e to the power of 2 apparently is 7.389
00:46:26.240 | does anybody not know what e is or want a refresher what e is a refresher would
00:46:34.720 | be great sure refreshers are always great sure the only reason I can do all
00:46:43.220 | these refreshers off top of my head is because I've done all this stuff with my
00:46:45.920 | you know my daughter and her friend recently so I can I can do math
00:46:50.220 | refreshers like this I'm ready about a month ago I couldn't because I'd
00:46:55.460 | forgotten everything
00:46:58.160 | so a the basic idea is like if you put $100 in the bank
00:47:13.360 | right at a hundred percent interest
00:47:24.120 | then after one year you'll get $200 and specifically that's your original hundred
00:47:35.920 | plus sorry I should say times one plus the interest and a hundred percent is a
00:47:53.320 | hundred over a hundred so it's one but the bank might not give you the whole
00:48:05.160 | you don't might not calculate the whole thing at the end of the year if they
00:48:08.960 | want to be a bit more generous they could calculate it twice they could
00:48:11.520 | calculate it once at six months and and again after another six months so you
00:48:16.040 | take your hundred dollars and after six months they would give you half of your
00:48:24.020 | interest so that's 50% so after six months you would have 150 and then at
00:48:32.680 | another six months they'll give you the other 50% but the other 50% is now
00:48:36.800 | going to be calculated on this right so this is times 1.5 and then again times
00:48:43.480 | 1.5 to 25 which is 100 times 1 plus 0.5
00:49:00.400 | squared if they're really generous they could pay it quarterly and if they paid
00:49:09.520 | it quarterly then the amount of money you're going to make is a hundred times
00:49:13.440 | one plus actually let's do this as a fraction rather than as a decimal a
00:49:17.800 | quarter
00:49:21.280 | therefore or they could pay it daily 100 times 1 plus 1 over 365 to the 365
00:49:43.080 | okay so we should be able to calculate these things in APL right no promises we
00:49:53.600 | could give it a go
00:49:56.180 | now let's do this 100 plus 100 times 1 plus a quarter to the 4 100 times
00:50:10.040 | 1 plus a quarter now a quarter is that it's a reciprocal of 4 1 plus a quarter
00:50:23.960 | okay to the power of is this
00:50:28.920 | and so this is going to happen first because we go right to left
00:50:36.280 | I should say you don't have a hundred dollars in the bank let's say you've got
00:50:43.840 | one dollar in the bank okay so in that case your one dollar would become two
00:50:51.680 | dollars if it was paid just at the end of the year or it become two dollars and
00:50:55.720 | twenty-five cents if it was played every six months or it become two dollars and
00:50:59.560 | forty-four cents if it was paid every quarter or we could do 365 5 it was paid
00:51:12.520 | every day it would be this number and you can see the more often it's paid the
00:51:20.400 | more money you're going to get right but like and this you know initially this
00:51:28.280 | went up pretty quickly but now it's going up pretty slowly so let's say it was
00:51:32.240 | paid hourly that's paid a hundred times per day
00:51:39.040 | and it's not really making much difference at this point a is the limit
00:51:50.720 | of this as this number gets really really really high
00:51:56.840 | so we could write that in math
00:52:10.720 | then we can say e is the limit as whatever X goes to infinity so as X gets
00:52:27.040 | really big that never hits infinity of okay and the one times we can just
00:52:33.400 | ignore right so it's a limit of 1 plus 1 divided by X to the power of X that
00:52:54.240 | makes sense that's a how's that radic I just remembered the definition of limit
00:53:03.720 | well it's something I have not seen in ages yeah I kind of say the kids loved
00:53:09.760 | seeing limit you know and of course they're immediately like well just get
00:53:14.560 | rid of it and put infinity there okay let's put infinity there one plus one
00:53:19.920 | divided by infinity okay kids what's one divided by infinity zero okay what's one
00:53:24.600 | plus zero one what's one to the power of infinity one okay so does he equal one
00:53:30.800 | no say okay well what do we do they're like well what about infinity minus one
00:53:37.960 | that's still infinity so this is our first introduction to limits and they
00:53:44.640 | they were just like they were partly like wow that's so cool and they were
00:53:48.600 | partly like never show me anything like this again this is wrong yeah it
00:53:54.200 | shouldn't happen get it out of my life but this is beautiful because like
00:54:01.840 | they're trying to make it concrete and somehow relates to these ideas that's
00:54:06.720 | amazing and they will understand it at a much deeper level than people you know
00:54:12.200 | just you know going through this reading theorems in in a classroom and yeah that
00:54:18.800 | there's something deeply disturbing about limit yeah and I guess like like the
00:54:23.320 | takeaway is that this is just something that people agree to right this is well
00:54:28.160 | I mean it's a it's it's I think it's more than just something people agree to
00:54:31.800 | like it's it's it's some kind of reality you know like it's it's a true it's a
00:54:38.080 | true thing that there exists independently about discovery of it right
00:54:44.040 | but how do you make the jump from something getting closer to something
00:54:50.720 | being that value that it gets closer to this is a definition this is like yeah
00:55:00.360 | I don't know anyway I mean I think it's really cool yeah all right so that is
00:55:07.560 | that is monadic monadic star and he is named after oiler I think oiler as more
00:55:20.280 | specifically oiler named it after himself famous blind Swiss mathematician
00:55:26.640 | but oiler did not discover a I don't know who did but it won't it wasn't him
00:55:32.920 | even though he got to name it somehow
00:55:38.960 | for those of you that remember calculus you know you can take the derivative of
00:55:47.960 | various functions for example we saw in the fast AI class that the derivative of
00:55:52.600 | x squared is 2x one of the things that's interesting about a is that the
00:55:57.000 | derivative of e to the x is e to the x it has a lot of crazy things going on with
00:56:05.840 | a and comes up a lot the maybe the most cool beautiful formula in the world is
00:56:16.360 | oilers identity which brings together a lot of the things we've seen so far
00:56:26.320 | and it's e to the i pi plus 1 equals 0 put another way e to the i pi equals
00:56:32.800 | negative 1 which is like total madness that this thing which is about circles
00:56:41.400 | and this thing which is about imaginary numbers and this thing which is about
00:56:45.800 | compound interest somehow combined to create negative one
00:56:54.440 | but that's mind blowing and so that's what that's why monadic star is e to the
00:57:00.320 | power of e to the power of is a pretty important thing and so we don't need a
00:57:06.080 | special symbol for a right because anytime you want a you just write this
00:57:12.680 | all right and then okay dyadic star is power of so 49 to the power of a half is
00:57:23.920 | square root of 49 5 to the power of 2 is 5 squared minus 4 square root is 2i
00:57:37.120 | because it's equal to minus 1 times 4 so you get the square root of minus 1 which
00:57:48.760 | is i times the square root of 4 which is 2 2i
00:57:53.760 | all right is that place to see yeah I think this is the first time e to the i
00:58:02.720 | pi has actually made sense to me because I did make the connection that pi is
00:58:08.040 | essentially like I think like a half like a half circle and radians or
00:58:11.840 | something yeah and so I is just that other you know I guess like the y on the
00:58:17.320 | plane yes all you're doing is you're just curving that around to the other
00:58:21.280 | side to turn it to a negative one add one on for that and I got zero yes
00:58:25.600 | exactly and maybe Wayne you can try to find like a really good video or
00:58:31.440 | something that explains that for people that have never seen that before because
00:58:35.480 | I think that'd be a great thing to put in there oh yeah I think there's a
00:58:38.880 | channel three blue one Brown may have some stuff if I see anything I'll put it
00:58:42.520 | up yeah ideally something that doesn't use any concepts that we haven't come
00:58:48.080 | across yet you know mm-hmm I keep my eye open for that yeah I mean the key thing
00:58:54.720 | around complex numbers to me I think is this idea that if you multiply it by
00:59:01.280 | negative one you flip something from one side of the you flip something from one
00:59:08.960 | side of the number line to the other on the real plane ditto if you multiply by
00:59:15.680 | negative one for a complex for a imaginary number it flips it to the
00:59:20.240 | other side of the number line but if you multiply something by I it rotates it by
00:59:27.360 | 90 degrees you go from two to two I to negative two to negative two I back to
00:59:34.400 | and so yeah I think a lot of these ideas end up basically being these kind of
00:59:44.560 | rotations around this number plane yeah you see stuff like that all over in
00:59:51.960 | engineering I think for me when I made the connection that if you look at the
00:59:56.400 | eye as kind of a shorthand for having an array of two numbers like basically
01:00:01.600 | just coordinates on a plane and that's just a way to kind of have that mapping
01:00:06.920 | to your number line all of a sudden everything else starts to fall into place
01:00:10.680 | and then when you're talking about magnitudes and stuff like oh wait I've
01:00:15.440 | seen this before as like you know magnitudes in I mean weird is it like the
01:00:22.080 | L2 norm or something like that it's like even if we're just having like the
01:00:25.080 | magnitude of like absolutely effective is the exact same thing it's likely it is
01:00:29.360 | well I seem put this in the chat what's this about was him can you tell us oh so
01:00:36.720 | it looks like the Jupiter kernel has a way of rendering I'm not to call it like
01:00:41.720 | function composition so if I type this into Jupiter yeah like that mm-hmm and
01:00:50.040 | what am I missing around this all do you mean the the parenthesis execute just
01:00:58.740 | that okay it gives us the expression tree that's beautiful okay we will come
01:01:07.080 | back to learning about that about that later but yeah you can basically put a
01:01:13.320 | bunch of functions in a row and it does interesting things if you get rid of the
01:01:18.680 | parenthesis
01:01:21.260 | they favor goodness me all right thanks gang enjoy the rest of your day thank
01:01:36.760 | you very much everybody thank you thank you bye yeah