[User] Please transcribe this text

[Assistant] And so after that process, then we know that the entire array is in its final order. All sorted.


[User] Please transcribe this text

[Assistant] Alright, so uhm, let's, one way to understand the way that an algorithm works is to think about invariance. So for the selection sort, we have a pointer that was our variable i that scans from left to right. That's indicated by a little red arrow in this representation.


[User] Please transcribe this text

[Assistant] No entry to the right of the arrow is smaller than any entry to the left of it. That's the way that we set it up. And the algorithm maintains those invariants by finding the smallest entry to the right and exchanging it with the next one.


[User] Please transcribe this text

[Assistant] So uhm, the code implements the invariance. So to move the pointer to the right, we increment i. So now the invariant, uh, might be violated.


[User] Please transcribe this text

[Assistant] So we have to fix it. It might be violated because you might have an element to the right of the pointer, uh, that is, uh, smaller than some, the element on the pointer. So what we have to do is identify the index of that minimum entry and exchange it.


[User] Please transcribe this text

[Assistant] Then once we've exchanged it, again we've preserved our invariant. After that point, uh, no element to the left of the pointer is going to change, and all the element, there's no smaller element to the right.


[User] Please transcribe this text

[Assistant] Uh, we have an inner for loop that for j, if it finds a smaller one, resets min. Uh, and then once we've looked at all the elements to the right of i, uh, we exchange the smallest one with i.


[User] Please transcribe this text

[Assistant] That's a complete implementation of selection sort.


[User] Please transcribe this text

[Assistant] Now, uh, it's easy to develop a mathematical model for the cost of selection sort, and here's the proposition that describes that.


[User] Please transcribe this text

[Assistant] Uh, selection sort uses, uh, about n squared over two compares and exactly n exchanges. And just looking at this trace of selection sort in operation, uh, really, uh, is proof, visual proof of this proposition.


[User] Please transcribe this text

[Assistant] In this diagram, the entries in black are the ones that are examined in order to find the minimum each time with the minimum in red.


[User] Please transcribe this text

[Assistant] Entries in gray are not touched. They're in their final position.


[User] Please transcribe this text

[Assistant] Well, you can see that this is going to be in general an n by n square in about half of the elements in the square are black or about n squared over 2. And you can see also the exact formula n minus 1 plus n minus 2 and so forth.


[User] Please transcribe this text

[Assistant] Uh, is the total number of compares used. Uh, and then on each of the n, uh, values of the variable i, uh, there's an exchange. So that's, uh, the cost in terms of the number of exchanges.


[User] Please transcribe this text

[Assistant] Uh, now what's interesting about this proposition about selection sort is that it doesn't matter what order the input is, uh, selection sort is going to use quadratic time because it always has to go through the whole thing to look for the minimum.


[User] Please transcribe this text

[Assistant] Another property is that, uh, you can't sort moving less data because selection sort, uh, does just a linear number of exchanges. Every item, uh, is put into its final position, uh, with just one exchange.


[User] Please transcribe this text

[Assistant] You can see our pointer moving from right to left. Every time it finds the smallest element to the right, it exchanges it into position.


[User] Please transcribe this text

[Assistant] Now, if the array is partially sorted, doesn't matter to selection sort.


[User] Please transcribe this text

[Assistant] That is worth travelling 17,000 kilometres for, let me tell you. Delicious. Close your eyes, taste, imagine. You've nailed it.


[User] Please transcribe this text

[Assistant] She's doing well. That looking good, Gina.


[User] Please transcribe this text

[Assistant] You see that lots of weapons, they're going out like nothing today.


[User] Please transcribe this text

[Assistant] But I'm originally Italian. And uh, today I'm going to cook Octopus.


[User] Please transcribe this text

[Assistant] When I'm having trouble in the kitchen, my first thing is to call my nonna. Nonna, I got this problem, how can I set it up?


[User] Please transcribe this text

[Assistant] My dish is simple, so everything has to work together.


[User] Please transcribe this text

[Assistant] So we got octopus, cauliflower puree, parsnip chips, and we got tarragon dressing. Okay.


[User] Please transcribe this text

[Assistant] I love octopus. It's a really simple dish, no many ingredients, just sticking to tradition.


[User] Please transcribe this text

[Assistant] My nonna loves octopus. She just gave it to me since when I was 7 years old. There is my nonna on the plate.


[User] Please transcribe this text

[Assistant] Everybody's encouraging, and that's the MasterChef I know and love.


[User] Please transcribe this text

[Assistant] Um, dumplings stuffed with lemons, and I'm serving them with saffron broth.


[User] Please transcribe this text

[Assistant] Making it to top 5, it's beyond my wildest beliefs. It's a 1 in 5 chance that I could actually win Mass Chef and I guess it's starting to sink in that it could be me.


[User] Please transcribe this text

[Assistant] A big thing for me is confidence, and I think that's something that I've steadily grown throughout the competition.


[User] Please transcribe this text

[Assistant] Yeah, how much time do we want? Let's, uh, six hours.


[User] Please transcribe this text

[Assistant] I've had a problem with editing my dishes and putting too many elements on the plate, so I'm really scaling it back today to show that I'm listening to what the judges are saying and I'm taking on their advice. You're not Picasso, you are a great cook. There's no rules, I can grab anything that I want, but...


[User] Please transcribe this text

[Assistant] My problem is that I often grab too many ingredients from the pantry, so I just need to try and restrain myself a little bit and just take what I need.


[User] Please transcribe this text

[Assistant] That's the first time. Oh, you know I do. I usually do that.


[User] Please transcribe this text

[Assistant] Today I'm making prawns and corn, grilled prawns, stuffed prawn heads. I'm gonna do a corn puree and some charred corn that I've got on the go.


[User] Please transcribe this text

[Assistant] This is a dish I've been practicing just to have on my sleeve that I can bring out when I need.


[User] Please transcribe this text

[Assistant] Yeah, it's a combo I've been playing with. I love prawns and it's just beautiful, tasty, marinated prawns. And they should go really well with the corn.


[User] Please transcribe this text

[Assistant] The issue with my dish that I want to cook today, it's quite simple. It's only got a couple of elements. So I'm wondering whether it's MasterChef finals week worthy. I really want to get that advantage and get the top dish today. So I'm going to add an avocado mousse. Just to tie the whole dish together.


[User] Please transcribe this text

[Assistant] Yeah, having a little bit of time regret. Thank you, Matt. Should have asked for more time.


[User] Please transcribe this text

[Assistant] My corn puree's on the go, my prawns are marinating and just trying to bring everything together now. I've ditched the avocado mousse. So, ding dong, the mousse is dead. The mousse is dead. Good. I really want to show the judges that I can rely on just these elements and make a great dish.


[User] Please transcribe this text

[Assistant] To make this dish finals worthy, I need to cook those prawns perfectly. And then with the stuffed prawn heads, I want them to be crunchy, but have some filling inside to really amp up the flavour.


[User] Please transcribe this text

[Assistant] I put that prawn filling into a piping bag and pipe it into the prawn heads. The prawn heads go in the oil until they're nice and crispy. I start cooking my prawns.


[User] Please transcribe this text

[Assistant] Good, and you're doing it gently, which is nice because you're not burning.


[User] Please transcribe this text

[Assistant] My prawns are looking so crispy and golden. That's exactly how I wanted it to cook.


[User] Please transcribe this text

[Assistant] They're standing up proud. My beautiful prawns are on there as well.


[User] Please transcribe this text

[Assistant] Yarnished with some coriander and some disturgents and the finger limes. It's bright and colourful, I'll give it that.


[User] Please transcribe this text

[Assistant] Yeah, that was hectic. George said we could have as much time as we wanted. I don't know why we didn't choose more than 75, but uhm, I'm happy with the flavours and just hope it all works together and the judges love it. To get that sort of advantage at this point in the competition, it could mean your trip into the finals. So uhm, there's a lot at stake with these little prawns.


[User] Please transcribe this text

[Assistant] This dish compared to a dish that I'll be putting up at the start of the competition, it's sort of chalk and cheese.


[User] Please transcribe this text

[Assistant] I'm proud. This dish shows my growth in the competition and...


[User] Please transcribe this text

[Assistant] Shows that I've been listening to the judges and scaling things back. I just hope they like it.


[User] Please transcribe this text

[Assistant] I hope so. I've been trying to take your advice for the last couple of weeks and sometimes it doesn't stick but I hope today it has. Essentially it's just corn and porn.


[User] Please transcribe this text

[Assistant] I'm so proud of my dish today and every time I step into that kitchen, I'm learning and just gaining confidence.


[User] Please transcribe this text

[Assistant] Top 5 is definitely a milestone, but now I've just got to keep fighting. Next goal is semi-finals, and that's what I'm aiming for. I have to believe that I can go all the way.


[User] Please transcribe this text

[Assistant] I'm just shocked where you get to cook the last service ever in the press club.


[User] Please transcribe this text

[Assistant] Also, don't forget to subscribe to our YouTube channel.


[User] Please transcribe this text

[Assistant] In this video I'm going to give you a challenge, a brain teaser of sorts. It involves weighing coins. So here it is. So say you have


[User] Please transcribe this text

[Assistant] 12 coins. 1, 2, 3, 4. Maybe they're quarters or something. 5, 6, 7, 8.


[User] Please transcribe this text

[Assistant] Either they are all exactly the same weight, or one of them has a different weight, and all the others are the same.


[User] Please transcribe this text

[Assistant] And if one of them ha- and if there's one that has a different weight,


[User] Please transcribe this text

[Assistant] A balance. So you have a balance here. You know, like the scales of justice.


[User] Please transcribe this text

[Assistant] It's this little base. Okay, and this is your, this is your balance. And so you can take some of these coins. Maybe you take like, maybe you take like these, these two here. And then, and then maybe, I don't know, these two here or something. And you can put some of the coins on one side. So I get some coins over here and some coins over here.


[User] Please transcribe this text

[Assistant] And then the balance will either balance or it won't, so it's either going to, it's going to do one of the following three things. Either this side is heavier and this side is lighter, so in that case we would have, whoop, we would have,


[User] Please transcribe this text

[Assistant] This sort of situation. This is heavier, this is lighter. Or, or this side is lighter and this side is heavier, so that would be like this sort of situation.


[User] Please transcribe this text

[Assistant] Or they're exactly the same and they balance. So that would be sort of as I've drawn it above.


[User] Please transcribe this text

[Assistant] So they balance. So there's three alternatives here, three things that can happen. One, two, three.


[User] Please transcribe this text

[Assistant] For any two groups of coins that you put on, put on the scale.


[User] Please transcribe this text

[Assistant] So now, here's the problem. Your task...


[User] Please transcribe this text

[Assistant] If you choose to accept it, is to determine whether one of these coins is different and if so, which one


[User] Please transcribe this text

[Assistant] And is it heavier or is it lighter?


[User] Please transcribe this text

[Assistant] So that's your task. Is there an odd coin? Which one is it? And is it heavier or lighter? That's your task.


[User] Please transcribe this text

[Assistant] And of course, okay, now that's not too difficult, you know, and, and of course the only thing you can do is, is use the scale. That's the only means you have that you don't have any other things that you can compare these against or anything like that. All you can do is put different groups of coins on the scale.


[User] Please transcribe this text

[Assistant] And here's, here's the clincher. Here's the tricky part.


[User] Please transcribe this text

[Assistant] The tricky part is, you have to be able to do this...


[User] Please transcribe this text

[Assistant] Using the scale only three times. Three times.


[User] Please transcribe this text

[Assistant] Of course, you know, if you could use it arbitrarily many times, then it would be easy. But the hard part is, can you do it in three uses of the scale for three different pairs of groups? Can you compare their weights and, and, and determine the out, you know, to solve your task?


[User] Please transcribe this text

[Assistant] Okay, so that is the, the brain teaser. That's, that's the problem.


[User] Please transcribe this text

[Assistant] And I challenge you to try to solve it on your own. Don't, don't look it up or anything like that. Try, try to solve it on your own. Try to figure out how you can use the scale, you know, three times and, and figure out that the answer, which whether it's as one lighter or heavier. And if so, which one, and is it lighter or heavier?


[User] Please transcribe this text

[Assistant] And so this is a, this is a difficult problem, I think. I, I, when I first came across it, when a friend first told me this problem, I was stumped. I, I couldn't, I couldn't, you know, I didn't see how to do it.


[User] Please transcribe this text

[Assistant] And uh, but it turns out there is a very nice way to think about problems, this problem and problems of this sort.


[User] Please transcribe this text

[Assistant] Using some ideas, just some basic ideas from information theory.


[User] Please transcribe this text

[Assistant] And uh, so I would encourage you to try to, try to think about this, try to figure out how you would solve this.


[User] Please transcribe this text

[Assistant] And uh, oh, you know, and of course when you do it, you know, you have to specify exactly which groups you're going to weigh and, and in what, you know, in what order and, and if one, if you get one outcome, then what will you do next? And so on and so forth. So you'll have sort of, you know, a plan of, of attack, a strategy of how to, how to solve it.


[User] Please transcribe this text

[Assistant] So there is a, there is a nice, nice simplifying


[User] Please transcribe this text

[Assistant] Uh, perspective that, that you can, a way to approach this type of problem using information theory that makes it much, much simpler to solve.


[User] Please transcribe this text

[Assistant] And so maybe later I will, I will give you the clue of how to solve it. But for now, I encourage you to try to do this on your own. And uhm, it's pretty tough. I, I think, I don't know if you'll be able to do it. So it's a challenge. It's a challenge. Okay. So that's, that's the brain teaser. See ya.


[User] Please transcribe this text

[Assistant] Get through today and tomorrow one of you will be holding the trophy.


[User] Please transcribe this text

[Assistant] Okay, some rules. You've got just two hours to recreate Peter Gilmore's white coral. You're also going to have 15 minutes to plate up the desserts at the end of the cook. The three most liked Peters will secure their makers a spot in the finale. The least impressive dish, however, will send their maker home.


[User] Please transcribe this text

[Assistant] Now the pressure's really on. You're running out of time. Come on. 8 minutes to go. Come on.


[User] Please transcribe this text

[Assistant] I think, and I'm sure you'll agree, that this was the perfect challenge to win their way into the finale.


[User] Please transcribe this text

[Assistant] And when I got Simon's, you know, I got that crunch and that excitement of that.


[User] Please transcribe this text

[Assistant] Chill, you know, when you breathe a little bit of the steam out of your nose.


[User] Please transcribe this text

[Assistant] Larissa, brilliant stuff. Well taste. Enjoy.


[User] Please transcribe this text

[Assistant] Yeah, we can tell. You were nervous at the start of the day. Not gonna wait.


[User] Please transcribe this text

[Assistant] Oh, look at that. That just shattered beautifully.


[User] Please transcribe this text

[Assistant] Yeah, I was going to say it's the closest to yours, Peter. Especially that coral. Like the texture of that, the evenness of that, the lightness of it is just absolutely lower weight. And it kind of sticks with you, yeah.


[User] Please transcribe this text

[Assistant] Wow, that was a semi-final for the history books.


[User] Please transcribe this text

[Assistant] Peter's white coral dessert was a cracking dish.


[User] Please transcribe this text

[Assistant] But thank you for the contestants to be able to cook a kind of dish like that, with that kind of clarity and texture and temperature, it's a real thrill.


[User] Please transcribe this text

[Assistant] Is one of the toughest decisions we've had to make.


[User] Please transcribe this text

[Assistant] Three of you are going to make it into this year's finale, but for one of you, the time in the MasterChef kitchen is about to come to an end.


[User] Please transcribe this text

[Assistant] Yes, Simon, you're working really well. Uhm, confident and capable.


[User] Please transcribe this text

[Assistant] Good job, Timmy. Smashing it. Nice, Simon.


[User] Please transcribe this text

[Assistant] Yes, Simon, you're working really well. Well done, Simi.


[User] Please transcribe this text

[Assistant] Making sweets! Bye! I'm a big fan of oranges. So I'm going to bake a flan.


[User] Please transcribe this text

[Assistant] We're going to make like some little orangettes, just really thin layers of the skin, and dip them in dark chocolate, but my base is the flan pâtissier.


[User] Please transcribe this text

[Assistant] I got messy with, uh, just the ratio of it, but I'm doubting now if, if I have enough batter to make my flan.


[User] Please transcribe this text

[Assistant] I'm doubting now if, if I have enough batter to make my flan.


[User] Please transcribe this text

[Assistant] I need to get my flan in the oven, otherwise I won't have any desserts to plate.


[User] Please transcribe this text

[Assistant] I get the flan out of the oven. I'm hoping. It's really airy.


[User] Please transcribe this text

[Assistant] My flan looks like a biscuit. It's a complete disaster, but I have no choice. I need to plate something up.


[User] Please transcribe this text

[Assistant] I know today wasn't my day at all, but it's just the beginning of an amazing great adventure.


[User] Please transcribe this text

[Assistant] I want to follow my passion because this is what I live for.


[User] Please transcribe this text

[Assistant] Okay, so I've got the buttermilk and vanilla panna cotta, uh, raspberry coulis, macadamia, praline, chocolate mousse and a mint dust.


[User] Please transcribe this text

[Assistant] With Merge Sort, it's a good opportunity to take a look at the intrinsic difficulty of the sorting problem. That's called complexity, and we'll look at that next.


[User] Please transcribe this text

[Assistant] The idea of complexity is it's a framework for studying the efficiency of all the algorithms for solving a particular problem.


[User] Please transcribe this text

[Assistant] That's called computational complexity. And in order to do this sensibly, we need what's called a model of computation. The operations of the algorithms are allowed to perform. For sorting, that's kind of straightforward. What we're going to do is have a cost model where we count the comparisons.


[User] Please transcribe this text

[Assistant] Now, in framing the difficulty of problems, we'll need two things. One is what's called an upper bound, which is a cost guarantee that's provided by some algorithm for solving the problem.


[User] Please transcribe this text

[Assistant] That's an upper bound on how difficult it is to solve the problem. We have an algorithm that can solve it. It's at least that easy.


[User] Please transcribe this text

[Assistant] Uh, now what we seek ideally is what's called an optimal algorithm where we prove that the upper bound and the lower bound are the same. Uh, that's an algorithm that's, that we know that has the best possible cost guarantee. That's the ideal for solving any problem.


[User] Please transcribe this text

[Assistant] So for sorting, let's look at what each of these are. The model of computation is what's called a decision tree. What that means is that all we can use is compares. That's the only way we can access the data. So our cost model is the number of compares.


[User] Please transcribe this text

[Assistant] Merge sort provides an upper bound. That's an algorithm that's guaranteed to get the sort done in time proportional to n log n. And what we'll look at now is the lower bound. There's a trivial lower bound which says you have to look at all the data. That's n. And we'll look at a better lower bound and see that merge sort is optimal.


[User] Please transcribe this text

[Assistant] So here's the basic idea for proving a lower bound for sorting. Let's say we have three different items, A, B, and C. Whatever algorithm we have is going to


[User] Please transcribe this text

[Assistant] Let's first do a comparison between two of the items. Let's say they're A and B. Uh, and then, uh, there's two cases. Either it's yes or it's not yes. Let's, let's say they're, uh, distinct.


[User] Please transcribe this text

[Assistant] Uh, and there'll be some code between the compares, but either way, then there's gonna be a different compare.


[User] Please transcribe this text

[Assistant] If a is less than b, maybe the next compare is b against c. And if you find that b is less than c and a is less than b, then you know that they're in the, any algorithm that does that knows that the items are in the order a, b, c.


[User] Please transcribe this text

[Assistant] In this case if, uh, c is less than b and a is less than c, then, uh, those three compares show that the order has to be a, c, b.


[User] Please transcribe this text

[Assistant] Uh, and if c is less than a, then it's gotta be c, a, b. Those three compares. Uh, that c is less than a, c is less than b, and a is less than b. The only possibility is c, a, b.


[User] Please transcribe this text

[Assistant] And continuing on the right, uh, perhaps the next compare is a less than c, uh, and maybe, uh, if c is less than a, another compare b less than c.


[User] Please transcribe this text

[Assistant] So in this case, if you go from top to bottom in the tree, uh, with three compares at most, uh, you can determine the ordering of the three different items.


[User] Please transcribe this text

[Assistant] The idea of the lower bound generalizes this argument to figure out the number of compares that you need, uh, for a minimum to determine the ordering among n items.


[User] Please transcribe this text

[Assistant] Now the height of the tree, as I just mentioned, is the worst case number of compares. Out of all the orderings, the one that's furthest down in the tree, that's the worst case. And so the algorithm, no matter what the input is, the tree tells us a bound on the number of compares taken by the algorithm.


[User] Please transcribe this text

[Assistant] And there's gotta be at least one leaf for each possible ordering. Uh, if there's some ordering that, uh, is not appear in a tree corresponding to a particular algorithm, then that algorithm hasn't, uh, can't sort, can't tell the difference between two different orderings.


[User] Please transcribe this text

[Assistant] So the lower bound is a proposition that uses a decision tree like that to prove that any compare-based sorting algorithm has to use at least log base 2 of n factorial compares in the worst case.


[User] Please transcribe this text

[Assistant] And by Sterling's approximation, we know that log base 2 of n factorial is proportional to n log base 2 n.


[User] Please transcribe this text

[Assistant] We assume that the array consists of n distinct values, and there's a decision tree that describes the performance of any algorithm, the compare sequence done by any algorithm, uh, to determine the n factorial different orderings. So this tree has to have at least n factorial leaves.


[User] Please transcribe this text

[Assistant] Uh, and if the tree is of height H, it has at most 2 to the H leaves.


[User] Please transcribe this text

[Assistant] Uh, the only, the, the tree that has the most leaves of height H is, uh, totally complete, uh, and that one has two to the H leaves. And those observations give us the lower bound.


[User] Please transcribe this text

[Assistant] 2 to the h has to be greater than or equal to the number of leaves, and the number of leaves has to be greater than or equal to n factorial, so that implies the height of the tree has to be greater than or equal to log base 2 of n factorial, uh, which is proportional to n log n by Stirling's formula.


[User] Please transcribe this text

[Assistant] That's a lower bound on the, uh, complexity of sorting. So we knew that the upper bound was n log, proportional to n log n, and we just proved that the lower bound is proportional to n log n, and that means that merge sort is an optimal algorithm.


[User] Please transcribe this text

[Assistant] Now you have to take these results in context. Really what we proved is that merge sort is optimal with respect to number compares, but we already know that it's not optimal with respect to space usage.


[User] Please transcribe this text

[Assistant] Merge sort uses, uh, twice as, uh, extra space proportional to the size of the array it has to sort. And simple algorithms like insertion sort don't. They, uh, don't use any extra space at all.


[User] Please transcribe this text

[Assistant] So, what we want to take from these theoretical results is a guide when we're looking at implementations and trying to solve practical problems.


[User] Please transcribe this text

[Assistant] In this example, what it tells us, what the theory tells us is, don't try to design a sorting algorithm that guarantees to use substantially fewer compares than merge sort. Say, half n log n compares. Is there a method that uses half log n compares? The lower bound says no.


[User] Please transcribe this text

[Assistant] On the other hand, maybe there is an algorithm that uses n log n compares, and also uses optimal space. It's optimal with respect to both space and time. And that's what we're going to look at soon.


[User] Please transcribe this text

[Assistant] Uh, the other thing is that the lower bound is for the particular model of computation being studied. This case compares.


[User] Please transcribe this text

[Assistant] It might not hold if the algorithm has more information about the keys. For example, if it's known that the input is almost ordered. We saw that insertion sort can be linear time for files that are almost ordered.


[User] Please transcribe this text

[Assistant] Uh, or, uh, something about the distribution of key values. If there are a lot of equal keys, we can get sorted, get it sorted faster than n log n. And maybe the way the keys are represented will look at different methods that take advantage of such properties.


[User] Please transcribe this text

[Assistant] So, partial reordered arrays, uh, we may not need n log n compares. Duplicate keys, we may not need n log n compares.


[User] Please transcribe this text

[Assistant] In compares, we're gonna look at a method that I guess that done in linear time in a lot of situations. Uh, and later on we'll look at digital properties of keys where we can use digit or character compares instead of whole key compares and get a faster sort for certain practical applications.


[User] Please transcribe this text

[Assistant] Computational complexity is a very useful way to help us understand properties of algorithms and help guide our design decisions.


[User] Please transcribe this text

[Assistant] They're cute, they're lovable, and judging by the 26 billion views of over 2 million YouTube videos of them pouncing, bouncing, climbing, cramming, stalking, clawing, chattering, and purring, one thing is certain. Cats are very entertaining.


[User] Please transcribe this text

[Assistant] These somewhat strange feline behaviors, both amusing and baffling, leave many of us asking, why do cats do that?


[User] Please transcribe this text

[Assistant] Throughout time, cats were simultaneously solitary predators of smaller animals and prey for larger carnivores. As both predator and prey, survival of their species depended on crucial instinctual behaviors, which we still observe in wild and domestic cats today.


[User] Please transcribe this text

[Assistant] As wild predators, cats are opportunistic and hunt whenever prey is available. Since most cat prey are small, cats in the wild needed to eat many times each day and use a stalk, pounce, kill, eat strategy to stay fed.


[User] Please transcribe this text

[Assistant] So one explanation for Grismo's propensity to reach into containers and openings is that she is compelled by the same curiosity that helped ensure the continuation of her species for millions of years before.


[User] Please transcribe this text

[Assistant] So it's not that Grismo hates your couch, chair, ottoman, pillows, curtains, and everything else you put in her environment. She's ripping these things to shreds and keeping her claws in tip-top shape, because this is exactly what her ancestors did in order to survive.


[User] Please transcribe this text

[Assistant] As animals that were preyed upon, cats evolved to not get caught, and in the wild, the cats that were the best at avoiding predators thrived. So at your house today, Grismo is an expert at squeezing into small spaces and seeking out and hiding in unconventional spots.


[User] Please transcribe this text

[Assistant] Considering everything we do know about cats, it seems that one of their most predominant behaviors is still one of the most mysterious.


[User] Please transcribe this text

[Assistant] So while her purring makes Grismo an excellent nap companion, it is also possible that her purr is healing her muscles and bones, and maybe even yours, too.


[User] Please transcribe this text

[Assistant] They developed through time as both solitary predators that hunted and killed to eat and stealthy prey that hid and escaped to survive.


[User] Please transcribe this text

[Assistant] This explains some of their seemingly strange behaviors.


[User] Please transcribe this text

[Assistant] To them, our homes are their jungles. But if this is the case, in our own cat's eyes, who are we?


[User] Please transcribe this text

[Assistant] I can cook with that. Finally! I'm walking through the herb garden and I feel like I'm a kid in a candy store.


[User] Please transcribe this text

[Assistant] Today, I'm gonna cook another Indian-inspired dish, my wife's favorite dish, prawn masala.


[User] Please transcribe this text

[Assistant] This is something that is dear and dear to me. So I should not go wrong with it because it represents me. It's like a symbol from masala. Loki. I'm delivering with good hands of love.


[User] Please transcribe this text

[Assistant] When people eat my prawn masala, the first reaction is they close their eyes.


[User] Please transcribe this text

[Assistant] Because they feel the taste playing up in their brain.


[User] Please transcribe this text

[Assistant] They get that boom, boom factor. It's got that chilly, tangy. It's a journey. I want the judges to feel that.


[User] Please transcribe this text

[Assistant] Today I'm going to cook prawn masala with roti and raita.


[User] Please transcribe this text

[Assistant] Masala is basically a combination of spices. The most important thing about masala is knowing what each spice produces. I add a clove of garlic to give the wetness.


[User] Please transcribe this text

[Assistant] My masala is going beautifully. And now I'm making sure my prawns are cooked really well.


[User] Please transcribe this text

[Assistant] The only thing that's happening in my brain is like I'm happy cooking. I'm happy cooking. I'm happy cooking. This is so much fun.


[User] Please transcribe this text

[Assistant] These dishes mean so much to me and my family and I hope the judges love it as much as we do.


[User] Please transcribe this text

[Assistant] Becoming a nona has been one of the greatest gifts that I've been given in my life. My ultimate goal would be to open a nona's cooking school. To be able to pass on the knowledge of simple basic cooking the same way I was taught.


[User] Please transcribe this text

[Assistant] So I've tweaked it to become a little bit lighter, more airy, a little bit more fancy.


[User] Please transcribe this text

[Assistant] It's going to be the best blow your mind tea cake. It's going to surprise them.


[User] Please transcribe this text

[Assistant] With less than 20 minutes to go, my dish is coming together nicely.


[User] Please transcribe this text

[Assistant] I'm plating up my dish. I've got the zabaglione, the lovely fluffy cake, the syrup and the mascarpone cream. I really hope I can wow them today.


[User] Please transcribe this text

[Assistant] I really hope I've taken this orange cake to a whole new level. It's not just your typical orange cake. I want it to wow them.


[User] Please transcribe this text

[Assistant] My orange cake was the best they've seen in the whole 10 years of MasterChef.


[User] Please transcribe this text

[Assistant] I'm that guy that everyone loves to go to for a feed, so with any luck, the judges will enjoy it.


[User] Please transcribe this text

[Assistant] There's a lot of indecision and, you know, we're still not completely sold on what we're gonna put up.


[User] Please transcribe this text

[Assistant] We've done so much prep for this main course. I've given myself a huge challenge making these noodles from scratch.


[User] Please transcribe this text

[Assistant] Ben's finally finished filleting this salmon and we have to vacuum pack 50 fillets. Right there, H bag, you do that. You know, we've got to cook them in a water bath, nine at a time. Quite a bit of olive oil, yeah? It's just taking so long.


[User] Please transcribe this text

[Assistant] We then mix all the noodles and veggies in a bowl. Oh, that smells amazing.


[User] Please transcribe this text

[Assistant] Yeah, like, every other day in the MasterChef kitchen, I'm as nervous as ever, so.


[User] Please transcribe this text

[Assistant] Yeah, this is uhm, the last time I'll be in the kitchen, so I've gotta give it my all and everything that's left in the tank is, you know, I've gotta use it.


[User] Please transcribe this text

[Assistant] And this is my dad Hess, and my boyfriend Elliot.


[User] Please transcribe this text

[Assistant] Having my family here at the pinnacle of the competition, I know that they'll be up there looking over me and sending me good energy.


[User] Please transcribe this text

[Assistant] I'm so excited to be able to cook my own food, but cooking three courses, four and a half hours, that's a whole nother ball game.


[User] Please transcribe this text

[Assistant] Dessert, I'm doing a play on a lemon meringue.


[User] Please transcribe this text

[Assistant] My strategy is purely just to work quickly. I know this menu like the back of my hand. These ingredients are things that I use all the time and I love to cook with. So to create a beautiful dish is not the challenging part. It's getting it all done in time. My anglaise on my ice cream is done.


[User] Please transcribe this text

[Assistant] I'm just waiting for that to cool down and I'm just getting onto my beef stock for my sauce for my main.


[User] Please transcribe this text

[Assistant] Today I'm cooking Marin and fennel for entree. Wagyu beef and celeriac for main. And my dessert is a play on lemon meringue. Second hour of the cook. I've got my ice cream in the churner. I have my meringue shards in the oven.


[User] Please transcribe this text

[Assistant] I've got my stock producing for the main and now I am just getting onto my marron.


[User] Please transcribe this text

[Assistant] I'm on track to get everything done, I think. Uhm, I'm moving really quickly, so I just need to keep up the pace. I love the fast-paced environment of a commercial kitchen. Tessa? Yep. All good? I'm all good, Shannon, thank you. My food dream is to hopefully have my own place one day, and this is definitely a menu that I would serve at my restaurant.


[User] Please transcribe this text

[Assistant] I've gone with this menu because they're ingredients that I know really well how to cook and I ultimately am 100% confident with these flavours.


[User] Please transcribe this text

[Assistant] I need to be playing smart. Managed to get me through the competition this far. The Marin prep is going to take me an hour, definitely, to get, make sure that the shells are out of these really nicely. It's a really fiddly job and I want to make sure that they're perfect. I might blanch them for a little bit longer. They're just a little bit.


[User] Please transcribe this text

[Assistant] I'm finding it too hard to release the tail meat from the shell. The tails still need a little bit longer to cook, so I'm just gonna blanch them for a little bit longer.


[User] Please transcribe this text

[Assistant] And in the meantime, get on to the bisque. To make my bisque, I'm combining Marin shells with some fennel, nicely spiced with cardamom and cinnamon and star anise. You'll get that subtlety of that spiciness, but it'll compliment the Marin nicely.


[User] Please transcribe this text

[Assistant] Feeling pretty good, everything's on and, you know, as it should be. I think I'm doing okay for the time. I hope I don't jinx myself.


[User] Please transcribe this text

[Assistant] For my entree, I'm doing a sous vide marin tail with a spiced fennel bisque. I've got my bisque done for the entree. I've re-blanched the marin tails to help extract that meat. I start peeling the marin.


[User] Please transcribe this text

[Assistant] I'm realizing that the meat is really mushy and just doesn't look right.


[User] Please transcribe this text

[Assistant] Come apart, yeaah. The Marron tails are overcooked.


[User] Please transcribe this text

[Assistant] I can hear my family encouraging me. Come on Tessa. Just reminding me that I just need to keep fighting, you know, I'm in the finale. Don't be stressed.


[User] Please transcribe this text

[Assistant] I'm behind now, but instead of fighting this, I'm not gonna waste any more time. I just need to get more Marin into hot water and get those tails out.


[User] Please transcribe this text

[Assistant] I can cook Marin beautifully and I have been confident through this whole competition. Two out of the three courses are savory, which is my strength. So why back down now? I need to back myself and think that I can take this out.


[User] Please transcribe this text

[Assistant] One hour to go. Second batch of Marin are looking great. They're coming away from the shells a lot easier. I get them in sous vide bags with some butter. I'm just gonna strain my sauces. So then you've got the fennel.


[User] Please transcribe this text

[Assistant] My main is a wagyu eye fillet. So I'm wanting to cook the eye fillet whole and, you know, slice it up so you can see that beautiful red meat.


[User] Please transcribe this text

[Assistant] Uh, it's gonna take probably about 45 minutes to cook and it needs about 20 minutes to rest. So, I'm running out of time.


[User] Please transcribe this text

[Assistant] My main is not in good shape. I need to sear my beef before I put it into the oven.


[User] Please transcribe this text

[Assistant] I add a wedge of fennel which has been braised in the bisque, a quenelle of caviar, some frothed bisque, and it looks really good.


[User] Please transcribe this text

[Assistant] I cannot believe I'm serving these legends today. I'm so proud of the dishes I'm sending out. I've put my heart and soul into getting these dishes done.


[User] Please transcribe this text

[Assistant] Bordelais sauce. Love the look of that, Tess. And a bone marrow crumb. This combination is just a classic and it showcases the type of cook I am and the food that I love to eat.


[User] Please transcribe this text

[Assistant] I still need to finish the sauce off. The sauce I'm serving with the wagyu is a Bordelaise. Really thick, dark reduction of beef and red wine and port and then that's split with bone marrow. This sauce brings a whole punchy flavour to the dish. It's really luxurious and rich and it will go nicely with that really fatty wagyu beef.


[User] Please transcribe this text

[Assistant] You can't serve raw wagyu. The fat needs to render, otherwise it's just a chewy bad texture in your mouth.


[User] Please transcribe this text

[Assistant] This is the finale. There is no way I would serve the beef raw to the judges. I'm not doing it. I'm gonna need five minutes.


[User] Please transcribe this text

[Assistant] I feel really stressed out. If I don't put anything but perfect on the plate, I might as well kiss that winning position goodbye. I just hope that five minutes is enough.


[User] Please transcribe this text

[Assistant] I top it with half of that marrow bone and chive crumb. Get the celeriac puree on the plate, which brings that creamy element. Pickled onion, mizuna leaves, and some baby sorrel. I top the dish off with some freshly grated horseradish. Looking good, Ches! And then I serve the bordelais on the side. You're on your test now, Ches! Yeah, sauce is gonna be left on the table.


[User] Please transcribe this text

[Assistant] I'm so glad that I can stay on track despite the setbacks with the Marin and the Wagyu. I'm still staying level headed and you know, I'm still backing myself. Okay, service please.


[User] Please transcribe this text

[Assistant] Cheers. Thanks, Shannon. Yeaah, I'm really happy. Stoked. Main service is over and I'm really happy with my dishes that I sent out. Hopefully it's enough to get me that lead.


[User] Please transcribe this text

[Assistant] Going into dessert, I definitely want a bit of a bak bak.


[User] Please transcribe this text

[Assistant] My dessert has to be so good to beat Larissa's. She's in the lead by one point right now. I'm pretty worried to be honest.


[User] Please transcribe this text

[Assistant] I know my flavours and I can produce some really nice desserts.


[User] Please transcribe this text

[Assistant] For my dessert, I'm doing lemon meringue with rosemary and ginger. There's four elements on my plate. I've made lemon and rosemary ice cream, meringue chard, topped with dehydrated raspberries. I still need to make my curd and my crumb.


[User] Please transcribe this text

[Assistant] I'm using ginger in the crumb, sort of the pastry element in the dessert.


[User] Please transcribe this text

[Assistant] And this is like a really acidic, punchy lemon curd.


[User] Please transcribe this text

[Assistant] I'm doing this because my favorite desserts is a lemon meringue pie. If I can do a play on that and get everything perfect on this dessert, then it puts me in a good position to potentially win this competition.


[User] Please transcribe this text

[Assistant] Let's make every single one perfect. Yep. I've never been under so much pressure. It all comes down to this lemon meringue dessert.


[User] Please transcribe this text

[Assistant] Larissa's got a one point lead. I know how great she is at desserts and how much the judges love her flavors. But I'm not out of this competition just yet.


[User] Please transcribe this text

[Assistant] This is my lemon meringue with rosemary and ginger.


[User] Please transcribe this text

[Assistant] I've learnt so much being in this competition about myself and what I'm capable of and it's changed me completely for the better.


[User] Please transcribe this text

[Assistant] And Larissa, she's so incredible and uhm, completely deserves to win. Oh, thank you so far.


[User] Please transcribe this text

[Assistant] A monthly column in Australia's leading premium food and lifestyle magazine, Delicious. $250,000 to kickstart their food dream and the title of Australia's next Master Chef.


[User] Please transcribe this text

[Assistant] Yeah. But that tastes like, it's not good.


[User] Please transcribe this text

[Assistant] 30 minutes to go! It's just become real!


[User] Please transcribe this text

[Assistant] Okay, Larissa, Simon, Tessa, come, quick.


[User] Please transcribe this text

[Assistant] I'm gonna make chocolate lava cake with vanilla ice cream. I never made it before, it's an invention test, so I gotta try to do something different.


[User] Please transcribe this text

[Assistant] Chocolate Nutella Hard Cake with Sour Cherries and Vanilla Ice Cream.


[User] Please transcribe this text

[Assistant] Afternoon tea sounds great. Probably rather go to the pub with Nigella and have a drink. But yeaah, getting time to spend with Nigella would just be unbelievable.


[User] Please transcribe this text

[Assistant] At home on the Brizzy River, I catch and cook crabs all the time.


[User] Please transcribe this text

[Assistant] My food dream is to be cooking for clientele on a charter boat. Just want to prove that I can cook good seafood. So today I'm cooking vodka chili sand crab with some coconut rice on the side. Everywhere else calls them blue swimmer crabs. But up in Queensland us cane toads call them sand crabs.


[User] Please transcribe this text

[Assistant] The base for my sauce for the sand crab is vodka and dried chillies. It needs time to infuse, so the first thing I did was get that ready. I know, Jelle, how are you? I'm fine.


[User] Please transcribe this text

[Assistant] In this cook, I'm feeling really confident. To the sauce, I'm adding white onions and spring onions and loads of butter. There's quite a bit of chilli from my vodka infusion, so I'm gonna serve it up with some coconut rice on the side. Really just need the flavour to stand alone and bring this dish up to top three.


[User] Please transcribe this text

[Assistant] Still give me enough time to get it out on the plate. I'm really focused this afternoon. I want to get into top three. I love cooking with crab. I've got to put up a good snap and I'm giving it a red hot crack. The sauce is looking perfect. It's time for the crabs. I'm going to cook the crab till they just go orange.


[User] Please transcribe this text

[Assistant] Throwing in the chilli infused vodka, spring onions and more butter to thicken the sauce up.


[User] Please transcribe this text

[Assistant] The crabs need to be cooked perfectly. We do not want to serve overcooked crab.


[User] Please transcribe this text

[Assistant] I'm really proud of this dish. I can't wait for the judges to dive in and get that snap of the crab claw.


[User] Please transcribe this text

[Assistant] The dish is vodka chili sand crab, and it's got a side of coconut rice.


[User] Please transcribe this text

[Assistant] I'm just ecstatic. Really quality food went up today. A definite game changer to get that pin. It's gonna be a tough, tough


[User] Please transcribe this text

[Assistant] Last time we stated the theorem of the Kraft-McMillan inequality. And in this video, we're going to give a proof of part A of McMillan's part.


[User] Please transcribe this text

[Assistant] So the proof we're gonna do is due to Jack Krush, and it's a marvelous little proof. It's one of those proofs that seems to just wander off into Never Never Land, but then it magically reappears behind you and taps you on the shoulder and just hands you the result. It's quite remarkable.


[User] Please transcribe this text

[Assistant] So, for the proof, I'm going to introduce a little bit of notation which will be useful later on as well. I'm going to use this x subscript 1 through k for a string of symbols x1 to xk, or what is essentially the same thing, a sequence


[User] Please transcribe this text

[Assistant] x1 through xk in the set script x to the k. So script x here is as usual our source alphabet and this x to the k is the set of all sequences of length k from that alphabet.


[User] Please transcribe this text

[Assistant] Now, we're gonna break up the proof into two parts. Case one will be when our source alphabet is finite, and then we'll consider the countably infinite case. So first,


[User] Please transcribe this text

[Assistant] Let's, so there's gonna be, yea, two parts of case one. And first, let's think about some...


[User] Please transcribe this text

[Assistant] The following situation. Let's say we have two integers, k and s, with k strictly positive and s non-negative. And let's think about the following set. Let's think about the set. Use my yellow again.


[User] Please transcribe this text

[Assistant] Let's think about the set of all sequences, x1 to xk, this is using our notation here, with the following property.


[User] Please transcribe this text

[Assistant] All such sequences for which the sum of the lengths equals s. So this is our integer s, and this is the sum over i from 1 to k. Think about that set.


[User] Please transcribe this text

[Assistant] I claim that the size of this set, the number of elements in this set,


[User] Please transcribe this text

[Assistant] Is lesser equal to b to the s. So b here, so notation, b is the b in our b-ary code. And I'm using l for l, l equals the size, the length of the code word for c of x, for x.


[User] Please transcribe this text

[Assistant] So in part A, our assumption is that we have a uniquely decodable B-ary code and we're trying to prove that this inequality is satisfied.


[User] Please transcribe this text

[Assistant] Now I will leave it as a exercise for you to prove this fact. It's not a hard exercise. This will be exercise.


[User] Please transcribe this text

[Assistant] And basically the reason why is because if you think about, you know, we have our code C here and it's uniquely decodable.


[User] Please transcribe this text

[Assistant] So the extension of c, c star, takes x1 through k, and gives us some element of a star. It gives us a sequence. And, right, and the sequence that it gives us is,


[User] Please transcribe this text

[Assistant] xk. So the length of this thing, if you were to look at the length


[User] Please transcribe this text

[Assistant] That's equal to the sum of those lengths, which is, by the definition of L, that's the sum of the L of XIs. So for any element in this set, this is equal to S. Or in other words, C


[User] Please transcribe this text

[Assistant] Star x1 through k is not only in a star, it's actually in a to the s because it is a sequence, it's an encoded sequence of length s.


[User] Please transcribe this text

[Assistant] And each element in the encoded sequence comes from the code alphabet A.


[User] Please transcribe this text

[Assistant] So, and then the final fact is that the size of A to the S is equal to B to the S. And you need to, in order to show that this inequality holds, the key fact is that C star


[User] Please transcribe this text

[Assistant] Is a one to one function. So use that C star is one to one. And that is the definition of a uniquely decodable code. So that's where unique decodability comes into the proof. Is using the fact that C star is one to one.


[User] Please transcribe this text

[Assistant] Okay, so I'm not going to go through the details of that, it's a pretty straight forward thing.


[User] Please transcribe this text

[Assistant] But now we're gonna get to the interesting part. So we're gonna use that fact to prove the inequality. So our goal, remember,


[User] Please transcribe this text

[Assistant] Our goal is to prove that inequality and let's rewrite it in this way. Let's flip the, the.


[User] Please transcribe this text

[Assistant] So we'll just put minus instead of. So 1 over b to the l of x equals b to the minus l of x. And our goal is to prove that this is less or equal to 1.


[User] Please transcribe this text

[Assistant] So let's do something very out of the blue. Let's just take this quantity and raise it to a power. Let's just raise it to say the kth power.


[User] Please transcribe this text

[Assistant] L of X here, not L of X I, L of X and now I'm going to have in a bit,


[User] Please transcribe this text

[Assistant] That's L of X. So let's raise this guy to the Kth power.


[User] Please transcribe this text

[Assistant] So what do we get? If we multiply everything all out, we get a sum over


[User] Please transcribe this text

[Assistant] x1 up to xk, and each of these sums is over all the x's in script x in our source alphabet. And when we pull everything together, we get b to the minus


[User] Please transcribe this text

[Assistant] L of x1 up to b to the minus l of xk because if you think about what it means to multiply all this out, you have k factors here and


[User] Please transcribe this text

[Assistant] When you multiply it out, you're gonna take one term from the first factor, one term from the second factor, and so on, one term from each factor up to k, multiply those together, and that gives you a term in the overall sum.


[User] Please transcribe this text

[Assistant] And if you think about this for a minute, if this isn't completely obvious to you, if you think about for a minute, then when you multiply this all out, you'll get exactly this.


[User] Please transcribe this text

[Assistant] Okay, so now let's rewrite this in a slightly more compact way using our notation from above. This is


[User] Please transcribe this text

[Assistant] The sum over all sequences, x1 to k from x to the k. And of course we can pull together the exponents here.


[User] Please transcribe this text

[Assistant] Into the sum of the exponents. This is a sum from, as i goes from 1 to k.


[User] Please transcribe this text

[Assistant] And now let's think about this, this sum here. Well, we're assuming,


[User] Please transcribe this text

[Assistant] That x is finite, that our source alphabet is finite. So what, so...


[User] Please transcribe this text

[Assistant] What does that tell us about this sum? Well, it tells us something which will be useful. It tells us that the sum is, uh, sorry, this sum


[User] Please transcribe this text

[Assistant] Since x is, since this set is finite, since our source alphabet is finite, then there is such a maximum, and it's, and it's a, it's a finite number, this is less than infinity.


[User] Please transcribe this text

[Assistant] So that's the key part where we use the finiteness of x to show that Lmax, uh,


[User] Please transcribe this text

[Assistant] It's a finite number. And now, how can we use this?


[User] Please transcribe this text

[Assistant] Well, each term in this sum out here, for each term in this sum, the exponent has a particular value.


[User] Please transcribe this text

[Assistant] For each term in the sum, the exponent has a particular value. And for all the terms where the exponent is the same, those, the terms are the same. So let's group them according to


[User] Please transcribe this text

[Assistant] So we can group them according to the value that the exponent takes. And the exponent is gonna go, let's call it s, it's gonna go from zero, it can't be negative, it's gonna go from zero up to the largest it could be is this k times lmax.


[User] Please transcribe this text

[Assistant] We know that's an upper bound. So we're summing over the values


[User] Please transcribe this text

[Assistant] That the exponent could take and then we have to sum over all of these guys that have that particular exponent. So all of the x1 through k's such that the sum of their lengths equals s. And then of course we have this same thing in here.


[User] Please transcribe this text

[Assistant] So we're just breaking up this sum into these two different parts. Now,


[User] Please transcribe this text

[Assistant] What do we know about this term inside the sum? Well,


[User] Please transcribe this text

[Assistant] Here, s is fixed. Every element of this inner sum, think about this inner sum, every element in this inner sum has exponent s, right?


[User] Please transcribe this text

[Assistant] That's exactly what we're summing over here. We're fixing s in the outer sum, and then we're summing only over those sequences that have that exponent.


[User] Please transcribe this text

[Assistant] So this equals, so this is just exactly b to the minus s.


[User] Please transcribe this text

[Assistant] And that doesn't depend on x, you know, this sequence, x1 to xk, so we can pull it out. We can pull it out of that sum. So, maybe I'll switch colors. This is a little bit here. Change things up.


[User] Please transcribe this text

[Assistant] So now we have the same thing on the outside.


[User] Please transcribe this text

[Assistant] But we have pulled out b to the minus s and we're left with this inner sum.


[User] Please transcribe this text

[Assistant] It just, the number of elements x1 through k that are, that have that sum, so this is the sum over s, b to the minus s, the number of x1 through k's


[User] Please transcribe this text

[Assistant] What we observed in part A is bounded by B to the S. This is the set of all these sequences X1 to K that sum to S, and so now let's apply our bound from part A. So let's use our bound, switch colors again.


[User] Please transcribe this text

[Assistant] Our bound told us that this is less than b to the s, so we have this whole thing.


[User] Please transcribe this text

[Assistant] So we got an upper bound for this quantity taken to the kth power and that was kind of remarkable because we just, you know, just out of the blue took this to the kth power and we got this nice bound for it.


[User] Please transcribe this text

[Assistant] So what does that tell us? Well, let's give this thing a name now. Let's call this something. Let's call this


[User] Please transcribe this text

[Assistant] Let's call, this is some number, right? You know, we have, you know, b is just some number and we have all the set of all of our lengths as x ranges over the source alphabet.


[User] Please transcribe this text

[Assistant] So this is just some number, you know, given our code. Let's call that number r. So this equals r to the k.


[User] Please transcribe this text

[Assistant] And we would like to show that this is less or equal to 1, and this is of course just r.


[User] Please transcribe this text

[Assistant] This is r. We'd like to show that r is less or equal to 1. So how can we use this?


[User] Please transcribe this text

[Assistant] Well, let's suppose r is not lesser equal to 1. Let's suppose r is greater than 1.


[User] Please transcribe this text

[Assistant] Well if r is greater than 1, then this is something greater than 1 to the kth power. And this is k times, you know, some integer here.


[User] Please transcribe this text

[Assistant] But what is K? Well, K is just some arbitrary positive integer, right? K, K was just, we just picked any integer K and this, and this held. So this is true for any K positive integer, et cetera.


[User] Please transcribe this text

[Assistant] And so as k is getting very, very large, as k goes to infinity, r to the k, if r is greater than 1, r to the k is going to infinity exponentially fast. Whereas k times l max plus 1 is just going linearly to infinity. So if r were greater than 1,


[User] Please transcribe this text

[Assistant] Then, when k is large, this would, this inequality would not be satisfied. So if, if, if r greater than 1, then r to the k would be greater than lmax plus 1 for k large. And that would be a contradiction, and therefore,


[User] Please transcribe this text

[Assistant] R is lesser equal to 1, which is exactly what we wanted to show. Check. Very nice.


[User] Please transcribe this text

[Assistant] So that proves case one. When our source alphabet is finite. I love that proof, that's so neat. Okay, so what about when x is infinite?


[User] Please transcribe this text

[Assistant] How can we, what can we do? Can we fix things? Can we still do it?


[User] Please transcribe this text

[Assistant] Well remember now, x is always going to be countably infinite because we're dealing with a discrete memoryless source, that's our assumption.


[User] Please transcribe this text

[Assistant] So it's countably infinite at least, and so let's write, we can, let's, we may as well just number the elements 1, 2, 3, and so on. So let's go ahead and do that.


[User] Please transcribe this text

[Assistant] And so what we want to show is that, we want to show that this sum


[User] Please transcribe this text

[Assistant] And still, you know, our assumption is that we have some uniquely decodable code C for all of these infinitely many source, uh, source symbols.


[User] Please transcribe this text

[Assistant] So let's rewrite this in a slightly different way using this numbering of our source alphabet. This is the sum as x goes from 1 to infinity.


[User] Please transcribe this text

[Assistant] B to the minus l of x. And what is the definition of this infinite series? Well, it's just the limit as n goes to infinity of the finite sums of the partial sums.


[User] Please transcribe this text

[Assistant] So now, we are, we have reduced things down to a finite case. Now we have just a finite sum here, we have finitely many lengths, and what if we look at the, if we say, maybe we call x prime,


[User] Please transcribe this text

[Assistant] Or maybe we'll call it, I don't know, x, eh, we'll just call it x'. x' the set 1 up to n.


[User] Please transcribe this text

[Assistant] Well, there's some, you know, we have our original C here, and just applying C to just that subset, we get some code words, C1 up to Cn.


[User] Please transcribe this text

[Assistant] And now it's pretty clear if you think about it for a moment that if C was uniquely decodable for this whole set, then it's certainly uniquely decodable when we just restrict it to this subset. These code words will also give us a uniquely decodable code for this subset. And therefore this finite sum here is lesser equal to one by case one, by case one.


[User] Please transcribe this text

[Assistant] So this is lesser equal to one and the limit of a bunch of things which are lesser equal to one is lesser equal to one. Lesser equal to one.


[User] Please transcribe this text

[Assistant] So that proves that the sum in the infinite case is also less or equal to one, and therefore we have proved part A of the theorem. We have proved that, we have proved McMillan's part.


[User] Please transcribe this text

[Assistant] For any uniquely decodable B-ary code,


[User] Please transcribe this text

[Assistant] The sum of 1 over b to the lengths is lesser equal to 1.


[User] Please transcribe this text

[Assistant] The idea for my dish today is a lemon chocolate truffle. And I wanna cover it with a white chocolate cloche that the judges can lift off. I pull out my ganache from the blast chiller.


[User] Please transcribe this text

[Assistant] It just seizes up. All the chocolate freezes around my truffle. I'm really thinking right now that I don't have a dish.


[User] Please transcribe this text

[Assistant] My dark chocolate's cooled down too much. It just freezes around my white chocolate ganache and now it's literally a clump of chocolate.


[User] Please transcribe this text

[Assistant] Oh my gosh. Okay. I unmold my chocolate dome.


[User] Please transcribe this text

[Assistant] But you can tell that it's really thick and the chocolate work inside isn't smooth.


[User] Please transcribe this text

[Assistant] So I start racking my brain and I invert it. I turn it into a bowl.


[User] Please transcribe this text

[Assistant] I know that my ganache is yummy so I scoop up all I can. I have one decent truffle.


[User] Please transcribe this text

[Assistant] I'm proud that I didn't give up, but I'm worried the chocolate works thick. I just hope that there's enough to keep me out of the bottom three.


[User] Please transcribe this text

[Assistant] I made a white chocolate bowl with a lemon white chocolate ganache and berries.


[User] Please transcribe this text

[Assistant] My first thought is I'm disappointed with myself. And then I pick myself up. You know, there's no one who's won the competition that hasn't been in a pressure test, that hasn't been in an elimination challenge. You can do this.


[User] Please transcribe this text

[Assistant] Today's challenge is to cook a dish that made you fall in love with food. My mind goes everywhere.


[User] Please transcribe this text

[Assistant] From the first dish I learnt how to cook to my fondest memory from childhood of food. And I'm pretty torn which one to go with.


[User] Please transcribe this text

[Assistant] I'm making a matcha cheese sponge cake. Wow. Sounds great.


[User] Please transcribe this text

[Assistant] I decide to go with my fondest memory from childhood of food.


[User] Please transcribe this text

[Assistant] My dad used to take me to a bakery every morning, and I just remember just love going into this bakery. It felt like wonderland, you know?


[User] Please transcribe this text

[Assistant] I just remember love sponge cake. I used to always get the sponge cake.


[User] Please transcribe this text

[Assistant] Okay. I need to get these meringue chunks out of my batter, but I'm running out of time. Jenny, come on.


[User] Please transcribe this text

[Assistant] Without the structure to hold the cake up, it can collapse over the side of the tin, which means I have like a mushroom cake.


[User] Please transcribe this text

[Assistant] And the batter mix is too stiff now because I've overworked my meringue. I'm hoping that it doesn't send me home.


[User] Please transcribe this text

[Assistant] I can't leave the matcha cheese sponge cake in the oven. I haven't got a minute to spare. I'm really hoping for a miracle that it's not dense.


[User] Please transcribe this text

[Assistant] Because I overworked my meringue. The cake is a bit dense down the bottom, but I just have to go with it now.


[User] Please transcribe this text

[Assistant] A matcha cheese sponge cake with a chantilly cream.


[User] Please transcribe this text

[Assistant] When I was young, like, I think I was around three to five years old. My dad used to drop us off at daycare.


[User] Please transcribe this text

[Assistant] I don't know if I've done enough in all honesty. I hope I have. Uh, my cake's a bit dense down the bottom.


[User] Please transcribe this text

[Assistant] Uhm, I am a perfectionist, so I get frustrated at myself cause I lose clarity in the kitchen.


[User] Please transcribe this text

[Assistant] Being one of the first in a pressure test is scary. I possibly can't go home today. I would hate to disappoint anyone and particularly my children and myself.


[User] Please transcribe this text

[Assistant] I'm trying to taste every element and then I taste it all together to see what all these flavors create on a palette.


[User] Please transcribe this text

[Assistant] Everything is balancing itself and trying to memorize how it tasted and recreating it is very important.


[User] Please transcribe this text

[Assistant] I have two goals today to impress Maggie B and to stay in the competition.


[User] Please transcribe this text

[Assistant] First thing I'm doing is rafak pastry. The pastry is the base and it's very important to get it right.


[User] Please transcribe this text

[Assistant] When I cook with joy, that's when I do my best. So that's what I'm focusing on. You're doing well, Samira.


[User] Please transcribe this text

[Assistant] Placing them in the verges is very important to prevent discoloration.


[User] Please transcribe this text

[Assistant] I'm brushing the sides of, uh, to prevent it from crystallizing. And yeaah, just watching it intently. I don't want to overcook it or undercook it, so.


[User] Please transcribe this text

[Assistant] I'm placing the apples cut side down into the caramel and cooking it over a high heat. The caramel looks great. I feel confident. I'm in a very good mood. I'm just trying to make sure all the apples cook through evenly.


[User] Please transcribe this text

[Assistant] And I'm moving them around, and then I'm gonna place the cartridge back on, because I want them to steam there, and soften.


[User] Please transcribe this text

[Assistant] I put rosemary seeds a bit early, but that's alright. At home, I always follow my instincts. Every element is very important in this dish. The apples have to be cooked. The caramel has to be right. The pastry has to be flaky and layered. Now it's the time to make the pastry's base.


[User] Please transcribe this text

[Assistant] Once I'm finished rolling out and folding the dough for the last time. Gently, gently. Just from the memory. And it's gonna puff.


[User] Please transcribe this text

[Assistant] I am happy with the apples. Next step is putting it all together.


[User] Please transcribe this text

[Assistant] I'm worried about the bubbles. Okay. I'm getting it out now. I am nervous, but it smells right.


[User] Please transcribe this text

[Assistant] So now I'm looking at my tart and I'm thinking, is it brown enough on top?


[User] Please transcribe this text

[Assistant] I'm stressing out, do I put it back and put the temperature up or keep the tartar ten out? And if I make a wrong decision, it's the end.


[User] Please transcribe this text

[Assistant] Okay. I'm getting it out now. I'm worried that my Tarta 10 isn't brown enough on top.


[User] Please transcribe this text

[Assistant] Do I put it back and put the temperature up or keep the tartatian out?


[User] Please transcribe this text

[Assistant] I make the decision. I put it back in the oven and crank the temperature up.


[User] Please transcribe this text

[Assistant] Cooking for my hero, Maggie Beer, it's a bit daunting. It's like cooking for someone who is so dear. I put all of my skill.


[User] Please transcribe this text

[Assistant] And my intuition into this cook. And I want to impress her. I want her to enjoy my cooking.


[User] Please transcribe this text

[Assistant] I don't think I've ever had, uhm, such an experience in the kitchen.


[User] Please transcribe this text

[Assistant] I have to pinch myself, I can't believe I'm here, sitting in front of Maggie Beer.


[User] Please transcribe this text

[Assistant] It just brings me back to those years when I first came to Australia and I didn't know anyone or anything and waiting for the TV show to come on TV and watch Maggie Cook. It just made me feel at home.


[User] Please transcribe this text

[Assistant] To be standing next to three of the best in the house. Let's do it. About to battle it out at the first chance of immunity. It's quite intimidating to be honest.


[User] Please transcribe this text

[Assistant] He knows so much about foods. He's an incredible chef. To have one-on-one time with him would just be just absolutely amazing.


[User] Please transcribe this text

[Assistant] Looks good, Chloe! I'm giving myself a huge challenge.


[User] Please transcribe this text

[Assistant] I've had my egg boiling exactly six minutes. Take it out and then I plunge it straight into icy cold water.


[User] Please transcribe this text

[Assistant] Matt and Shannon say that there's gotta be more flavour. I start adding some soy and some mirin, little pinch of sugar, and I let it just simmer away.


[User] Please transcribe this text

[Assistant] I got some really good feedback from the judges and I'm really hopeful that I'm in with a chance.


[User] Please transcribe this text

[Assistant] I am terrified. I'm his young chef of the year.


[User] Please transcribe this text

[Assistant] I'm looking at this table filled with beautiful produce.


[User] Please transcribe this text

[Assistant] And I'm really wishing that I could pick more than just 10 ingredients.


[User] Please transcribe this text

[Assistant] I need to make sure that I get everything I need for this dish.


[User] Please transcribe this text

[Assistant] It's important to get the pasta dough perfect. You want it to come together and not be too grainy and, you know, not be too soft.


[User] Please transcribe this text

[Assistant] Making this tortellini today, I'm just thinking about how much I love them and how much they inspire me every day.


[User] Please transcribe this text

[Assistant] I wanna get quite a umami, smoky, corny type broth. It's gonna be smack in your face and delicious.


[User] Please transcribe this text

[Assistant] With their porn mousse, it's important that it holds together, I can get enough flavour and that it's really nice and smooth and melts in your mouth.


[User] Please transcribe this text

[Assistant] It's feeling smooth in my hands, but it's really hard to tell unless I cook it. So I scoop a little bit out and I place it into the broth.


[User] Please transcribe this text

[Assistant] I taste it and it's light and non-grainy. But I'm not 100% happy.


[User] Please transcribe this text

[Assistant] Shannon's right, my porn mousse is really lacking balance. It really needs some acidity.


[User] Please transcribe this text

[Assistant] Without acidity, the balance of flavours would be thrown.


[User] Please transcribe this text

[Assistant] And my chance is that immunity pain will be gone.


[User] Please transcribe this text

[Assistant] In the MasterChef kitchen, you've got to really think on your feet, think of different ways to do stuff. I'm racking my brain. Come on Chloe, you've got this!


[User] Please transcribe this text

[Assistant] Yep. It's got to be absolute perfection.


[User] Please transcribe this text

[Assistant] It needs to look and taste like a restaurant quality dish.


[User] Please transcribe this text

[Assistant] I have five minutes to go and I've gotta get those tortellini in the pan. Ari.


[User] Please transcribe this text

[Assistant] The thing is that an immunity pin does not come easy. You have to be victorious, not in one, but in two rounds. So what do we have for you, round one?


[User] Please transcribe this text

[Assistant] Under this cloche is the world's most versatile ingredient.


[User] Please transcribe this text

[Assistant] It's the indispensable cornerstone of literally thousands and thousands of dishes.


[User] Please transcribe this text

[Assistant] But you can use those six eggs to make anything you want sweet or savoury. You will have 45 minutes.


[User] Please transcribe this text

[Assistant] You also have an open pantry, the garden's in play, really. The world is your oyster, in this case, your egg.


[User] Please transcribe this text

[Assistant] It's great, it's great, it's great. Yeah, yeah. It just still needs. Yeah, it needs some.


[User] Please transcribe this text

[Assistant] I think the hardest thing to do with this dish is actually balance the flavors. You know, too much fruit dominates, too much mousse is too creamy, too much lemon curd is too acidic.


[User] Please transcribe this text

[Assistant] The balance and the weight of those three elements has been really, really good.


[User] Please transcribe this text

[Assistant] You had a disaster. The disaster is not the dish. The disaster is the cooking of the eggs and peeling the eggs and not leaving yourself enough time for things going wrong.


[User] Please transcribe this text

[Assistant] The problem is you've got disparate bits on a plate and they don't work together. It looks like a modern dessert's gone wrong.


[User] Please transcribe this text

[Assistant] But to get your hands on that immunity pin, you need to do something even harder than beating those three. That's to beat the professional chef.


[User] Please transcribe this text

[Assistant] And today, I'm sorry to say, you're in for a battle royale.


[User] Please transcribe this text

[Assistant] Today's chef has worked at some of Australia's very top restaurants. Rockpool Bar and Grill, Key, and Benalong. He's also


[User] Please transcribe this text

[Assistant] At Benalong he's currently senior sous chef working directly alongside the legend that is Peter Gilmour. He's like Peter Gilmour's right hand man. You ready for this Chloe?


[User] Please transcribe this text

[Assistant] Please welcome from Benalong in Sydney, Shuey Ishizaka.


[User] Please transcribe this text

[Assistant] Shiri, welcome. Thank you. Just to give you a sense of what you're up against. Not just the unfamiliar environment.


[User] Please transcribe this text

[Assistant] But you're also up against a cook who is smashing it. She's on a roll, so don't take her lightly. Okay. She is a force.


[User] Please transcribe this text

[Assistant] Great light filling, good, clean flavour of prawn, lovely, satiny pasta. There's lots of detail in that dish, as well as lots of flavour, and that's a good combination, especially when you put in good technique as well.


[User] Please transcribe this text

[Assistant] So Chloe, that gives you a score of 24 out of 30. That means Shuey, you need 25 or more to win.


[User] Please transcribe this text

[Assistant] I scored your dish. 8 out of 10.


[User] Please transcribe this text

[Assistant] Journey to the West, Chapter 53, The Man in the Canoe.


[User] Please transcribe this text

[Assistant] From behind Guan Yin, Wukong peeked at Red Boy.


[User] Please transcribe this text

[Assistant] The monkey was about to strike the demon when Guan Yin held up five metal bands. She threw them at Red Boy.


[User] Please transcribe this text

[Assistant] Evil demon! said Guan Yin. How dare you try to attack me!


[User] Please transcribe this text

[Assistant] Wukong raised his iron bar to strike him. No Wukong, said Guan Yin. Don't hurt the demon.


[User] Please transcribe this text

[Assistant] I will take him back to Mount Podolaka to be my student.


[User] Please transcribe this text

[Assistant] said the monkey. Guanyin took the base down to earth.


[User] Please transcribe this text

[Assistant] As the man talked, Wukong watched him carefully.


[User] Please transcribe this text

[Assistant] The monkey was about to say something when Bajie stepped forward.


[User] Please transcribe this text

[Assistant] When it was about halfway across, Wukong noticed something.


[User] Please transcribe this text

[Assistant] The two of them watched as the canoe slipped under the surface of the water Wukong stamped his foot


[User] Please transcribe this text

[Assistant] I'm gonna fight as hard as I can. No one wants to be the first one out. I know my family's proud of me. I would like to just stay here to just prove to myself that uhm, that I've got what it takes.


[User] Please transcribe this text

[Assistant] I love making preserves and jams and chutneys. I'm not really sure what I'm going to go with, but I've got my own fridge, got my own pantry, so really the rest is up to me.


[User] Please transcribe this text

[Assistant] We're all so very proud of you and excited to see how far you can take this adventure. All our love, the Kerr boys, Andrew, Simon and H.


[User] Please transcribe this text

[Assistant] I just need to make sure I jam as much flavour in these dumplings as I can. For my filling, I throw in some diced bok choy, coriander stem, coriander leaves, some chilli oil, some ginger, some garlic.


[User] Please transcribe this text

[Assistant] I'm starting to not be so nervous now. I don't want to go home, but I'm going to be the first to go home. I know someone has to, so we'll just see what takes place. Today I'm making chicken dumplings with a vinaigrette and a chilli oil. My dough for my dumplings is nice and smooth. I now just do my little donut.


[User] Please transcribe this text

[Assistant] The first tester I taste, the balance isn't there. No, it needs a bit more sugar. So I adjust the filling and then try again and keep going until I get it right.


[User] Please transcribe this text

[Assistant] I want to serve the judge as a big batch of dumplings. That's what I normally do at home when I'm making them for the kids. So I've taken a lot of care to make as many dumplings as I can.


[User] Please transcribe this text

[Assistant] Next is to cook the dumplings. I put them in the fry pan with a little bit of oil just to crisp up the bottom. And then I need to add some water.


[User] Please transcribe this text

[Assistant] There's no way I'm gonna be able to use these. I'm gonna have to ditch them.


[User] Please transcribe this text

[Assistant] Immediately I think, I'm gone. What am I going to serve? I've got nothing. I've got about 30 minutes left. I'm thinking of the kids at home and I don't want to disappoint them. I've just got to keep fighting. So I'm just going to have to make some more.


[User] Please transcribe this text

[Assistant] Pressure now has just ramped up tenfold and I know that there's not enough filling there to make all dumplings that I want. I just hope there's enough that I can just get something up.


[User] Please transcribe this text

[Assistant] I'm fighting hard. I, I wanna stay in the competition. I've just gotta, just keep pushing.


[User] Please transcribe this text

[Assistant] So with the filling I had left, I could only make four dumplings. It's nowhere near as much as what I would normally make at home, but at least I'm going to be able to get something up.


[User] Please transcribe this text

[Assistant] I had to ditch my first lot of dumplings because I set them on fire, but I managed to get four dumplings up based on the scraps that were left over. All I can hope for now is that they cook in time.


[User] Please transcribe this text

[Assistant] I'm gonna serve them with my actual sauce. It's something I always make whenever we have dumplings. At least I know that is gonna be perfect. Oh god, don't bring your spoon out. I'm happy with the sauce. You never know from the judge. They walk away with this.


[User] Please transcribe this text

[Assistant] I would normally serve a big batch of these to the family, but with all the problems I've had, I could only get three on the plate.


[User] Please transcribe this text

[Assistant] You know, we got through and it was tough but now it's, it's good.


[User] Please transcribe this text

[Assistant] Last time we proved part A of the Kraft-McMillan theorem. McMillan's part. And part B, Kraft's part, says that for any set of lengths satisfying this inequality, there exists a B-ary prefix code with those lengths.


[User] Please transcribe this text

[Assistant] Now to prove this in general, one has to take a given such set of lengths and construct sort of abstractly a prefix code with those lengths.


[User] Please transcribe this text

[Assistant] And rather than go through the general formal proof of this, I wanted to just work out a couple examples to demonstrate the main idea, to demonstrate the construction, because


[User] Please transcribe this text

[Assistant] The formal proof, the notation really obscures the main idea of what's going on and makes things more confusing than they really are. So once you see the basic idea in some examples, then it will be easy for you to turn it into a proof. If you wanted to. Okay, so let's set things up here.


[User] Please transcribe this text

[Assistant] So we have our set x, and let's just label its elements x1, x2, and so forth. They might be finitely many, they may be infinitely many, but we can always label them because it's assumably countable.


[User] Please transcribe this text

[Assistant] And let's also call L subscript i just to simplify life a tad. Let's call that L of xi.


[User] Please transcribe this text

[Assistant] And furthermore, let's call L, a little bit ambiguous here, but not too bad.


[User] Please transcribe this text

[Assistant] Sequence of these L's be a vector in the, in the finite case. L1, L2, L3, and so on.


[User] Please transcribe this text

[Assistant] Now, the first thing that is important is that this sequence be non-decreasing. In other words, that L1 is less or equal to L2 and so on. So it's in increasing order. So this is important. Increasing order.


[User] Please transcribe this text

[Assistant] Be a little bit concerned at this point, because what if our original x's were


[User] Please transcribe this text

[Assistant] We're not in such a way that this was in increasing order. But that's not so bad. We can always arrange for them to be in increasing order because we just gave these x's arbitrary labels here. We can choose the ordering of the x's. We can just label these so that their corresponding l's are in increasing order.


[User] Please transcribe this text

[Assistant] The construction is going to, to use B-ary expansions.


[User] Please transcribe this text

[Assistant] B-ary expansions, and in the case when B is 2, which the examples we'll do here will be, this is just binary expansions of fractional numbers. So if you have a number between 0 and 1, we're going to represent it in binary.


[User] Please transcribe this text

[Assistant] So here's how we're going to do that. It's just the usual thing, but you may or may not be familiar with it. That is 1 half or 1 over 2 to the 1. This is for b equals 2.


[User] Please transcribe this text

[Assistant] 0.01 we will use to denote 1 over 2 to the 2, 0.001 is 1 over 2 to the 3, and so on.


[User] Please transcribe this text

[Assistant] So you, you are certainly familiar with decimal expansion, so the, the equivalent thing in decimal, you know, you would write 0.1 for 1 over 10 to the 1.


[User] Please transcribe this text

[Assistant] And 0.001 for 1 over 10 to the 2 and so forth. And for decimal expansions we also have


[User] Please transcribe this text

[Assistant] Something like this, where it would be 2 over 10 to the 1.


[User] Please transcribe this text

[Assistant] So the only difference here is that sort of the, the, the base is changed from 10 to 2. And more generally if you had, so this would be b equals 10.


[User] Please transcribe this text

[Assistant] For some other base, you would put that b in the denominator. So in general you would have, you would have just that. Okay.


[User] Please transcribe this text

[Assistant] When you add these guys, these, these binary ones for example, you have to carry things a little bit differently than you would in the decimal case. So when you add these guys, let's say you add 0.01 into 0.01 in, uh, in binary expansions.


[User] Please transcribe this text

[Assistant] Then you can't have 0.02 because that's not in binary. So you have to carry. So you carry the 1.


[User] Please transcribe this text

[Assistant] And another quick example, maybe if we had, you know, something where we had to carry twice.


[User] Please transcribe this text

[Assistant] 0.001, then what's this? Well, we add these, we have to carry a 1, but then we have to add that to a 1, we have to carry another 1, and we get 0.100. And of course, you can always


[User] Please transcribe this text

[Assistant] You know, this representation is only unique up to adding additional zeros. So, you know, if we had some


[User] Please transcribe this text

[Assistant] Some binary fraction 0.101, then that's the same as 0.1010 and I could add another zero or however many zeros I wanted.


[User] Please transcribe this text

[Assistant] So this for example, just to complete the cycle.


[User] Please transcribe this text

[Assistant] This would of course be 1 over 2 to the 1 plus 1 over 2 to the 3.


[User] Please transcribe this text

[Assistant] So it's good to start getting familiar with these binary expansions, binary expansions especially, because later when we do arithmetic coding, we're going to make extensive use of binary expansions.


[User] Please transcribe this text

[Assistant] Okay, so now let's do an example. Let's first do a simple example. We'll do the example that our, our famous example A from before when we had, when we had, uh, we had the code.


[User] Please transcribe this text

[Assistant] One, yeaah, one zero, I think, uh, one one zero and one one one. Yeaah, I think that was it.


[User] Please transcribe this text

[Assistant] So in this code, we had the following lengths. We had one, two, three, and three. So let's see, let's maybe just starting from those lengths, let's apply the procedure. So now we're going to hide this. We're going to assume that we don't know


[User] Please transcribe this text

[Assistant] You know, we're, we're not assuming this code now. We're just going to take these lengths. So we're, so let's take L equals one, two, three, and three. So I'm using this notation here for the lengths.


[User] Please transcribe this text

[Assistant] And here's the procedure that we're going to use to construct a prefix code with these lengths. Now, first of all, we, we know already that we, you know, from before we, when we computed the sum, you know, when we added, uh,


[User] Please transcribe this text

[Assistant] 1 over 2 to those lengths up, we know that this was equal to 1, so we know that that


[User] Please transcribe this text

[Assistant] According to Kraft, we ought to be able to construct such a prefix code. A binary prefix code. So here B is two. B is two. That's why I'm using twos.


[User] Please transcribe this text

[Assistant] So here's what we're going to do. Let's visualize the sum of these numbers as sort of stacking up some blocks. So let's...


[User] Please transcribe this text

[Assistant] Say we have, this is going to be an interval from 0 to 1.


[User] Please transcribe this text

[Assistant] 0 to 1, and we're gonna just say we have a block first of size 1 over 2.


[User] Please transcribe this text

[Assistant] So we have a block and the height of that block is one half.


[User] Please transcribe this text

[Assistant] And then we have another block and it's height is one quarter. We're stacking these up.


[User] Please transcribe this text

[Assistant] And since our lengths were in non-decreasing order, they were in increasing order, then


[User] Please transcribe this text

[Assistant] The size of the successive blocks is always getting smaller and smaller. So the first one was a half, then we add a quarter, an eighth, and one eighth.


[User] Please transcribe this text

[Assistant] And if we were to add up, you know, if we were to look at what these points along the interval are, well, they're going to be, of course, one half, three quarters, and seven eighths.


[User] Please transcribe this text

[Assistant] Okay, very simple. Now, let's write this, these guys out in their binary expansions. So what is that? Well that one's just 0.1, 0.01, 0.001, and 0.001.


[User] Please transcribe this text

[Assistant] And let's do the same thing for these numbers over here. Let's write these out. Well, zero is just, well, we could write 0.0 or something.


[User] Please transcribe this text

[Assistant] equals zero, I'll just put zero point for now.


[User] Please transcribe this text

[Assistant] And this is, of course, the same as that, but now we have to add. So let's add these two binary numbers. We have to add


[User] Please transcribe this text

[Assistant] We have to add this to this, so we have to add 0.01 to 0.1, and we did that, I think that was one of the examples we did before, that's 0.11, and now we have to add this, 0.001 to 0.11, and that's just 0.111, and of course 1 is, well, 1 is 1.


[User] Please transcribe this text

[Assistant] Okay, now let's write over, where should we, maybe over here, uhm, actually let me, yea let me put it over here.


[User] Please transcribe this text

[Assistant] Let's number these guys. So we have K and LK. So the first thing here, we'll say 1, 2, 3, 4. Just number them off.


[User] Please transcribe this text

[Assistant] And now we'll look at the length, that, that length. So this was one, two,


[User] Please transcribe this text

[Assistant] Three and three, so I'm just lining these up with these, these boundaries of the blocks.


[User] Please transcribe this text

[Assistant] Now, okay, so what, where are we going? We wanted to construct a code. And so here's how we're going to, we're going to


[User] Please transcribe this text

[Assistant] Grab a code off of this representation. So we're going to make these binary representations of the, the, the boundaries between these intervals. Have, we're going to extend them to LK places. So the first one we're going to take to one place.


[User] Please transcribe this text

[Assistant] We take it to one place. Second one we take to two places, so we need a one zero. The third one we take to three places. So now we have one one zero. And this one's already in three places, so we just have one one one. And now,


[User] Please transcribe this text

[Assistant] Look, that is, that's exactly the code. Well, at least the, the, the, the, the, the fractional part, the part right of the...


[User] Please transcribe this text

[Assistant] Point there. So the code is zero.


[User] Please transcribe this text

[Assistant] And in fact, this is of course a prefix code, we already knew that.


[User] Please transcribe this text

[Assistant] Now we have a new sort of perspective on this prefix code. We see how you could derive it, how you could, how you could obtain it by looking at the representation of these lengths in sort of this, this inverted sort of one over B to the L thing and adding them up and interpreting those as


[User] Please transcribe this text

[Assistant] The numbers in binary representation to a certain number of places.


[User] Please transcribe this text

[Assistant] So that's the construction for this, this simple little example. And let's do another one. Let's do one that's maybe a little more involved so you can.


[User] Please transcribe this text

[Assistant] Start to see a little more how to generalize it. So let's now take


[User] Please transcribe this text

[Assistant] Let's also, we'll keep b equals two and let's just pick some lengths here. So let's say two, three, three.


[User] Please transcribe this text

[Assistant] Three, four, four, and I'm picking them in non-decreasing order. And maybe skip five, we'll throw a big one in there, six.


[User] Please transcribe this text

[Assistant] So now, what are the corresponding numbers 2 to the minus lk?


[User] Please transcribe this text

[Assistant] Well, we're going to have one over two to the two is one over four, one over two to the three is one eighth, one eighth, one sixteenth, one sixteenth,


[User] Please transcribe this text

[Assistant] And the next one, well 5 would be 1 over 32, so 6 is 1 over 64. Okay, so these are our


[User] Please transcribe this text

[Assistant] Numbers in that sum and remember before we, we represented that by stacking up these blocks in order. So let's do the same thing.


[User] Please transcribe this text

[Assistant] Oh, well first maybe we should check. If we added all these up, would we get something less or equal to one? That's what we need for a craft to apply. So let's see, one fourth plus another fourth is going to be half.


[User] Please transcribe this text

[Assistant] Plus an eighth is five eighths, so we're at five eighths, and then another eighth gives us six eighths and a sixty-fourth, so we're well under one. Okay, so things are, things are looking fine. So what would be it? That would be, I guess, let's see.


[User] Please transcribe this text

[Assistant] Uhm, to get to 64, we need to multiply 8 over 8. That would give us 48 over 64 plus 1 over 64. So it's 49 over 64. Okay.


[User] Please transcribe this text

[Assistant] So let's now do the same thing that we did above. Let's draw a picture. Maybe we'll draw a big, big, yeah, maybe make a big, uh, well, let's leave that there so we can see it. Okay. So let's draw our,


[User] Please transcribe this text

[Assistant] Maybe I won't go all the way to one so I have room. So let's see. So let's say we're going to have, the first one is going to be a quarter. So maybe I'll make that a little bigger than a quarter so we actually have room to get to.


[User] Please transcribe this text

[Assistant] Maybe I won't, actually let me not do these exactly to scale, because otherwise it's going to be impossible to read.


[User] Please transcribe this text

[Assistant] So that was a quarter, eighth, eighth, eighth, sixteenth, sixteenth.


[User] Please transcribe this text

[Assistant] Should be even smaller, but you get the idea. Just so we can have room to write. And then a 64th.


[User] Please transcribe this text

[Assistant] Okay. And it's, there's more to go. So anyway, so this is zero way down here and this is one, certainly not to scale.


[User] Please transcribe this text

[Assistant] And now let's write in our numbers here. So we have one fourth.


[User] Please transcribe this text

[Assistant] One eight, one eight, one eight.


[User] Please transcribe this text

[Assistant] 1 16th, 1 16th, and this little guy here is 1 64th.


[User] Please transcribe this text

[Assistant] So the next step, what did we do next? Well, we, we wrote down the binary expansions and then we added up the binary expansion. So let's do the same thing.