[User] Please transcribe this text

[Assistant] I'm very happy with my main. I know that my family will love the dish and I hope the judges will love it too.


[User] Please transcribe this text

[Assistant] Uh, it's special, at the same time, I'm cooking a dish that my auntie does at home for us.


[User] Please transcribe this text

[Assistant] This fish curry is my auntie's curry. I've not made any changes to the fish curry.


[User] Please transcribe this text

[Assistant] I can hear my wife screaming. That small woman have a loud voice.


[User] Please transcribe this text

[Assistant] 30 out of 30. That is amazing. But I should not be getting carried away. That's another dish to be scored.


[User] Please transcribe this text

[Assistant] Even though I have a big lead, anything can happen. That doesn't mean that he can't catch up.


[User] Please transcribe this text

[Assistant] To replicate this dish, it's going to be very hard. You've got to be very light with flavours. But me, I'm heavy with flavours. It's going to be a very hard challenge.


[User] Please transcribe this text

[Assistant] There's a total of 19 elements in this dish. Time is a crucial thing in this kitchen.


[User] Please transcribe this text

[Assistant] As much as I want to perfect the dish, I need to have all the elements ready.


[User] Please transcribe this text

[Assistant] And these meringues have to go in the oven as soon as possible. They need at least 4 hours to dry.


[User] Please transcribe this text

[Assistant] Oh, the pressure is very high. I'm trying to multitask as much as possible. Still got heaps of things to do.


[User] Please transcribe this text

[Assistant] Every pressure test I've been, I've made mistakes early in the cook, and I can't afford to make any mistakes today.


[User] Please transcribe this text

[Assistant] So I'm gonna make sure I follow every single instruction carefully. So now I'm starting with my coconut ice cream.


[User] Please transcribe this text

[Assistant] That coconut ice cream is one of the main elements in a dish.


[User] Please transcribe this text

[Assistant] I need to make sure it's smooth, silky, I need to nail it. For the coconut ice cream, I'm mixing all the dry ingredients first. Mix them together with the wet ingredients


[User] Please transcribe this text

[Assistant] Pass them through a sieve, then I can work with the liquid nitrogen.


[User] Please transcribe this text

[Assistant] I have never dreamed in my life that I'll be cooking a Heston's dish.


[User] Please transcribe this text

[Assistant] If I want to beat Ben today, I need to make sure all my elements are spot on without any mistakes.


[User] Please transcribe this text

[Assistant] My coconut ice cream mixture looks perfect. Very nice and glossy. But I'm not using a churner today. I'm using liquid nitrogen. First time I'm handling liquid nitrogen. So let's see how it goes.


[User] Please transcribe this text

[Assistant] I'm very happy with the coconut ice cream. It's so smooth. It's beautiful. Liquid nitrogen is my best friend now.


[User] Please transcribe this text

[Assistant] My first liquid nitrogen ice cream, a success. But I can't stop, I have to go, I have to make sure that I finish every element, and I only have two and a half hours left.


[User] Please transcribe this text

[Assistant] The lychee gel, insert, set. Next I'm gonna pipe in the caramel and uh, coriander yogurt. Keep it up, Sash, you're doing well.


[User] Please transcribe this text

[Assistant] Is that fudge? It's a pistachio gel. Both me and Ben are neck and neck now.


[User] Please transcribe this text

[Assistant] We are doing most of the developments at the same time. Ben is a very determined focus man.


[User] Please transcribe this text

[Assistant] If he puts his thoughts in something, he will make sure he achieves it and he will work very hard towards it.


[User] Please transcribe this text

[Assistant] So, I need to make sure I push myself all the way till the finish.


[User] Please transcribe this text

[Assistant] So now, I'm gonna start with my Earl Grey and, uh,


[User] Please transcribe this text

[Assistant] Lavender mousse. That earl grey lavender mousse with inserts inside was one of the highlights. I need to make sure it's the same texture as what Heston put up for us.


[User] Please transcribe this text

[Assistant] I'm very happy with the mousse. Piping the mousse into the mold. Shake all the air bubbles out.


[User] Please transcribe this text

[Assistant] It looks beautiful. I'll let it cool down. So hopefully I'm on track.


[User] Please transcribe this text

[Assistant] I go back to the recipe, I read again and again, a few times. That's when I realised.


[User] Please transcribe this text

[Assistant] I made a big mistake. I should have put the inserts.


[User] Please transcribe this text

[Assistant] Into the mousse before it goes into the blast chiller.


[User] Please transcribe this text

[Assistant] I made a big mistake. I should have put the inserts into the mousse before it went into the blast chiller. Now my mousse is rock solid.


[User] Please transcribe this text

[Assistant] I tried my best not to make mistakes, but somehow it happened.


[User] Please transcribe this text

[Assistant] A lot of things are going through my mind. And I start to panic.


[User] Please transcribe this text

[Assistant] My family is amazing. As much as I'm there struggling today.


[User] Please transcribe this text

[Assistant] I don't have the time or ingredients to redo the most again.


[User] Please transcribe this text

[Assistant] The only thing I can think is let the mousse thaw for a while.


[User] Please transcribe this text

[Assistant] And hopefully I can put the inserts in later.


[User] Please transcribe this text

[Assistant] That looks great. The frozen yogurt snow looks amazing.


[User] Please transcribe this text

[Assistant] I will be missing one whole element in the dish and that's gonna cost me a lot.


[User] Please transcribe this text

[Assistant] Mentally, I'm drained out, but I'm still pushing myself.


[User] Please transcribe this text

[Assistant] Make sure I finish this competition with a bang.


[User] Please transcribe this text

[Assistant] So, in the meanwhile, to finish up my vanilla sponge, I need to scoop out the center of the sponge, and fill it with some white crystallized chocolate, and also, tonka bean panna cotta.


[User] Please transcribe this text

[Assistant] Looks like most of the elements are ready. The only concern I have is my mousse. This mousse dome needs to be perfect.


[User] Please transcribe this text

[Assistant] I might have a good lead, but if one element is not on the plate, I might lose a lot of points.


[User] Please transcribe this text

[Assistant] I need to put it there as long as I can to make it really solid hard before I can push it out. The boost is not set. I need to make sure


[User] Please transcribe this text

[Assistant] He is in the blast chiller as long as possible.


[User] Please transcribe this text

[Assistant] I really wanted to put all the elements up today without any mistakes. If I don't have the most ready on time, I'm in trouble.


[User] Please transcribe this text

[Assistant] I only have a couple of minutes left. Need to make sure everything is perfect. I gotta do the moreng now.


[User] Please transcribe this text

[Assistant] My second try on the Moose. I'm very nervous now.


[User] Please transcribe this text

[Assistant] At last, all the mousse is coming out perfectly.


[User] Please transcribe this text

[Assistant] For me to come through to this stage in MasterChef, I'm very impressed. I can't believe myself, me, finished Heston's recipe and managed to put up everything on the plate.


[User] Please transcribe this text

[Assistant] Even though I have a big lead, Ben is known for the pressure test. So, I'm not sure whether I've done enough to beat him today.


[User] Please transcribe this text

[Assistant] Uh, me doing a dessert and getting nine nine nine nine.


[User] Please transcribe this text

[Assistant] If I call out your name, please step forward.


[User] Please transcribe this text

[Assistant] You guys are good cooks, I mean you've proved yourself getting here, getting so far. So please, don't lose heart. But for now, it's time to say goodbye.


[User] Please transcribe this text

[Assistant] Try kicking your legs more. That's good. Don't go too far!


[User] Please transcribe this text

[Assistant] Why are you doggy paddling? I taught you how to swim. Do your breaststroke.


[User] Please transcribe this text

[Assistant] Try kicking your legs more. That's good. Don't go out too far.


[User] Please transcribe this text

[Assistant] Kathy! Get back here! I see a shark!


[User] Please transcribe this text

[Assistant] Try kicking your legs more. That's good. Don't go out too far!


[User] Please transcribe this text

[Assistant] Well, a team of Japanese researchers have done what might be the most fun study in the history of ever. And they may finally have an answer for that last one.


[User] Please transcribe this text

[Assistant] Many cats, though not all, exhibit a behavior similar to intoxication when they encounter catnip, as well as another plant called silver vine. They rub their faces in it, roll around in it, and generally do hilarious things. Catnip and silver vine don't cause any physical or neurological damage,


[User] Please transcribe this text

[Assistant] The way intoxicating substances can in humans. And it's funny, so we humans will happily fill cat toys with the stuff so we can elbow each other and make fun of Fluffy for being in a state we technically caused. We've known for a while that the feline love of catnip and silvervine is inborn. In fact, the catnip response is at least partly genetic.


[User] Please transcribe this text

[Assistant] For most people, catnip is just a fun way to play with our pets. But the Japanese team wanted to know more about the how and why. So when a paper published in Science Advances in 2021, they soaked filter paper in neptilectol.


[User] Please transcribe this text

[Assistant] A chemical isolated from silver vine that gives it that zinc. When they exposed cats to the paper, the cats responded in pretty much the same way that they do to catnip and silver vine plants. That is,


[User] Please transcribe this text

[Assistant] For example, you might guess that humans had selectively bred it into our pets because we think it's funny. But it's not just domestic cats who like catnip.


[User] Please transcribe this text

[Assistant] It's much more likely that these plants provide some other advantage. As a starting point for a hypothesis,


[User] Please transcribe this text

[Assistant] The researchers observe that humans sometimes use silver vine as a mosquito repellent. And since cats do like to roll in catnip,


[User] Please transcribe this text

[Assistant] And Silvervine, the team suspected they might be transferring neptilectol.


[User] Please transcribe this text

[Assistant] First, the researchers confirmed that mosquitoes avoided both silver vine and purified neptilactol. They once again tempted cats with neptilactol-laced paper.


[User] Please transcribe this text

[Assistant] And confirm that the cats transferred some of the compound to their fur when they rubbed their faces on the paper. Then, they exposed the kitties to a bunch of mosquitoes. Definitely the least fun part of the study. But they did confirm that mosquitoes landed less often on cats with neptilactol in their fur. This gave them pretty clear evidence that there's a mosquito-repelling benefit to playing in catnip and silver vine. More research needs to be done, however. Just showing there's a benefit doesn't prove that the catnip response evolved for that reason.


[User] Please transcribe this text

[Assistant] So I guess those poor researchers will just have to do more super fun studies with cats and silver vine until they finally learn the truth.


[User] Please transcribe this text

[Assistant] It's rough being a scientist, you know? You know what's awesome, though? Making videos with the help of awesome people.


[User] Please transcribe this text

[Assistant] Especially this month's President of Space, Matthew Brand. We are so lucky to have you, and each and every one of our patrons, too. If you'd like to support SciShow, you can go to patreon.com slash SciShow to learn more.


[User] Please transcribe this text

[Assistant] And, uh, learning curves is a tool that I actually use very often to try to diagnose if a particular learning algorithm may be suffering from a bias or a variance problem or a bit of both.


[User] Please transcribe this text

[Assistant] Here's what a learning curve is. To plot a learning curve, what I usually do is plot JTrain, which is the, say, average squared error on my trading set.


[User] Please transcribe this text

[Assistant] And by the way, if I have a large training set and I'm artificially restricting the size of my training set in order to plot JTrain, here if I set M equals 3, say,


[User] Please transcribe this text

[Assistant] Uh, and I train on only three examples, then for this figure, I'm going to measure my training error only on the three examples that I actually fit my data to. And uh, so even if I have, say, a hundred training examples, but I want to plot what my training error is for m equals three,


[User] Please transcribe this text

[Assistant] So just to summarize, what we've seen is that if the training set size is small, then the training error


[User] Please transcribe this text

[Assistant] And if I have m equals 5, then you know, maybe a quadratic function can fit this data or so, so. But as my training set gets larger, it becomes harder and harder to ensure that I can find a quadratic function that passes through all my examples perfectly.


[User] Please transcribe this text

[Assistant] So in fact, as the trading set size grows, what you find is that my average trading error actually increases. And so if you plot this figure, what you find is that


[User] Please transcribe this text

[Assistant] Whereas when m is larger, then it gets somewhat harder to fit all of your training examples perfectly, and so your training set error becomes a little bit larger. Now, how about the cross-validation error?


[User] Please transcribe this text

[Assistant] So your cross validation error and your test set error will


[User] Please transcribe this text

[Assistant] Tend to decrease as your training set size increases because the more data you have, the better you do at generalizing to new examples or just the more data you have, the better the hypothesis you fit.


[User] Please transcribe this text

[Assistant] Standard example of fitting a straight line to data that, you know, can't really fit well by a straight line. So we end up with a hypothesis that maybe looks like that.


[User] Please transcribe this text

[Assistant] Now, let's think what would happen if we were to increase the training set size. So instead of five examples like what's drawn there, imagine that we have a lot more training examples. Well, what happens if you fit a straight line to this?


[User] Please transcribe this text

[Assistant] What you find is that you end up with, you know, pretty much the same straight line.


[User] Please transcribe this text

[Assistant] The straight line just can't fit this data and getting a ton more data, well the straight line isn't going to change that much. This is the best possible straight line fit to this data, but the straight line just can't fit this data set that well. So if you plot the cross validation error, this is what it will look like.


[User] Please transcribe this text

[Assistant] But by the time you've reached a certain number of training examples, you've almost fit the best possible straight line. And even if you end up with a much larger training set size, with much larger value of M,


[User] Please transcribe this text

[Assistant] What you find in a high bias case is that the trading error will end up close to the cross validation error.


[User] Please transcribe this text

[Assistant] And finally, the problem of high bias is reflected in the fact that both the cross-validation error and the trading error


[User] Please transcribe this text

[Assistant] And as this trading site size increases a bit, you know, we may still be overfitting this data a little bit, but, uh, it also becomes slightly harder to fit this data set perfectly. And so as the trading site size increases, we'll find that JTrain


[User] Please transcribe this text

[Assistant] Even as we get, you know, a moderate number of training examples. And so maybe the cross-validation error may look like that.


[User] Please transcribe this text

[Assistant] Is the fact that there's this large gap between the training error and the cross validation error.


[User] Please transcribe this text

[Assistant] The two curves, the blue curve and the magenta curve are converging to each other, and so if we were to extrapolate the speaker to the right,


[User] Please transcribe this text

[Assistant] Then it seems likely that the training error would keep on going up and the cross validation error would keep on going down. And the thing we really care about is the cross validation error or the test set error, right?


[User] Please transcribe this text

[Assistant] And so in this sort of figure, we can kind of tell that, you know, if we keep on adding training examples and extrapolate to the right, well, our cross validation error will keep on coming down. And so in a high variance setting, getting more training data is indeed likely to help.


[User] Please transcribe this text

[Assistant] But uh, plotting learning curves like these can often tell you, can often help you figure out if your learning algorithm is suffering from bias, or theories, or even a little bit of both. So when I'm trying to improve the performance of a learning algorithm, one thing that I'll almost always do is plot these learning curves.


[User] Please transcribe this text

[Assistant] Hello everyone, welcome back to EnglishPod, my name is Marco. And I'm Erica. And today we're bringing you again our romantic dramatic suspense series, I'm Sorry I Love You Part 7.


[User] Please transcribe this text

[Assistant] Exactly. So now let's see what Veronica and Steven are gonna say to each other. Maybe they will break up?


[User] Please transcribe this text

[Assistant] Well, it's a very, uh, intense drama, but we saw some great words and a lot of great phrases in there when Stephen was telling her all these beautiful words, right?


[User] Please transcribe this text

[Assistant] Okay, or to arrive. That's right. So let's listen to some examples of how we can use show up in different contexts.


[User] Please transcribe this text

[Assistant] Alright, so I think it's pretty clear now, the verb show up.


[User] Please transcribe this text

[Assistant] As you know, the doctor, he was stalking Veronica.


[User] Please transcribe this text

[Assistant] Okay, stock. Now, this isn't a good thing, right?


[User] Please transcribe this text

[Assistant] The noun form exactly. So, if I am stalking somebody, I am considered to be a stalker.


[User] Please transcribe this text

[Assistant] It's crazy. Yes, it means a crazy person. A crazy person. What a nut job. He's a nut job. Okay, so would you really call this to someone, like, to their face?


[User] Please transcribe this text

[Assistant] No, but it's a little bit insulting, right? It's like saying you're crazy, but stronger. Well, the doctor was a nut job, he was stalking her, and she apologized to Steven for getting him worked up. Worked up. So, work up. To be worked up. When you get worked up, what happens?


[User] Please transcribe this text

[Assistant] Okay, you get worked up. You got worked up. Okay, very good. And well, Steven got worked up over nothing, but he didn't mind, he said she is his love, and he called her his soulmate. His soulmate. Soulmate.


[User] Please transcribe this text

[Assistant] Okay, so your soulmate is that perfect compliment for you, and it's usually romantic, right?


[User] Please transcribe this text

[Assistant] Very good. Well, we've seen some really interesting words, so why don't we listen to our dialogue again, and then we'll come back and look at some of the phrases that were used.


[User] Please transcribe this text

[Assistant] Now it's the complete sentence. I'm sorry for getting you worked up over nothing.


[User] Please transcribe this text

[Assistant] And now for our next phrase. So when Steven was telling Veronica how much he loved her, he told her, not a day has gone by when I haven't thought of you.


[User] Please transcribe this text

[Assistant] There hasn't been a moment where I haven't thought of you. Now, how can we change a little bit? What can we change within this phrase?


[User] Please transcribe this text

[Assistant] Okay, so you can use different times in that phrase, but an important thing is that the compliment is always negative, right?


[User] Please transcribe this text

[Assistant] Alright, and now our last phrase. He told her, I'll always be here for you, no matter what. No matter what. No matter what. No matter what. What does he mean by that?


[User] Please transcribe this text

[Assistant] Okay, so if I want to get that job, I'm going to get it no matter what. So nothing's gonna stop you. Now, we can change the WH word, what, at the end, right, with other ones.


[User] Please transcribe this text

[Assistant] Okay, so those were some really great phrases and I think you can play with them a little bit, change some things, and then you can use them in your everyday life.


[User] Please transcribe this text

[Assistant] I don't know. So well, come to our website, tell us what you think happens or what you would like to happen because I know many people are expecting a little bit more, uh, romance maybe and less drama.


[User] Please transcribe this text

[Assistant] Exactly, Erica and I are always there to answer your questions and, well, anything you guys need.


[User] Please transcribe this text

[Assistant] So now I wanted to make a very basic point about


[User] Please transcribe this text

[Assistant] Uh, about uh, corporations and shares. What, if I give you a thousand shares in a company,


[User] Please transcribe this text

[Assistant] And, uh, you wonder, well, what does that mean that I own a thousand shares? You have to ask another question, which is how many shares are there outstanding? So, uh, we talked about this before. I'm not up to date on these, but my share of the company is equal to


[User] Please transcribe this text

[Assistant] So, it's my number relative to the total. If I own half of the shares outstanding, then I own half of the company.


[User] Please transcribe this text

[Assistant] Companies do things called splits, where they will


[User] Please transcribe this text

[Assistant] Break a share in two and call one share another 1.5 shares or two shares or whatever. They do that periodically. Why do they do that? It seems that companies think


[User] Please transcribe this text

[Assistant] The target price per share is something like $30 a share. So, suppose your company, uh, has done very well and the price per share, which was originally $30, is now up to $60.


[User] Please transcribe this text

[Assistant] Your board of directors may then, someone might bring it up at the board meeting, we should do a two for one split to get our share price back down to the magic $30 a share. So then you would then send out a letter to all of your shareholders and saying we're doubling the number of shares.


[User] Please transcribe this text

[Assistant] Well, I put down on my slides, this is essentially meaningless. All they're doing is changing the unit of measurement. It's like going between metric and ever du proie. It means nothing. So, by the way, why do they even do it?


[User] Please transcribe this text

[Assistant] Well, why not, you know? Uh, one reason they do it is they just think, uh, uh,


[User] Please transcribe this text

[Assistant] If the share price gets too high, you can't buy a fraction of a share. It gets too expensive and people like to buy in round lots because the brokers encourage that of a hundred shares. So if it's thirty dollars a share, you can buy an investment round lot for three thousand dollars.


[User] Please transcribe this text

[Assistant] But it gets expensive if you don't split. Now one company that doesn't split is Berkshire Hathaway. Uh, that's Warren Buffett's company. And it's been selling for thousands of dollars per share. So you can't even buy a round lot unless you're a substantially wealthy person.


[User] Please transcribe this text

[Assistant] Warren Buffett does that out of some principle. He can do it, well I should say his board does that. They can do it because it's all meaningless.


[User] Please transcribe this text

[Assistant] But not totally meaningless, just that it gets hard to buy small amounts of shares. You can't, you can buy one share, but you can't buy half a share. So uhm, uh,


[User] Please transcribe this text

[Assistant] ...called the corporate charter, and the corporate charter defines...


[User] Please transcribe this text

[Assistant] Because, well, it's not, it's the smallest state in the United States and small states have an incentive to


[User] Please transcribe this text

[Assistant] That's why, in America at least, especially, where we make it very clear, why would you buy shares in a company? Hey, they pay dividends. It's like interest except it's variable and tends to grow through time, whereas debt contracts, it doesn't grow, it's just fixed. So you're doing it for the dividends.


[User] Please transcribe this text

[Assistant] Some people, so remember we had the return on a corporation has two components. The capital gains, which is the appreciation in the price per share, and the dividends.


[User] Please transcribe this text

[Assistant] People tend to talk so much about the capital gains, the movement of the market. They forget about dividends, and some people don't even know there are dividends.


[User] Please transcribe this text

[Assistant] But it's actually the whole reason for being for the stock market. Ideally, anyway, you buy shares to get dividends. And in fact, if you look at history, most, even, uh, up to recent times, the, most of the returns you get on the stock market are in the dividends. People think, well, no, isn't it just that the market is sword? Well, historically, over a hundred years, dividends are more important.


[User] Please transcribe this text

[Assistant] So companies don't have to pay a dividend, but typically young companies don't.


[User] Please transcribe this text

[Assistant] Once they're mature, they like to start paying dividends and it signals to the world that they're really making money. If you invest in a company that never pays a dividend, you start to wonder, you know, is this real or is this a fraud? I never get a penny from them.


[User] Please transcribe this text

[Assistant] So once they're into making money, they think it's, uh, it impresses investors to get dividend checks. I remember my own company, we incorporated in Delaware.


[User] Please transcribe this text

[Assistant] First company, Case Shiller Weiss Incorporated, uh, and we didn't have to pay a dividend. I remember we had a board meeting where we talked about exactly this. And, you know, we've never paid a dividend.


[User] Please transcribe this text

[Assistant] But they don't even, someone said they don't even believe in it. You know, nothing has ever happened. So we should pay a dividend.


[User] Please transcribe this text

[Assistant] But we didn't. We held on. The employees eventually did well when we sold the company. They found out that their shares really were worth something. But we should have started paying dividends to make it clearer. We didn't.


[User] Please transcribe this text

[Assistant] So when a company pays a dividend, what happens to the share price? Well, very simple. It drops.


[User] Please transcribe this text

[Assistant] Because the company used to have the money and now it doesn't. It paid it out. The share price pretty much has to drop. I don't suppose it always does because funny things happen. But the basic idea is that a share drops in value when a dividend is paid. But I have to qualify that.


[User] Please transcribe this text

[Assistant] It doesn't drop in value when you get the check in the mail for your dividend.


[User] Please transcribe this text

[Assistant] Exact, any exact moment. So a company has to define what they call an X dividend date.


[User] Please transcribe this text

[Assistant] That means they will pay out the dividend, this dividend, typically quarterly dividend, every three months. They'll pay out this dividend,


[User] Please transcribe this text

[Assistant] To shareholders of record on this date.


[User] Please transcribe this text

[Assistant] So company values drop routinely on the ex-dividend date. That doesn't mean bad news about the company at all.


[User] Please transcribe this text

[Assistant] Well I think this is an essentially behavioral human question. So the reason they don't want to miss a dividend is because they think that will harm the investor support. And they don't want to see their stock price fall.


[User] Please transcribe this text

[Assistant] If the investors lose confidence in the company, the stock price can fall, and then the management starts to worry that they'll be taken over.


[User] Please transcribe this text

[Assistant] If the price gets too low, takeover people will think, I'll buy it and I'll shut it down and sell off all their assets maybe. You can get, if it gets low enough. So it's a big fear. They don't want investors to have a bad attitude. So then why would you as an investor be disturbed if a company didn't pay a dividend?


[User] Please transcribe this text

[Assistant] Well, I think it's a sort of fundamental human mistrust.


[User] Please transcribe this text

[Assistant] You don't know that these guys are on the level, you know, maybe they're crooks, or maybe they're not, uh, it's like missing, uh, missing a payment on your credit card.


[User] Please transcribe this text

[Assistant] Uh, you know, you have a credit rating that depends on your actually making these monthly payments. And you can take the attitude, well, I miss it once in a night. I'll pay it up, you know, I'll pay the fine. What difference does it make? But your credit rating will go down if you do that. So most people personally think, I'm going to pay every month. This is something I'm really going to do.


[User] Please transcribe this text

[Assistant] Uh, and they kind of imagine that it's like that with dividends, that the company, if they miss a dividend, it means they're kind of unreliable or untrustworthy. Now they didn't have to think that, but that apparently is how a lot of people think. So that's why lots of companies don't ever want to miss paying a dividend.


[User] Please transcribe this text

[Assistant] Yeah, no, the thing is that a dividend is not promised.


[User] Please transcribe this text

[Assistant] The public might have some preconceived notions and think it's like my credit card bill, and I better, and if they're not paying, yeaah, there's something wrong here.


[User] Please transcribe this text

[Assistant] Uh, now they could stop paying a dividend for perfectly good reasons.


[User] Please transcribe this text

[Assistant] Uh, like they, they want to do something with it, uh, more productive.


[User] Please transcribe this text

[Assistant] But the investors might not understand. By the way, I don't mean that firms never miss paying a dividend. I'm just saying that some firms, uh, pride themselves on never having missed a dividend.


[User] Please transcribe this text

[Assistant] Each of you has undeniably earned your shot at the immunity pin. Eliza?


[User] Please transcribe this text

[Assistant] Carly, can you do it again? Can you get a chance at winning the immunity pin?


[User] Please transcribe this text

[Assistant] I never, just so you know, never, ever, ever buy bok choy. Never.


[User] Please transcribe this text

[Assistant] So here's some rules. Each of you must cook one dish. Anything you want.


[User] Please transcribe this text

[Assistant] Sarah, because you're our amateur, you get 75 minutes. And Jared, because you're our professional, you'll only have 60 minutes.


[User] Please transcribe this text

[Assistant] There's one more algorithm that is very powerful and is very widely used both within industry and in academia and that's called the support vector machine.


[User] Please transcribe this text

[Assistant] And uh, compared to both logistic regression and neural networks, the support vector machine, or the SVM, sometimes gives a cleaner and sometimes more powerful way of learning complex nonlinear functions. And so I'd like to take the next videos to talk about that.


[User] Please transcribe this text

[Assistant] Later in this course, I will do a quick survey of a range of different supervised learning algorithms just to very briefly describe them. But the support vector machine, given its popularity and how powerful it is, this will be the last of the supervised learning algorithms that I'll spend significant amounts of time on.


[User] Please transcribe this text

[Assistant] As with our development of other learning algorithms, we're going to start by talking about the optimization objective. So let's get started on this algorithm.


[User] Please transcribe this text

[Assistant] So in logistic regression we have a familiar form of the hypothesis there and the sigmoid activation function shown on the right.


[User] Please transcribe this text

[Assistant] But if y is equal to 1, then we're sort of hoping that h of x will be close to 1. So right, we're hoping they'll correctly classify that example.


[User] Please transcribe this text

[Assistant] And what having h of x close to 1, what that means is that theta transpose x must be much larger than 0. So this greater than, greater than sign, that means much, much greater than 0.


[User] Please transcribe this text

[Assistant] That's because if it's z that is theta transpose x is when z is much bigger than zero is far to the right of this figure that, you know, the output of logistic regression becomes close to one.


[User] Please transcribe this text

[Assistant] Conversely, if we have an example where y is equal to zero, then what we're hoping for is that the hypothesis will output a value close to zero and that corresponds to theta transpose x or z being much less than zero because that corresponds to the hypothesis outputting a value close to zero.


[User] Please transcribe this text

[Assistant] Right, so for the overall cost function, we usually, uh, we would also have a sum over all the training examples and a 1 over m term. But this expression here, that's the term that a single training example contributes to the overall objective function for logistic regression.


[User] Please transcribe this text

[Assistant] Now if I take the definition for the form of my hypothesis and plug it in over here.


[User] Please transcribe this text

[Assistant] Now, let's consider the two cases of when y is equal to 1 and when y is equal to 0. In the first case, let's suppose that y is equal to 1. In that case, only this first term,


[User] Please transcribe this text

[Assistant] And the objective matters because this 1 minus y term would be equal to 0 if y is equal to 1.


[User] Please transcribe this text

[Assistant] So when y is equal to 1, when in our example, x comma y, when y is equal to 1, what we get is this term, minus log 1 over 1 plus e to the negative z, where, as similar to the last slide, I'm using z to denote theta transpose x.


[User] Please transcribe this text

[Assistant] And of course in the cost we actually had this minus y, but we just said y is equal to 1, so that's equal to 1. I just simplified it away in the expression that I have written down here.


[User] Please transcribe this text

[Assistant] And if we plot this function as a function of z, what you find is that you get this.


[User] Please transcribe this text

[Assistant] Curve shown on the lower left of the slide. And thus we also see that when z is equal to large, that is when theta transpose x is large, that corresponds to a value of z that gives us a fairly small value, a fairly small contribution to the cost function.


[User] Please transcribe this text

[Assistant] And this kind of explains why when logistic regression sees a positive example with y equals 1, it tries to set theta transpose x to be very large because that corresponds to this term in the cost function being small.


[User] Please transcribe this text

[Assistant] Now, to build a support vector machine, here's what we're going to do. We're going to take this cost function, this minus log one over one plus z to the negative z, and modify it a little bit. Let me take, uhm, let me take this point one over here, and uh,


[User] Please transcribe this text

[Assistant] So the curve that I just drew in magenta, the curve that I just drew in purple and magenta, so it was a pretty close approximation to


[User] Please transcribe this text

[Assistant] The cost function used by logistic regression except that is now made up of two line segments. There's this flat portion on the right and then there's this straight line portion on the left.


[User] Please transcribe this text

[Assistant] And uh, don't worry too much about the slope of the straight line portion. It doesn't matter that much. But uhm,


[User] Please transcribe this text

[Assistant] That's the new cost function we're going to use for when y is equal to 1. And you can imagine it should do something pretty similar to logistic regression. But, uh, it turns out that this will give the support vector machine computational advantages and give us later on an easier optimization problem, uh, that, that will be easier for software to solve.


[User] Please transcribe this text

[Assistant] We just talked about the case of y equals one. The other case is if y is equal to zero. In that case, if you look at the cost, then only the second term will apply, because the first term goes away, right? If y is equal to zero, then you have a zero here. So you're left only with the second term and the expression above.


[User] Please transcribe this text

[Assistant] And so the cost of an example or the contribution of the cost function is going to be given by this term over here.


[User] Please transcribe this text

[Assistant] And if you plot that as a function of z, so I have here z on the horizontal axis, you end up with this curve.


[User] Please transcribe this text

[Assistant] And for the support vector machine, once again, we're going to replace this blue line with something similar.


[User] Please transcribe this text

[Assistant] Uhm, and in sigma we replace it with a new cost, this flat out here, this zero out here, and that then grows as a straight line, like so. So let me give these two


[User] Please transcribe this text

[Assistant] And this function on the right, I'm going to call cost subscript zero of z. And the subscript just refers to the cost corresponding to when y is equal to one versus when y is equal to zero. Armed with these definitions, we're now ready to build the support vector machine. Here's the cost function, j of theta, that we have for logistic regression.


[User] Please transcribe this text

[Assistant] In case this equation looks a bit unfamiliar, it's because previously we had a minus sign outside, but here what I did was I instead moved the minus signs inside this expression. So it just, you know, makes it look a little weird.


[User] Please transcribe this text

[Assistant] First, we're going to get rid of the 1 over m terms, and this just happens to be a slightly different convention that people use for support vector machines compared to for logistic regression. But here's what I mean. What I'm going to do is I'm just going to get rid of these 1 over m terms, and this should give me the same optimal value for theta.


[User] Please transcribe this text

[Assistant] Because 1 over m is just a constant. So, you know, whether I solve this minimization problem with 1 over m in front or not, I should end up with the same optimal value for theta.


[User] Please transcribe this text

[Assistant] Here's what I mean to be, to give you a concrete example. Suppose I had a minimization problem that they are minimized over a real number u of u minus 5 squared.


[User] Please transcribe this text

[Assistant] Now, if I were to take this objective function and multiply it by 10. So here, my minimization problem is min over u of


[User] Please transcribe this text

[Assistant] U equals 5, right? So multiplying something that you're minimizing over by some constant, 10 in this case, it does not change the value of u that gives us uhm, that minimizes this function.


[User] Please transcribe this text

[Assistant] So in the same way, what I've done by crossing out this m,


[User] Please transcribe this text

[Assistant] The second bit of notational change, which is just again the more standard convention when using SVMs instead of logistic regression, is the following.


[User] Please transcribe this text

[Assistant] So for logistic regression, we had two terms to the objective function.


[User] Please transcribe this text

[Assistant] And what we had was we had a, we controlled the trade-off between these by saying, you know, we wanted to minimize A.


[User] Please transcribe this text

[Assistant] Some of the term b, where I guess I'm using, you know, a to denote this first term and I'm using b to denote that second term, maybe without the lambda.


[User] Please transcribe this text

[Assistant] Instead of parameterizing this as a plus lambda b,


[User] Please transcribe this text

[Assistant] Uhm, we could, and so what we did was by setting different values for this regularization parameter lambda, we could trade off the relative weight between how much we want to fit the training set well, that is minimizing A, versus how much we care about


[User] Please transcribe this text

[Assistant] For the support vector machine, just by convention, we're going to use a different parameter. So instead of using lambda here to control the relative weighting between, you know, the first and second terms, we're instead going to use a different parameter, which by convention is called c.


[User] Please transcribe this text

[Assistant] So for logistic regression, if we set a very large value of lambda, that means, you know, give b a very high weight. Here is that if we set c to be a very small value, that that corresponds to giving b a much larger weight than c, than a.


[User] Please transcribe this text

[Assistant] So this is just a different way of controlling the trade-off. It's just a different way of parameterizing how much we care about optimizing the first term versus how much we care about optimizing the second term. And if you want, you can think of this as the parameter C playing a role similar to one over lambda.


[User] Please transcribe this text

[Assistant] And it's not that these two equations or these two expressions will be equal if c equals one over lambda, that's not the case. But rather is that if c is equal to one over lambda, then these two optimization objectives should give you the same value, the same optimal value for theta.


[User] Please transcribe this text

[Assistant] So just filling that in, I'm gonna cross out lambda here and write in the constant c there. So that gives us our overall


[User] Please transcribe this text

[Assistant] Finally, unlike logistic regression, the support vector machine doesn't output a probability. Instead, what we have is we have this cost function, which we minimize to get the parameters theta. And what a support vector machine does is


[User] Please transcribe this text

[Assistant] Is it just makes a prediction of y being equal to one or zero directly? So the hypothesis will predict one or zero.


[User] Please transcribe this text

[Assistant] If theta transpose x is greater than or equal to zero, I now predict


[User] Please transcribe this text

[Assistant] And we'll also talk about how to modify this just a little bit to learn complex nonlinear functions.


[User] Please transcribe this text

[Assistant] Good morning. Good morning. I'm sure not a place you want to be on the second day of the competition. But!


[User] Please transcribe this text

[Assistant] It is always a mark of a great contestant and competitor in this competition that you get up and you give it a red hot go. There is so much more to come in this competition. You do not want to miss out. Trust us.


[User] Please transcribe this text

[Assistant] The reality is, one of you will be going home today. So early in the competition. Don't let it be you.


[User] Please transcribe this text

[Assistant] So all you've got to do is combine your two ingredients in a way that makes sense. Give us a single dish and of course make it delicious. You have 75 minutes.


[User] Please transcribe this text

[Assistant] You also have an open pantry.


[User] Please transcribe this text

[Assistant] And you're going home. That is what you call a good motivator.


[User] Please transcribe this text

[Assistant] I tell you what, it may look like a dog's breakfast, but if I can swear, just ever so, you know, briefly,


[User] Please transcribe this text

[Assistant] That ice cream, that walnut sort of praliny crunchy ice cream in the date puree is just absolutely gold.


[User] Please transcribe this text

[Assistant] There's no doubt, it's very pretty, it's very fresh, and I think it's a clever idea, but I think it's a dish in the making, you know, in the experimenting. Yeah, it's not my favourite. Not my favourite at all.


[User] Please transcribe this text

[Assistant] If she survives today, I think the key for her is just to discover her mojo and understand that three ingredients on that plate can be...


[User] Please transcribe this text

[Assistant] Absolutely delicious. That peaches look beautiful. I mean, you know, they're nice and bright and fresh and it's a little old fashioned, but could taste yum.


[User] Please transcribe this text

[Assistant] The first elimination, a terrifying prospect for the four of you. Someone's time in the MasterChef kitchen is about to end. What we ask to do is to create a dish


[User] Please transcribe this text

[Assistant] And, Matt commented on the flavour of the earl grey in your custard. Rashadal. We loved the nostalgic link, the value that you added to your dish.


[User] Please transcribe this text

[Assistant] Benita, Rashidel, this challenge was all about pairing two ingredients beautifully. Benita, yours was peaches and Earl Grey tea. Rashidel, mango and green peppercorn. Rashidel, you erode the mango. However, we were left searching for the flavour of green peppercorn. And that's why, Rashidel, we're sorry, you're going home.


[User] Please transcribe this text

[Assistant] Well, sci-fi is very popular, Star Trek, Star Wars, and well, there are some really interesting words that maybe you wouldn't use in real life or in normal circumstances, but you do want to understand these movies or why they say these words, right?


[User] Please transcribe this text

[Assistant] Okay, also known as a spaceship. That's right. Actually, this is interesting because you know the word UFO.


[User] Please transcribe this text

[Assistant] But everything for educational purposes. That's right. Okay, so, so we saw some words that were maybe a little bit difficult, so let's take a look at these now in Language Takeaway.


[User] Please transcribe this text

[Assistant] Alright, so it's kind of like to enter by force somewhere.


[User] Please transcribe this text

[Assistant] Well, when you settle something is you end a fight or a dispute or an argument or an argument or a problem.


[User] Please transcribe this text

[Assistant] Not everyone agrees, but you have no other choice.


[User] Please transcribe this text

[Assistant] Right, exactly. Well, now, another very popular word, and within sci-fi, is this word, Tractor Beinge.


[User] Please transcribe this text

[Assistant] That grabs an object and doesn't let it escape and brings it towards another spaceship.


[User] Please transcribe this text

[Assistant] Right, and it brings it in. So the spaceship managed to escape their tractor beam.


[User] Please transcribe this text

[Assistant] Well, maybe, I don't know, but in sci-fi, you will always hear this tractor be...


[User] Please transcribe this text

[Assistant] Okay, or even when you stop at a red light and it turns green,


[User] Please transcribe this text

[Assistant] Let's listen to our dialogue again and then we'll come back and take a look at some of the phrases that came up in this dialogue.


[User] Please transcribe this text

[Assistant] The first phrase that we can take a look at and maybe it looks a little bit strange.


[User] Please transcribe this text

[Assistant] He said, she will no longer be your prisoner.


[User] Please transcribe this text

[Assistant] So what does he mean by no longer?


[User] Please transcribe this text

[Assistant] Okay, so how would I use it in this form no longer be?


[User] Please transcribe this text

[Assistant] Okay, or, or I can say I will no longer be your boyfriend.


[User] Please transcribe this text

[Assistant] Alright, so no longer be. What about our next phrase?


[User] Please transcribe this text

[Assistant] You know nothing of science fiction. So you would use a noun afterwards.


[User] Please transcribe this text

[Assistant] Okay, so interesting phrases.


[User] Please transcribe this text

[Assistant] But now you can understand when they use some of these words that maybe are a little bit difficult and very common in these types of movies.


[User] Please transcribe this text

[Assistant] Okay, so we saw the verb, uh, so we saw the word settle already.


[User] Please transcribe this text

[Assistant] Now, let's settle this once and for all.


[User] Please transcribe this text

[Assistant] So what does that mean? Finally. That's right, forever. Okay, so once and for all, forever.


[User] Please transcribe this text

[Assistant] So why don't we listen to some other examples of how we can use this phrase once and for all in different contexts.


[User] Please transcribe this text

[Assistant] Okay, so now I think it's clear we've seen a lot of words, we've seen a lot of phrases. Let's listen to our dialogue one more time.


[User] Please transcribe this text

[Assistant] Well, that's why it's called science fiction, right? Yes.


[User] Please transcribe this text

[Assistant] But it is interesting to some people and well, behind Star Wars there is a huge culture. Even some people know some of the languages or symbols that are used in it or the names of some of the robots and models of spacecraft.


[User] Please transcribe this text

[Assistant] Exactly. Well, that's all for today, guys. I hope you enjoyed our lesson. And of course, if you have questions or comments, you can leave them in the comments section on our website, EnglishPod.com.


[User] Please transcribe this text

[Assistant] This video was made possible by Audible. Get a free audiobook and a 30-day free trial when you sign up at audible.com slash real life lore.


[User] Please transcribe this text

[Assistant] Elon Musk is no stranger to Twitter. With over 42 million followers, he ranks 33rd overall on the site, just slightly behind NASA itself. And while, yeah, Elon will often post some pretty silly memes to his account, it's also a pretty useful tool to see inside of his mind.


[User] Please transcribe this text

[Assistant] Take for instance, a tweet he replied to roughly a year ago, where someone asked about putting 1 million people on Mars by the year 2050. And Musk, the ever-optimist, replied with a simple, yes.


[User] Please transcribe this text

[Assistant] Essentially, it would basically be like taking the entirety of Austin, Texas and transporting everyone who lives there and all of their infrastructure over to Mars. Not to even mention that Mars is on average 100 million miles away, and it takes anywhere between 6 and 8 months just to get there, and that is only going one way.


[User] Please transcribe this text

[Assistant] So let's dive into how possible this really is. First, let's begin by discussing the technology itself and see if this really even can be done at all. The key component for this insane migration of people to happen revolves around SpaceX's latest rocket ship known as Starship.


[User] Please transcribe this text

[Assistant] The rocket, once complete, will consist of two stages. The Super Heavy Booster for the first stage, and the Starship itself for the second. Once complete and on the launch pad, Starship will stand at 122 meters tall and weigh a whopping 150 tons, making it the largest rocket ship ever built.


[User] Please transcribe this text

[Assistant] Further, the rocket will be 3.5 times as powerful as the Saturn V rocket that sent NASA astronauts to the moon several decades ago, and will be capable of carrying 100 tons of payload into orbit and further on towards Mars.


[User] Please transcribe this text

[Assistant] As mentioned previously, and much like SpaceX is accustomed to, the rocket will be fully reusable. As soon as the rocket takes off and is boosted into space, the first stage will descend back to Earth and land much like the SpaceX Falcon 9 does today. And further, the Starship will also be capable of landing itself upright, too. But while you might think,


[User] Please transcribe this text

[Assistant] This is because, although it's a massively powerful rocket, it will still take the majority of its fuel just to break free from Earth's gravity. Thus, for every rocket heading to Mars, a subsequent rocket will also need to be launched to refuel each ship.


[User] Please transcribe this text

[Assistant] And to further complicate this process however, is the fact that Earth and Mars are also at ever-changing distances apart.


[User] Please transcribe this text

[Assistant] So rather than say, launch a rocket whenever, it is much preferred to wait for the Earth-Mars transfer window as it's known.


[User] Please transcribe this text

[Assistant] Traveling home wouldn't be possible at all because all of the fuel would have been expended during the journey just getting there. And this is why the first settlers who get there will have to set up a fuel production facility straight away. Otherwise, well, I guess good luck ever coming home or making use of those reusable rockets again.


[User] Please transcribe this text

[Assistant] The fuel that will most likely power Starship on its journey to Mars will be something known as deep cryomethylox, or essentially just methane and liquid oxygen.


[User] Please transcribe this text

[Assistant] The trouble, however, will be producing these on Mars and finding an efficient way to do so. What is likely the solution, however, will be to use the ice melt found on Mars for water, as well as the large amount of carbon dioxide that can be found in the Martian atmosphere. Together, along with a complex chemical conversion process, the propellant


[User] Please transcribe this text

[Assistant] Which, at least by today's standards, will take about 10 and a half American-sized football fields worth of solar arrays. Needless to say, you better be packing a lot of these for the trip.


[User] Please transcribe this text

[Assistant] Now, let's just assume that all of these incredible technical challenges are overcome. I mean, I wouldn't put it past Elon, but there is still one more massive logistical problem.


[User] Please transcribe this text

[Assistant] Right now, SpaceX is hoping to launch the first trips to Mars in the mid to late 2020s.


[User] Please transcribe this text

[Assistant] This decade. Which would leave just 25 years left to achieve the goal of 1 million people on Mars by 2050.


[User] Please transcribe this text

[Assistant] With each ship carrying roughly 100 people, that means that each transfer window would allow for an additional 100,000 people to make the journey. And across the 12 transfer windows available between 2025 and 2050,


[User] Please transcribe this text

[Assistant] Well, then the 1 million Martian population mark can easily be eclipse.


[User] Please transcribe this text

[Assistant] But one important item not to overlook is the fact that there will likely need to be many exclusively cargo missions as well in order to send the critically needed supporting infrastructure and supplies. In fact, Musk has hinted before that the cargo to person ratio would be something like 10 to 1.


[User] Please transcribe this text

[Assistant] Meaning that for every one rocket ship destined to carry 100 people to Mars, an additional 10 would need to be sent carrying supplies. So in all likely reality, it would probably be something more like 100,000 or even more starship trips required just to get to the 1 million people on Mars goal.


[User] Please transcribe this text

[Assistant] So, with all of that in mind, the reality of meeting the goal becomes quite complex.


[User] Please transcribe this text

[Assistant] Oh, and I also forgot, you also need to consider that even more additional rocket ships would be required to perform all of the refueling required too. So in order to reach the 1 million people goal, it doesn't seem unreasonable to assume that something like 15 or 20,000 starships would be required over the 25 year time frame.


[User] Please transcribe this text

[Assistant] And I mean, that's just not super feasible. Even if you built two starships per week beginning today, that would only get you to a little over 3,000 of them by 2050. Which is obviously pretty short of the required amount. And even further complicated matters is the actual cost of it all.


[User] Please transcribe this text

[Assistant] Europeans began migrating from the old world in droves. Yet it still took an incredibly long time just to reach the 1 million person mark.


[User] Please transcribe this text

[Assistant] After sailing for roughly six to eight weeks and traversing something like 5,500 kilometers of open ocean, depending on the start and end points, it could be said that the European journey to and colonization of the Americas is very similar.


[User] Please transcribe this text

[Assistant] Although not exactly known when 1 million European migrants reached and settled in America, it very likely took a little over 200 years. Not happening until sometime in the early 18th century, between 1720 and 1730.


[User] Please transcribe this text

[Assistant] Technology is certainly trending in that direction, and the motivation is there as well. But to expect a million people, well, I think we may have to wait until at least the end of the century, or even possibly a bit longer to see that one.


[User] Please transcribe this text

[Assistant] However, if you're wanting to learn a lot more about the dangers and challenges that humans will face while colonizing the red planet right now, one of the best ways to do so is by experiencing one of the best books ever written on the subject called The Martian by Andy Weir.


[User] Please transcribe this text

[Assistant] While it's obviously a fictional story about an engineer who becomes stranded on the planet in the near future, the story is expertly researched and grounded in real world logistics and technology issues that document the incredible harsh reality of surviving on a hostile alien world.


[User] Please transcribe this text

[Assistant] I'm sure you've probably heard all about Audible by now, but I've been an Audible member for years now because they keep expanding their selection in fantastic new ways. There are, of course, thousands of audiobooks for you to select from, but that's really just the tip of the iceberg. With their newly rolled out Audible Plus membership,


[User] Please transcribe this text

[Assistant] You'll get access to thousands more originals and podcasts so you can go from a sci-fi novel like The Martian to a true crime podcast into a biography and from there to countless other titles. I listen to audible content nearly every day while I'm cooking, driving, studying, or even just falling asleep to something that sounds nice. And you can too.


[User] Please transcribe this text

[Assistant] But best of all, like I mentioned previously, you can get any audiobook you want out of their thousands of titles completely for free and get a 30 day free trial as well by going to audible.com slash real life lore or by texting real life lore to 500 500.


[User] Please transcribe this text

[Assistant] You can get something really cool for free and you get to support real life lore at the same time. And as always, thank you so much for watching.


[User] Please transcribe this text

[Assistant] We've locked up all the specialist chefy equipment. This week is all about your raw talent guys. Your ability to cook delicious dishes using only the equipment that people have at home.


[User] Please transcribe this text

[Assistant] Hang on, hang on. Cause it is lock up all the fancy equipment.


[User] Please transcribe this text

[Assistant] What that is for me is like the best strawberries and cream, but pineapple and cream.


[User] Please transcribe this text

[Assistant] Today's invention test is all about one person's kitchen. My mother's. Eloise, tell us what you had to choose from.


[User] Please transcribe this text

[Assistant] You need to rip something out. In eight minutes, which is possible.


[User] Please transcribe this text

[Assistant] Right, but your frame of mind wasn't there. Okay.


[User] Please transcribe this text

[Assistant] Your idea about putting those little agar cubes of apricot, I reckon you've been watching Hista Blumenthal. I'm not him, you're not him. Right? Focus on what you do.


[User] Please transcribe this text

[Assistant] I'm so, so pleased for you. Congratulations. And joining Eliza and Sarah is


[User] Please transcribe this text

[Assistant] Uh, yeaah, I started off on the back foot. I think I was a little bit behind. I was just feeling the stress and the tension of the whole scenario. But in the end, I was getting into my stride a little bit better and I felt a little bit better how things were going.


[User] Please transcribe this text

[Assistant] Yeah, look, it means everything to me. This whole, uh, situation being a mass chef has been such an experience so far. I'm still getting into it, I'm still finding my feet.


[User] Please transcribe this text

[Assistant] I feel like generally I'm getting a little bit closer to where I want to be and that means, yeaah, that means everything to me to be here and to stay in the competition.


[User] Please transcribe this text

[Assistant] I'm definitely going to follow my food dream and get into a kitchen somewhere along the way. Uhm, it's definitely where I want to be.


[User] Please transcribe this text

[Assistant] Make this my home. My family. Really hoping it's enough to get me over the line.


[User] Please transcribe this text

[Assistant] What I wanted to do was hero the halloumi and something that I would enjoy eating, so.


[User] Please transcribe this text

[Assistant] Welcome back. Let's now talk about our first data structure. And that's going to be arrays.


[User] Please transcribe this text

[Assistant] And let's say I wanted to store my friends names in variables so that I could use them later in my program. And so with the knowledge that we have so far, this is how we would do it. So, const.


[User] Please transcribe this text

[Assistant] Let's spell this correct. Then friend2.


[User] Please transcribe this text

[Assistant] Now, this isn't really fun to do, right? Because imagine that we actually wanted to represent 10 friends, and then we would have to create 10 variables. So that doesn't sound like fun.


[User] Please transcribe this text

[Assistant] Instead, wouldn't it be great to essentially bundle all of these values together into some bigger container?


[User] Please transcribe this text

[Assistant] Well, that's why we have data structures in JavaScript. And arrays are such a data structure. So an array is like a big container into which we can throw variables and then later reference them.


[User] Please transcribe this text

[Assistant] And that's super important because programming is most of the time all about data. So we get data from somewhere, we store and process data, and then we give some data back.


[User] Please transcribe this text

[Assistant] And that data, it has to go somewhere. So it has to be stored in some place. And for that, we use data structures just like arrays. So in case we have more than just a single value.


[User] Please transcribe this text

[Assistant] The two most important data structures, at least in JavaScript, are arrays and objects. And so now, let's learn all about arrays. So instead of doing this, let's create a variable, which I'm going to call friends.


[User] Please transcribe this text

[Assistant] And then we use the brackets to create a new array. And then in there we can put different values separated by commas. And so let's now use the exact same friends.


[User] Please transcribe this text

[Assistant] Peter. And make sure that these commas here are outside of the string. So that's an error I see people do. And so this needs to be one string. So you need to start and finish it. Then the comma and then another value, then another comma and then another value.


[User] Please transcribe this text

[Assistant] Okay, and now let's take a look at it in the console.


[User] Please transcribe this text

[Assistant] Okay, and so this is what the array looks like in the console.


[User] Please transcribe this text

[Assistant] Basically, just as we wrote it in our code. And that is the absolute basics about arrays. So that's how we create one. At least that's the way that we use the most. But there is actually another way. So let me show that to you as well. So let's say we wanted an array of years.


[User] Please transcribe this text

[Assistant] And so instead of the brackets, we could also write


[User] Please transcribe this text

[Assistant] So an array can hold as many values as we want and also values of any type that we'd like. So it doesn't have to be strings like here. Of course, numbers work just the same.


[User] Please transcribe this text

[Assistant] So here we used a different way of creating the array, which was using this array function. So you see that it's a function because we called it here, basically using these parenthesis.


[User] Please transcribe this text

[Assistant] And we also needed to use the new keyword, because otherwise it's not gonna work. But anyway, it's way more usual to just use the brackets like I did up here, which is called the literal syntax.


[User] Please transcribe this text

[Assistant] So now we know how to create arrays, so basically how to put elements into an array, but of course we need to have a way to get them out. And for that we use the square bracket syntax again.


[User] Please transcribe this text

[Assistant] So let's say that we want to log to the console the first element of this friends array. So that would be Michael.


[User] Please transcribe this text

[Assistant] So that's the name of the array. And then we use the square brackets and then the number zero.


[User] Please transcribe this text

[Assistant] That's because arrays are zero-based, which means that this first element is the element number zero, then this one is element number one, number two, and so on and so forth.


[User] Please transcribe this text

[Assistant] And so if we want the element at position 0, so this first one, then we write friends, square brackets, 0. And that's it.


[User] Please transcribe this text

[Assistant] And now let's say we wanted Peter here as well. So that would be element 0 1 2.


[User] Please transcribe this text

[Assistant] And so let's just write two and check it out. And indeed we get Michael and Peter. Cool. Now we can also get the actual number of elements that is in the array.


[User] Please transcribe this text

[Assistant] So let's also log that one to the console. And this one works by saying friends dot


[User] Please transcribe this text

[Assistant] is something called a property, which we're gonna talk about a little bit later in this section when we talk about objects. Anyway, what matters is that this is gonna be the exact amount of elements that is in the array. And it's not zero-based.


[User] Please transcribe this text

[Assistant] So it will not be 2, even though the last one here is element number 2. Instead, it really gives us the number of elements in the array. So we should expect this to log 3.


[User] Please transcribe this text

[Assistant] And yeaah, here we go. Now, we can use this to automatically get the last element of any array. And that is useful so that we don't have to count how many elements are in the array. So, let me show you how we could do that.


[User] Please transcribe this text

[Assistant] Friends, and then remember to retrieve an element from the array, we need to square brackets. So just like this. And then to get the index of the last element in the array, all we need to do is friends.length minus one.


[User] Please transcribe this text

[Assistant] So friends.length minus one. And that's because, uhm, again, friends.length is not zero based. So this is three, remember, but this last element is two. And so we always need to subtract one from this number here.


[User] Please transcribe this text

[Assistant] Okay, so what this also means is that inside of these brackets we can put any expression. It doesn't just have to be a number literally like we did here and here.


[User] Please transcribe this text

[Assistant] So here we have this expression, and remember that an expression is something that produces a value. And so this one here is going to be calculated first. So it will compute friends.length, which is 3, minus 1 is 2, and then it will get friends at position 2.


[User] Please transcribe this text

[Assistant] And that's also one of the reasons why it's important that you know what is an expression and what is a statement. Because once again, we could not put a statement in here. So inside of these square brackets, JavaScript expects an expression, not a statement.


[User] Please transcribe this text

[Assistant] Anyway, we got the correct element from the array, which is the element number two. And so that means that this automatic retrieval of the last element works just fine.


[User] Please transcribe this text

[Assistant] Alright. And moving on, there is more stuff that we can do. So this square brackets syntax that we used here is not only for retrieving elements from the array, but we can also change it to add elements to the array.


[User] Please transcribe this text

[Assistant] So let's say that for some reason I'm no longer friends with Peter and that I want to replace him with some other friends. And so now we can change or mutate the array in the same way.


[User] Please transcribe this text

[Assistant] So we can say friends at position number two, and now I'm doing it manually here again. So we can say that this should be equal to something else. Let's say j. And if we now log this friends array to the console, then we should already see the new array. So.


[User] Please transcribe this text

[Assistant] Friends, and let's see. And indeed, the element number two, so this one here, is now replaced with j.


[User] Please transcribe this text

[Assistant] So in the beginning, when we first logged the, uh, friends array to the console, it was still in this state. So it still had Peter. And that's why here in the beginning we still see that original state. But then as we move on through the code,


[User] Please transcribe this text

[Assistant] At some point here, we change that array. And so when we then log the array again, that change is of course reflected here in the output.


[User] Please transcribe this text

[Assistant] But wait, didn't I say in the last section that variables declared with const cannot be changed?


[User] Please transcribe this text

[Assistant] And we did in fact declare the friends variable here with const, right? But I was still able to change one element of the array here from peter to j, right? So isn't that a contradiction?


[User] Please transcribe this text

[Assistant] Well, what I didn't tell you at the time is that only primitive values are immutable. But an array is not a primitive value. And so we can actually always change it, so we can mutate it.


[User] Please transcribe this text

[Assistant] And it works this way because of the way that JavaScript stores things in memory. And once more, we will have a whole lecture just on that topic alone in a special section about how JavaScript works behind the scenes.


[User] Please transcribe this text

[Assistant] So what you need to know for now is that we can actually mutate, uh, arrays even though they were declared with const. Now what we cannot do is to actually replace the entire array. So we cannot do


[User] Please transcribe this text

[Assistant] This cannot save that the entire friends array should now be...


[User] Please transcribe this text

[Assistant] Bob and Alice. That would be illegal. So let's see. And now we get assignment to constant variable. And so that's why that we cannot do, but let's just keep it here anyway. So you get this as a reference.


[User] Please transcribe this text

[Assistant] Next up, I want to show you that an array can actually hold values with different types all at the same time. So let's, uhm, experiment with that. So let's create an array which holds all kinds of information about me.


[User] Please transcribe this text

[Assistant] So let's say, Jonas. So that would be the first name.


[User] Please transcribe this text

[Assistant] Then the last name, then the age, and here we can actually calculate the age from other values. And that works because in each position, JavaScript simply expects an expression. And so if we do this, then this is perfectly.


[User] Please transcribe this text

[Assistant] Okay, so this will here produce a value and so that's the value that will then be stored at position number two of the new array. And that also works for variables. So we could, for example, do


[User] Please transcribe this text

[Assistant] First name equal Jonas. And then, here instead of literally writing that, we could use this variable name. And so this would then be replaced with the actual string.


[User] Please transcribe this text

[Assistant] So let's put some more data and actually we could even put other arrays inside of an array. So that's really cool. So let's put the friends array here in the Jonas array. And then with this, we have all the relevant data about Jonas in one handy data structure.


[User] Please transcribe this text

[Assistant] And that's really convenient because then we don't have to create one variable for each of the data points.


[User] Please transcribe this text

[Assistant] So let's of course inspect this now in the console so that you can see that all of these expressions here basically, so this and this here and this, so all of them are going to be replaced with the values that they produce. And so,


[User] Please transcribe this text

[Assistant] Indeed, we now get Jonas, we have the calculated age, and here we have the array.


[User] Please transcribe this text

[Assistant] And we can expand that by clicking on this small triangle here, and then we can see the actual array, uh, in here. We also have the length. So length is five. And so that's where JavaScript gets this friends.length from.


[User] Please transcribe this text

[Assistant] Jonas.length would of course also work and it would be this five that we see here.


[User] Please transcribe this text

[Assistant] Great. So these are the very fundamentals of arrays in JavaScript. And now just to finish this video, let's work on a very small array exercise so that we can see why arrays are actually so useful. And to do that, let's bring back our old colch function. So.


[User] Please transcribe this text

[Assistant] It's gotta be somewhere here. Yes. Let's use this one. We've coded this so many times that I don't want to repeat it.


[User] Please transcribe this text

[Assistant] So cock age. And now let's say that we have an array of birth years. And then we want to calculate the ages for some of them. So a new array.


[User] Please transcribe this text

[Assistant] And now we will be able to use the colchH function and then store the results of calculating the ages for some of these years into a new array. So let's see how, and let's see first how we could not do it. Okay.


[User] Please transcribe this text

[Assistant] For example, if we wanted to use the colqh function for all of the elements in this array, we could not do this.


[User] Please transcribe this text

[Assistant] It's not going to work, because this year's is an array. And if we pass this year's array as an argument to the call gauge function, it doesn't know what to do with it, because this operation here expects a single value, and we cannot do a number minus an array.


[User] Please transcribe this text

[Assistant] So let me actually show you what's going to happen if we run this and well, that's not the error that I wanted to show you. So what we get is identifier years has already been declared. So this means that somewhere in the code we already have.


[User] Please transcribe this text

[Assistant] Uh, an array called years. And yeaah, here it is. Let's change the name of this one to just y.


[User] Please transcribe this text

[Assistant] So that one doesn't really matter anyway. But now, let's see what happens. And, well, not much did happen. So we actually need to, uh, inspect the result of this.


[User] Please transcribe this text

[Assistant] So console.log and then the result of this. So let's see. And now we get the result, not a number. And so that's the result of attempting to subtract a whole array, which would be this year's array, from a number.


[User] Please transcribe this text

[Assistant] Okay, so let's actually do that here as well. Remember that we have access to all the variables that we declare in the script, also in the console. So that's the use array that we just declared.


[User] Please transcribe this text

[Assistant] But years, for example, plus 10, does not work. At least not in a way that we expected it. So the plus operator, what it does here, is to convert everything to a string, just like I showed you before. And so the string here is then basically this array as a string, and then it adds the 10 here.


[User] Please transcribe this text

[Assistant] So that's not meaningful at all. And if we use it with minus 10, then it's even weirder, so we get not a number. So all of this is to say that we cannot really do operations with arrays. But we can still use the colqh function on individual elements of the array, of course.


[User] Please transcribe this text

[Assistant] So let's do that, and we will assume that I want to calculate the ages for the first, the second, and the last array element. So this one, this one, and this one. So...


[User] Please transcribe this text

[Assistant] Let's, uh, calculate this and then store the result into a variable called h1.


[User] Please transcribe this text

[Assistant] And so as I said, I want to calculate the age for this first element. And so what we do is to take years at position zero. And so this year will then basically be replaced with 1990. And then colch is called with 1990 and the result is stored to age one. Now let's do this some more times.


[User] Please transcribe this text

[Assistant] And here I'm using, uh, one. So remember I want this, this, and the last one, but I don't want to count the number of elements in the array. And so I use that trick that I just showed you in the beginning, which is to first compute the length of the array. So here's dot length.


[User] Please transcribe this text

[Assistant] And yeah, so we got three values here, which are these three ages. But we can take this even a little bit further. So since we started with an array, it's usually a good idea to also end up with a new array. So let's create an array, const, ages. And now what should I put in here? Well, remember how I set up here?


[User] Please transcribe this text

[Assistant] That any position of the array simply needs to be an expression. So something that produces a value. And as we already know, this here produces a value as well. Right? It is an expression. And so I can take this and simply put it as a position in this array.


[User] Please transcribe this text

[Assistant] And so JavaScript will then go ahead, compute this value, and place it in the array.


[User] Please transcribe this text

[Assistant] So basically, we can place function calls into an array just fine, because they will produce a value.


[User] Please transcribe this text

[Assistant] And now here we need to again do years.


[User] Please transcribe this text

[Assistant] And now, finally logging it to the console, and then we're done.


[User] Please transcribe this text

[Assistant] And indeed, we get the three same values that we had up here separately, now all nicely placed into this array. And this of course works because JavaScript will start by running these function calls, these three function calls here, and then place all the results in an array afterwards.


[User] Please transcribe this text

[Assistant] Nice. And I think that should be enough for one video. I hope that you see how fun arrays can be and how useful they can be. And in the next lecture, we will make them even more useful by doing some operations with them.


[User] Please transcribe this text

[Assistant] Well, it's a mystery box, but it's not just any mystery box.


[User] Please transcribe this text

[Assistant] And over the last 15 years, she's run Australia's most respected chocolate and pastry school. Please welcome, from Savour in Melbourne, Kirsten Tybalt!


[User] Please transcribe this text

[Assistant] Of the white chocolate with the bitterness of the green tea powder is fantastic. Smashed it man, well done.


[User] Please transcribe this text

[Assistant] Now it's time to taste and decide which three of you have done the best dishes and which three of you have stumbled. Let's start the tasting with Callan.


[User] Please transcribe this text

[Assistant] Are these supposed to be hazelnut beads with long stings, is that the idea? Yes. So I think that's super cute, using this hazelnut idea as little beads with a bit of stings out. Nice texture.


[User] Please transcribe this text

[Assistant] Uhm, it's minimal to say the least. That's missing.


[User] Please transcribe this text

[Assistant] Pressure, madness that comes over you when you're cooking for one of your heroes and you're desperate to impress Janice and you've just done too much. Okay.


[User] Please transcribe this text

[Assistant] If I call your name, please step forward. Yours is one of the three best dishes of the day. You'll be competing in this week's immunity challenge, where possibly you could fight it out for a pin.


[User] Please transcribe this text

[Assistant] So we've got a lavender gel, some lime marshmallow, and a crème fraîche mousse.


[User] Please transcribe this text

[Assistant] Alright, so we were talking about that crash, and I think what led to the crash was the driver jammed on the brakes. Right.


[User] Please transcribe this text

[Assistant] That's right, or maybe the ground crew at the airport. Okay, or the flight crew. Also at the airport. Alright.


[User] Please transcribe this text

[Assistant] Well, even though we're talking about F1 racing, a lot of the language can be used in many different situations. So let's look at some of those phrases now.


[User] Please transcribe this text

[Assistant] Okay, so I understand that to mean like the final length of time.


[User] Please transcribe this text

[Assistant] Right. No, it means you must complete five minutes before you can be finished.


[User] Please transcribe this text

[Assistant] A situation that is almost dangerous, but wasn't.


[User] Please transcribe this text

[Assistant] You can visit us at EnglishPod.com where Marco and I are around to answer your questions. Alright, any Canadian race car drivers? Uh, uh, yeaah, there was one recently. Someone, some, something.


[User] Please transcribe this text

[Assistant] They were interested in studying the effect of using different learning algorithms versus trying them out on different training set sizes.


[User] Please transcribe this text

[Assistant] Machine learning problems like these, so the supervised learning problems to try to categorize what is the appropriate word to go into a certain position in an English sentence.


[User] Please transcribe this text

[Assistant] They took a few different learning albums which were, you know, sort of considered state of the art back in the day when they ran the study in 2001. So they took a variance, roughly a variance on logistic regression called a perceptron. Uh, they also took some of their albums that


[User] Please transcribe this text

[Assistant] The exact algorithms of these details aren't different, aren't important. Think of this as, you know, just picking four different classification algorithms, uh, and really the exact algorithms aren't important.


[User] Please transcribe this text

[Assistant] But what they did was they varied the training set size and tried out these learning algorithms on a range of training set sizes, and that's the result they got.


[User] Please transcribe this text

[Assistant] And the trends are very clear, right? First, most of these algorithms give remarkably similar performance. And second, as the trading set size increases on the horizontal axis, as the trading set size in millions, as you go from, you know, a hundred thousand up to a thousand million, that is a billion


[User] Please transcribe this text

[Assistant] And this is, uh, results like these has led to a saying in machine learning that often in machine learning is not who has the best algorithm that wins, it's who has the most data.


[User] Please transcribe this text

[Assistant] Let's try to lay out a set of assumptions under which having a massive trading set we think will be able to help. Let's assume that in our machine learning problem,


[User] Please transcribe this text

[Assistant] For example, if we take the confusable words problem that we had on the previous slide, let's say that the features x capture what are the surrounding words around the blank that we're trying to fill in. So the features capture that we want to have, we have a sentence for breakfast, I ate blank eggs.


[User] Please transcribe this text

[Assistant] So the features capture, you know, what are the surrounding words, then that gives me enough information to pretty unambiguously decide what is the label why, or in other words, what is the word that I should be using to fill in that blank out of this set of three conclusible words.


[User] Please transcribe this text

[Assistant] So that's an example where the features x have sufficient information to predict y. For a counter example,


[User] Please transcribe this text

[Assistant] From only the size of the house and from no other features.


[User] Please transcribe this text

[Assistant] Well, there are so many other factors that will affect the price of a horse other than just the size of the horse that if all you know is the size, it's actually very difficult to predict the price accurately.


[User] Please transcribe this text

[Assistant] So that would be a counter example to this assumption that the features have sufficient information to predict the price to the desired level of accuracy. The way I think about testing this assumption, one way I often think about it is I'll often ask myself,


[User] Please transcribe this text

[Assistant] Given the Input Features Act, so given the features, given the same information available to a learning algorithm, if we were to go to a human expert in this domain,


[User] Please transcribe this text

[Assistant] Can a human expert accurately or can a human expert confidently predict the value of y?


[User] Please transcribe this text

[Assistant] For this first example, if we go to, you know, an expert human English speaker, like you go to someone that speaks English well, right? Then the human experts in English, just really most people like you and me,


[User] Please transcribe this text

[Assistant] But in contrast, if we go to an expert in human prices, like maybe an expert router, right, someone who sells houses for a living. If I just tell them the size of a house and I tell them what the price is, well, even an expert in pricing or selling houses wouldn't be able to tell me. And so there's a sign that


[User] Please transcribe this text

[Assistant] For the housing price example, knowing only the size doesn't give me enough information to predict the price of the house. So let's say this assumption holds.


[User] Please transcribe this text

[Assistant] So these are all powerful learning algorithms with a lot of parameters that can fit very complex functions. So I'm going to call these


[User] Please transcribe this text

[Assistant] And because we have a very powerful learning algorithm that can fit very complex functions, chances are if we, uhm,


[User] Please transcribe this text

[Assistant] Run these algorithms on the data set, it will be able to fit the training set well, and so hopefully the training error will be small.


[User] Please transcribe this text

[Assistant] Now, let's say we use a massive massive training set. In that case, if we have a huge training set,


[User] Please transcribe this text

[Assistant] Even much larger than the number of parameters, then hopefully these algorithms will be unlikely to overfit. Right, because we have such a massive training set. And by unlikely to overfit, what that means is that the training error will hopefully be close to the test error. Finally, putting these two together, if the training set error is small and the test set error is close to the test error,


[User] Please transcribe this text

[Assistant] Training error. What these two together imply is that hopefully the test set error will also be small.


[User] Please transcribe this text

[Assistant] So the bias problem we're going to address by making sure we have a learning algorithm with many parameters, and so that gives us our low bias algorithm.


[User] Please transcribe this text

[Assistant] By using a very large trading set, this ensures that we don't have a variance problem either. So hopefully our algorithm will have low variance. And so it's by putting these two together that we end up with a low bias and a low variance learning algorithm.


[User] Please transcribe this text

[Assistant] First, can a human expert look at the features x and confidently predict the value of y? Because that's sort of a certification that y can indeed be predicted accurately from the features x.


[User] Please transcribe this text

[Assistant] Let's now explore some more features of the for loop and also create a somewhat more useful example.


[User] Please transcribe this text

[Assistant] And one of the most used applications of for loops is to loop through arrays. So let's get back the array that we were using before. So where is that?


[User] Please transcribe this text

[Assistant] So I mean the one where we talked about objects. Yeah, this one. So go to this lecture about introduction to objects and then grab this Jonas array. And maybe you didn't write it back then, but then you can just write it, uh, right now.


[User] Please transcribe this text

[Assistant] Okay, and so now we can use a for loop to loop through this array.


[User] Please transcribe this text

[Assistant] And let's say for now that we wanted to individually log every element of the array to the console. So very simple. All we want to do is to log these five elements here. So let's write a for loop. And as always, we start with the counter.


[User] Please transcribe this text

[Assistant] So let, and now a traditional counter variable name has been i for a long time. And so let's use that here as well. So just i.


[User] Please transcribe this text

[Assistant] And this time, we need to start it at zero. And that's because the array is zero-based when it comes to reading elements out of the array. Remember? And this will make sense once we actually write the code of this loop.


[User] Please transcribe this text

[Assistant] Let's now actually skip the condition for now. So we're gonna deal with that a little bit later.


[User] Please transcribe this text

[Assistant] And so now updating the counter is going to work exactly the same as before. So since we want to log all of the elements, we need to update the counter variable simply by one. And so again, we use plus plus.


[User] Please transcribe this text

[Assistant] And remember, all we want to log to the console is each element of the array. And so, without the loop, we would write that like this. So, Jonas, zero. Right? And then, let's do that outside. So we would do this, this, and then all the way to, uh, number four.


[User] Please transcribe this text

[Assistant] Let's comment this out, but this is helpful to see what kind of code we want to achieve. So again, we want to start at Jonas 0, which is the first element. Jonas 1 is this one, then 2, 3 and 4.


[User] Please transcribe this text

[Assistant] And so that's the reason why we started the counter at zero, because that's the first element that we want to get. It's Jonas, zero. And so here instead of hard coding the zero, of course we are going to use our counter variable. So, and that's i.


[User] Please transcribe this text

[Assistant] And now the trickiest part here is the condition. And so that's why we left it for the end. But now we need to actually tackle it.


[User] Please transcribe this text

[Assistant] For how long do we want to keep this loop running? Well, it should run when i is 0, right? It should also run when it's 1, 2, 3 and


[User] Please transcribe this text

[Assistant] Because 4 is the last element. But when it's 5, it should no longer run. Right? And that's because Jonas, uh, at 5 does not exist. Let's just write that.


[User] Please transcribe this text

[Assistant] And so that means that the i counter variable should always stay below 5.


[User] Please transcribe this text

[Assistant] So let's write that here. So i should stay below 5. And so with this, as soon as the counter variable is updated to 5, then the next iteration of the loop will not run anymore. So let's try this.


[User] Please transcribe this text

[Assistant] And here it's of course not Jonas, it's Jonas array. So let's actually change the name up here in the array itself.


[User] Please transcribe this text

[Assistant] Let's try that again. And yeah, we get a log of each of the elements in the array. So all of the five of them. Great. But there's actually still one problem with this, which is that we hardcoded the length of the array here with five. So let's now say that we add another element.


[User] Please transcribe this text

[Assistant] Let's say just true, and so if we try this now, do you think that true will be locked here as well?


[User] Please transcribe this text

[Assistant] It will not, because of course we are still telling JavaScript that i should stay below 5. And so it will not print the array at position number 5, which does now exist. So now we do have Jonas at position 5, right?


[User] Please transcribe this text

[Assistant] And so the solution to this is to not hard code the value here, but to compute this value. So basically to get it from JavaScript itself.


[User] Please transcribe this text

[Assistant] And how can we get this number? Well, actually this 5 is simply the length of the array, right? Not of this one anymore, but of the original one.


[User] Please transcribe this text

[Assistant] So this array has a length of 5. And so 5 is exactly the number that we put here. And so we can simply replace the hardcoded value with a dynamically calculated one. And that's Jonas.length. Remember? So.


[User] Please transcribe this text

[Assistant] So let's try that. And indeed, it still works. And if I now go back to adding something else, like true, then jonas.length will now be 6. And that of course happens automatically, and we don't have to manually change any code in that loop.


[User] Please transcribe this text

[Assistant] So now indeed true also appears here in our log. Great.


[User] Please transcribe this text

[Assistant] Let's now also log something else here. Let's say the type of the variable.


[User] Please transcribe this text

[Assistant] So type of Jonas I. And I hope that this part here makes sense. So the fact that we're using the counter variable here to retrieve all the elements of the array.


[User] Please transcribe this text

[Assistant] So now let's say, so string, string, number, string, object. So remember how I said that an array is in fact an object, and here we have the proof of that. And then finally the last one is of course a boolean.


[User] Please transcribe this text

[Assistant] Okay, so I hope that this logic here made sense. And so this is, in a nutshell, how we loop arrays using the for loop.


[User] Please transcribe this text

[Assistant] Now what we did here was only to read values from an array. But now let's also at the same time create a new array which will contain this type of each of the elements.


[User] Please transcribe this text

[Assistant] So basically this. Alright. So again, what I want to do now is to create a new array which will contain all the types for all these elements.


[User] Please transcribe this text

[Assistant] And if that sounds a little bit useless, then, uh, just keep in mind that these are all just educational exercises. So I designed them to show you how these different features of the language work.