[User] Please transcribe this text

[Assistant] Lee reflects on her 1930s childhood from the perspective of the conflict-ridden 1950s. So yes, Lee is nostalgic for the sweetness and light of her youth for summer days playing outdoors.


[User] Please transcribe this text

[Assistant] Thanks, Thought Bubble. So our hero and narrator, Scout, is confused by the hatred and violence she witnesses in her town. At the start of Mockingbird, Jem explains the social order of Make'em. The thing about it is, our kind of folks don't like the Cunninghams, the Cunninghams don't like the Yules, and the Yules hate and despise the colored folks. Scout doesn't like this. She argues that there is just one kind of folks.


[User] Please transcribe this text

[Assistant] Folks. Scout, I don't want to cast dispersions, but that's literally the definition of communism. But class is deeply entrenched in Macon, like when Scout asks her Aunt Alexandra if she can invite a poor classmate named Walter Cunningham home, Alexandra tells her, And when Scout pressures further, Alexandra finally says,


[User] Please transcribe this text

[Assistant] But in the logic of the novel, Alexander's thinking isn't just mean-spirited. It's flat-out dangerous, because Scout and Jem have actually already hosted Walter Cunningham, a fact that saves Atticus from a beating and briefly saves the life of Tom Robinson. Because remember, when a mob converges on the jail to lynch Tom, they find Atticus waiting outside, right?


[User] Please transcribe this text

[Assistant] And I think that gesture represents more than professional pride. It also demonstrates how deeply ingrained ideals of southern femininity are in Calpurnia's life. It's one thing, and certainly this heroism shouldn't be dismissed, to allow a girl to act like a boy at home. But when it comes to her church and her community, Calpurnia ultimately forces Scout to conform to the gender roles that we discussed last week.


[User] Please transcribe this text

[Assistant] How is Scout supposed to make sense of that? Well, for this we turn to Atticus Finch. He's sort of a Gregory Peck- Oh, it's time for the open letter. Oh, look at that. It's the movie tie-in edition of my own book, The Fault in Our Stars. An open letter to movie adaptations. I just want to state for the record that this was Meredith's idea. It's not like I need Crash Course to inform you that the paperback edition of my book is now available for just $12.99. Dear movie adaptations.


[User] Please transcribe this text

[Assistant] So who's the Mockingbird in this novel? Is it the elusive Boo Radley, confined to the nest of his home, but generous in his love for the Finch children? Is it Tom Robinson, whose kindness to Mayella Yule was literally the death of him? Is it the author herself, singing her heart out about the imperfect gardens of her youth? Or is it Scout herself, whose education in empathy is also an education in race, class, and gender oppression? Could also be Katniss Everdeen.


[User] Please transcribe this text

[Assistant] Here's a neural network with two input units that is not counting the bias units and two hidden units in this, this layer and two hidden units in the next layer and then finally one output unit. And again these counts 2, 2, 2 are not counting these bias units on top.


[User] Please transcribe this text

[Assistant] And in particular, I'm going to draw this neural network with the nodes drawn as these very fat ellipses so that I can write text into them. When performing forward propagation, we might have some particular example, say some example, x i comma y i, and it would be this.


[User] Please transcribe this text

[Assistant] Xi, then we feed into the, to the input layer. So this is mainly Xi1 and Xi2 are the values we set the input layer to. And when we forward propagate it to the first hidden layer here, what we do is compute Z21 and Z22.


[User] Please transcribe this text

[Assistant] And, uh, the sigmoid activation function applied to the z value gives us these activation values. So that gives us a21 and a22. And then we forward propagate again to get


[User] Please transcribe this text

[Assistant] You know, here, uh, z3-1, apply the sigmoid of the logistic function, the activation function to that to get a3-1, and similarly, like so. Until we get z4-1.


[User] Please transcribe this text

[Assistant] Let's erase this arrow to give myself some more space. And uhm, if you look at what this computation really is doing, focusing on this hidden unit, let's say, we have that this weight.


[User] Please transcribe this text

[Assistant] Shown in magenta there is my weight theta two one zero. The indexing is not important. And, uh,


[User] Please transcribe this text

[Assistant] This way here, which I guess I'm highlighting in red, that is theta 2, 1, 1,


[User] Please transcribe this text

[Assistant] And this weight here, which I'm drawing in green in the cyan, is theta 2, 1, 2.


[User] Please transcribe this text

[Assistant] This red weight times this value. So that's a theta two one one times a two one. And finally,


[User] Please transcribe this text

[Assistant] This sine wave times this value, which is therefore plus theta 2, 1, 2 times a 2, 1. And so that's forward propagation.


[User] Please transcribe this text

[Assistant] Flowing from the left to the right of this network, the computations instead flow from the right to the left of the network and using a very similar computation as this. And I'll say in two slides exactly what I mean by that.


[User] Please transcribe this text

[Assistant] To better understand what backpropagation is doing, let's look at the cost function. Here's the cost function that we had for when we have only one output unit. If we have more than one output unit, we used to have a summation, you know, over the output units indexed by k there. But if only one output unit, then this is a cost function.


[User] Please transcribe this text

[Assistant] And, uh, we do forward propagation and back propagation on one example at a time. So let's just focus on a single example, xiyi.


[User] Please transcribe this text

[Assistant] And, uh, focus on the case of having one output unit, so y i here is just a real number. And, uh, let's ignore regularization, so lambda equals zero, and this final term, that regularization term goes away.


[User] Please transcribe this text

[Assistant] Associated with the I training example that is the cost associated with training example XIYI.


[User] Please transcribe this text

[Assistant] That's going to be given by this expression that the cost sort of of training example i is written as follows.


[User] Please transcribe this text

[Assistant] And, uh, what this cost function does is it plays a role similar to the squared error. So rather than looking at this complicated expression, if you want, you can think of cost of i being approximately, you know, the squared difference between what the neural network output is versus what is the actual value.


[User] Please transcribe this text

[Assistant] Just as in logistic regression, we actually prefer to use the slightly more complicated cost function using the log. But for the purpose of intuition, feel free to think of the cost function as being the sort of squared error cost function.


[User] Please transcribe this text

[Assistant] And so this cost of i measures how well is the network doing on correctly predicting example i, how close is the output to the actual observed label y i. Now let's look at what backpropagation is doing. One useful intuition is that


[User] Please transcribe this text

[Assistant] So concretely, the cost function is a function of the label y and of the value, this h of x output by our neural network. And if we could go inside the neural network.


[User] Please transcribe this text

[Assistant] Then that will affect these values that the neural network is outputting and so that will end up changing the cost function.


[User] Please transcribe this text

[Assistant] And, uh, again, really, this is only for those who are experts in calculus.


[User] Please transcribe this text

[Assistant] If you're familiar with, if you're comfortable with partial derivatives, what these delta terms are is they turn out to be the partial derivative of the cost function with respect to these intermediate terms that we're computing.


[User] Please transcribe this text

[Assistant] And so their measure of how much would we like to change the neural network's weights in order to affect these intermediate values of the computation.


[User] Please transcribe this text

[Assistant] So as to affect the final output of the neural network H of X and therefore affect the overall cost. In case this lost part of this, uh, partial derivative intuition, in case that didn't make sense, don't worry about it. The rest of this, uh, we can do without, without really talking about partial derivatives. But let's look in more detail about what back propagation is doing.


[User] Please transcribe this text

[Assistant] If we're doing forward propagation and back propagation on this training example i, this is y i minus a


[User] Please transcribe this text

[Assistant] So this is really the error, right? It's the difference between the actual value of y minus what was the value predicted. And so we're gonna compute delta 41 like so. Next we're gonna do delta 41.


[User] Please transcribe this text

[Assistant] Propagate these values backwards, I'll explain this in a second, and end up computing the delta terms of the previous layer. We're going to end up with delta 3 1, delta 3 2.


[User] Please transcribe this text

[Assistant] And then we're going to propagate this further backward and end up computing delta 2, 1 and delta 2, 2. Now the backpropagation calculation


[User] Please transcribe this text

[Assistant] It's a lot like running the forward propagation algorithm, but doing it backwards. So here's what I mean. Let's look at how we end up with this value of delta two two. So we have delta two two. And uhm,


[User] Please transcribe this text

[Assistant] Similar to forward propagation, let me label a couple of the weights. So this weight, which I'm going to draw in cyan, let's say that weight is theta 2 of 1, 2. And this weight down here, let me highlight this in red, that's going to be, let's say, theta 2 of 2, 2. So if we look at how delta 2, 2 is computed, how it's computed for this node,


[User] Please transcribe this text

[Assistant] It turns out that what we're going to do is we're going to take this value and multiply it by this weight and add it to


[User] Please transcribe this text

[Assistant] This, uh, delta two two is going to be equal to.


[User] Please transcribe this text

[Assistant] Theta 2 1 2 is just that magenta weight times delta 3 1 plus, and then the thing I had in bed, that's uh, theta 2 2 2 times delta 3 1.


[User] Please transcribe this text

[Assistant] So it's really literally this red weight times this value plus this magenta weight times this value and that's how we wind up with that value of delta.


[User] Please transcribe this text

[Assistant] And just as another example, let's look at this value. How do we get that value? Well, it's a similar process if this weight


[User] Please transcribe this text

[Assistant] Which I'm gonna highlight in green. This weight is equal to say delta 312.


[User] Please transcribe this text

[Assistant] Then we have that delta 32 is going to be equal to


[User] Please transcribe this text

[Assistant] And by the way, so far I've been writing the delta values only for the hidden units, uh, and not, but not, but excluding the bias units. Depending on how you define the back propagation algorithm, depending on how you implement it, you know, you may end up implementing something to compute delta values for these bias units as well.


[User] Please transcribe this text

[Assistant] I'll try to give a little bit more intuition about what backpropagation is doing, but unfortunately this is a, you know, difficult algorithm to try to visualize and understand what it's really doing. But fortunately, you know, I've been, I guess many people have been using it very successfully for many years, and if you implement the algorithm, you can have a very effective learning algorithm.


[User] Please transcribe this text

[Assistant] Hi, I'm John Green, this is Crash Course Literature, and today we continue our discussion of Chinua Achebe's Things Fall Apart. Mr. Green, Mr. Green, I can't even believe we're spending two weeks on this book, like it's about as long as a babysitter's club.


[User] Please transcribe this text

[Assistant] Because it's a historical novel about the colonization of Africa in the late 19th century, but it was written in the late 1950s, just as European colonial powers were giving up their colonies.


[User] Please transcribe this text

[Assistant] And like the novel, Chinua Achebe lived between these two worlds. So let's start there.


[User] Please transcribe this text

[Assistant] With a human picture that matched the complexity of actual humans. And with Okonkwo's story, Achebe grounds the reader really deeply in the ancient Igbo life and culture before there's even any mention of missionaries. So we get a clear look at the structures and beliefs and traditions that held the community together before Europeans arrived.


[User] Please transcribe this text

[Assistant] Except, of course, it's also not a clear look, because one, we're reading fiction. More importantly, we're reading fiction written a hundred years after European context.


[User] Please transcribe this text

[Assistant] Mr. Brown is willing to listen to the villagers talk about their beliefs and tries to incorporate some of their traditions into the practices of his Christianity. But then, Mr. Brown's successor in Umphia, the Reverend James Smith, quote, saw things as black and white, and black was evil.


[User] Please transcribe this text

[Assistant] He knew that Umofia would not go to war. He knew because they had let the other messengers escape. And then when the British district commissioner arrives to arrest Okonkwo, he finds that Okonkwo has hanged himself.


[User] Please transcribe this text

[Assistant] Crash Course is made by all of these nice people and it exists because of your support at Subbable.com. Subbable is a voluntary subscription platform that allows you to directly support Crash Course so we can make it free for everyone forever. Thank you again for watching and thank you for bearing with me as I deal with this


[User] Please transcribe this text

[Assistant] Endless cold, also the open letter will be back next week when we will be talking about To Kill a Mockingbird. And I promise I will not sound like a bullfrog then. As we say in my hometown, don't forget to be awesome.


[User] Please transcribe this text

[Assistant] Alright, but well, even though it might be a little bit of an uncomfortable, uhm, topic, there is some great language in here, isn't there?


[User] Please transcribe this text

[Assistant] Well we're going to look at two words that will appear in our dialogue and the first one is lingerie.


[User] Please transcribe this text

[Assistant] Pretty sexy. Now the spelling of this word is interesting, isn't it?


[User] Please transcribe this text

[Assistant] That's right. And our second word, awkward.


[User] Please transcribe this text

[Assistant] Alright, so, we're gonna be hearing both of these two words in the dialogue. Now, Marco, where are we here?


[User] Please transcribe this text

[Assistant] Alright, well we're gonna look at words here that mostly have to do with underwear, describing underwear. Right. And the first one is granny panties.


[User] Please transcribe this text

[Assistant] No, it's a slang word, uhm, and we use it to describe really big, ugly underwear like your grandmother would wear.


[User] Please transcribe this text

[Assistant] Well, obviously for women there are more options and more different things you can choose from. So it's a whole separate category for women.


[User] Please transcribe this text

[Assistant] Right, so silky. Obviously we know silk is a soft, shiny fabric, right? So when something is silky, it's either made from silk or it's soft and shiny.


[User] Please transcribe this text

[Assistant] Well the sales girl offers different styles of undies.


[User] Please transcribe this text

[Assistant] I mean I don't know if I would say undies when I'm talking about men's underwear.


[User] Please transcribe this text

[Assistant] Well, I think we've got some examples to show you what that is like.


[User] Please transcribe this text

[Assistant] No, of course not, it's impolite. It's really negative.


[User] Please transcribe this text

[Assistant] Alright, well let's listen to some examples.


[User] Please transcribe this text

[Assistant] Exactly. This is something that you use when the situation is negative.


[User] Please transcribe this text

[Assistant] Yeah, I wanna get this test over with, I wanna get this day over with, I wanna get this...


[User] Please transcribe this text

[Assistant] But you know what, I have seen some men who go shopping with their girlfriends or wives and actually enjoy buying underwear. See, that's the thing.


[User] Please transcribe this text

[Assistant] I think there's a lot to talk about here. So come to our website at EnglishPod.com


[User] Please transcribe this text

[Assistant] Mmm, looks good. I'm positively famished.


[User] Please transcribe this text

[Assistant] Today I'm making a compi salmon. It's the first dish I cooked for my gorgeous girlfriend and she's stuck around so it can't be too bad.


[User] Please transcribe this text

[Assistant] So, uh, hopefully the judges will like it too and know meself an apron.


[User] Please transcribe this text

[Assistant] So I've been driving cranes for about 8 years now. Worked in gold mines, iron ore.


[User] Please transcribe this text

[Assistant] I love the fine dining aspect of things, uhm, looking at, you know, pretty plates of food and trying to replicate those in my own way.


[User] Please transcribe this text

[Assistant] My mates, a lot of them think it's a bit of a laugh, but I'm making that career change from crane driving into fine food.


[User] Please transcribe this text

[Assistant] It's time for me to do something that I enjoy and cooking's what I love. It looks bloody beautiful.


[User] Please transcribe this text

[Assistant] Yep, so a confit salmon, crispy skin, lemon and caper foam.


[User] Please transcribe this text

[Assistant] Butternut pumpkin puree, oyster mushrooms, nasturtium leaves. Little bit of sauce in the onions there. What is that? Ah, it's just a little bit of chicken goodness.


[User] Please transcribe this text

[Assistant] Look, I just love cooking, um, you know, being, working away from home for months at a time and


[User] Please transcribe this text

[Assistant] Hi, welcome. What's your name? My name is Lee. My dish is a stuffed pork fillet and a saffron fondant potato soup.


[User] Please transcribe this text

[Assistant] So this one is a smoked vanilla ice cream, there's a bit of a honeycomb, there's chocolate oil, there is a saffron poached pears.


[User] Please transcribe this text

[Assistant] As you learned last week, marketing analytics can provide a number of benefits to your business.


[User] Please transcribe this text

[Assistant] It can help you plan your marketing efforts, evaluate your effectiveness and optimize your marketing and your purchase funnel. But none of that can be done without data.


[User] Please transcribe this text

[Assistant] Data can come from different sources, can be of varying quality, and can be helpful or unhelpful to you depending on what it is.


[User] Please transcribe this text

[Assistant] But without data and the ability to understand and analyze it, marketing efforts can only go so far.


[User] Please transcribe this text

[Assistant] This week, we will cover what kind of data marketing analytics use and where that data comes from.


[User] Please transcribe this text

[Assistant] Then we'll take a closer look at how digital data is collected. As you know,


[User] Please transcribe this text

[Assistant] All our online interactions generate data, but depending on the device you use to go online, the way data is collected differs. You may have heard of cookies and pixels used to track online behavior, for instance.


[User] Please transcribe this text

[Assistant] It's important to understand the mechanics of how this works, as it will help you understand the nature of the digital data you're working with and the limitations.


[User] Please transcribe this text

[Assistant] In the third lesson this week, we'll walk through an example of how a marketing team collects digital data and uses it for their campaigns.


[User] Please transcribe this text

[Assistant] Let's get started with the first lesson and learn more about the different offline and online data that marketing analysts use.


[User] Please transcribe this text

[Assistant] Hi, I'm John Green, this is Crash Course Literature, and today we're gonna talk about the poetry of Sylvia Plath. Mr. Green, Mr. Green, ugh.


[User] Please transcribe this text

[Assistant] I heard she's like the patron saint of sad teenage girls. Well, me from the past, once again, you're prejudging an author based on what you've heard rather than what you've actually read. I know this because I used to be you, and I am keenly aware of the fact that you have not actually read Sylvia Plath. So let's actually read some poems before trying to convince everyone about how smart we are.


[User] Please transcribe this text

[Assistant] So Sylvia Plath is often described as a feminist poet, writing about the plight of women before women's rights were a mainstream idea. Like essayist Thomas McClanahan wrote, at her brutal best, and Plath is a brutal poet,


[User] Please transcribe this text

[Assistant] She taps a source of power that transforms her poetic voice


[User] Please transcribe this text

[Assistant] The top quite gone, except for a sort of hinge of skin. A flap like a hat. Dead white.


[User] Please transcribe this text

[Assistant] Her father was an entomologist and wrote a book about bees, which would be the subject of many of Plath's later poems. Her mom was a first generation American pursuing a masters in teaching when she met Plath's father. Sylvia published her first poem at the age of eight.


[User] Please transcribe this text

[Assistant] The internship was the inspiration for her wonderful novel, The Bell Jar. She said she looked back at the experience as though looking through a bell jar.


[User] Please transcribe this text

[Assistant] In real life, Plath's first suicide attempt was in 1953. She crawled underneath her house and took her mother's sleeping pills.


[User] Please transcribe this text

[Assistant] And said later that she was blissfully succumbed to the whirling blackness that I honestly believed was eternal oblivion. But she survived and graduated from Smith and then went on to win a Fulbright scholarship to study at the University of Cambridge where she met Ted Hughes, a poet whose work she admired. They married a few months later and found a mutual interest in astrology and the supernatural and a mutual admiration for each other's work.


[User] Please transcribe this text

[Assistant] In 1962, Plath discovered that Hughes was having an affair, and they separated.


[User] Please transcribe this text

[Assistant] Later that year, she experienced a creative burst and wrote a book's worth of poems. And then, in February of 1963, she took her own life. She was only 30. Thanks, Thought Bubble. Oh, must be time for the open letter.


[User] Please transcribe this text

[Assistant] Abe Lincoln? Alright, an open letter to suicide. Dear suicide, you are a permanent response to a temporary problem and you are a solution to nothing. I just want to say that at the outset there is nothing good or romantic about you, suicide. You are a tragedy. You are also, in almost all cases, preventable. Abe Lincoln had periods of intense


[User] Please transcribe this text

[Assistant] And he became the best president of the United States.


[User] Please transcribe this text

[Assistant] John Green. Okay, so Sylvia Plath became the first person to posthumously win a Pulitzer Prize for poetry for her book The Collected Poems, published in 1981. But she's best known for Ariel, a collection of poems written in something of a poetic frenzy in the months before she died and published in 1965.


[User] Please transcribe this text

[Assistant] Everything we customarily think of as feminine is turned on its head. The voice is now coolly amused, witty, now sour, now fanciful, girlish, charming, now sinking to the strident rasp of the vampire. So here are a couple excerpts from one of Plath's most famous poems, Lady Lazarus. You can hear me read the whole thing here. Dying is an art, like everything else. I do it exceptionally well.


[User] Please transcribe this text

[Assistant] I do it so it feels like hell. I do it so it feels real. I guess you could say I have a call.


[User] Please transcribe this text

[Assistant] It's easy enough to do it in a cell. It's easy enough to do it and stay put. It's the theatrical comeback in broad day to the same place, the same face, the same brute, amused shout. A miracle.


[User] Please transcribe this text

[Assistant] Out of the ash, I rise with my red hair and I eat men.


[User] Please transcribe this text

[Assistant] The poem is brutal and angry and morbid it involves a lot of


[User] Please transcribe this text

[Assistant] Now, like when proper poets read from their poetry, they read it all so slowly that they can afford to take a full breath at the end of each line. But you should treat a line break as some kind of punctuation.


[User] Please transcribe this text

[Assistant] Maybe it reads as a comma. Maybe it just means that there's a stronger emphasis on the word before or after the line break. One of the pleasures of reading poetry for me is that I kind of get to be the co-creator of the poem by making choices about how to read it. Sylvia Plath wrote in her journal once that she felt as though she lived in two extremes.


[User] Please transcribe this text

[Assistant] Joyous positive and despairing negative. And we see both in her poems. Like in Letter in November, she gives us a glimpse of the joyous positive.


[User] Please transcribe this text

[Assistant] So Sylvia Plath was influenced by writers like James Joyce, Virginia Woolf, D.H. Lawrence, but also by Emily Dickinson. And if you watched our episode on Dickinson last year, you'll see that influence.


[User] Please transcribe this text

[Assistant] They both share a preoccupation with death, but they also both write from the perspective of women who find themselves trapped by lack of opportunity. So along with poets like Robert Lowell and Anne Sexton, Plath is often seen as a member of the confessional school of poetry. This so-called poetry of the eye dealt directly with trauma and with relationships, and these poems were often autobiographical. But vitally, they weren't just recording their emotions on paper and then inserting line breaks and rhymes.


[User] Please transcribe this text

[Assistant] It is winter here. Look how white everything is. How quiet. How snowed in. I am learning peacefulness. Lying by myself quietly as the light lies on these white walls. This bed. These hands. I am nobody. I have nothing to do with explosions.


[User] Please transcribe this text

[Assistant] It has to take everything in. For me, this idea of two white lids that will not shut is central to my understanding of humanity and our ineradicable hope.


[User] Please transcribe this text

[Assistant] This poem for me at least captures the difficulty of being a person, but also what's rewarding about being a person. I think Sylvia Plath often gets a bad rap precisely because her poetry resonates with teenagers, and I think it's a little bit unfair. Yes, there are times when she romanticizes death and self-injury, and I don't like it when she does that. But there's astonishing emotional authenticity in her poems, and she manages it without irony.


[User] Please transcribe this text

[Assistant] Her focused observation of the world around her, the pupil that has to take everything in, that was a great gift to us because by keeping her eyes open as long as she did, she helped us to keep ours open. Thanks for watching, I'll see you next week.


[User] Please transcribe this text

[Assistant] Whack pork belly into a hot pan and caramelise some of the skin. Add a bit of bourbon, some lemon juice.


[User] Please transcribe this text

[Assistant] I think with my dish I can really make the lemon the hero.


[User] Please transcribe this text

[Assistant] It sure is. The water looks so nice. Anchor the boat for a little while. I'm gonna take a dip.


[User] Please transcribe this text

[Assistant] It sure is. The water looks so nice. Anchor the boat for a little while. I'm going to take a dip.


[User] Please transcribe this text

[Assistant] It sure is. The water looks so nice. Anchor the boat for a little while. I'm gonna take a dip.


[User] Please transcribe this text

[Assistant] So how does this help us figure out what are potentially fruitful or potentially not fruitful things to try to do to improve the performance of our learning algorithm?


[User] Please transcribe this text

[Assistant] And in other words, if you figure out by looking at learning curves or something else that you instead have a high bias problem,


[User] Please transcribe this text

[Assistant] Then for goodness sakes, don't waste your time trying to carefully select out a smaller set of features to use because if you have a high bias problem, using fewer features is not going to help. Whereas in contrast, if you look at the learning curves or something else and figure out that you have a high variance problem, then indeed,


[User] Please transcribe this text

[Assistant] Trying to select out a smaller set of features that might indeed be a very good use of your time. How about trying to get additional features? So adding features usually, not always, but usually we think of this as a solution for fixing


[User] Please transcribe this text

[Assistant] Adding polynomial features, this is another way of adding features, and so that's another way to try to fix a high bias problem. And, uh, if concretely, if your learning curves show you that you instead have a high variance problem, then, you know, again, this is maybe a less good use of your time.


[User] Please transcribe this text

[Assistant] And finally, decreasing and increasing longer. These are quick and easy to try, because these are less likely to be a waste of, you know, many months of your life.


[User] Please transcribe this text

[Assistant] Uhm, in case this isn't clear to you, you know, do encourage you to pause the video and think through this. That, uh, convince yourself that decreasing longer helps fix high bias, whereas increasing longer fixes high variance. And, uhm,


[User] Please transcribe this text

[Assistant] So a network like this might have relatively few parameters and be more prone to underfitting.


[User] Please transcribe this text

[Assistant] An alternative would be to fit a maybe relatively large neural network with either more hidden units, so if that's a lot of hidden units in one layer, or with more hidden layers.


[User] Please transcribe this text

[Assistant] The main potential problem of these much larger neural networks is that they could be more prone to overfitting. And uhm, it turns out that if you're applying a neural network,


[User] Please transcribe this text

[Assistant] Very often, using a larger neural network often is actually the larger the better. But if it's overfitting, you can then use regularization to address overfitting.


[User] Please transcribe this text

[Assistant] And uhm, usually using a larger neural network by using regularization to address overfitting, that's often more effective than using a smaller neural network. And the main possible disadvantage is that it can be more computationally expensive.


[User] Please transcribe this text

[Assistant] And finally, one of the other decisions is say the number of hidden layers you want to have, right? So do you want one hidden layer, or do you want three hidden layers as I've shown here, or do you want two hidden layers?


[User] Please transcribe this text

[Assistant] And try training neural networks with one hidden layer, with two hidden layers, with three hidden layers, and see which of those neural networks performs best on the cross validation sets. You take your three neural networks with one, two, and three hidden layers.


[User] Please transcribe this text

[Assistant] Example two. Put some ice on your foot and the swelling will go down.


[User] Please transcribe this text

[Assistant] Now the basic corporate charter emphasizes that all common shareholders are treated equally.


[User] Please transcribe this text

[Assistant] Uh, they don't have to pay out dividends to them. But if they do pay out dividends, it has to be every share gets the same. Uh, and that's where the word equity comes in. It's equality of shareholders.


[User] Please transcribe this text

[Assistant] Does not have to pay dividends. The board decide, doesn't ever have to pay dividends. But you, you trust that the board will pay dividends because, uh, the other shareholders want the money. They can't get at it without paying you too.


[User] Please transcribe this text

[Assistant] The firm can also repurchase shares instead of paying a dividend. No law is saying that they have to, uh, they can both issue new shares and they can repurchase shares. The board decides.


[User] Please transcribe this text

[Assistant] There's also other kinds of corporate liabilities. Warrants, which are a form of option. Convertible debt.


[User] Please transcribe this text

[Assistant] The thing that ties it down is that all shareholders have one vote. And they elect the board.


[User] Please transcribe this text

[Assistant] Now, there are critics of shareholder democracy. Notably, Burleigh and Means wrote a book in 1933 that was very influential, arguing that


[User] Please transcribe this text

[Assistant] Well, you've described a system of corporate governance that sounds plausible and probably does work for little companies, but it might not work for big companies.


[User] Please transcribe this text

[Assistant] Well I know, when I set up my own little company, Case Schiller Weiss, there were three of us and we got some more, where we had one more major shareholder. We got together and it was very clear


[User] Please transcribe this text

[Assistant] We voted and things happened because we were involved. Uh, so the democracy, it just seemed perfectly natural, uh, and functional.


[User] Please transcribe this text

[Assistant] But Burley and Means thought that it doesn't work so well for big companies. The same reason maybe why voting for


[User] Please transcribe this text

[Assistant] When there are millions of people voting, it doesn't work so well. So, I don't know what you think. Do you vote?


[User] Please transcribe this text

[Assistant] I mean, as you go to the voting booth in an election, does it ever occur to you that my vote doesn't matter unless the rest of the people are equally tied, right? If exactly half vote for one candidate and exactly half vote for the other candidate, then it's tied and my vote would decide. Okay? Otherwise, my vote doesn't do anything.


[User] Please transcribe this text

[Assistant] Uh, so what's the probability that my vote is the deciding vote? Well if there's millions of people,


[User] Please transcribe this text

[Assistant] The probability must be, you know, miniscule.


[User] Please transcribe this text

[Assistant] So if you're really rational, you, you wouldn't vote.


[User] Please transcribe this text

[Assistant] Uh, but people still vote in elections, and this must be out of some sort of patriotic feeling or sense of, uh, sense of obligation.


[User] Please transcribe this text

[Assistant] But when it comes to corporations, those senses aren't so, you don't feel patriotic for a corporation. And a corporation has an election, why do I even bother? We're holding diversified portfolios, aren't we?


[User] Please transcribe this text

[Assistant] So I've got a hundred different stocks. I can't keep up with how they're all being managed. I would go to an election and vote my share. I'm only a tiny, tiny fraction. So why should I do that?


[User] Please transcribe this text

[Assistant] So Burley and Means said that while in practice we have shareholder democracy, in practice, uh, the, uh,


[User] Please transcribe this text

[Assistant] The democracy is, uh, imperfect. It's really self-perpetuating boards of directors. Uh, so, that led, their book was extremely important historically. Uh, and what it led to is new regulation.


[User] Please transcribe this text

[Assistant] I tried to allow for takeovers of companies.


[User] Please transcribe this text

[Assistant] What Burley and Means said is a lot of companies were ill-managed and managed for the interests of the board of directors because they just owned, effectively owned the corporate, they can't pay themselves big amounts of money. They can put fairly generous salaries. They can hire their friends and give them nice jobs.


[User] Please transcribe this text

[Assistant] They're sort of ripping off the company. The shareholders, some of them might hear about this and get upset, but it's hopeless. You can't influence the votes of so many people.


[User] Please transcribe this text

[Assistant] Under authority of its, of the act that had just created it in 1934 established rules for proxy contests so that people who wanted to change the governance of the company could reach the shareholders


[User] Please transcribe this text

[Assistant] And ask them to sign a contract to let you vote on my behalf. You would give them the right


[User] Please transcribe this text

[Assistant] To be a proxy for you at the shareholders meeting.


[User] Please transcribe this text

[Assistant] Uh, companies didn't want to help, uh, outsiders reach their shareholders. They wouldn't publish the list of shareholders. So there was no way that a proxy contest could have been


[User] Please transcribe this text

[Assistant] The Roosevelt, uh, New Deal was that it wasn't socialist. It was maybe motivated by social harmony.


[User] Please transcribe this text

[Assistant] And concern about poor people, but it left intact the corporation.


[User] Please transcribe this text

[Assistant] So, this doesn't sound like Franklin Delano Roosevelt at all, but it is. It's trying to make, uh, trying to make democracy work. And they wanted shareholder democracy to work. So that there have to be election contests in corporations like we see in politics.


[User] Please transcribe this text

[Assistant] Now, some companies have classes of shares, uh, as permitted by state law. So, uh, you can have both voting and non-voting shares.


[User] Please transcribe this text

[Assistant] Berkshire Hathaway, which is the company of Warren Buffett, who, uh, uh, has both Class A shares that have voting rights.


[User] Please transcribe this text

[Assistant] And Class B shares do not. I don't know if that, I have to update this, what the Class A shares sell for now. It was recently $200,000 a share.


[User] Please transcribe this text

[Assistant] The New York Times has both Class A shares than Class B. Uh, uh, Class A has less voting rights than Class B.


[User] Please transcribe this text

[Assistant] Uh, which allows the descendant of the original Adolf Ochs family still to control the company. Why do they do that? Well, they think that the New York Times serves a higher purpose. That is,


[User] Please transcribe this text

[Assistant] They gave the original New York Times family more voting rights than the other shareholders. This has been under criticism recently, uh, but still, still is maintained.


[User] Please transcribe this text

[Assistant] Uh, Facebook, Mark Zuckerberg, uh, recently, I don't know what the percent is right now, but, uh, had 28% of its shares, but 57% of its voting shares. Which means, basically, Mark does whatever he wants. Uh, he has a majority of votes in the, uh,


[User] Please transcribe this text

[Assistant] Let's now take functions even one step further and calling one function from inside another function. And this is something that we do all the time in JavaScript. But I have seen many beginners struggle to understand this logic. And so I created a specific video just for this topic.


[User] Please transcribe this text

[Assistant] And to illustrate functions calling other functions, let's go back to our initial example of a function being like a foot processor. So let's move to the first functions lecture, which is this one, and simply copy this function.


[User] Please transcribe this text

[Assistant] So remember that we had this function, which was like a fruit processor, which received a certain number of apples and a certain number of oranges. And then based on that, it basically produced and returned a juice, uh, to us.


[User] Please transcribe this text

[Assistant] But now in this example, let's consider that the fruit processor can only make juice with smaller fruit pieces. And so before making the juice, the food processor now needs another machine that first cuts the fruits that we give it into multiple smaller pieces.


[User] Please transcribe this text

[Assistant] So I hope that's not an example too silly, but I think it makes sense actually to understand the point that I'm trying to make. So let's actually start by writing that machine. So basically that function that cuts a fruit into multiple pieces. So let's say function cut fruit


[User] Please transcribe this text

[Assistant] Pieces, and then this function will receive a fruit.


[User] Please transcribe this text

[Assistant] We received the apples and oranges, and then we're gonna use our newly created machine to cut the received apples and oranges into pieces. And so, let's do that.


[User] Please transcribe this text

[Assistant] Then this will call the fruit processor function, which then in turn will call the cut fruit pieces function. And actually twice. So once here and once here. And so let's now actually analyze how the data flows between these functions.


[User] Please transcribe this text

[Assistant] So down here we are calling the fruit processor function with the arguments to and.


[User] Please transcribe this text

[Assistant] And as we already know, this will then replace the apples parameter in the function with the number 2 and the oranges parameter in the function with the number 3. So that should be nothing new at this point, right? We are simply replacing the parameter placeholders with the actual values 2 and 3.


[User] Please transcribe this text

[Assistant] And now let's analyze what's going to happen with these apple value. So apple right now holds the number two and that value two will then be used to call the cutPieces function, right?


[User] Please transcribe this text

[Assistant] Now as we call cutPieces, this too is actually the argument for the cutPieces function.


[User] Please transcribe this text

[Assistant] And it will basically replace the fruit parameter. So the fruit placeholder. Okay. So now fruit here in this cutPieces function is also two. And I hope that these arrows here make the data flow quite obvious.


[User] Please transcribe this text

[Assistant] Then inside this function, of course, the fruit is then also 2, which will get multiplied by 4. And so the result here is going to be 8.


[User] Please transcribe this text

[Assistant] And so the result of calling this cutPieces function with apples will be 8.


[User] Please transcribe this text

[Assistant] And so that's the value that we then store into the apple pieces variable. And from there, we will then build this juice string, uh, that we have down here. Okay.


[User] Please transcribe this text

[Assistant] So take a moment and analyze exactly how the data flows from one function to another.


[User] Please transcribe this text

[Assistant] Because I know that it can be a little bit confusing, especially calling the cutPieces function here, without a tangible number.


[User] Please transcribe this text

[Assistant] So we're calling cutPieces here not with an actual number that we wrote ourselves, like 2 or 3, but really with the argument that we received into FruitProcessor. So that can be a little bit confusing, so take a second to understand exactly what happens here.


[User] Please transcribe this text

[Assistant] And what happened here with the apples variable will of course happen exactly the same with oranges. And so I'm not going to go into that part here because that would be too confusing having all these arrows here on the slide.


[User] Please transcribe this text

[Assistant] But of course you can analyze that for yourself and see exactly what is going to happen. But now let's move back to the code to see how this actually works out in practice.


[User] Please transcribe this text

[Assistant] And so now we need to change this juice string here. So in the function that we just saw, it was already complete, but let's now write it out ourselves. So here we used to have apples, but now we want to use the applePieces value. So applePieces


[User] Please transcribe this text

[Assistant] Okay, so here we call the fruit processor function then just as I explained in the slide. And then let's simply log the result to the console. There is no need in this case to store it into a variable.


[User] Please transcribe this text

[Assistant] Okay. And so again, this works because the results of calling this function will become this string here that we return from the function.


[User] Please transcribe this text

[Assistant] And so then console.log works with that string. So let's try that.


[User] Please transcribe this text

[Assistant] And indeed, we get a juice with eight pieces, which is four times two here.


[User] Please transcribe this text

[Assistant] And then, uh, 12 pieces of orange, which is 3 times 4.


[User] Please transcribe this text

[Assistant] And so that works just as expected. Great. So I think that was a really great example to illustrate this mechanics of one function calling the other.


[User] Please transcribe this text

[Assistant] But now again, you might ask the following question. Why not simply multiply both of the input values by 4 and call it a day? So we could do that of course. We can say applePieces equals apples times 4 and orangePieces here is oranges times 4 as well.


[User] Please transcribe this text

[Assistant] But we did it this way for, well, multiple reasons.


[User] Please transcribe this text

[Assistant] First, the point that I'm making here is that it's very common for one function to call another function. So just like we did here.


[User] Please transcribe this text

[Assistant] Then second, this is also a very good example to illustrate the don't repeat yourself principle that I mentioned earlier. So the dry principle. For example, imagine that suddenly the cutting machine would cut in three pieces and not in four pieces.


[User] Please transcribe this text

[Assistant] Then, if we didn't have the separateCutFruitPieces function, we would have to change the code in multiple places.


[User] Please transcribe this text

[Assistant] And this is not a problem, of course, with two lines of code. But if we needed to cut like 10 fruits into pieces, then we would have to change that in all the places. And that would simply be annoying. And it could also be a source of bugs. So of coding mistakes.


[User] Please transcribe this text

[Assistant] And so it's a lot better to put that functionality into its own function. So if the fruit was now only cut in three pieces, all we have to do is to change it here, and that's it.


[User] Please transcribe this text

[Assistant] Then this changes to 6, which is 2 times 3, and this changes to 9, which is 3 times


[User] Please transcribe this text

[Assistant] Okay, so I hope that made sense to you and that you can start internalizing this kind of logic. With time and practice, you will exactly know when you should create your own functions and when to have multiple functions, uh, one calling another.


[User] Please transcribe this text

[Assistant] Great. Once more, congratulations for all the progress that you're making here.


[User] Please transcribe this text

[Assistant] Working through these lectures about functions can be a lot of work, I know, and it can be sometimes a little bit confusing.


[User] Please transcribe this text

[Assistant] So you're making great progress and it's great to see that you're already at this point of the course.


[User] Please transcribe this text

[Assistant] So again, functions is a very important topic, and so in the next video we're gonna take a couple of minutes to review the fundamental principles about functions that we just learned here. So stay tuned for that one, and I see you in a minute.


[User] Please transcribe this text

[Assistant] Good luck everybody. Your time starts now.


[User] Please transcribe this text

[Assistant] I love that you can't see the lemon medal, but it just sort of sings lightly in the background of it all. It's really beautiful. Thank you.


[User] Please transcribe this text

[Assistant] I was actually blown away. I remember how we all cooked the first day and how we felt about how we cooked and yeah, there's some really brave and clever cooking going on out there and I'm really excited for you.


[User] Please transcribe this text

[Assistant] Yeah, pretty nervous to be honest. I feel like I have a little bit of blurred vision, but I just need to concentrate a bit and get a dish in my head. Time is ticking. I'm just gonna have to come up with some bits and pieces as I go and really hope that it comes together at the end.


[User] Please transcribe this text

[Assistant] A goat's cheese and macadamia nut ravioli and a grape and bacon sauce.


[User] Please transcribe this text

[Assistant] The discovery of the structure of DNA was one of the most important scientific achievements in the last century, in human history in fact. The now famous double helix is almost synonymous with Watson and Crick, two of the scientists who won the Nobel Prize for figuring it out.


[User] Please transcribe this text

[Assistant] But there's another name you may know, too. Rosalind Franklin. You may have heard that her data supported Watson and Crick's brilliant idea.


[User] Please transcribe this text

[Assistant] Or that she was a plain-dressing, belligerent scientist, which is how Watson actually described her in The Double Helix.


[User] Please transcribe this text

[Assistant] But thanks to Franklin's biographers, who investigated her life and interviewed many people close to her, we now know that that account is far from true, and her scientific contributions have been vastly underplayed. Let's hear the real story.


[User] Please transcribe this text

[Assistant] Rosalind Elsie Franklin was born in London in 1920. She wanted to be a scientist ever since she was a teenager, which wasn't a common or easy career path for girls at that time.


[User] Please transcribe this text

[Assistant] But she excelled at science anyway. She won a scholarship to Cambridge to study chemistry, where she earned her PhD.


[User] Please transcribe this text

[Assistant] And she later conducted research on the structure of coal that led to better gas masks for the British during World War II.


[User] Please transcribe this text

[Assistant] In 1951, she joined King's College to use X-ray techniques to study the structure of DNA, then one of the hottest topics in science. Franklin upgraded the X-ray lab and got to work, shining high-energy X-rays on tiny, wet crystals of DNA.


[User] Please transcribe this text

[Assistant] But the academic culture at the time wasn't very friendly to women, and Franklin was isolated from her colleagues.


[User] Please transcribe this text

[Assistant] She clashed with Maurice Wilkins, a lab mate who assumed Franklin had been hired as his assistant. But Franklin kept working. And in 1952, she obtained Photo 51, the most famous x-ray image of DNA.


[User] Please transcribe this text

[Assistant] Just getting the image took 100 hours. The calculations necessary to analyze it would take a year. Meanwhile, the American biologist James Watson and the British physicist Francis Crick were also working on finding DNA's structure. Without Franklin's knowledge, Wilkins took photo 51 and showed it to Watson and Crick.


[User] Please transcribe this text

[Assistant] Instead of calculating the exact position of every atom, they did a quick analysis of Franklin's data and used that to build a few potential structures. Eventually, they arrived at the right one. DNA is made of two helicoidal strands, one opposite the other, with bases at the center like rungs of a ladder.


[User] Please transcribe this text

[Assistant] Watson and Crick published their model in April 1953. Meanwhile, Franklin had finished her calculations, come to the same conclusion, and submitted her own manuscript.


[User] Please transcribe this text

[Assistant] The journal published the manuscripts together, but put Franklin's last, making it look like her experiments just confirmed Watson and Crick's breakthrough, instead of inspiring it.


[User] Please transcribe this text

[Assistant] But Franklin had already stopped working on DNA and died of cancer in 1958, never knowing that Watson and Crick had seen her photographs.


[User] Please transcribe this text

[Assistant] It's often said that Franklin would have been recognized by a Nobel Prize if only they could be awarded posthumously.


[User] Please transcribe this text

[Assistant] And in fact, it's possible she could have won twice. Her work on the structure of viruses led to a Nobel for a colleague in 1982.


[User] Please transcribe this text

[Assistant] It's time to tell the story of a brave woman who fought sexism in science and whose work revolutionized medicine, biology, and agriculture. It's time to honor Rosalind L.C. Franklin, the unsung mother of the double helix.


[User] Please transcribe this text

[Assistant] Okay, that's not a dish, that's just a thrown together combination of dry ingredients.


[User] Please transcribe this text

[Assistant] Yesterday we locked up all that specialist cooking equipment, all the stuff that the modern cook uses. There it is over there. And you know what? It's gonna stay there all week.


[User] Please transcribe this text

[Assistant] Because this is home cooking week. Everything that you're gonna cook this week, you can cook in your kitchen at home. And today's pressure test is no exception. But don't think


[User] Please transcribe this text

[Assistant] Just because there's no liquid nitrogen, or no water baths, it's gonna be easy.


[User] Please transcribe this text

[Assistant] Right. Boys, today, nothing in this dish is gonna be a surprise. Trust me. And simply, it's roast chicken, peas, and potatoes.


[User] Please transcribe this text

[Assistant] This is what we're gonna do to break this chicken down. And you've gotta, you've gotta pay attention. Right? Wings off.


[User] Please transcribe this text

[Assistant] Try and control the temperature of the pan. When you get good colour on one side, put the breast against the edge of the pan again on the other side.


[User] Please transcribe this text

[Assistant] Come on Pete, keep up. Put your vegetables in. Alright? So your vegetables should be going in now.


[User] Please transcribe this text

[Assistant] And about 150 of white wine. Skibble taste.


[User] Please transcribe this text

[Assistant] Yep. Yes, Gary. Now, you need to go back to your pea mixture, which is going to be a custard.


[User] Please transcribe this text

[Assistant] And you're gonna just gently push that through.


[User] Please transcribe this text

[Assistant] So pour in your custard. Right, and you should have just enough.


[User] Please transcribe this text

[Assistant] In fact, I would prefer it if they're a little elliptical. Alright, so you get a nice, turned potato.


[User] Please transcribe this text

[Assistant] Now I wanna make sure that they are all absolutely spot on. I'm gonna play a little gag on you, right?


[User] Please transcribe this text

[Assistant] And we're gonna put butter into the pan. How many potato?


[User] Please transcribe this text

[Assistant] Now this is the home stretch, okay? Beef puree hot, peas getting hot, fondant's looking gorgeous, sauce the correct consistency, chicken golden brown, and the custards are cooked. Not much, is there?


[User] Please transcribe this text

[Assistant] Two beautiful pieces out of it.


[User] Please transcribe this text

[Assistant] Yeah, I got, I got two big errors, which is that my fondant's crunchy, you know, so, soft outside, then I'm crunching through that, the centre of the potato, and undercooked potato's not very nice at all, so that's a, that's a real shame. And he split the custard


[User] Please transcribe this text

[Assistant] of sophistication but enough to challenge you guys enough for you to rethink if you survive today how you apply yourselves in this competition because when you get it right


[User] Please transcribe this text

[Assistant] You'll try to keep up, and you're all engaged in what you were doing. You were tasting, moving things around, you were touching, and that's what cooking's all about.


[User] Please transcribe this text

[Assistant] But, regardless of what you learnt, whether or not you enjoyed cooking along with me, at the end of the day, someone is going home.


[User] Please transcribe this text

[Assistant] Great stuff too. Well, I think it was fantastic. There's no doubt that the thing we love to see is...


[User] Please transcribe this text

[Assistant] For me, that, that custard is fantastic. It's beautifully set. It's got a lovely airy lightness. Uhm, it's a really good dish of food.


[User] Please transcribe this text

[Assistant] My fondant is beautifully cooked. It's just right.


[User] Please transcribe this text

[Assistant] That was a rollercoaster ride for you. Tell us how you thought it went.


[User] Please transcribe this text

[Assistant] These done so much right. The fondant. Cooked through? Yea.


[User] Please transcribe this text

[Assistant] Uh, pea puree is great, the color of the skin is great. The chicken in places is absolutely perfect. It's just that point of being cooked.


[User] Please transcribe this text

[Assistant] You can see it on this one bit of chicken we've got left, maybe, maybe clearer, but it's just here. You can just see it there. If you'd flipped it over the pan, let the pan heat.


[User] Please transcribe this text

[Assistant] Lee, it's only been a short time that you've been with us, but I think we've come to learn.


[User] Please transcribe this text

[Assistant] Having no family here, uhm, definitely makes me miss them more.


[User] Please transcribe this text

[Assistant] To finish this part about functions, let's review everything important that we learned so far in order to make sure that you really understand functions before we move on to other topics.


[User] Please transcribe this text

[Assistant] And let's start by bringing back and rewriting the function that we wrote before, which is the years until retirement function.


[User] Please transcribe this text

[Assistant] So I think that was, yeah, it was here in the lecture about arrow functions. So let's copy this one and paste it here.


[User] Please transcribe this text

[Assistant] And the first thing that we're gonna do is to actually convert it to a more normal function expression. So, how do we do that? Well, in this case, we simply get rid of the arrow here,


[User] Please transcribe this text

[Assistant] And then, uh, write the function keyword here. And so now this is just a regular function expression like we learned before.


[User] Please transcribe this text

[Assistant] Next up, we could export this functionality here into another function, so like a callh function that we've been using before. So let's do that, because then we can do what we did in the last lecture, which was to call one function inside of the other function.


[User] Please transcribe this text

[Assistant] A function and then the birth year again.


[User] Please transcribe this text

[Assistant] Now, you might find it confusing that we have two different functions here with the same parameter names.


[User] Please transcribe this text

[Assistant] So this one has birth year, and this one has two. But that's not a problem at all. So this birth year in this function is not at all related to this birth year in this function. They are two completely different parameters, so basically two different variables.


[User] Please transcribe this text

[Assistant] We could even have a variable outside of any of the functions, which could also be called birth year.


[User] Please transcribe this text

[Assistant] Okay. And we could do that now, but I don't want to confuse you even further. Okay. But what matters here is that this parameter is really like a local variable to each function.


[User] Please transcribe this text

[Assistant] Anyway, let's now go ahead and delete this here and instead, uh, calculate the age based on the function that we just wrote.


[User] Please transcribe this text

[Assistant] And actually we just delete this part here. And so now the age will come from the function cogH. And what we pass in here is the birth year.


[User] Please transcribe this text

[Assistant] So again, it's confusing now with these, uh, same parameter names here, but, uh, let's quickly call this function just so I can quickly show you the data flow.


[User] Please transcribe this text

[Assistant] Jonas. So, 1991 will be the birth year here in this function. Then, as a first step, this years until retirement function calls cork age. And it calls cork age with the argument of 1991. So this one here. And so then, birth year in this function also becomes 1991.


[User] Please transcribe this text

[Assistant] And so then here the operation will be 2037 minus 1991. And if you find it less confusing, we could change this year to something else. Let's just say year and it would work the exact same way. Okay. So again, these variable names in these two different functions.


[User] Please transcribe this text

[Assistant] They do not have anything to do with one another. Alright? But let's actually put it back here, because it's good to keep this in mind.


[User] Please transcribe this text

[Assistant] Down down here, let's actually go back to returning a number and, uh, not this string, which for now I will just comment out.


[User] Please transcribe this text

[Assistant] So here we call this function and once more I'm not going to store it into a variable. So we will just log the result of this to the console.


[User] Please transcribe this text

[Assistant] His years until retirement will be 2. So a negative number, which means that he already retired. So let's quickly account for that.


[User] Please transcribe this text

[Assistant] So, what we will do is to basically return this number if it is above zero, and if it is below zero, we are gonna return, uh, something else, like minus one or something, or some special number.


[User] Please transcribe this text

[Assistant] So, instead of returning simply the retirement, let's take a decision here based on the retirement value. And so that's something that we learned in the last lecture. So, let's use an if-else statement. And say, if the retirement is greater than zero,


[User] Please transcribe this text

[Assistant] So if there are more than zero years left until retirement, then return this retirement value.


[User] Please transcribe this text

[Assistant] Okay, so remember that in the if block, uh, we can put any code that we want. And so that includes the return statement. And else...


[User] Please transcribe this text

[Assistant] Let's just return always minus one. So minus one is kind of a standard number in programming. We could also like return


[User] Please transcribe this text

[Assistant] Like this, so a number that shows us clearly that this has no meaning.


[User] Please transcribe this text

[Assistant] Let's just keep it at number one, uh, minus number one, okay? And I'm returning actually numbers here and not a string as we had before because that's usually what we do, especially when we actually receive a number as an input. So here in this function, we get birth year.


[User] Please transcribe this text

[Assistant] Here as an input and it's a number and therefore it's a good practice to then also return a number.


[User] Please transcribe this text

[Assistant] Okay, let's try this again. That would even change it to something more drastic. So 1950. And let's see what we get now.


[User] Please transcribe this text

[Assistant] Great. Now, one thing that I didn't mention yet is that this return keyword here will actually immediately exit the function. So it will first return the value that we tell it to return.


[User] Please transcribe this text

[Assistant] Now we can get rid of the rest. And I will put that after the return. So we will log to the console, uh, this string here that we just had.


[User] Please transcribe this text

[Assistant] What do you think will happen when we run this code now? And keep in mind that we have to return before the console.log in both cases. So in the if block here and also in the else


[User] Please transcribe this text

[Assistant] So what do you think is gonna happen with these console.logs? Well, let's see.


[User] Please transcribe this text

[Assistant] And indeed, they are simply ignored. So they will not get executed because, as I said before, the return statement immediately exits or immediately returns the function. And so therefore, there is no chance that this code here is even reached.


[User] Please transcribe this text

[Assistant] So if we want this one here to execute, we need to put it before the return. And in VS Code, I can simply hit Option or Alt up.


[User] Please transcribe this text

[Assistant] Okay, and that will then move the line up. So we can, we also have that here somewhere in this menu.


[User] Please transcribe this text

[Assistant] So that's move line up and move line down. So just so you see which one is the shortcut. So I use that one all the time. I also use add cursor below all the time and I also use add next occurrence. So that would be command or control D. So what this means is that we have, if we have


[User] Please transcribe this text

[Assistant] This for example here is selected, then we can already see all the other ones, but if we hit command D, then it will actually select.


[User] Please transcribe this text

[Assistant] So you see, now we have these four selected, and so we now could replace all of them at the same time. For example, like this. Okay. But anyway, let's go back to what we were doing here.


[User] Please transcribe this text

[Assistant] So I just moved the console.log before the return here. And so now there should be a chance that the console.log is actually executed before the value is returned.


[User] Please transcribe this text

[Assistant] And so let's do the same here. So again, I'm hitting option or alt.


[User] Please transcribe this text

[Assistant] And so these two lines changed position. And now, yeaah, now it works. So we get the string, and here we get Mike has already retired.


[User] Please transcribe this text

[Assistant] Okay, so this was to show you some more things about functions that we had already learned and also show you something new, which is the fact that the return statement here immediately exits the function.


[User] Please transcribe this text

[Assistant] We reviewed already some things here, but now it's time to really review everything that we learned so far about functions in these first couple of lectures.


[User] Please transcribe this text

[Assistant] And here we have the three type of functions that we talked about. So we have forced, the function declaration, and one particularity about function declarations is that they can be used before they are declared in the code.


[User] Please transcribe this text

[Assistant] Second, we have the function expressions, and they are essentially function values that are stored in a variable.


[User] Please transcribe this text

[Assistant] And finally, we have arrow functions that are in fact also function expressions, but special ones. And these are great for quick one-line functions where we don't need to explicitly use the return keyword and no curly braces either.


[User] Please transcribe this text

[Assistant] I also said that this one has no disk keyword, but more about that in one of the future lectures.


[User] Please transcribe this text

[Assistant] Now what's important to note here is that these are three different ways of writing functions, but they all work in a similar way. So all of them can receive input data, they transform data, and then they can output data.


[User] Please transcribe this text

[Assistant] It's all optional, but usually that's the things that functions do. And no matter which type of function we use, we can always do these three things.


[User] Please transcribe this text

[Assistant] And now let's zoom in a little bit further and take a close look at the structure of a common function, let's say. And this one here is a function statement, but it works the exact same way for all other types of functions again.


[User] Please transcribe this text

[Assistant] First, usually a function needs a function name. So corkH in this example. Then a function also has parameters. And these parameters are essentially placeholders that receive input values.


[User] Please transcribe this text

[Assistant] So as I said before, these are a little bit like local variables of a function. So variables that are defined only inside of this very function.


[User] Please transcribe this text

[Assistant] Now, as you also already know, we use functions to reuse pieces of code. And these pieces of code are inside the function body. So this is where the function's input data is usually processed and then returned.


[User] Please transcribe this text

[Assistant] And speaking of the return, by the end of the function, we usually have a return statement, which we use to output a value from the function. And also, as I mentioned a little bit earlier, the return statement also immediately terminates the function's execution. We also say that the function returns. Okay, and now about calling the function.


[User] Please transcribe this text

[Assistant] We do that using parentheses. So we write the name of the function like we did here with corkH, and then with the parentheses we call the function. Because without the parentheses, the function is really just a value.


[User] Please transcribe this text

[Assistant] But then with the parentheses, we actually call the function. And we can also say that we run the function, or invoke the function, or execute the function, and all of these terms kind of mean the same.


[User] Please transcribe this text

[Assistant] Now in this case, since the function actually has parameters, we then call the function with arguments.


[User] Please transcribe this text

[Assistant] And these arguments are the actual values of the function parameters. So we use these to input the actual data into the function. And we can also imagine this as replacing the placeholders that are the parameters.


[User] Please transcribe this text

[Assistant] Then, once the corkH function has finally done its job, then all this expression will basically be replaced with the returned value. So in this case, the H that was replaced here.


[User] Please transcribe this text

[Assistant] And that age value is what we then store into this age variable.


[User] Please transcribe this text

[Assistant] So we use this variable to basically save the returned value that was outputted from the function. Okay? Now just one other thing that I want to make clear is that this console.log that we have in the function, so in that first line there, has nothing to do with returning a value.


[User] Please transcribe this text

[Assistant] This simply prints a message to the developer console, but it has nothing to do with returning. So actually the console.log() is actually just another function call inside the callh function, because console.log() is itself a function.


[User] Please transcribe this text

[Assistant] And so the argument that we pass into the console.log function is what will get printed to the developer console.


[User] Please transcribe this text

[Assistant] Okay, so just wanted to make sure that you really get this distinction between console.log and return. The reason why we always use console.log is because we want to see the results of our experiments in the developer console in the browser.


[User] Please transcribe this text

[Assistant] Anyway, I think this pretty much sums up all there is to know, at least for now, about functions.


[User] Please transcribe this text

[Assistant] So make sure that you got all of this down and then you can move on right to the next video where the first coding challenge of this section waits for you. And as you can probably guess, it's going to be about writing your own function for the very first time. So I hope to see you there soon.


[User] Please transcribe this text

[Assistant] Where does the data marketers use come from? Since we're such a digital world, you may think collecting data only happens online and we'll talk about online data in our next video.


[User] Please transcribe this text

[Assistant] But there's plenty of useful customer data that can be found offline too, which can help give you a complete picture of who your customers are and how they behave.


[User] Please transcribe this text

[Assistant] While the customer journey is shifting more and more online, there's still a significant part of that journey that happens in a physical location, whether it be a store purchase or engaging in a service.


[User] Please transcribe this text

[Assistant] Which means that 86% of customer purchases are happening in a physical location.


[User] Please transcribe this text

[Assistant] Additionally, a report by Google shows that very few people do their purchasing wholly online or wholly offline, but use a mix of both. They either do research online and buy offline, or do research offline and buy online.


[User] Please transcribe this text

[Assistant] This is why it's crucial to engage with both offline data and online data to truly understand customer behavior and use those insights to influence your marketing approach.


[User] Please transcribe this text

[Assistant] What do we mean when we say offline data? It's simply data you gather about a customer that isn't through an online channel.


[User] Please transcribe this text

[Assistant] Filling out a survey or giving customer feedback.


[User] Please transcribe this text

[Assistant] Offline data can also be tracked through point of sale information when your customers make a purchase.


[User] Please transcribe this text

[Assistant] You learn what product they bought, the date, and the amount they spent.


[User] Please transcribe this text

[Assistant] Offline data can also include call center tracking or focus group participation as well.


[User] Please transcribe this text

[Assistant] You can also track in-store visits and behavior through WiFi logins, app usage in the store, and beacons, which are little devices placed in the store that communicate with smartphones through Bluetooth signals.


[User] Please transcribe this text

[Assistant] Let's look at an example of a bookstore. On a Wednesday afternoon, a customer stops by, browses around and comes to the counter with two bestsellers they want to purchase.


[User] Please transcribe this text

[Assistant] The bookseller asks if they want to sign up for a frequent buyer card and the customer gives their name and address to the bookseller who enters them into their POS database.


[User] Please transcribe this text

[Assistant] They also give their email address to sign up for the newsletter. The customer pays for their books and is on their way.


[User] Please transcribe this text

[Assistant] This is the type of transaction that happens all the time.


[User] Please transcribe this text

[Assistant] But now, the bookstore has all of this new data to help them better understand who's shopping at their store.


[User] Please transcribe this text

[Assistant] Not just a name, but where their customer lives, their shopping habits, and sometimes age and gender.


[User] Please transcribe this text

[Assistant] Offline data is typically rich with demographic information about customers, and it's often information that you may not be able to collect online.


[User] Please transcribe this text

[Assistant] Offline data can also show how much each customer purchased, which can help determine their lifetime value, what they purchased and when.


[User] Please transcribe this text

[Assistant] The bookstore can now better understand its customer demographic, which will help with marketing efforts.


[User] Please transcribe this text

[Assistant] The bookstore can also understand what times of the week are busiest, which will help them with staffing.


[User] Please transcribe this text

[Assistant] It will also help them understand what inventory to keep in stock in order to increase sales.


[User] Please transcribe this text

[Assistant] Now, because they have a name and email address attached to the purchase, they can target customers with book recommendations.


[User] Please transcribe this text

[Assistant] And since they've collected this information directly from their customer, they can ensure that it's accurate and represents their current customer base.


[User] Please transcribe this text

[Assistant] Since it was given directly to them, it mitigates any privacy concerns as well.


[User] Please transcribe this text

[Assistant] All of the insights you can gather from this offline data can help you tailor your marketing strategy, better target your customer base, and see the context of your customer's journey.


[User] Please transcribe this text

[Assistant] But collecting offline data at point of sale isn't the only place where you can obtain it.


[User] Please transcribe this text

[Assistant] Businesses can purchase third-party data from companies who collect offline insights.


[User] Please transcribe this text

[Assistant] Purchasing behavior and even information on offline media consumption that can help businesses gain further insights into their customers' behaviors.


[User] Please transcribe this text

[Assistant] You've probably heard of the Nielsen TV ratings or heard of someone who has a Nielsen box.


[User] Please transcribe this text

[Assistant] Nielsen is a company that monitors media consumption across a variety of devices, including TVs and smartphones.


[User] Please transcribe this text

[Assistant] CommScore is a similar company that also tracks media consumption across devices. This is another type of offline behavior.


[User] Please transcribe this text

[Assistant] Businesses can then purchase their data to better understand customer behavior around media engagement, including when they watch and what they watch.


[User] Please transcribe this text

[Assistant] The better you can understand your customer, the better you can target them with advertising for your product or service. There are many other third party data sets you can buy.


[User] Please transcribe this text

[Assistant] There are data from supermarket loyalty cards and credit card transactions, for instance, that provide information on the purchases of different products and brands.


[User] Please transcribe this text

[Assistant] There are industry specific data, like data for the pharmaceutical sector, or data on car sales, etc.


[User] Please transcribe this text

[Assistant] While most brands have access to their own sales data, these third-party datasets help them with competitive analysis as they give them some insights into the sales for other brands as well.


[User] Please transcribe this text

[Assistant] Now that we've gone over offline data, in our next video, we'll talk about online data, how to collect it and what insights you can get from it.


[User] Please transcribe this text

[Assistant] Now that we've talked about offline data, or ways to collect information about your customer's behaviour in their everyday lives, let's look at what online data is, what insights it can provide, and how to collect it.


[User] Please transcribe this text

[Assistant] With society today becoming more and more digital, marketers have a vast number of tools they can use that will help them gain insights from customers' online behavior.


[User] Please transcribe this text

[Assistant] Those insights can better inform marketing efforts, make advertising more personalized, and engagement more meaningful.


[User] Please transcribe this text

[Assistant] Brand engagement may begin by interacting with a brand's content or posts on social media, for instance.


[User] Please transcribe this text

[Assistant] Platforms like Facebook, Instagram and Twitter have insights or analytics dashboards that can reveal a lot about an account's followers, including the number of followers, where they're from, what their age is, their gender breakdown, when they're most frequently online and what languages they speak.


[User] Please transcribe this text

[Assistant] This can help a business understand who their audience is on social media, and if the audience they're targeting is indeed the one following them.


[User] Please transcribe this text

[Assistant] Social media insights can also provide information on which pieces of content are being interacted with the most, which is also helpful knowledge about your audience.


[User] Please transcribe this text

[Assistant] User engagement may also begin when someone sees an ad on social media for a product or service you offer.


[User] Please transcribe this text

[Assistant] This is different from the kind of organic engagement a business would build with original content in the way of posts and videos. Instead, the business would create ads targeted to a specific audience with specific characteristics and demographics.


[User] Please transcribe this text

[Assistant] When someone clicks on the ad, the business can track the interaction and further interactions with the business.


[User] Please transcribe this text

[Assistant] Businesses who created ad campaigns through a platform like Facebook Ads Manager can see when people interact with their ad and what consumers do as a result of seeing the ad.


[User] Please transcribe this text

[Assistant] Do they visit their website or app? Sign up on the email list? Or buy a product or service?


[User] Please transcribe this text

[Assistant] This kind of data, so knowing whether an ad campaign results in a full purchase or just a website visit, is incredibly valuable to have in order to better understand the impact of your marketing efforts.


[User] Please transcribe this text

[Assistant] Website insights produced by dashboards like Google Analytics or Adobe Analytics are also able to give you a lot of rich audience data that you can use to inform your marketing strategies.


[User] Please transcribe this text

[Assistant] Similar to social media insights, website analytics will tell you how many people are visiting your site, where they're from, what language they speak, their age and their gender breakdown.


[User] Please transcribe this text

[Assistant] It will also tell you where they're entering or leaving your site.


[User] Please transcribe this text

[Assistant] How long they're staying on your side and which pages they're drawn to the most.


[User] Please transcribe this text

[Assistant] You can use website data to see how well you're doing on website engagement, content areas to fix, and if your efforts to drive your audience to your site are working.


[User] Please transcribe this text

[Assistant] Keep in mind that these kinds of insights from social media dashboards and Google Analytics are going to be anonymous. Well, anonymous to you.


[User] Please transcribe this text

[Assistant] You'll know for example that a thousand people between the ages of 30 and 40 living in New York City clicked on your ad, but you won't know who they are.


[User] Please transcribe this text

[Assistant] If you sell products online, you can track not only purchases, but names and information of your customers like the point of sales data collection we saw in the last video.


[User] Please transcribe this text

[Assistant] Here's an overview dashboard from Shopify, a popular e-commerce software tool.


[User] Please transcribe this text

[Assistant] Purchasing information will give you a lot of demographic data, product preference data, and customer purchasing behavior insights to use for your future strategies.


[User] Please transcribe this text

[Assistant] You can also more actively collect customer information through something as simple as a sign-up form for a newsletter, a free e-book or a rewards or loyalty program.


[User] Please transcribe this text

[Assistant] Or you can also gather customer information through feedback questionnaires and surveys that can give you insights on how a customer feels about your brand, uses your products, or how likely they would be to recommend you to others.


[User] Please transcribe this text

[Assistant] So far we've talked about data that can be gathered online for a specific website.


[User] Please transcribe this text

[Assistant] or online business. However, there are instances where marketers want to collect information about the competition as well. They may want to know what audience a competitor attracts or they may want to get more insights into how they stack up versus the competition.


[User] Please transcribe this text

[Assistant] Marketers can leverage third party databases to gather data about competitors. These third party databases provide data collected and reported by someone else, namely a third party.


[User] Please transcribe this text

[Assistant] In most cases, marketers will have to pay for that data. As with offline data, there are many third party databases available related to online behavior.


[User] Please transcribe this text

[Assistant] Marketers use tools that provide data on online browsing behavior, as well as data gathered from social media posts.


[User] Please transcribe this text

[Assistant] Conscore and Nielsen are two prominent providers of data on online behavior.


[User] Please transcribe this text

[Assistant] Both report on which websites and apps people use, how much time they spend on them, the demographics of the people who use them, and so on.


[User] Please transcribe this text

[Assistant] Together with their data on offline media usage, they provide marketers with a good picture of how users spend their media time.


[User] Please transcribe this text

[Assistant] Another type of data tools that can be useful to marketers are social listening tools.


[User] Please transcribe this text

[Assistant] They can help marketers understand what people outside their audience are saying about their brand online.


[User] Please transcribe this text

[Assistant] They monitor how often different brands are mentioned in social media posts and they provide insights on whether these mentions are mostly positive or negative.


[User] Please transcribe this text

[Assistant] In our next videos, we'll take a look at how data is collected and how some data will be more useful than others.


[User] Please transcribe this text

[Assistant] All of you are gonna come into the pantry with Janice and I.


[User] Please transcribe this text

[Assistant] Unfortunately for some of you today, it was a real battle. If I call your name, please step forward. You'll be in tomorrow's pressure test. Right.


[User] Please transcribe this text

[Assistant] Consider the problem of cancer classification where we have features of medical patients and we want to decide whether or not they have cancer. So this is like the malignant versus benign tumor classification example that we had earlier.


[User] Please transcribe this text

[Assistant] But now let's say we find out that only 0.5% of patients in our training and test sets actually have cancer. So only half a percent of the patients that come through our screening process have cancer.


[User] Please transcribe this text

[Assistant] Close to one of two extremes where in this case the number of positive examples is much, much smaller than the number of negative examples because y equals one so rarely. This is what we call the case of skewed clauses.


[User] Please transcribe this text

[Assistant] We just have a lot more examples from one class than from the other class. And by just predicting y equals zero all the time, or maybe by predicting y equals one all the time, an algorithm can do pretty well.


[User] Please transcribe this text

[Assistant] Let's say you make a change to your algorithm and you now are getting 99.5% accuracy.


[User] Please transcribe this text

[Assistant] So if you have very skewed classes, it becomes much harder to use just classification accuracy because you can get very high classification accuracy or very low errors.


[User] Please transcribe this text

[Assistant] And, uh, it's not always clear if doing so is really improving the quality of your classifier because predicting y equals zero all the time is, uh, doesn't seem like a particularly good classifier.


[User] Please transcribe this text

[Assistant] When we're faced with such skewed clauses, therefore, we would want to come up with a different error metric or a different evaluation metric. One such evaluation metric are what's called precision recall. Let me explain what that is. Let's say we're evaluating a classifier on a test set. For the examples in the test set, the actual clause is


[User] Please transcribe this text

[Assistant] Two by two table as follows, depending on, and I've followed these entries depending on what was the actual class and what was the predicted class.


[User] Please transcribe this text

[Assistant] An example that's a true positive, meaning our algorithm predicted that it's positive and in reality the example is positive.


[User] Please transcribe this text

[Assistant] Based on what was the actual clause and what was the predicted clause.


[User] Please transcribe this text

[Assistant] So let me write this down. The precision of a classifier is the number of true positives divided by the number that we predicted as positive.


[User] Please transcribe this text

[Assistant] Right? So all the patients that, you know, we went to those patients and we told them we think you have cancer. Of all those patients, what fraction of them actually have cancer? So that's called precision. And another way to write this would be true positives.


[User] Please transcribe this text

[Assistant] And then in the denominator is the number of predicted positives. And so that will be the sum of, you know, the entries in, in this first row of the table. So it will be true positives divided by true positives. I'm going to abbreviate positive as POS.


[User] Please transcribe this text

[Assistant] And then plus, false positives. Again, abbreviating positive using POS.


[User] Please transcribe this text

[Assistant] So that's called precision. And as you can tell, high precision would be good. That means that of all the patients that we went to and we said, you know, we're very sorry we think you have cancer. High precision means that of that, of that group of patients, most of them we had actually made accurate predictions on and they do have cancer.


[User] Please transcribe this text

[Assistant] What fraction of them do we correctly detect as having cancer? So if all the patients have cancer, how many of them do we actually go to them and, you know, correctly tell them that we think they need treatment?


[User] Please transcribe this text

[Assistant] So, writing this down, vcal is defined as the number of positives.


[User] Please transcribe this text

[Assistant] Excuse me, the number of true positives, meaning, uh, right, true positives, meaning the number of people that have cancer and that we correctly predicted have cancer. And we take that and divide that by


[User] Please transcribe this text

[Assistant] So this is the right number of actual positives of all the people that do have cancer. What fraction do we correctly flag and, you know, send for treatment?


[User] Please transcribe this text

[Assistant] And in particular, if we have a learning algorithm that predicts y equals zero all the time, that it predicts no one has cancer, then this classifier will have a recall


[User] Please transcribe this text

[Assistant] Precision and recall are defined setting y equals one rather than y equals zero to be sort of the presence of that rare class that we're trying to detect. And, uh, by using precision and recall,


[User] Please transcribe this text

[Assistant] So, uh, for the problem of skewed clauses, precision and recall gives us more direct insights into how the learning algorithm is doing, and there's often a much better way to evaluate our learning algorithms than looking at classification error or classification accuracy when the clauses are very skewed.


[User] Please transcribe this text

[Assistant] What happened? Now what, what did he do wrong?


[User] Please transcribe this text

[Assistant] I've made a quandon semi-fredo with a lemon crumb and cheese mix.


[User] Please transcribe this text

[Assistant] Thank you. Thank you so much. Enjoy.


[User] Please transcribe this text

[Assistant] Stupid girl making me spend so much money. Now I have to get it from the ATM.


[User] Please transcribe this text

[Assistant] I know where to put my card. Stupid machine talking to me like I'm an idiot.


[User] Please transcribe this text

[Assistant] Stupid girl making me spend so much money. Now I have to get it from the ATM.


[User] Please transcribe this text

[Assistant] I know where to put my card. Stupid machine talking to me like I'm an idiot.


[User] Please transcribe this text

[Assistant] Yeah, yeah, I know what I selected. Just give me my money.


[User] Please transcribe this text

[Assistant] Stupid girl making me spend so much money. Now I have to get it from the ATM.


[User] Please transcribe this text

[Assistant] I know where to put my card. Stupid machine talking to me like I'm an idiot.


[User] Please transcribe this text

[Assistant] When we talked about the if-else statement, I mentioned that it's a control structure and also that there are more control structures, right?


[User] Please transcribe this text

[Assistant] Well, one of the other control structures are loop. And so loops are our final big topic in this JavaScript fundamentals section.


[User] Please transcribe this text

[Assistant] Loops are a fundamental aspect of every programming language, because they basically allow us to automate repetitive tasks. So tasks that we have to perform over and over again.


[User] Please transcribe this text

[Assistant] And here I like to use the analogy of a gym. So when you go to a gym, you might, for example, lift weights, right?


[User] Please transcribe this text

[Assistant] And let's say that you do 10 repetitions of a certain weightlifting exercise. So we could represent that by doing something like this.


[User] Please transcribe this text

[Assistant] And remember, we want 10 repetitions. So we would have to paste this code here.


[User] Please transcribe this text

[Assistant] 10 times, and I don't know even if this are 10 times or not, but anyway,


[User] Please transcribe this text

[Assistant] You can start to guess that this is probably not.


[User] Please transcribe this text

[Assistant] A best practice. Just imagine that we had 30 repetitions instead of just 10. And then if we wanted to, for example, change some word here in this string,


[User] Please transcribe this text

[Assistant] Then we would have to change that in all of them. So this really violates the don't-repeat-yourself principle, right? Because we're basically repeating the same code here 10 times and all we're changing is just this number.


[User] Please transcribe this text

[Assistant] So instead of doing all this, we can now create a loop, and then put one of these lines of code in there, and the loop will then run that code over and over again until we tell it to stop. And so let's implement a so-called for loop now. And that's a loop which has a counter. So.


[User] Please transcribe this text

[Assistant] So let's do that, and we simply write for and open parenthesis. So a little bit like the if statement, and this is a for statement, and so it looks similar.


[User] Please transcribe this text

[Assistant] Now the loop statement has three parts. The first part is the initial value of a counter. And in the case of this current example, the counter is the value that will start here at number 1 and go all the way to number 10.


[User] Please transcribe this text

[Assistant] So let's call this counter rep, which stands for repetition. And so here we literally create a variable called rep.


[User] Please transcribe this text

[Assistant] And we start it at 1, because, well, that's our first repetition. Okay? And here we need to use a let variable, because this counter will later be updated by the for loop.


[User] Please transcribe this text

[Assistant] So that's the first part of the for statement. Then we use semicolon and go to the second part. And the second part is a logical condition that is evaluated before each iteration of the loop. So before each time that the code in the loop is executed.


[User] Please transcribe this text

[Assistant] So let me just write it here first and then this will make more sense.


[User] Please transcribe this text

[Assistant] So our condition will be rep needs to stay below or equal.