Hello and welcome back. This is the second part of our two part lecture on pointers and dynamic memory. Here is a quick recap of some of the relevant topics we have studied. We have studied the usage of variables and pointers to variables in C++ programs. We have seen the usage of the address of operator and the content of operator. We have seen how memory can be allocated on the stack segment as well as on the data segment or heap. In the last lecture, we looked at the new construct in C++ which allows us to dynamically allocate memory in the data segment or heap. In this lecture, we are going to see how dynamically allocated memory persists across function calls. And therefore, we will need to explicitly deallocate dynamically allocated memory. And we will also look at some good programming practices when deallocating dynamically allocated memory. Let us start with a simple function. In this function, I basically want to read the quiz marks of a certain number of students. And then I want to do some computation on it like finding the minimum and the maximum marks. So, in this function, I have this integer variable num students. I ask for the number of students in the class and read in that number in num students. Then I ask for the marks of all the students. And I call this function read quiz marks which takes as a parameter num students, the number of students in the class. And what I expect this function to do is to dynamically allocate an integer array of the same size as the number of students, read in the marks of all the students into that array and return to main a pointer to the first element in that array of integers. So, q marks has to be a pointer to an integer. So, as you can see that read quiz marks will basically take in an integer number and it will return a pointer to an integer. How might this function read quiz marks look like? Here is a sample implementation of read quiz marks. As a precondition, I have n greater than 0 as post condition. I guarantee that the marks of the students are going to be stored in a dynamically allocated array that is going to be returned. Inside read quiz marks, I dynamically allocate an integer array of size n. And then if that dynamic allocation failed, I return null. So, note that I could have put this as part of my post condition that if dynamic allocation fails, we are going to return null. I did not do that here only to save space, but in good programming practice, you should indicate this as part of the post condition. And if the dynamic allocation was successful, then I will simply iterate through this for loop, read in all the marks and store them in the marks array and finally return marks. Now, what is marks going to contain? It is basically going to contain the address of the first element in this dynamically allocated array. So, that is going to be returned to the main function. Let us see how the memory layout might look like as we execute this program. So, here I have the stack segment and the data segment in main memory. Here is the main function and when the main function is called by the operating system, the activation record of the main function will be in the call stack in the stack segment. In this activation record, each of the local variables of main function will be present. They will be allocated space in the activation record. And let us say that we have now read in the value of num students and that is 2. The value of q marks is still initialized. So, I have not shown anything over here, q marks basically contain some garbage value now. And then I go ahead and invoke this function read quiz marks. What is going to happen? The parameter here is num students which is 2. So, when I call read quiz marks, an activation record for read quiz marks will be pushed into the call stack in the stack segment. So, for the time being, let us assume that the stack is growing this way from the top to the bottom here. So, this is the bottom of the stack and this is pushed on top of the stack. And in the activation record of read quiz marks, I will have space for the formal parameter n which of course has the value 2 that is the value of num students. I also have space for marks and I should also have space for I but I have not shown that here just to keep the diagram simple. Now, when I execute the statement, I am dynamically allocating an array of size n that is 2 and this array will be allocated in the data segment. We have seen this in the last lecture. These are the addresses of the first bytes of the set of 4 bytes that is allocated for storing each integer. So, hex 400 to hex 403 stores the first element of the array and hex 404 to hex 407 stores the second element of the array. And I copy the address of the first element in the array to marks as a result of executing this assignment. And then finally, in this loop, let us say I have read in these two integer marks 10 and 15. And finally, when I return marks, what am I doing? I am basically saying the value of hex 400 should be returned to the main function and the activation record of read quiz marks will be gone. And in the main function, since the value returned by read quiz marks is assigned to q marks, so q marks will get the value hex 400. Note that the two array elements allocated in the data segment have stayed back, but now I can no longer call them as mark 0, marks 1 because I have come out of I have returned from the read quiz marks function in which mark 0 and marks 1 were the elements of the local array. Now, I have come out of this function, so I cannot call them using marks 0 and mark 1. So, although the activation record of read quiz marks is non-existent in the stack segment, the memory that was dynamically allocated in that function still persists. And interestingly, the main function has the address of this dynamically allocated memory. So, it can access this memory. What might the main function do by accessing this memory? Well, it might do a whole bunch of things here. If you go through this code, you will see that it is doing some sanity checks and then it is basically calculating the minimum and maximum of the marks. But now the question is that since read quiz marks returned without freeing up these two dynamically allocated memory locations, when is this memory going to be freed or deallocated? Now, it turns out that in C++ memory that is dynamically allocated by any function is not going to be automatically deallocated or freed when the function returns. So, unless you explicitly deallocate dynamically allocated memory, all of this is just going to hang around in the data segment until the program ends execution. And this can be very wasteful of memory. Let us see an illustration of how wasteful this can be. So, here is a modified version of our read quiz marks function which I am calling alternate read quiz marks. The only difference with respect to the previous function is highlighted in brown over here. I have a new integer pointer variable called temp which I am using to store the address of a new dynamically allocated integer array of the same size as n. Here is the sanity check to check if the new function actually succeeded. And in this loop in which I read in the marks, I am also adding 10 to each marks and storing it in this array temp which is a dynamically allocated array.  How might the memory layout look like in this case? So, of course, the activation record of main is there and these are the two local variables of main. The activation records of alt read quiz marks will contain the space for the formal parameter n, space for marks and temp which are basically going to store addresses and also space for i which I have not shown here to keep the diagram simple. And let us say that we have read in inside this for loop values 10 and 15 for mark 0 and marks 1 and 10 has been added to each of these and the values 20 and 25 have been stored in 10, in temp 0 and temp 1. Now, when I execute return marks, what happens? The activation record for alternate read quiz marks will be gone, but these two arrays which were allocated will persist in the data segment. But in the main function, what am I going to do? I am actually going to use only the integers at the address which I can access from q marks. So, basically I can access only this array of integers which contain the marks and so I will be basically only using this array and not using this array. So, array temp is of no use in main, but it persists in the heap and this is why we have wasted memory space. So, this is why we need to explicitly deallocate dynamically allocated memory and C++ provides a special construct to do this. If you had allocated memory for a single variable like this, we had studied this in the last lecture, then you can deallocate that memory by simply saying delete and the name of the pointer type variable which stores the address of the dynamically allocated variable. And if you allocated an array dynamically like this, you basically deallocate that array in the same way except that you put these two square brackets here to indicate to the computer that you were deallocating an entire array that was dynamically allocated. So, note the slight difference in usage. We basically use a square brackets here to say that I am deleting an entire array. Otherwise the keyword to be used is delete. A good programming practice when deallocating, you must always deallocate dynamically allocated memory once you have no further use of it, but you should also check for the validity of an address before you deallocate memory at that address. So, instead of just saying delete my array, you should perhaps check whether my array is not equal to null and only then delete my array because deallocate memory at the null address, then your program is going to crash. The null address of the zero address recall is outside the memory space of every process. So, here is how you might deallocate dynamically allocated memory in all read quiz marks. Just check whether temp is not equal to null and delete it. Note that by the time we have reached this point in this function, we know that temp is not equal to null, but I would still insist that before you use delete, you should always check that temp not equal to null. This is good programming practice. That would take away the dynamically allocated array temp. And now when you come back in the main function, you only have that part of the dynamically allocated memory persisting that you really need. And now it is main's responsibility to deallocate this dynamically allocated memory. This was allocated inside all read quiz marks, but since all read quiz marks didn't deallocate it, now main must deallocate it. And this is how main is going to deallocate that array. So, in summary, we saw the persistence of dynamically allocated memory across function calls. We saw the need for explicit deallocation of dynamically allocated memory. We saw the delete construct to help us do this. And we also saw some good programming practices when deallocating dynamic memory. Thank you.


Long arm of the law. The far-reaching power of the authorities. The long arm of the law finally caught up with the robber, and the police arrested him today.


Often our minds are wandering. We don't think of others or their space. But what is a minor annoyance here is a dangerous choice on the road. Pay attention and give space when merging. Remember, road safety starts with you.


My talk is basically a short update on my work on getting a LibreOffice build working in the WSL environment and basically we can go straight to it. What is WSL? WSL is a Windows subsystem for Linux and that is basically a lightweight emulation layer that allows you to run Linux distributions within Windows and you can have multiple different versions installed by side by side without issues. You can use them simultaneously and what's also a nice feature is that you can seamlessly share files between the Linux realm and the Windows realm and this works both ways and also calling the applications. Linux tools from Windows side works by just prefixing the command with WSL and then the command in the Linux container but you can also do the opposite way just call a Windows program by using the path to the Windows executable from your Linux container. And this virtualization doesn't block you from using other tools like a virtual box so the use can run in addition to having a WSL system running and the WSL2 version also gained the capability to use graphical applications seamlessly on your Windows desktop and it's even integrated in the Windows start menu so if it's a default application entry for this in your Linux distro you don't have to configure anything you can type the Windows key and start typing the first letters of the Linux applications and you can run it seamlessly and also with a pretty good speed so there's no slugginess like if you were to set up a manual VNC for example on a Linux box and try to use VNC to call into that box there's always the delay of the screen refresh but with the GUI support in the WSL there's none of that so it's a great way to use Linux tools on Windows when there's no equivalent available but yeah why would you even consider building a Linux version when you are a Windows user? And I guess the main point why I started looking at into it is the point of reliability. The Windows builds we are currently using the setup is pretty flaky and it fails randomly and in an unpredictable way. That doesn't mean that our Linux builds are without fault but at least the compilation stage the the building stage is reliable so you usually only get problems when you start the testing phase when there's timing issues or similar stuff but the build itself using Linux is pretty reliable and stable and of course it's also a matter of convenience if you're using Windows because your bank application requires a special tool that doesn't run on Linux or if you're a gamer and that's why your primary desktop is a Windows you don't have to set up a dual boot system or use a VM with an additional overhead to be able to use Linux tools and compile LibreOffice for Linux for example and then there's a nice benefit of being able to just compile faster on the one hand because you can use a system libraries instead of compiling ship versions quite easily on Linux and you can use Ccash and this is especially handy if you're starting from scratch often but yeah and the other point is ease of deployment because Linux machines or at least the software that is needed to build LibreOffice is all freely distributable it's easy enough to create either a recipe that other people can follow to install it in one or two command lines or you can also create a full copy of the of the VM image that other people could then import yeah and if you're familiar with building LibreOffice on Linux then you don't have to learn anything else it's exactly the same procedure so they need the the same packages and the build works exactly the same way and as mentioned you can use Ccash without a problem right now on Windows Hossine is trying to get Ccash support for Windows builds but in my experience it on the one hand doesn't even accelerate the build compared to pre-compiled headers and also the subsequent build making use of the Ccash results fails for me for example so none of those problems exist on Linux so this is a way to speed up a development process and another selfish more or less point is that it's easy enough to create the release baseline with that Alma Linux the new baseline for master branch and the new versions is even available as an image that can be installed using the Microsoft Store app so you don't even have to to browse the internet where to find the image to import you can just use the Microsoft Store and tell it to create an Alma Linux 8 installation and then install the packages that are listed on the wiki for that release build baseline and yeah as mentioned it's possible to create exports and imports images so if you want to use a random other distro of your choice that is not readily available in the Windows Store you can usually just start by finding a docker image and import that and just go from there and yeah basically you you're not restricted to what's available in the Microsoft Store but basically any Linux distribution can be used it's a just a matter of preference then and yeah speed again this is probably the most important thing why people would want to use it if you ever used git within sequin I think you can appreciate how much fast it is for example on a Linux box or even in the native git version and yeah I cannot underestimate how how frustrating it is to have to wait for felt eternity for a simple git status command and of course this is also a problem with CI when a build gets interrupted during the checkout phase the repository can leave the lock file behind and then it fails at tons of builds in quick succession just because the build got interrupted or about it during the checkout stage and yeah why then do the effort of building the Windows version from the Linux environment and to prepare the system and something new we used a sequin because it basically offers the same kind of environment for a build so the goal is just to replace sequin with a wsl instead and it still would use the visual studio compiler and not something like min gw or something similar it's basically just replacing sequin and still using all the Microsoft tools for the actual build and yeah you might ask why you replace sequin and yeah again the speed the sequin is pretty slow especially when it comes to file operations as well as when it comes to forking your processes creating new instances of the processes and this is of course heavily used in our build especially when you're building with all languages or also building with help then this really hurts the build time and also related to this sequin especially when used on the CI system can be quite a diva it's very temperamental and there are random failures that basically result in a failure to launch a program and Windows then just displays a dialogue waiting for a user to close dismiss the dialogue for the build to actually fail and this is one of the causes for leftover issues on RCE system that in the meantime were kind of worked out by just taking the bot offline if it detects such a situation but of course this is only a workaround it doesn't solve the problem and with the wsli I hope that is a step in the direction to solving this issue and another is near problem depending on how you look at it is that it's hard to have a single or a uniform baseline when using sequin as a baseline because it's more or less a rolling type of a fair worth of sequin so depending on when you install or set up the system you might have different versions of the utilities and libraries installed and compared to half a year later and while this hasn't been a problem recently it has been in the past and required users to back to a specific version of the segment DLL and stuff like that and of course if you have a Linux distro that is not of the rolling type then it's much easier to to have a unknown state so to speak and yeah with so many things there are too many ways to do stuff and I indicated or mentioned earlier that there's a difference between working in the Linux container run where this working on the on the Windows side and file access and stuff is speedy within wsl2 but if you were to access files from the Windows side or the opposite way then there is overhead not quite as bad as with sequin but at least I noticed a drawback and the prior version of wsl didn't have this problem so the interoperability between the cross access of files was much better but of course the access times within the container would be much lower as in some cases I read it wsl to improve the within Linux access up to up to 20 times so this is of course one of the drawbacks you have to weigh in on designing which way which approach you take and yeah for the moment I just didn't go with the wsl one approach because yeah then you lose the the benefits from using wsl2 for also using it as a as a tool to create Linux versions but of course since they are pretty similar it can be tested later and yeah as mentioned yeah my approach is different from the initial hack that was created by Tor he I think tried to use it control the build from the Linux container side but yeah I didn't go that throughout I wanted to have it much as few things as possible from the wsl container and do as much as possible on the on the on the Windows side but of course this then poses the question how do you bootstrap this environment and PowerShell or Windows command prompt are pretty different from a bash shell and that's why I said that pretty risky to try to to hack our configure system into something that is completely alien to what was done before so I basically took a shortcut so to speak and I'm using a git bash that can be installed from Visual Studio and it's using mcs2 which is similar to sqn basically based on sqn but not quite sqn and of course just this single component and the build then starts off by running the autocan.sh within the container you see the wsl.slash.autocan.sh command this tells it to run this command the autocan.sh and the linux container and since sqn already is a Linux like environment this more or less works but of course all the stuff that is specific to Windows needed addressing for example we have a lot of detection for a file path that are looking up the registry and in sqn this is exposed using the proc sudo file system bent yeah of course this is not available in wsl so I had to create a little helper it just uses a simple bed file to get the relevant registry keys and yeah also our configure is quite inconsistent when it comes to how a file name or file path should be handled so there's a valid mix of using linux style path versus the mixed style windows path which means forward slashes and the traditional windows path or file names using the backport slashes and of course this also needed addressing because wsl itself only can deal with the linux path and if it accesses a path of the windows side it has to be using a mount path and there's a unfortunate thing regarding the difference between sqn and wsl both have or helper functions to convert paths between the two systems but wsl is path convert function for example fails hard if it's already in the form you want to get so if you're requesting it to get a unix style path and pass in an already unix style path then you get an empty result and of course this was messy and made a configure very bloated in my first attempts and yeah I decided it's not worth to spend too much time on making the configure situation nice or ready to to integrate straight away instead I just ignored all the specifics about the differences between wsl and sqn and just tried to make a configure pass and then to make it actually suitable for use with wsl I created a helper script that just modifies the values from config underscore host.mk the the file that it makes reads with all the variables that are needed for the build all the different utilities out of the path and during that script I also unified the path to work like that and yeah it's not nice not something that is ready to be integrated but it worked just fine and let me proceed with the rest of the work and yeah unfortunately unfortunately LibreOffice is not just a single piece of software it requires or uses lots of eternal stuff and every project more or less has its own little quirks here and there and expect different environments rather best or not and so honestly I didn't want to again before even working out the main part it didn't want to spend much time in fixing each and every external project this so I tried to disable using the real-time config switches as much as possible and yeah at least this got me going and there was another unexpected side effect of using the AMSYS version of of bash there because it tried to convert everything that it thought was a path that did not exist already and example we are using many options for the compilers that start with the forward slash option the one of their ways on Windows 2 specify optional flags and this then was turned by AMSYS into C program files git bash slash over and of course this broke the build obviously and one way to fix this or address this was to change the switches to just using the hyphen style that is also supported and this made the problem go away or also as a way to use double slashes at the first instance of a slash this also prevents this behavior but of course yeah this was quite a teacher's approach and you know made the make files a little ugly and especially and with the idea behind you that I don't didn't want to break support just by adding support for WSL this made me question the the viability of this approach and yeah even if many external libraries and stuff are optional not everything is so either you have to use a system component or compile it as part of liberal office and at some point I just had to add support for the for the external libraries and this is where I hit a roadblock that would turn out to be a blessing in disguise and it's a pearl of all things there's a different way to configure pearl in which it should have a file path and open SSL just insists on having a pearl that uses a window style path and patching the build system of an external is always very flaky and might change within next update and so I certainly didn't want to do major changes to the externals and how that work so instead look for alternative solutions and found it in the means of strawberry pearl this is a windows version of pearl that behaves as expected from the open SSL points of view and is also available as a portable distribution so it doesn't conflict with anything else you have on the system you just track it into the directory and can use it from there but without impacting the rest of your system and yeah this of course made it no longer necessary to call a pearl from within WSL so this cleared up lots of calls by just using the strawberry pearl runtime instead not just for open SSL but in other places and that in turn saved me from quoting path for the make shell invocation and then to make sure to convert them to the WSL convention using the mount point style of path and as a side effect it also comes with some additional tools that I also then didn't have to call from within WSL like for example the resource compiler or thinker tool and yeah I said a blessing in disguise turns out because yeah that allowed me to strip a lot of special casing in the in the new build portion of our make files and then another blessing I found the magic invocation on how to disable the path conversion that msys does and yeah this was really the the breakthrough in quotes that made me have confidence in this whole thing again this made me make files so much cleaner and it started to look pretty clean and I hadn't adopted anymore that I can make it work without breaking the second way of building and yeah I of course as a release engineer I'm focused on also providing the installation sets and this was the last thing that needed fixing and again this was surprisingly easy again it's just the most tedious because the install set code is this pearl in disguise only it's not using pearl way of doing things it's just using pearl language and it's unnecessary convoluted and has lots of leftovers from ages ago that are not really longer used and make finding your way around who are complicated and also uses the anti-patterns of of removing the interesting bits of error logs the actual error of the command that failed is submitted to most of the times and this makes it annoying because then you have to dig where so the command called let me get you the error message and once you see the error measures usually particularly what needs to be actually fixed and yeah the result of all this is that I got it to work it I had none of those random failures that I had with Sigmund but this is of course not conclusive because my build machine at home is not as powerful cannot build with that high parallelism like the CIM machines can and of course they don't my machine doesn't do build or after build after build and unfortunately there is a new issue that's popped up and windows tries or randomly suspends one of the accessibility processes that I used during creation of help and I was really thankful this is a wrong word but I was relieved that it wasn't related to the WSL environment because also I'm not sure who it was in Micah Gansky or maybe Noel also head of the Sigmund based building environment so yeah this is just an annoyance because the build doesn't proceed it just waits forever until the command is either either killed or handled in in another way and I honestly expected the build to be a little faster but it turns out it actually a slight a slight penalty of using this approach and if you're talking about a four hour build time it's around 10 minutes so it's not that much of a slowdown but still I would have expected the build to be a little faster but yeah it was summertime and the my laptop was thinner throttling so it was hard to have reliable numbers and I still need to look into what exactly is causing the slowdown compared to a second build but even if it's slower it's not significantly slower if you factor in the benefits of an offset if a build fail and need to redo a whole build because of the random failures so I still want to go ahead with the approach and yeah and basically make it integration ready and yeah there's an easy thing that can be tried still is by just using WSL and see how that stands but yeah getting to get around to try that yet but at least in my approach there's nothing specific to a WSL for the Windows build part but of course yeah you're not getting the GOI support in this case but for building the Windows version that's not necessary sorry yeah what's next next things is to clean up Convicker and remove all of my nasty print style debugging stuff and make it work with not my hardcoded parts but yeah make it happily coexist with the SIGWIN way and I'm thinking of keeping the post-processing of Convicker host mk because it's much easier approach if it was all handled in Convicker you basically have to duplicate every SIGWIN section and the Windows handling in the Convicker is already so so fast so I'd rather avoid that but yeah I'm not fixed on that yet but at least it looks to be the the simple option and yeah and of course I need to actually put it through its paces by using the same hardware where the errors with the green pop-up and this requires me to deploy Windows 10 or 11 on the build machines first and then I can do a larger scale test by looping the build basically and replacing the current Windows baseline is on the is planned anyway because the current systems which are Windows server 2012 R2 are reaching the end of life so I will be switching to Windows 11 anyway and yeah then I can test the SIGWIN versus WSL performance on the on the real CI setup yeah and I think I were in time just in time so if you have questions I'll be around so or maybe Stefan you can come down and set up already then if you have any questions thank you


What's up everyone takedown here welcome back to another video as you guys might know I'm a former employee of Canadian Tire I was there for about five years and over my five years I did learn a lot of tips and tricks that is still used today when I'm shopping at Canadian Tire And I wanted to share a lot of these with you guys because it can help you save some money Now this can also be done at other retail stores like Walmart and other things like that But for the most parts it is about Canadian Tire. Let's get right into it So the first thing is about their promo deals that they have throughout the year that are 30 times Canadian Tire money for the day or Spends for example, $200 and get a $50 promo card Some of those can actually be stacked if you put them on multiple transactions So these days are usually throughout the year. So usually there's the long weekend in May There's something in July. I think around Canada day There's other big red Thursday events and definitely black Friday But there's multiple ones throughout the year and you can keep an eye on the flyers to find when these events are or If you have the app or Canadian Tire credit card, you will be notified when these events are happening They'll send you an email or they'll just notify you on the app now When going for example, if it is $200 and you get a $50 promo card If you're spending over $200, let's say you're spending over $400 Before taxes you could split that up between two transactions and get two of the $50 promo cards Rather than put it all in one transaction and only gets one That's something that they don't tell you that you can stack them if you're doing multiple transactions For example for me if I'm buying truck tires, which usually I go with Goodyear SRA, even if they're on sale It's around 250 per tire. So four tires That is $1,000 if I put them all on one transaction that is simply going to be spend the $1,000 and I'm only getting a $50 gift card now if I go and I put all four tires on four separate transactions All of the transactions are gonna be over the $200 threshold and I will be able to get four of the $50 gift cards So that is like saying spend a thousand and get $200 in those gift cards If you are going to go for those events and you need to get big ticket items put them on multiple Transactions once one transaction goes over that threshold tell them that that's all you want on that receipts They'll give you a gift card for whatever the event is and then you just have them put the rest of the stuff You are buying and hopefully you will get over another gift card and get multiple gift cards That's usually what I do and especially helps one of you are buying tires The next tip I'm gonna be sharing is also about these big red Thursday events and Black Friday and other events throughout the year That they do have big ticket items in the flyer Now one thing that you do not know is whenever you go in the store Let's say you're going in for one of the TVs and you go in the TV departments And you're wondering why it's not there and why they moved the skid of them into automotive They actually do it for a marketing and Strategic reason the reason for that is when you go into the store for that big ticket item When you go into the TV aisle and it's not there and you're told that it's an automotive You now have to walk to a different department of the store and in hopes that You're going to go and you're gonna spot something and be like hey I actually need that I'm gonna buy that as well or see something else that's on sale and go That's actually a really great price and buy that as well So instead of you just coming into the Canadian Tire Store for that big ticket item for that TV You're gonna be buying multiple things if you have to walk around the store to find what you actually came in for So instead of putting everything let's say that big ticket item that TV in with the rest of the TVs You're likely just gonna come in get that TV and leave because you're gonna go directly to where it is Instead of being redirected so it's kind of smart that they do that But they're doing it for a reason the next tip is about the regular sale items that are in the weekly flyer Now those items can actually be redeemed at the sale price two weeks before the sale starts and Two weeks after the sale ends It just is a matter of you walking up to the manager and asking them to do it And if you're nice about it, they will honor the price But if you're going to be going in and you're disrespecting them or you've already had previous problems with that manager Usually they will not allow it whatsoever Because they don't need to do that, but it is something that they can honor now I did this in the past because I worked in automotive I needed that ability to look up in the system to see when things are going to be coming on sale for example tires for my customers and That's something that usually only managers are allowed so if you go in you ask an employee when something is going to be coming on sale or If you can honor the sale price from last week, they usually cannot allow it They have to call the manager and it's the manager's decision whether or not they can and most of the time They will again if you're nice about it if you're going in and you're demanding it or you're being a dick They're going to say no They're not going to allow it and you're going to be without whatever item you are going to hopefully Was going in for to get it for on sale So you can go and do that but that is also excluding things like Black Friday the Christmas sale and any other Limited items where it's wall quantity lasts Usually that is not included in the regular sale and it cannot be honored Especially things that are going to be gone or discontinued They do not honor that because they can't get any more of it in so it's not a regular sale item The next one is to do with the automotive department And that is whenever you are booking an oil change and you've already had oil changes there in the past For example myself. I always stick with the same type of oil and that is the Quaker State full synthetic Now I have had in the past where I've called for an oil change And I didn't do this and they put the wrong thing in the system and on my work order Luckily the mechanic knew what I previously got so I did put the right stuff in but there can be a mix up from time to time Now simply whenever you call if you had an oil change in the past Simply say to them you want the same thing as last time So what they're gonna do is they're not even gonna think about this They're gonna go under your history and they're gonna transfer everything over from the last oil change to your current work order for your current Appointments and what that will do is it limits all of the human error for picking the type of oil The velocity of the oil the brand of oil that you want and also the oil filter So it'll all be the same as you previously had and it will also alert them If they do not have that oil in stock or if they don't have the filter in stock And it will let them know that it needs to be ordered before you come in for your appointment So it actually helps you with not only Making sure everything is there ahead of time and that they do have the stuff in stock But it makes you have a peace at minds where you don't have to think of are they putting the right oil in my Vehicle because they're just transferring over the same as you had last time Went into your new work order. So it's a lot easier for them They don't have to go in and try to find what oil you wanted They can just transfer it over and it's easy as that The next tip is something that you can do at other stores if they do have the system And that is when an item that you want to purchase is not on the shelf Ask an employee if it is in another location on the floor in the store It will be right in the system or if there is none in stock It will also tell them that's on the computer and if there is some in the back If there is a warehouse location, they can simply know where to go in the back So one thing I absolutely hated is whenever people would ask me if something's in stock I would check on the computer and realize either none is in stock or there is none In that location. There's another location if there's none in stock. I'd always be asked. Can you check the back? Literally do not do that with the Canadian entire employee because they're literally when they're checking on the system It tells them if there's any in stock at all in the building if it says zero There's no point to go and check if it says that there's some in the back They know exactly where to go look if it says there's some on the floor in a different location a different location For example an ends or a skid somewhere. They know where to go So usually the employee knows what they're looking for. They're not just going to tell you No, just so they don't have to go and look and the last tip and trick with Canadian tire is about Warranties and returns. So let's say you have a two-year warranty on an item If you have to go and return it and it is within the warranty period They should and can honor it because what they're going to do if it's something that needs to be repaired They're gonna send that back to Corporate to the warehouse. They're gonna decide whether or not it's something to be fixed If it is they're gonna fix it and then send it back out to a Canadian tire Not specifically that one, but they're gonna send it back to a Canadian tire Now if it's something that cannot be fixed and it's to be destroyed All they're gonna be doing is putting it into the back and at the end of the day They're literally going to just smash and destroy it and toss it into a dumpster They're gonna spray paint it so nobody can come and take it to fix up and resell They're just going to go and destroy it and spray paint it so it can't be used again now to reason for this is because Whenever you come to do the warranty and and or return to get your money back, whatever you're doing all they're gonna be doing is Corporates can be paying them for that item so you're getting your money back But the company is getting the money back from corporate So they're getting their money back So it's not that they're losing a sale and they're giving you the money back They're going to be getting the money from corporate for that item because it has to be destroyed because it's faulty or Something wrong with it or it's broken and it was within the warranty period So keep that in mind is that if they tell you no, we can't take this back They are lying if it is within the warranty period and it can be taken back All they're going to be doing is destroying it anyways And they are going to be getting their money from corporate So there is no reason to deny you as long as it is within the period Of the warranty for whatever item it is and as long as you do have your receipts or you purchase with your credit card And they can find the transaction There's no reason for them denying you a return or a refund Because they're getting their money back one way or another when they send it off or destroy it They send that paperwork to corporate. They're getting their money back So keep that in mind with Canadian Tire 2 that sometimes they tell you they can't do it Just because somebody just does not want to do the paperwork for it The company that specific Canadian Tire is not losing any money any way and it can be done So hope you guys have enjoyed this video of different tips and tricks with Canadian Tire And I'll see you guys in the next video. Please take care. Peace


President of the United States. Kiwanians, ladies and guests, as a special speaker at our 72nd Annual Convention, he shares our belief in the need for private initiative and volunteerism to President of the United States. Thank you. Thank you very much. Thank you. Thank you all very much. It's wonderful to be with the Kiwanis again. Beginning here, I was thinking back to the last time I addressed this gathering in person, and that was more than 20 years ago, back in 1964. So let's promise each other something. That in the future, we won't be such strangers. A lot has changed in the last two decades. I remember the first time I was introduced to the Kiwanis. I was described as an actor and spokesman for American business. Of course, that's how a lot of people still think of me. But I've never felt far from the Kiwanis. Since that day in 1964, I've watched Kiwanis international grow to include 315,000 members in 71 countries, bringing the Kiwanis' ideal of service and charity to over 8,200 communities. Now that's one kind of inflation I'm all for. I've watched as your organization led the nation in the fight against drugs back in 1969, even as others talked of tolerance and experimentation. And you've been a leader in that fight ever since. With your help, America is winning. We're getting the message across that drugs are an evil, pure, and simple. And we're convincing our children to say that magic word when it comes to drugs to just say no. I can't help but insert something here. I don't know whether you know where that phrase came from about just say no. Nancy was speaking to some school children in Oakland, California. And a little girl asked a question about what do you do if someone offers drugs. Nancy said just say no. And today there are over 12,000 just say no clubs in schools across the United States. But from the innumerable acts of personal caring and charity the Kiwanis perform to the clubs you sponsor in our nation's schools to instill the spirit of volunteerism in our youth Kiwanis exemplifies the American tradition of neighbor helping neighbor. And then of course there are the Kiwanis public service billboards that line highways across the country. If you'll forgive this old actor I just have to tell you it feels good to once again see my name up in lights. By the way speaking of the spirit of volunteerism and your great generosity reminds me of a story about a friend from my show business days who couldn't have been more the opposite the famously stingy Jack Benny. Jack was having lunch with another famous entertainer of the time Edgar Bergen. In those days Edgar Bergen and his dummy Charlie McCarthy were the biggest things on radio. Well there was a group of show business types there after lunch when the check arrived Benny picked it up even though by that time his cheapness had become legend. Someone turned to him said Jack I'm surprised you asked for the check. Benny said so was I and it's and it's absolutely the last time I'll ever have lunch with a ventriloquist. Well after telling that though I have to make it plain that that was all part of the act Jack wasn't really that way indeed he was the soul of generosity and kindness the other was just part of the public performance his act. The great generosity of the Kiwanis is what's become legend. The service as you perform reach beyond the direct beneficiaries to embrace all of America in a community of carry. You represent America's heart good strong knowing you give generously and you give well often putting comparable government programs to shame. You know the difference between private charity and public programs that with personal giving there are two winners the person who gives as well as the person who receives and very often it's the giver who receives the most precious gift personal private charity humanize a society it makes us more aware of each other of our hopes needs of our sorrows and joys it makes us all more compassionate. The Kiwanians have demonstrated this compassion and caring over and over again in thousands of communities and for that reason I'm today proud to announce that you have been selected to receive my private sector initiative citation award for all that you've done to fight school age drug abuse. Nancy and I congratulate you all on a job well done and because you exemplify what is best about our private life I want to talk to you today about what we must do to protect that way of life. I want to enlist your support in the campaign I began on July 3rd on the steps of the Jefferson Memorial there I called on America to complete the work of the author of the Declaration of Independence with an economic bill of rights that will restore to Americans the freedoms our founding fathers assumed we would always have and protect us and future generations from the encroachments of big government in our lives. Make no mistake we face a clear and present danger in Congress the momentum of big government which we've managed to hold back these last few years has only been gathering steam getting ready to burst through all the restraints that we've imposed upon it. Let me give you just a few examples first the so-called budget process an article in the Washington Post recently described a part of that process the article was entitled a member's menu for airport pork and it described how one of the members of the House Public Works and Transportation Committee circulated a fill-in-the-blanks form among the members asking them to sign up for their favorite pork barrel project according to the post few could resist grabbing and I quote a piece of the action piece of the action that sounds more like a movie review of the untouchables a piece of the action like the UDAG program that will spend millions of your tax dollars to build luxury hotels restaurants and condominiums or the so-called demonstration projects in the highway bill that don't demonstrate anything but the ability of some in Congress to bring home the bacon a piece of the action sometimes the waste is absurd like the thousand acres of underwater property the federal government is planning on buying a shameful secret of the farm programs is that one of the biggest recipients of agricultural subsidies in America isn't even an American he's the prince of lichtenstein and he happens to own a few hundred thousand acres in texas it seems that everybody is getting a piece of the action and that's why when the house senate conference committee agreed on a budget recently it included 41 billion dollars in increased domestic spending with essential defense programs held captive to a 64 billion dollar tax hike it's always the american people who are expected to foot the bill with higher taxes now i promise this from now to the day i leave office i won't hesitate for one moment to use my veto power and if a tax hike makes it to my desk i'll veto it in less time that it takes vanna white to turn the letters v e t o but what happens in the years ahead can we always count on the occupant of the oval office to stand fast against this tide will the next president hold the line against tax hikes and big spending and even if he's determined the fact is the presidential veto power has been seriously weakened to the last 15 years the checks and balances our founding fathers designed into our constitution have been put awry by a congress unwilling to give up its spendthrift ways later in life when jefferson examined our constitution he found one glaring omission a failure to include an article in the constitution that would prohibit government borrowing what we've come to call deficit financing his concern ran deeper than his well-founded fears of profligate government from history and experience he knew that it was in the economic realm that the oppression of government was most often keenly felt he knew that a government with no limit on borrowing was a government with no limit on its power over the individual that this power to borrow was like a wedge that could be driven between the individual and his god-given rights of freedom and poverty property when i signed the tax reform bill i said that these last decades had seen an expansion and strengthening of our civil liberties but that our economic rights have been too often neglected even abused well as time that abuse stopped and that's why we're calling for an economic bill of rights that will complement and strengthen jefferson's political bill of rights oh congress sit up and take notice the people are entitled to the fruits of their labor and shall not be burdened by excessive taxation therefore more than a mere majority of the congress will be required to raise taxes under our plan let me just say something here on one of the talk shows over the weekend i heard someone complaining that to ask for more than a 50 percent plus one vote to raise taxes was somehow pulled out of the blue and unusual and it didn't make sense well it's not that unusual why should 50 percent of the of the representatives plus one be able to pass something as important as more money out of your pockets while there were 50 less one who didn't want that to happen and it isn't that unusual when i was governor of california he it took two-thirds of the legislature to approve the budget and in voting bond issues which is government borrowing it took 60 percent of the vote not 50 plus one we're a federation of sovereign states and sometimes i think the federal government should take more of a close look at how well some of the states are doing and improve itself accordingly but what we intend is that the future of succeeding generation shall not be mortgage to the national debt through deficit spending the congress shall be required under our plan to balance the budget each and every year now i grant you that can't happen in a single year to those who say well why don't you present a budget no when for 50 years or more we have been deficit spending and building that debt the deficit is the point that it cannot be undone in one year without causing great hardship to a number of people in the country so we have to set a pattern as the gram rudman hollings bill did of each year reducing that deficit to a designated date at which point then the budget must by constitution remain balanced special interest legislation shall not be hidden from the people the president shall have the right to veto individual appropriations in other words the president shall have the line item veto truth in federal spending congress shall specify how every single new program is to be paid for the people are entitled to pursue their own livelihood free from excessive regulation and tax subsidized competition and i will appoint a presidential commission to spearhead efforts to privatize public owned enterprises the burden of government shall not be hidden from view the congress shall require that a financial impact statement accompany each bill specifying the effect on economic growth employment and competition overseas educational development creativity and initiative will be fostered by diversity in our educational system welfare programs must not harm the structure of family and community through the use of incentives the congress will seek to lift the least fortunate to independence and full participation in american life and economy free and fair trade will be encouraged the congress shall pass no measure that slows growth shrinks markets or destroys jobs by a erecting high tariffs or other trade barriers we shall take seriously the fifth and 14th amendment guarantees to life liberty and property whenever government expropriates the use or value of private property whether outright or through government regulations owners will be justly compensated when i when i spoke before the kawanas those 23 years ago i said we had come to a time for choosing the choice was between freedom and increasing state control it is time i said to that we ask ourselves if we still know the freedoms that were intended for us by the founding fathers and if we will pass on to these young people the freedoms we knew in our youth because freedom is never more than one generation away from extinction it has to be fought for and defended by each generation this is the recurrent challenge the one from which we cannot shrink today we have the chance to write into the structure of the law guarantees of our so much abused economic freedoms to ensure that this generation and the next will enjoy the fruits of their labor will continue to live in a land of hope and opportunity where big government no longer blocks the doors to progress we can proclaim this truth to be self-evident that the american dream is our sacred birthright that in this time for choosing with one voice we proudly choose freedom thank you all very much god bless you all thank you mr president for taking time to address our 72nd international convention we are most grateful and to show our appreciation i want to present to you two mementos first i understand that today is nancy's birthday so we want you to have a special portrait a replica of the 6000 billboard that kawanas clubs have posted during the past two years and please express happy birthday to nancy from all of us and to accompany that we have enrolled you as a hixon fellow in our kawanas international foundation this contribution of one thousand dollars to which kawanas the kawanas international foundation is adding ten thousand dollars is in your honor and will be used for kawanas programs to support the prevention of school age drug abuse


Okay. So, welcome back. So, today's last lecture will be given by Professor Jensong Lee. Actually, this is his last lecture. Lecture series, yes. Okay. So, okay, please. Okay, thank you. Okay, so this is my last lecture. So, yesterday I talked about TOR. So, this is a form of TOR, right? So, and this holds for over-damped Langjubang system and Markov jump process. Okay, and this holds in the steady state. This is important. And also, additionally, we also showed this KUR, Kinetic Uncertainty Relation for Markov jump process. It also holds in the steady state. So, these two relations holds in the steady state. So, one of you yesterday asked me, then what happens if the system is not in the steady state? So, I mean, yeah, that's a very important question. So, some modification is necessary to, I mean, for this arbitrary state case. So, this is TOR with arbitrary state when arbitrary time dependent protocol is given. So, these holds for over-damped Langjubang system and Markov jump process. So, this is the modification. The other things are same.  So, here tau is final time and omega is protocol change speed. So, for example, if there is no protocol, which means that omega equal to 0, then this term goes out. And in the steady state, actually, applying this in front of this observable value in the steady state, actually, this is nothing but just observable average. So, in the steady state, this equation inequality returns back to this original steady state TOR. So, this is a modification. And then what about under-damped Langjubang dynamics? So, actually, these are holds for over-damped Langjubang dynamics. So, this is a TOR with arbitrary state when arbitrary time dependent protocol is given for under-damped Langjubang dynamics. So, similar to this previous case, in front of this observable average, we have to put some operator. And additionally, we have to put some, I mean, some constant here, i. So, here i is related to initial Shannon entropy. So, a little bit becomes a little bit complicated. But anyway, when we take over-damped limit, which means that m over gamma goes to zero limit, then we can show that this expression goes to, I mean, this TOR in the steady state. So, in this way, actually, these TORs are consistent theory, each other. Okay. So, this is some variance of TOR in arbitrary state and arbitrary protocol is given and for under-damped Langjubang dynamics. Okay. And then, actually, I prepare some how to apply TOR to some experimental situation. But because of time, I will skip that part. And then I want to go to the lecture four today. So, I mean, so this is a schematic of a stochastic system we are interested in. So, T equal zero is initial time, T equal tau is final time, and these are initial states, and these are final states. So, this initial state constitute this initial distribution. And final state constitute final distribution. Okay. And gamma is stochastic trajectories. So, we are interested in observable, observable theta. So, for example, there are heat, work, and displacement, and so on. And this is entropy production, which is a function of gamma. So, actually, now we want to find the general relation between these quantities. So, yesterday we learned TOR. So, TOR is a relation between the observable and entropy production. So, as I showed you in the first page, it looks like this. So, I mean, this is a relative variance and a relative fluctuation, and this is entropy production. So, as I explained yesterday, it is a kind of a trade-off relation. So, we have to pay more thermodynamic cost for reducing fluctuation. This is the meaning of TOR. And today, and actually, so this is a relation between these two, observable and entropy production. And what about this measurable quantity, which is a distribution? Distribution is also measurable quantity, right? So, today I'm going to talk about thermodynamic speed limit, which is a relation between these distributions and entropy production. Okay, so let's suppose this situation. So, here P0 is initial distribution, any initial distribution of a system. And this is a final distribution of a system. So, we want to move this initial state P0 to final state during a finite time tau. Let's suppose that this situation, then this inequality holds. So, let me explain the meaning of this inequality. So, tau is transition time from initial state to the final state. Final distribution. So, this is a transition time and this is entropy production. And this A bar, A bar, you can think it as a dynamical activity, which is a number of jumps, number of transitions during the process. And here DTVPQ, PNQ, it is called Total Variation Distance. And actually this is one of the distance between two distributions P and Q. So, here there are two distributions P0 and P tau initial distribution, final distribution. So, I mean this is a distance between the initial and final distribution. So, I will explain the explicit definition of these two quantities in the next slide. So, let's look at this equation. So, for example, if we reduce this total transition time, then from this inequality it means that entropy production should increase. Or if we want to reduce entropy production, then the transition time should increase. So, roughly saying it is also kind of a trade-off relation. So, we have to pay more thermodynamic cost for faster transition. It is quite intuitive to understand, right? So, this is the meaning of this speed limit. Okay, here. So, I will show you the definition later. Of course, I mean this term also depends on some protocol. So, actually this is not constant. So, that's why I say roughly saying, roughly saying it is a trade-off relation. But anyway, this is a positive number. So, any other question? Okay, no? If no, then... And conventionally we write the speed limit in this way by moving this entropy term to the right-hand side in this way. Okay. So, in lecture 4, in the first section, I will show you how to derive this speed limit. And in the second section, I will show you how to apply this speed limit to the problem of finite time land that was bound. Okay. Okay. So, this is a speed limit. And the motivation of the study of this speed limit is actually the quantum speed limit, which was introduced in 1945. So, this quantum speed limit is about the closed quantum system. Actually, it is for closed quantum system. So, let's say that this is the initial state of a quantum system and this is a final state of the closed quantum system. So, the evolution is unitary, of course. So, this is a quantum speed limit. So, the transition time is larger than this value. Here, L is some kind of distance between two states. So, the thing is that if we take how bar goes to zero limit, which is a classical limit, then you see that this term becomes zero. So, actually, in this limit, the quantum speed limit becomes trivial. It means that transition time is non-negative. It's a very trivial statement. So, people asked then whether there is some meaningful and useful speed limit in a classical system. Okay. And then, I mean, it is for any Hamiltonian but closed quantum system. So, evolution is unitary evolution. Actually, I don't know what about this theory but as far as I know, I mean, this is a general bound. So, I don't know whether there is some restriction for Hamiltonian. So, it holds for, I mean, general, some unitary evolution case with a certain Hamiltonian for closed quantum system. Sorry, I cannot hear you. Yeah. Yes? I mean, this limit is a, we know that this is a classical limit. So, quantum to continuous state space. So, that's why I say that this is a classical limit but anyway, this is a closed system. So, your question is that this limit goes to some thermodynamic. Yes, right. I mean, this is a simple limitation. So, one trial. So, we want to see that what happens if we take a classical limit, whether we can have some meaningful speed limit in a classical situation but anyway, if we take this kind of a classical limit then we cannot find any meaningful speed limit in a classical system. But of course, I mean, I'm dealing with a classical system even though it is an open system. So, I mean, that's why people asked whether there is a meaningful classical limit in a classical, in a classical system. And so, that's why it becomes a motivation to study a speed limit in a thermodynamic classical system. Yeah. But of course, nowadays people are also studying the quantum speed limit for open system, open thermodynamic system. So, then we can derive a similar structure, a similar inequality in such an open quantum system. Okay. So, this is a motivation. So, this is a speed limit. And in this lecture, our focus only on the discrete state model which is a Markov-Jumper process. Of course, we can consider long-term dynamics with continuous states but if we consider the long-term dynamics we have to use other distance measures such as a so-called a vasestine distance. But here I will not talk about the vasestine distance. So, here in this lecture I will only focus on the Markov-Jumper process. Okay. So, this is a system setup. So, the master equation, so R and M is a transition rate from M state to N state at time t and PN is a probability of state N at time t. And entropy production rate. We learned how to write entropy production rate in terms of rate, transition rate, and probability. Of course, this speed limit can be derived when we use different entropy production. For example, this same inequality holds for when we use Hatanosas entropy production or non-ideobetic entropy production we learned what is Hatanosas entropy production yesterday? Or the day, okay, yesterday. So anyway, this inequality holds for Hatanosas entropy production but for simplicity in this lecture I will only focus on this just total entropy production rate. And this is a dynamical activity rate. So, this is nothing but the number of jumps rate. So, this is the definition of dynamical activity rate. So, by integrating this dynamical activity rate from time zero to tau then it gives a total number of jumps, right, during the process. So, we call it total activity. And this A bar is defined by total activity divided by total time. So, it is a mean activity. So, here this A bar means mean activity here. And finally, this one, DTV, Q and P and Q is called total variation distance and the definition is looks like this. So, there are two distributions, P and Q. So, it measures how far they each other. So, you can check that this distance is in between zero and one. So, when the two distributions are exactly the same then actually it becomes zero. So, when these two distributions are same and it becomes zero and when the two distributions are completely different then it becomes one. So, it is a measure for distance between these two distributions. A different one. I'll explain it later. Okay. That's a very good question. There is actually the relation between this one and Kohl-Benn-Liver divergence. Okay. So, for simplicity I will use the notation Kohl-Benn-L to denote this total variation distance. So, we can simply write the speed limit in this way. Simple way. Okay. So, this inequality, speed limit was first derived. And this is a first, I mean proposed form in 2018 and of course it was derived in 2020. But here in this lecture I will introduce you some general form of speed limit. What I mean by general is that from this relation we can derive this, the first proposed form. So, if we know how to derive this then we can automatically derive this result. Okay. So, to derive this general form we have to start from this key relation. So, this key relation, key inequality means that there exists some convex function h, convex function h which satisfies this inequality. So, I will show you how to derive this key relation later but at this point please accept this inequality first and then by dividing the same factor here for both side of equation divided by same factor and then here we define function g of x, h of x divided by 2x. Then let's look at this left term. Then you see that actually this is a form of g of x function. This is argument x. So, by changing this as a g of x and then taking the inverse function of g then we can have this inequality. Finally, then from this relation now we change this relation to this one. So, we can derive this general form. So, now we know how to derive from this key relation to this general form. So, the remaining task we have to do is that we have to know how to derive this key relation. Okay. So, no question up to this point. Okay. G must have some... Sorry, g function. Yeah, right, right, right, right. You're right. It should be some kind of monotonic function in some specific, I mean for interested range. Okay. So, this is a definition of total variation distance. So, distance between two distribution. And this is the same for this integration, right. And then from the triangle inequality this term is a lot smaller than this one. And from this master equation here we plug this term into this one. Then the result is like this. Oh, sorry. This is typo. This should be diluted. And then this one it should be smaller than this one from the triangle inequality. Okay. So, up to this point it's very easy. And so the total variation distance is smaller than this equation. Now, I will define some function q and q star in this way. So, q and m is related to this first term and q star is related to this second term and divided by a dot. A dot is a dynamical activity rate. So, this is a dynamical activity rate. But you see that actually this is a kind of a normalization constant. So, it means that this q and q star variables are actually the we can regard q and q star as a probability because this is a normalized quantity. So, by using this definition we can rewrite this equation in this way. And then this is actually the definition of a total variation distance. So, total variation distance of q and q star is actually this one. So, by using this relation we can rewrite this term by using the total variation distance in this way. Okay. Now, I will use some important property of the statistical distance and their relations. So, this is a total variation distance. I explained. So, it is in between 0 and 1. When the two distributions are exactly the same it becomes 0 and completely different it becomes 1. And there is a, and this is a Coolbank library divergence as you asked. So, this is the definition of a Coolbank library divergence. When you see that when two distributions are exactly the same it becomes 0. So, it is similar to this total variation distance. However, actually it does not have upper bound. Actually it can be infinity. It can diverge. So, there is some relation between the total variation distance and the Coolbank library divergence in this way. So, there exists some convex function h which satisfies this inequality. It means that the h of total variation distance is smaller than Coolbank library divergence. So, this is an important relation between these two, I mean distance and divergence. So, I will show you, I will show you explicit form of this convex function h later but here let's accept this inequality. This is a well known inequality in information science. So, by using this inequality and taking the inverse function of h then we can show that this total variation distance is smaller than this quantity. And here because this is a convex, h is a convex function then the inverse is a concave function. Now, with this definition of q and q star now we can calculate this Coolbank library divergence q and q star. So, we can be written in this way and now you probably you are familiar with now this expression. This expression is about the entropy production rate and divide by this tot, I mean dynamical activity rate. So, by using this equation we can write in this way and now here let's divide by a and multiply by a the same thing and then because now this becomes some normalized quantity I mean so we can regard it as a probability because it can be normalized. So, it is like a average value of this h inverse function and as I explained that and this is h is a convex function and h inverse is a concave function. So, it is inverse of a Jensen's inequality. So, because this is a concave function this is the average of this whole function and this is the average of this argument and h inverse function. So, this is larger than this one. So, this is a kind of inverse of Jensen's inequality we learned in the first day.  So, we have this conclusion. So, is there any question for this derivation? Yes, right. Dynamical activity at times 0 is 0. This one or this one? In the denominator shouldn't it be a tau minus a 0 in the denominator? This is positive number, yeah positive number. I mean this one? No, the first very first one. This one? So, dynamical activity this one? Yeah. So, in the next line a dot by a tau is there right? A dot by a of tau. This one? Yeah, this one. Yes? You said this is probability like. Yeah, probably because if we integrate out this one then it becomes a tau.  Okay. Yeah, a 0 is a 0. Yeah, right. Because the definition of a t is that total number of jumps during the process from times 0 to tau actually so when t tau goes to 0 actually the total number of jump is 0 so that's why a 0 is 0. Okay. Any other question? Okay, if you know. Okay, so I showed that the total variation distance is smaller than this number. So, by moving this term to the left hand side and by taking the inverse function of this then finally we have this key relation. So, this is a way to derive this key relation and there is one important property of this Colben-Liver divergence here. So, this is a Colben-Liver divergence. So, Q and Q star. But, you see that this indices N and M are actually dummy variable dummy indices. So, we can exchange them. So, this is the exchange indices. But, this is actually the Colben-Liver divergence of Q star and Q. So, you see that in our case the Q, Q star and Q star Q are same gives the same divergence. So, in our case Colben-Liver divergence is symmetric. But, this is in general they are not symmetric. Colben-Liver divergence is not symmetric in general but in our case by using this Q and Q star we can show that Colben-Liver divergence is symmetric. So, I mean this is I mean I will use this property in the next derivation. So, please remember this property in our case. Okay. So, because now we know how to derive this key relation so, we finally derive this general form. Okay. Now, let me show you then the explicit form of this convex function H. Okay. So, this is a relation between the total variation distance and Colben-Liver divergence. And, one simple example of H function is a Pinscher function which is given by 2 x square. So, very simple function satisfy this inequality. But, I mean the I mean I will not show how to derive it but you can you can see the derivation in the information science book text book. But anyway so, we are now considering two kind of distance. This is a distance but it is not distance but anyway the it is in between 0 and 1 and it is larger than 0. So, let us consider two simple distributions. So, first P distribution is 0 1 and Q distribution is 1 0. So, we can calculate the total variation distance by using this two distributions. This is a calculation. So, you can check that the total variation distance is equal to 0. So, it means that two distributions are completely different. And, of course we can calculate the Colben-Liver divergence here. So, due to this term actually it diverges. So, by putting this number to this inequality by using this Pinscher function we can easily check that this inequality holds. So, this inequality holds but very loosely holds. What I mean by loose is that the number here is 2 and but here the number is infinity. So, 2 is smaller than infinity is very very loosely I mean the bounded by this bound is very loose. This is what I mean by loose. So, when the total d is close to 1 this Pinscher function gives a very loose bound as we saw in this example. So, the meaning of d is close to 1 is that as we saw in this example two distributions are I mean completely different right. And, the meaning of this d is close to 0 is that two distributions are very much same very much same. So, when the two distributions are very much same then Colben-Liver divergence also is close to 0. So, when d is close to 0 then Colben-Liver divergence also close to 0 then when we put this two number to this inequality in such a case now it becomes much tighter because now it becomes a 0 it's smaller than close to 0. So, it means that Pinscher is very loose near d equal to 1 but it becomes tight when d is close to 0. What does it mean? So, we are now considering this Colben-Liver divergence with q and q star and the definition of q and q star is given in this way. So, the meaning that two distributions are very much the same which means that this is a forward direction rate and this is a backward direction rate. So, the meaning that d is close to 0 and then two rates are equal I mean they are almost equal which means that the process is nearly reversible and the meaning that d is close to 1 and then these two rates are very much different which means that the process is highly irreversible. So, it means that the Pinscher function gives a very loose bound for highly irreversible process but it gives a tight bound for only for nearly reversible process. So, this is the meaning of this bound Pinscher bound. So, do you understand my point? So, to enhance this looseness near d is close to 1 then we can use other functions. So, for example, this is a Bretton-Hubert function and this is a Kilar-Doni function proposed by Kilar-Doni. So, let me show you these three functions. So, this x axis is the total variation distance d and y axis is this h function and this blue curve denotes a Pinscher function and this g and a bh function denotes this bh function and this is a g function. So, as you can see from this plot at d equal to 1 here so p function is finite however this g and bh function diverges and as we know from this example when d equal to 1 the cool back library divergence diverges so these two functions actually provides much tighter bound than the Pinscher bound near d equal 1. But if the cool back library divergence is symmetric in this special case then we can use more tighter bound. So, this is a plot of this tightest bound so actually this is tight everywhere compared to other functions and as I mentioned that in our case the cool back library divergence is symmetric, right? So, that's why the reason we can use this tightest bound in our four-hour speed. Which is more tighter? Precisely saying actually I will show you the example then this is a tightest when the system has two states we cannot find tighter than this bound when the system state has just only two states but I'm not sure whether for example a three state and a four state model which one is tightest. Information science are concerned this one almost I mean they are almost a mathematician. So, this is a general form of speed limit and this is a definition of G. So, for example if we use this Pinscher function to x square and then we can easily calculate this one and this G if we use this function then it is simply x Gx equal to x so identity function. So, we can easily found that this speed limit and this is actually the first proposed form I introduced you in the first page. So, this is actually the previous result which means that this result is tight for only for nearly reversible process but it becomes very loose it gives a very loose bound for highly reversible process. However, if we use this tightest bound then I will call this bound as a symmetric KL debound then this is I mean the speed limit form then this is actually the tight for all processes and this is actually gives a tightest bound. I'll show you one example why I call this tightest. Okay, so I explained the how to derive the general form of speed limit but here then I will show you how to derive this tightest symmetric KL debound. Okay, so what I want to do is that when the Colbert library divergence is symmetric then I want to show that this gives the bound between the Colbert library divergence and total variation distance in this form. Okay, so this is a total variation distance definition and square. Now, I multiply by this term and divide by this term, so same thing. And here I use Cauchy-Schwarz inequality. So this is square and this is square and their product. And because this summation gives one and this summation gives number one so actually this summation gives number two. So that's why it becomes this one and this quantity is defined as a look-am distance. So it means that total variation distance is smaller than look-am distance. And this is a re-expression of this look-am distance. So we can divide this term into two parts, this one and this one. And then here we divide by this quantity and multiply by this quantity. So this is a re-expression of this look-am distance. And because you see that, I mean the total variation distance is defined in this way. So this term is actually normalized quantity. If we sum over this, then it becomes one. So we can regard this term as some kind of a probability. So let's denote this term as p tilde n. And we can also immediately show that the tangent type of this function gives this value. You can check it by yourself. Then this is kind of, because this is a probability, so this is kind of an average of this tangent type of function, right? And then for positive side, tangent type of probability function is a concave function, right? So we can use the inverse of Johnson's inequality. So this is the average of a tangent type of probability function and this is the argument average and tangent type of probability function. So this is larger than this quantity. And then by using the definition of p tilde, we can now write in this way. And this one, so this first part, first term is this part and the second term gives this part. So by defining this one as a symmetrized Kodak library divergence, so we can write in this way. This is actually different, in general this is different from these quantities. And so by using this definition, then we can write in this way. So because now this term is smaller than this term, so finally we have this inequality. And then by taking the inverse function of tangent type of probability, then we can show this relation. And we know that tangent type of probability can be written in this way by using the logarithmic function. So you see that this function is actually the same as this one. And if the Kodak library divergence is symmetric, then in this case ds is equal to d. So in this case ds is equal to d. So in such a case, we can change ds is equal to d. So finally we derive this inequality. In such a way we can show this bound. So is there any question about this derivation? Is it clear? Okay. So up to now I talked about how to derive a general form of speed limit. And then now from now on, I'm going to talk about how to apply this speed limit to the finite time random bound problem. So what is random bound? So it tells us that for erasing one bit of information, then at least KBT log 2 heat should be dissipated. So it can be formulated in this way. Heat should be larger than KBT log 2. Then this minimum value. So this minimum bound is attained only in the quasi-static limit. I mean the quasi-static erasing process. In such a case we can have this minimum bound. We can approach this minimum bound. So for finite time process, because a quasi-static limit takes infinite time. So for finite time process we can easily expect that some additional cost is necessary. So from this series of studies they found that this additional cost is proportional to one of our tau. Here tau is erasing time. So when tau goes to infinity which is a quasi-static limit then we can have this minimum bound. But if tau is very small then this additional cost diverges. So this is a problem of a finite time lander's bound. Then what is the erasing process? So let's suppose that there is one single memory, one bit memory. So it can have two states, one state and zero states. So in this example the system is in the zero state. So we read this memory is in zero state. So if there are many memories initially then this is a 1, 1, 0, 1, 0, something like that. So let's say that initially the probability for observing the memory is in zero state is half and the probability for observing the memory is in the state of one state then it is also half. So initially the zero and one probability is given half and half. And then the erasing process means that it is nothing but reset to zero process. So after the erasing process the final state will be like this. They are all reset to zero. So it means that probability of observing zero state is probability equal to one and probability of observe the one state is zero. So this is a meaning of the erasing process. So erasing process is nothing but the distribution change from the initial distribution to the final distribution. Half-half distribution to the 1, 1, 0 distribution. So for this distribution change we can easily calculate the total variation distance which is simply given by one-half. And we can also easily calculate the Shannon entropy change. This is the result, I mean calculation result. So the answer is minus log 2. So now we can use our speed limit. So this is a general form of speed limit and if we rearrange these terms and then we can show that the entropy production is larger than this value. And here v is defined as L divided by the total activity. And we know that entropy production can be divided into two parts. So this is a system entropy change and this is a reservoir entropy change. So we know that what is a system entropy change. So this is a Shannon entropy change and this is a system entropy change. And then this is a heat queue. So by plugging this equation into this inequality and arrange the terms then we have this inequality. So it means that dissipation heat is larger than KBT log 2 plus something else. So from this inequality we can easily identify that this term is additional cost for finite process of erasing erasure. So I mean this is the importance of G function. I define the what is G function. G function is Hx divided by 2x. So this is the meaning of G function. Actually it gives the additional cost. So for example if we choose the Pinsk function H equal to 2x squared then actually in that case it is a simply identity function so it becomes just this number. And as you see from this factor so it is proportional to the additional cost is proportional to 1 over tau. So this is a previously observed behavior. But if we use this symmetric K on the bound then we can calculate this additional cost. It becomes this quantity. It is different from this one. And here we define it this way. But it will give a tightest bound. So let me give you an example. So this is a discrete 1-bit model and this is a coarse-grained bit model with a continuous state space. So the discrete 1-bit model is actually it has a two state, zero state and one state. So let's suppose that initially the state is in the one state here. So by raising the energy state of the one state then we can move this system to the zero state here and then lower the energy level again. So this is a process of erasing process. So this is a discrete 1-bit model. But we can also play with a long-term system with a coarse-graining. So let's say that this is a long-term system and this is some kind of some symmetric potential. So we can coarse-grained in this way. If the particle, Brownian particle is inside in this area then we can read this system is in one state and if the particle is located in this area we can read this system is in zero state. In such a way we can do a coarse-graining to the system and then use this continuous system as some bit model. So that's why I call this one coarse-grained bit model. So in this kind of model let's say that let's suppose that initially the particle is in this one area and by applying some asymmetric potential then we can move the particle from one state to the zero state. So in such a way we can erase the memory. So this is a result. So this is a calculation result of this discrete 1-bit model by using some protocol, by using this protocol. So y-axis is entropy production and x-axis is inverse of v and v is defined in this way. And the reason why I plot x-axis by using this inverse of v is that actually inverse of v is proportional to time tau. I mean in large in this limit you can think the inverse of v is like time. So this is plot of these two bounds. So this orange one is pin square bound and this blue dashed one is a symmetric KLD bound. And as you see from this plot at v equal to 1 here at this limit the symmetric KLD bound diverges but the pin square bound is finite at this point. So let me magnify this area. Okay so this is a magnified view. As you see from this plot the pin square bound actually the v equal to 1 this area is highly irreversible area and this is a nearly reversible area. So in this highly irreversible process area then pin square bound gives a very loose bound because it is a finite but data and symmetric KLD bound diverges.  I mean it touches the data and other three lines is about the other H function so Gilardoni and BH and Vajada functions so you see that always they are looser than this symmetric KLD bound. And we can also find the condition for optimal protocol which means that the protocol which gives the result that touches this tightest bound so this red dot actually is calculated from this optimal protocol so it means that actually this is a really tightest bound and this green dot green dot is a simulation result from this coarse-graining bit model by using in the overdamped long-term system by using this symmetric potential and I mean I derived this this speed limit from the discrete state system I mean I derived this speed limit from the master equation Markov-Jumbo process but our speed limit also can be applicable to this coarse-grained bit model with a continuous space so this data I mean this simulation data is really above this our bound so I mean it clearly shows that this bound is clearly applicable to this continuous space but anyway coarse-grained bit system but you see that there is a gap here a large gap here so this gap actually comes from the process of coarse-graining so to reduce this gap actually we have to use a different distance measure such as a basestine distance something like that okay so this is the final page so in this final lecture I talked about the speed limit so this is kind of a trade-off between time and thermodynamic cost and so I talked about how to derive this speed limit general form of speed limit so from this speed limit we can derive the previously known speed limit form and by using this speed limit we can apply this speed limit to the problem of finite time land that was bound and it gives a really tight test bound so this is all about my final lecture okay so that's all okay questions common compared to this quantity so yeah I mean if this is I mean it can diverge so I mean if the time is very large then this portion will be very small but so in the highly irreversible limit which means that the process is very fast in such a limit then actually it diverges it can diverge I mean it can be very large compared to this one so I mean it means that for our daily lives our computing erasing computing is very fast right so it means that in such a case I mean it should be very much larger than this KBT log 2 okay so your question is about probably this one so you mean yeah here so you mean that I calculated by using this constant value yes right so actually it depends on I mean there is no perfect erase I mean there may be some small error right so error will depends on time and protocol and something like that so we can actually write in this way so when there is error then we can write 1 minus epsilon and here epsilon in such a case we can also calculate it and it will be 1 half plus something epsilon dependent term here and also there's a Shannon entrepreneur this also depends on epsilon but even though it has an error so I mean I mean the speed limit is generally applicable to any the probability distribution changes so it gives the same bound it gives this same same bound actually so this data I mean this data point actually calculated from this discrete one bin model so when we calculate this one bin model of course there is a finite this each point has a finite some error epsilon here so all data points are above this the symmetric k on the bound so it holds for I mean any any case even with it has an error so I mean this data point is calculated when the erasing process time is relatively long and in this case the data points are calculated when the erasing process time is relatively short so it actually contains I mean any almost any possibility so the discrete time Markov chain what do you mean I I drive this one yeah I drive this from the Markov process yeah Markov chain yes I mean if we can define distribution then we can I mean this is a general for any I mean we even so if we can define a distribution at certain time then we can apply this theories to any I mean any system yes yes I think so yeah so I don't understand your point so discrete time discrete time I got the point yes discrete time yes I got the point I I have a question in the course screen to beat model yes you show that there is the bound is not tight yes and is there any other good way to is there any other good course screening method to get tight bound so in this game okay so in this game actually I mean if we use the relation we have derived then I think it is actually this is a we cannot avoid I mean this gap because I mean this term comes from we neglect some intra-entropy production so the meaning of this intra-entropy production is that entropy production which is produced inside in one course grained one course grained state so because we cannot avoid this and intra-entropy production so actually if there is a course graining then there should be some gap here then if you make more state then the gap will probably I think so thank you a simple question regarding the erasing process example so as I see the picture there is always the step where the energy barrier is resetted to the initial configuration here so is that necessary procedure no not necessary but so but I mean this is not necessary because I mean okay but I think the whole process for erasing if we started from this state this energy level state and I think it is natural to think to return back to the original state I think it's a natural way to think the erasing process so the reason why I wonder is that so in my point of view this becomes erasing process because so for the initial process so both sides have the same probability to have the particle and that information erases because after that energy barrier there is only one side where the particle resides so as I see it at the last step that kind of two possible states reborn again so my question is can we really call that erasing process erasing process is defined in this way so it is some losing the information of the I mean the previous state that's the erasing process so regardless of the initial state so if the final I mean from the final state if we cannot guess I mean the previous state then actually we can say that the information is erased so so regardless of the initial state actually the final state is in the zero state so we can say that this is an erasing process