Cool, hi everyone. My name is Jack and today I'm going to be talking about advanced permissioning in Django. It's the first time I've been using Google Notes, so let me see how this, actually don't even know how this works. Did that work? Bingo. Cool. So, the reason why I'm giving this talk is because I was recently part of a project and in that project I, along with a friend, had to implement a pretty complicated permissioning system that involved object level permissionings, it involved, it was a REST framework project that was using React on the front end, but all the permissioning was done on the back end and I didn't know how to do any of this. I faffed around on it for a while, I screwed it up a couple of times before I got it right. Luckily I learned a lot in the process and it turned into this talk which is really a lot of lessons learned from building a pretty complicated permissioning framework or permissioning system in Django. Django projects are pretty simple in terms of permissioning. You have more or less three types of users. You have anonymous users or logged out users. You have logged in users who have some level of permissioning, some increased access to logged out users and then you have super users who can do everything. And it's just those three, it's pretty straightforward. You don't have any object permissions and you don't have any grouping of users. You just have three user tiers and the way that you would normally approach that is you would just have it on the model itself. You have a super user flag that Django gives you for free, logged in and logged out, Django gives you for free and that's pretty easy. What I was building had more tiers of users than that. Logged out users could do very little, a certain class of users were not super users but were admins and they could edit content for a group of users on the site but not for everyone on the site. They can edit some content but not everyone's content and they can also manage the users that had access to that content. They could create new users and assign them to that content so they had super user type permissions for certain objects but no permissions at all for other objects. And then finally, regular users could view content but only content that was available to the groups that they were a part of. So yeah, that's where I learned doing all of this. It talks about building a permission management system in Django project but hopefully the concepts will be abstract enough that it will help for other projects. The permissioning in Django is based on permissioning in Linux and I think that the kind of rules and principles that I'm going to go through will be useful if you're building in Django, it will be useful if you're building in Flask, it will be useful if you're implementing permissioning in a lot of different user facing projects. And also for what it's worth if you want to butt in with like a question or anything, feel free. I think it's like a small enough group that's cool so just get my attention. I don't consider myself to be any kind of like super expert on this stuff. I just spent a heck of a lot of time working on it last year and also a heck of a lot of, I lost a heck of a lot of sleep thinking about it because it really for a while until I started figuring it out as kind of a nightmare. So yeah, who is this talk for? It's really for three groups, for developers who are considering adding more fine grained permissioning to an existing Django project that right now only has simple permissioning. For developers who already use complicated permissioning or object level permissioning but have run into problems managing that permission state, which is kind of common if you use something like Django Guardian to do object level permissioning. And it's also for people who just want to better understand how permissions in Django work, both out of the box and also using add-on packages. So I guess before we dive in, it's good to define what permissions are. Does anyone have a good definition for permissions or? In Django, permissions can apply to individual users or they can apply to groups of users. And the fact that you have a choice as to where you want to put permissions, whether you want to assign them at an individual user level or at a group level is super useful. It can also be a source of a lot of difficulty and creating a lot of complicated state that you have to mentally manage if you don't do it right. So we'll be digging into that in a bit. It's all about access who can see what on a site and permissions are all about control, who can do what. And the way that Django defines permissions in the docs is really the definition that I like best. They say that permissions are binary flags designating whether or not a user can perform a certain task. So that covers both things that we're concerned about. It covers who can do what and who can see what. Because who can see what is just a task like any other task. The two important parts or at least the two parts that stuck out to me in this definition of permissions is the word binary, which seems obvious if you've done a lot of work with permissions before. But I don't think that a lot of, I know I at the beginning didn't think about permissioning in a binary way, but it helps to. You either can do something or you can't do something and there's no middle state between the two that simplifies a lot. And then the other one is the phrase to perform a certain task. Performing a certain task, this stuck out to me because it is really the mental map that you create for permissioning. It's not just about control and not just about access. Permissions are assigned and evaluated on a per task basis, as opposed to on a per page basis or anything like that. So yeah, one other important thing that this definition sets up is an implicit separation between the permissions and the tasks. And if you're building a complicated permissions management system, one of the most important things that I found is preserving this separation. Django doesn't force you to, Rest Framework doesn't force you to, Guardian doesn't force you to, but it's really, really important to. So my first tip is permissions, they're related to tasks, but they should be kept totally separate from tasks. By keeping them separate, it makes it a lot easier to avoid unexpected outcomes, to extend your permissions management system later and maybe most importantly to write tests around your permissions management system. If your permissions are controlling anything that really is important, that certain people do have access to or don't have access to, having a good test framework around that is equally important. And it's hard to do if you don't separate the permissions from the tasks. So yeah, this separation, it's also true for users and groups. It's kind of similar to the separation between logic and views, where you want to keep your logic out of your views when you can. But that's one that everyone knows and kind of follows. This is one that's a little bit less common to follow, at least in the projects that I've worked on and looked at. So we talked about what permissions are, what's permissioning? It's a system for managing permissions. That's like probably the most obvious of anything that I'm going to stay today. But it's also an important distinction where if permissions are your state, permissioning is your state flow. It's your system for managing the state. If you have a project that's relatively simple and has simple permissioning requirements, managing that state is easy. You can do it in your head. If your project is more complicated, it requires a more complicated system to manage that state. I write a lot of JavaScript as well as Python. It's almost like moving from jQuery to React, where it's hard at the beginning. But once you understand both systems, you realize that even though React is more complicated, it's also a hell of a lot better for managing complicated state. Permissions are kind of like that. If you only have a simple requirements for permissions, you really don't have to worry about it too much, because there's not much state to manage. But once there is a lot of state to manage, it gets important that you're thoughtful about how you build these things. So let's talk about Django permissions and what you get out of the box. Permissions in Django, this is all pretty straightforward. It's tied to and actually a part of the Django authentication system. It makes sense. Your permissions are based on the user. So to have it tied to the authentication system, the user auth system makes a ton of sense. It includes the concept of groups. So permissions in Django, they can be tied to an individual user. They can also be tied to a group of users. So if you have a site that has like a paid members section, rather than assigning the privileges to the people in that section, you can put them all in a group called paid members and assign the permissions to that group and everyone inside the group will have it. If you've worked with Django, you know this, it's pretty straightforward. It's also super useful, because if you want to change permissions for your paid members, you can do it once for the whole group rather than having to run every user through that individually. In a minute, I'll show you why it's also something that you have to be super careful with, because it's not always straightforward what's gonna happen when you manage permissions on users and also permissions on groups. Third thing, it allows permissions to be associated with models and so it's tied to the model system in Django. It doesn't have to be, but it usually is. And you get for free with Django three different types of permissions for each of your models. Yeah? The what's that? Yeah, that's actually one of the things that I'm gonna get at in a minute, because I scratched my head on this for like literally three days before I figured out how to do it. But no, that's 100% true. The three that you get for free are add, change, and delete. It makes implicit that if you are logged in, you can read everything on the site or you don't have access to the model at all. So in this particular setup, read permissions are implicit, but in most complex permissioning systems, especially if you have certain parts of content that you want some people, but not everyone to read, you wanna make it explicit. And towards the end of this, I'll show you how to do that. Yeah. So just to kind of map out what it looks like in a typical project, logged out users, let's say, can do nothing. Super users can do whatever they want. They have add, change, and delete permissions. This is just like a little kind of throwaway project that I'm gonna be using as a sample for some of the code that I'm gonna show today. But you've got a site with users and articles, and users can publish articles, super straightforward. And regular users on the site, when they're logged in, they can add articles, but they can't do anything else. They can't change articles, they can't delete articles. So since the permissions that we're using for this setup come free with Django, our models file is gonna look like just any other models file. You don't have to do anything abnormal to it. And here is just a simple function-based view for editing an article. That's the one that we're looking at right now. Super users are the only users who can edit existing articles. So we check if the user is a super user. If they're not, we raise a 404, and if they are, then we execute the rest of that view logic so that they can edit the article. Does anyone see any problems with this? Yep, that's exactly right. The good news is this will 100% work, and if you are only implementing, if you only have simple permissioning requirements on your site, no big deal, this is just fine. But you just broke rule number one. Permissions, while related to tasks, should be kept separate from tasks. We don't wanna check if the user is or isn't a super user. We want to check if the user has or doesn't have the specific permission that they would need to interact with the view. In this particular case, it's a distinction without a difference, but you could imagine wanting to add a third class, maybe editors to the site, where it all of a sudden wouldn't be a distinction without a difference where you would want to be able to test for that permission explicitly. So, it's pretty easy to keep the permission separate from the tasks here, rather than having the view check whether or not the user is a super user. Instead, you check whether or not the user has permission to change articles. Pretty straightforward. If you look, I'm just gonna go to the Django source code for a minute, and if you look at the source code for the has perm call that we just used here on this last slide, the first thing that it does is it checks if the active user is or isn't a super user, and if the active user is a super user, it's always going to return true. It almost is like it don't check any other permissions. This person's a super user. They can do whatever they want. They have run of the place. And you'll also notice that the has perm function takes an optional object argument. We'll get to that in a minute. It's important when you implement object level permissioning later. Django gives you the foundation for that, even though it doesn't give you any implementation for it. But it hints at how easy it is to implement object level permissioning into an existing project that you have. So yeah, and then this is just the last slide that we're on. This is what we were just looking at a moment ago, the right way to check if a user has the ability to change articles. So let's get a little bit more complex and add that third class of users, the editors. And we want, actually before we add the editors, let's say we want to just change things up and we want users to be able to change the articles that they wrote, but nothing else. So the only thing that's different here, super users can still do everything, run of the mill users can still only add articles, but they can now also edit the articles that they've added. No problem. Let's take the earlier view that checks if the user has the appropriate model permission, but we also run a check to see if the user created the article instance and we let that user do the edit if they did. Let that sit for just a sec. There's one problem here. It breaks rule one. It doesn't separate the permissions logic from the task logic. So if we wanted to do it in a way that doesn't break rule one, we'll add a new file, permissions.py, we'll call it, and we'll define a function in here. You could do this as class based or function based. It's probably, for what it's worth, better to do it class based, but it's a little bit easier, clearer to explain if you do it function based. And yeah, we define the function has perm or is author and it does exactly what you expect it to. It takes a user object, it takes the permission string and optionally an instance and it returns true or false depending on whether or not the user has the permission to change that instance. And yeah, we implement it in the views and we are now good. A couple of quick notes. This pattern of separating out permissions into a separate file, it's kind of a little bit barred from Django REST framework. It's how they do permissions. They do a really pretty good job of separating concerns between permissions and tasks or between permissions and views in the case of Django REST framework. Does anyone here use DRF, by the way? Cool. Like I mentioned a couple of minutes ago, one big difference is that in Django REST framework, the permissions are always defined as classes, which like I said is probably a better way to do it. It's just a little bit less clear to explain it that way. But if you're familiar with doing class based views and using object oriented programming in Python, you would maybe want to go that way. So all the code that we've looked at so far has been around checking permissions, which is important. But you also wanna build a system to manage the assignment of those permissions and the revocation of those permissions. That's part of a permissioning system. So we're gonna take a look at how you would do that by creating a third type of user, the editor. And editors have the ability to do whatever they want to articles, but they can't do anything at all to any other object instance type. And by doing what we already did by separating out the permissions check, we're already most of the way to implementing this. There are two ways to assign and, oh, this is getting back to the users and the group thing. There are two ways to assign and revoke permissions on a user. The first way is the most straightforward of the two. You operate directly on the user object. So here I did it in a file called utils.py. You can do whatever you want. You typically are gonna wanna have two opposite functions, one to assign the permissions and one to revoke the permissions. So you don't get into a weird state where people have permissions that you don't want them to and it's difficult to take them away. You can also make this a single function that takes a Boolean and just a directional Boolean. Granting permissions to users who already have them or removing permissions from users who don't. Doing it, it's item potents are doing it multiple times. It's not going to do behave in a way that you don't expect it to, there's no problem there. Here's a tip, it's worth taking the time to create a screen that shows which users have what permissions. I don't use the Django admin, so I don't know if this comes for free in the Django admin or not, but if it doesn't or if you're not using the Django admin, I spent a lot of time in weird states not quite knowing who had permission to what. It is definitely worth taking the couple hours it takes to be able to see that on a screen who has permissions to what, it makes it a lot easier. And any time you want, and then one thing that I didn't do in this utility file is I didn't put a check that the person who is granting editor status has permission to do that. That's also if you're doing like a complicated permissioning system, you would probably want to make sure that it takes the user object of who's doing it and making sure that they can do it as well. Simple, simple. And yeah, the revoke function is just the opposite. It takes the perms away instead of giving them. The other way to assign permissions is through the Django's groups model. And with this approach, you assign the permissions to a group and then you add the user to that group. Rather than having permissions explicitly, the user doesn't have any permissions explicitly. The user has the permissions implicitly by virtue of the fact that they're a member of a group that has those permissions. I got into a weird state with thinking about groups because in the project that I was working on, you would have groups of users who could edit the user object of other users. So the way that I kind of came to thinking about groups, and it might be obvious if you've, it might be obvious to everyone but me, but it wasn't at the time, is that groups are a group of users and a group has a set of permissions. That set of permissions might be permissions to perform actions on a totally different set of user objects, but it's a group of users that have a set of permissions. I don't know if I did a great job explaining that, but I feel like it's important. Rule two in terms of designing like a permissioning system that has what Django gives you with users and groups is you can assign permissions to users or you can assign permissions to groups, but you probably shouldn't do both. There is nothing in Django that will keep you from doing both. It's just probably a good idea to make the assertion that you're only going to do one or the other because the danger of not doing it that way is you have users that have certain permissions and you know that they have certain permissions and you revoke those permissions and expect them to no longer have access to a certain set of assets, but they still do because they're part of a group that has those permissions and it works the opposite way too where you might remove them from the group that has those permissions, but if they have them explicitly on the user object, they might still have them and it's really a lot easier to manage that state like not as a system, but as a human if you decide to do it one way or the other. Assigning permissions at the group level has some advantages. First of all, the advantages to assigning permissions at the user level is that it's easier and it's more explicit if you only do it that way and someone has a permission, by removing that permission you will always remove that permission 100% of the time. At the group level, if they're part of two groups and there's permission overlap between those two groups, you can remove them from one group and they might still have a permission that you don't want them to have because they're part of another group. So doing it at the user level is more explicit and arguably safer for that reason. Doing it at the group level, the advantages there is you can create groups of users where those permissions overlap. It gets more important when you have overlapping permissions and you have users, different cohorts of users that might have some of the same permissions and you don't want to accidentally revoke some of the permissions that they have. And yeah, the other advantage to operating on groups as opposed to users is it's easier to change what permissions an entire cohort of users have. So if you have a group of users called admins and then you create a new model and you want them to have access to that model, if they're all part of a group, it's really easy. You just give that group access to that model. If they're not all part of a group, you have to figure out who should have access to that model and make sure that each individual does. So it's harder, especially when you don't have a stable project and you're constantly adding stuff to it. And like I said, keep in mind there's no limitation to using both.  So yeah, when you assign permissions directly to users, a simple map of that looks like this. I just created going on our project, we have user one who's the editor in chief and user two who's the editor. And the editor in chief has permissions to permission one and permission two. And the editor has permission two. Pretty easy. We'll have four total functions to manage these permissions. Two, to grant and revoke permissions to an editor in chief. And two, to grant and revoke permissions to normal editors. If we want to add user three, an additional editor, fairly straightforward, just run the function to grant editor perms and we're done. It gets a little trickier going to the example out of set of why it's easier to use groups in some cases. This gets a little bit tricky when you want to add new permission for editors. If we want to add this permission three to editors, we need to change the function that grants it to editors, but we also need to make sure that the two people that currently have those editor permissions run through that function again so that they have it. In this simple example, it's not that big of a deal because you can manage all of this state in your head pretty easily, but in more complicated systems, it can get out of control pretty quick. If you imagine that there were a lot more users, too many to fit on the screen, and there was an additional type of user, like a writer, for example. And writers had permission overlap with editors where writers had permission three, but not permission two. Then there's no way to know if someone's both an editor and a writer, or if that person is only an editor. So if you want to take an editor and turn them, I'm sorry, if you wanted to take a, yeah, exactly. If you wanted to take editor privileges away from someone, if they're also a writer, you would be taking the writer privileges away from that person too. And that's where groups can make things easier. So a group map looks like this. You've got group one, editors in chief, group two, editors. You want to add a new editor, you add them to the group. You want to add a new permission to editors. That's easy too, you just add a new permission to the editors group. And when you want to add that group of writers that only has permission three, that becomes easy as well. And you have no problem with someone who's both in group two and group three. If you take group two away from them, they'll still have permission three because they're still part of group three. So again, there's no right or wrong way to go whether you want to do it directly on the user or whether you want to do it on the group. I personally like doing it on the group in most projects. But if you have very fine grained permissions where you have, let's say, 100 users and of those 100 users, there are like 80 different sets of permissions. Having a separate group for each of those sets of permissions probably doesn't make much sense. If you've got 100 users and there are five or six sets of permissions, having those in groups probably does make a lot of sense. The one big thing that Django permissions doesn't do out of the box is it doesn't let permissions be associated with individual model instances. Why would you want this functionality? If you want certain users, I mean, you spoke to it earlier, if you want certain users to be able to see a set of articles but not all articles, you can't do that out of the box with Django. But while Django doesn't support object permissions out of the box, it does provide the foundation for it. So I didn't copy it, so I have to. It's a little bit small to read. But in the Django docs, it lays out the foundation. Django has a permission framework that's a foundation for object permissions, though there's not any implementation for it at the core, means that checking for object permissions will always return false but that the function is there. An authentication backend will receive the word blah, blah, blah. So yeah, the foundation is there. And out of all of the tools that extend vanilla Django to implement object permissioning, Django Guardian is the one with the most active community and probably the most well-maintained. It's, yeah. It makes use of an additional authentication backend in Django and it's a really good project. The documentation is a little bit sparse in areas, but I love using it. So using our examples from before, let's add object permission to it. So we'll take an example where you have your site of users and articles and you want to add a paywall to it so that some users can, some articles are behind the paywall and other articles aren't. Now, obviously there's a trivial way to implement this that doesn't require object level permissioning where you have users that are either paid users or unpaid users, but we're going to do it with object level permissioning because that's what we're here for. First, we've got to add a new permission to the model and this gets to the view level permission that we added at the bottom of the models file right here. Django out of the box gives you the change permission, the add permission, and the delete permission. It doesn't give you the view permission, but that's what we want. So we add it as a permissions tuple at the bottom of, in the meta of our model. And we'll also create an article view view and in that article view we check, we don't have to change anything, we just check if the user has the perm or not, we cast the instance with it. This is how you assign and revoke object level permissioning to a user. It's a shortcut that Guardian gives you to pull the sign perms where you pass the permission, the user object, and the instance. It works for group objects as well where you pass the permission, the group object, and the instance, and we are then done. We can still use the same has perm call that Django gives us to check whether or not a user has object level perms. We just have to pass the object along with it. So now we know how Django permissions work out of the box, how to extend them using object level permissioning and the two key rules for keeping your permissioning system sane, to keep permissions separate from tasks and to either use permissions directly on users or indirectly on groups, but not both. So we'll take a look at some code using Django REST framework and see how this all fits in. I'm going to start with a class-based view for articles. I'm not going to explain too much how views in Django REST framework work, but basically you just define an object, a query set. You define a serializer, and you define permission classes, a tuple of however many permission classes that you want. And you inherit from different views that REST framework gives you for free. And those views give you the different types of calls. So list create view gives you the ability to post to it or get from it. And if you get from it, you get multiple objects. Retrieve, update, destroy. Let's you operate on a single object, and you can potentially have get perms, change perms, so put patch perms and delete perms. The serializer class is where the serialization and deserialization occur, but the permissions are checked in the view. So how permissions are determined in the REST framework? They're always defined as a list of permission classes. And before you run the main body of each permission, before running the main body of the view, each permission in the entire list is checked. And if any of them come back as permission denied, it will not give you access to the view. So you can string multiple permissions together. And if any of them fail, then you're not going to have access to whatever resource it is that you're trying to get. The permissions that REST framework gives you for free, they're all pretty straightforward. Allow any is authenticated, is admin user. For what it's worth, is admin user. For a while, I thought that that was the same as is super user. It's obvious that it's not, but it actually corresponds with the is staff field in the Django user model, not the is super user field. Is authenticated or read only is the same as is authenticated, but logged out users have view permission. And then Django model permissions is where it gets interesting. Django model permissions is where it starts to use the view permission that we assign to the model, and also the change permission, the delete permission, and the add permission that Django gives you for free. Django object permissions, they check if a user has object level permissions, in addition to checking if a user has model permissions. So you have to pass both, which is another thing that was a head scratcher for me for a while, where I was assigning users object level permissions to stuff, and they couldn't access the things that they were being assigned to, because they need model level permissions and also object level permissions to it. And all of these permission classes inherit from a base permission class that REST framework also provides. And that base permission class has just two methods, has permission, and has object permission. And for base permission, they both return true, but you can extend this or any of the other permissions that REST framework gives you to do custom permissioning. And when you are going after an object, as long as these two things return true, you'll have access. If either one of them returns false, you won't. So back to the permission classes that Django REST framework gives to us, there's one thing that will keep us from using any of these permission classes for our example. We have that additional non-default permission type, the can view. And Django doesn't give us that for free. We added that later. So we need to add a custom permission for our view. This, for what it's worth, is the Django object permissions class in REST framework. And the interesting thing here, if you take a look at the perms map there, you see the add, change, and delete, the three permissions that Django gives you for free. We need to update that perms map so that it also has view perms for get, options, and head. And we're going to do that right there. First of all, we're going to make it so that none of the methods come back as safe methods. By default, get, options, and head are safe methods. And then we're going to require view perms for get, options, and head. And we subclassed from the Django object permissions class that I just had up there. And now it should work. And we use our custom object permissions instead of the REST frameworks object permissions in our two class-based views. And we will have the behavior that we want, where we can assign permissions on an object level and assign them granularly based on the type of request, based on whether it's an add, a get, a change, or delete. So yeah, just to wrap up, awesome. Permissioning can be complicated, but it can also be really simple if you take the time to understand it. It's a lot easier if you put restrictions on yourself by following two simple rules. Rule one, permissions should be kept separate from tasks. Rule two, you can assign permissions to users or to groups, but you probably shouldn't do both. Django, Django Guardian, and Django REST framework give you everything that you need if you're in a Django project. They also provide a really good roadmap for how you should go about building this if you're in a non-Jango project. But what they don't do is they don't force you to follow or even understand the two rules that make all of this a lot easier. So the next steps, if you want to implement some of this into your own project, is first off, start separating your permissioning logic from your task logic. Then decide if you want to implement permissions directly on user objects or indirectly using groups. It's an important decision, and it's not the type of decision that you can easily go back and forth between the two. Use classes for your permissions logic so that they're more reusable and extendable. And finally, implement object-level permissioning if and when you need to. Cool. Any questions? For anyone who wants to ask a question, if you're sitting at the desk, you can use a mic. There's a little silver button. Just be sure to turn it off when you're done. And for anyone against the wall, just speak loudly. But we have about a little over five minutes for questions. Yeah. Is there any reason why you didn't use setting a content type whenever creating a permission? In the Django documentation, it explicitly says content types whenever you're adding a known one. You definitely should do that. I didn't just because it's a little bit more clear that you're passing a permission class. But that content type is just a unique string on the Django permissions model. So in these examples, it was the same. But if you were doing permission system that managed permissions for more than just one model, that's a really good point. You should definitely do that. And I should update the slides to reflect that. I wasn't sure if you were only doing it because you were only using it on a single map or a single model. I was doing it for clarity, but it's the type of thing that I should have mentioned. OK. Thanks. Are those slides available online? Not right now, but they will be five minutes from now when I share them. OK. Fair enough. So I'll just post them on my Twitter, I guess. Yeah. There's no good reason why I have. The reason is because that's how I've always done it. PK is the convention, but I've always explicitly put an ID on all of my models. And I don't know why I haven't stopped doing that. But I just haven't. So any other questions? I remember towards the beginning, you mentioned something about Linux, about this being similar to the permissions on Linux. Like the UMass values and all that. Like I'm not familiar with Django at all. Can you tell me if does Linux have anything to do with this? I guess the command is. Linux has nothing to do with it. This is how I understand it. And I'm no Linux nerd or anything. But the way that I understand it is that it has nothing to do with it other than that it provided the inspiration for how Django should go about githubing groups. All right, thank you. Cool. Last chance. Thanks, everyone.


As you will have noticed, this session has started very late, we're going to run for half an hour, so we've been given our allocated time, so that we can have a proper conversation, because this is an important subject. I'm Xanny Minton-Bettos from The Economist. With me is Guy Standing, and I've been thinking about how to introduce Guy. He is a research professor at SOAS, the School of Oriental and African Studies at the University of London. But he's also, I think, and forgive me, I think he's become the moral conscience, or one of the moral consciences of the WEF. I suspect 10 years ago we would not have been having this conversation here, but we are now. Guy has written, and we're going to start off, he's written three four books on the prokaryat, and the prokaryat has made him, and I'm perhaps only flattering him a little, I think into a sort of Latter-day Dirkheim, in that he has really given a vocabulary and a typology, which even if you don't agree with it, helps you to think about the sort of fairly tumultuous events we've been seeing. And so we're going to talk for the next 20 minutes or so, and then have some discussion with all of you on what the prokaryat is, what it means for understanding what's going on in the world. And just so that you know, Guy has, I think, at least two other appearances this week, where those things that we won't have covered this afternoon we will discuss then. But Guy, tell us what is the prokaryat, and how does this concept help us understand the world today? Well, first of all, knowing how many events take place here, I thank you all for coming, finding time for this session. I'm going to be very schematic. I have copies of the three books that relate to the subject, if anybody is still interested, but at the end of the session. And I've been working on this for, dare I say, at 30 years, many research projects. I was director of labour research at the ILO, and this theme has been playing through my work. And for a long time, most people on the left and right ignored it, but suddenly in the last few years it's taken off. And to be invited here is a strange experience in itself. And it's interesting that the prokaryat, which was published first in 2011, has now been translated into 19 languages and sold a phenomenal number of copies. And every single day I get emails and contacts from people around the world. People I don't know, never heard of, just saying, you're talking about me. And it's a very interesting experience because the second book, a prokaryat charter, which was a set of policies to address the prokaryat, in a sense comes from all those emails and all those contacts. Because people are saying, you know, what we need is X, what we need is Y, and you get that. So it's an interesting experience, and it starts with a reflection on Carl Polany's great book, The Great Transformation. Those of you who haven't read it will at least know it. He said basically industrial capitalism developed through a disimbedded phase dominated by financial capital in the 19th century pursuing laissez faire. And the insecurities and inequalities multiplied until there was a crisis when there was a rise of neo-fascism, fascism and other forms of extremism. And there was a threat of the annihilation of civilization. Until or if there is a re-imbedded phase with a new system of regulations, redistribution and social protection. That was his framework. Well, I've been arguing for years that we are now in the midst of a global transformation. The painful construction of a global market system in which the disimbedded phase, which started roughly in 1980, with the triumph of the Montpelerin society, Milton Friedman, Frederick Hayek and so on, which we now call neoliberalism, I should end the disimbedded phase where it wasn't just a liberalization of markets, but it was a conscious pursuit of the commodification of everything that could be commodified, privatization, and most importantly from minority, and that's given relatively little attention in public discourses, is the systematic dismantling of all institutions and mechanisms of social solidarity that stood against the market. And as in physics, a market system needs some forms of resistance, some sorts of representation, some sorts of mechanisms to remind people of the values of empathy, compassion and so on. And we've gone through this phase and now I don't need to tell any of us in this room we've reached the crisis point. And in that 2011 book on the page one I said unless the insecurities of the precariat are addressed very soon, we're going to see the emergence of a political monster. Now I'm not going to give any names who that might be, but I promise you an extraordinary number of people have written to me in the last couple of months saying that monster has arrived. So we'll leave it at that. Now to compress a complex story, what's happened is that with the liberalization of markets in the 1980s and 1990s, you had a new form of regulation. It's not a period of deregulation. And one key event was that the world's labour supply trebled. An extra two billion people became part of the global labour market, all of whom were habituated to expect to life and living standards of 150th of what anybody in the OECD countries would have expected as of now. Now since then we've had a huge downward pressure on real wages all over the OECD, stagnant real wages, and for the group I'm about to talk about declining real wages. And in that process we've also had a technological revolution, the Silicon Revolution, which has made the relocation of production and employment so much easier and the re-division of labour so much easier, the restructuring of firms so much easier, and blocked off traditional channels of mobility, rising mobility through corporations, through occupations, which have been restructured and subject to state regulation, and have been fragmented so you don't have the old guild traditions where people enter the profession and rose through the ranks. That's been subject to licensing and changes regulation so you don't have traditional channels of mobility and it's a very crucial part of the story. Now the latter part of the story that I'm going to be talking about on Thursday I think it is, is that the neoliberalism has morphed into what I call rentier capitalism. The returns to property have gone up dramatically particularly since trips came into force in 1995 so intellectual property and all the rental income associated with it has gone up astronomically. The stock of patents is now estimated by WIPO at something like $16 trillion. Phenomenal amount and it all goes to plutocratic corporations and plutocrats earning rental income. Very critical part because you've had the real wages falling, rental income going up and you had the breakdown of the 20th century income distribution system as such. So everywhere we see the share, you don't need Thomas Piketty to tell us, we know the share going up to capital has gone up, the share going to labour has gone down. But much more interesting than that fact within the share going to capital, the share going to the very top has gone up and within the share going to labour, which has been shrinking, the share going to the upper echelons of labour have been going up relative to the rest. So you have a double whammy sort of situation. Now there are a number of other factors which I discuss in the book but the class system that is emerging that Sandy has referred to which I've been working on conceptualising and gathering data from thousands of corporations and a huge number of surveys over the years is roughly as follows. Basically you have a plutocracy at the top, we all know that, we all know their names, many of us wish we didn't or at least some of them. They are the rentiers of the world, they're fast rentiers. Then you have an elite serving the plutocracy and plutocratic corporations, some of them represented at Davos obviously. We don't want to talk too much about them because somebody might throw something at me in the discourse. Then below that you have a shrinking celeriat. When I was at Cambridge doing labour economics, what I called a celeriat was expected to be the overwhelming norm by the end of the 20th century. Everybody having employment security, pensions, paid holidays, paid medical insurance, a trajectory of promotion etc. That's shrinking everywhere. The big thing that the celeriat worry about is they're worried about their children falling way down. The old proletariat is disappearing and the profitions that I discuss, I'm not going to discuss in the books with people who don't want employment security, they like the freedom of being freelancers or whatever. They're a particular group but I want to concentrate on the precariat. The precariat is the growing group in every part of the world. Underneath the precariat is what I call a lumpen precariat or an underclass. People out in the streets dying prematurely. The precariat is not an underclass. It's very important. People who think the precariat and journalists often do are standing talking about an underclass. No. Global capitalism wants the precariat. The precariat can be defined in three dimensions. First of all, it has what a Marxist would call distinctive relations of production. It's being habituated to accept a life of unstable labour, casualisation, the new thing of crowd labour etc. That's the least interesting aspect for me intellectually and politically. It also consists of millions of people who don't have a sense of occupational identity, an occupational narrative to give to their lives. They also have to do a hell of a lot of work for labour that isn't recognised in statistics or accumulated and is part of the status frustration they are experiencing. And it's the first emerging class in history whose level of education on average is higher than the level of labour they typically have to perform. Huge under-employment if you like. Those aspects refer to the first part and it leads to what I've called in the books the precaritised mind. If you are in the precariat you don't know what's the best thing to be doing with your time. Should I do a little bit more of this, a little bit more of that, a little bit more so you are suffering a sort of existential insecurity. Now the second aspect is that the precariat has to rely almost entirely on money wages. It doesn't get access to those non-wage benefits paid by corporations. It doesn't get access to rights-based state benefits either because means testing has spread and this puts people in the precariat into poverty traps. Every country we are suffering from huge poverty traps where if you go from low benefits which are being cut everywhere into the sort of low wage jobs they can get they are facing a marginal tax rate at 80%, 90% or whatever, something like that. On top of which they are suffering from what I call precarity traps not expecting to get those benefits straight away. They often have to wait and then they lose them for one reason or another so people in the precariat are on the edge of unsustainable debt. This is the big phenomenon and it's leading to such economic insecurity that the anger is rising and the last part is that people in the precariat are losing the rights of citizenship in many ways. I document that in the latter two books and the real meaning of being in the precariat is this. You're ultimately a supplicant and the original Latin term for the precariat was to obtain by prayer. You have to ask for favours and this is really humiliating, degrading and that's the reality of a huge number of people who are writing to me. Now the last part of the story and then I will stop is that at the moment it's a dangerous class because it is subdivided. Subdivided into the first group what I call atavists, people who've fallen out of working class communities and families and they're looking back. They don't have what their parents had or what their communities had but they don't have a lot of education so they listen to those monsters who are playing on the fears and they're voting for them. The second group I call the nostalgics, the migrants, the Roma, the minorities, the disabled who don't have a sense of a present home.   And this group is very angry too but is looking around for a politics of paradise and it doesn't see it at the moment. And that's why they don't turn out at elections. They don't turn out for the Hillary Clinton's or for the Remain campaign in Britain and they won't turn out for the old social democrats because they're not offering them a future. They're still harking backwards. So we have a terrible political crisis where the first part of the precariat is turning up and voting for these extremists. The third part is still looking for a new politics and that I'm trying to make the main subject of the latter two books. So that's the essential theme and I apologise if I've used up too much of the time. You've compressed three books into ten minutes so I think that's pretty impressive. So a very good summary and for anybody who has not read any of your books they'll know exactly what the very comprehensive framework that you've painted. I want to push back a little bit, both in terms of, I think one doesn't have to accept your description of what's happened in the last 30 years to find your topology interesting. So we're not going to have a debate about neoliberalism. We can leave that aside. But just in terms of the mapping this very interesting typology onto what's been going on in politics and I wonder how far it really gets you and I just want to give you a couple of examples. If you look at my own country, you know, the Brexit decision, actually this is not my phrase I wish it was but someone gave me a very telling phrase for what it was which it was an alliance between blue collars and red trousers. Because basically the blue collar workers who I think are the attivists to an extent that in your typology voted together with a lot of people who are not in the precariat at all who wanted to take back control who were, you know, the sort of quintessential Tory with the Nigel Farage's. So that's a political alliance which doesn't really work in your typology. And then the second example is because you say that the progressives who I think reading your books were the ones that you expected to push for change were remarkable by their absence. They didn't vote for Hillary Clinton, they didn't vote in sufficient numbers and they certainly didn't vote in sufficient numbers for Britain to stay in the European Union. So when you look at this typology, which to repeat is a very useful one, how do you translate that into what we've actually been seeing and the precariat is not behaving as a single unit or even necessarily as three separate bits? Well, I think looking at the data and talking to a lot of people, I think the typology does stand up with the Brexit. For young people in the precariat, that third part, I've been invited to talk at various universities, various places around Britain, particularly in Scotland and the north. They saw the Brexit vote as a choice between two negatives and they didn't like either. They didn't certainly like Nigel Farage or a lot of that, but they were offered an agenda of fear. If you do this, you will get worse. At the same time as you had a government that's been giving them austerity for the last six years, cutting their living standards, increasing their insecurities, why should I listen to them telling me what I should go for? Well, a lot of them basically stayed at home. Why get out of bed for either of those two options? Now, if you go to the United States, there's a huge amount of resentment about the Bill Clinton era, which was an era when there were possible, and he produced the Welfare Reform Act of 1996 of when he won and knows that act, it was a horrendously regressive piece of legislation. And I've had talks with Bob Reich, who was the Secretary of Labour at the time, and I said, well, it's all very well coming out now against inequality, but that did more to promote inequality, plus Larry Summers building up for the subprime crisis. So, the precariat in the United States weren't attracted to Clinton, either Clinton, and they certainly weren't attracted to Trump, but they too tended to stay at home. And I think we're going to see repeats of that position until we get a new type of progressive politics that comes out. And I think it's a responsibility of the people who come to somewhere like Davos to be encouraging that phase, because this is a real shock to the system. That's certainly true, and it's something that would be interesting to hear the audience's reaction, that even in the 24 hours or whatever that this event has been going seems to be much more seriously stated and heartfelt than usual. For years there have been conversations about we have to do something to help the losers from globalization and technical change, but it was basically pretty proforma stuff. And I think now there is a sense of, at the very least this is a massive wake up call, something has to be done. But then give us, and I know you've got another two sessions on this, but give us a preview of what, from your perspective, the elements of the right solution are.  Why, because we ask questions. Because before we had this session, she said we won't discuss this today. It's okay. Then rise. She's the best of the kind. But tomorrow I'm going to be having a session on basic income. I passionately believe, and I've been arguing for 30 years, that a basic income as a right has to be part of the future. And we have to move to that. I believe confronting rentia capitalism means that we need a new income distribution system that's consistent with market capital. Don't get me wrong, that's consistent with, that will actually increase efficiency and increase the morality of the system. And that I believe a basic income is one of the essential ingredients of building a new income distribution system. All the arguments for that will discuss tomorrow. But I think at the same time, the immediate crisis is that rentia capitalism has got out of control. I was invited by sales, the dream force, sales force rather, to speak at the dream force thing, the chief executives. And at the end, Mark Benio said, he said basically what you're saying is the system is rigged. Which just happens to be a phrase that a certain monster uses a lot. But I said of course it's been rigged because it's been rigged in favour of intellectual property rights, which the economist has been fantastic on ever since 1851, it's had a good system. Are you suggesting the first eight years we were no good or 1853? You wrote an excellent article in 1851 which I quote, which is, she wasn't around at the time, but it was excellent showing why intellectual property rights were just wrong and were contrary to free markets. And the rentia system that has been built up by trips, by the 3000 plus trade and investment packs that are preserving those incomes, we have to unravel that. We have to see a rolling back of that. Because if we don't, more and more of the income will be taken off by the patent hoovers, the big corporations that have thousands of patents and the Foxcons in China that have got over 12,000 patents. And each one of those patents gives them a monopoly income flow of 20 years. What free market is that? So we have to see a new system that is built and I think that's an essential part. That's exactly what I hope you do, give a taste of it, not only so that everybody comes tomorrow and the next day to have a discussion about both basic income and this system, a better system rather than rentia capitalism today. But I also wanted for you to describe that so that the audience gets a sense of the scale of your ambition and the scale of radicalism because then the next obvious question is, if you look at the politics of the left today, and this is not going to come from the polish to the right almost certainly, it comes from the politics of the left, one other big thing that is happening is that the centre left and indeed the left in many places is collapsing. So how do we get from, in your world view, how do you get from where we are today to this kind of agenda, never mind being enacted, being a vibrant political force? Well, I think if you go back to Polanyi, you will see that it took, we don't want this to be repeated, it took almost 50 years for the counter transformation to take place against the excesses. I'm actually quite optimistic, I get invited to huge number of places where there are groups forming, precariat groups. I've been invited to speak about the precariat in over 400 places. That doesn't happen in 37 countries. And there is a huge energy out there. I really feel that there's a lot of energy and there's a lot of idealism in that energy. And it's interesting that it's not like the old proletariat. For the precariat, the primary enemy is not the corporate boss, it's the state. They want a reform of the state. And it's interesting because most of the insecurities come from the institutions of the state, not necessarily the government but the state. And I think that the energy out there can translate very quickly into new political movements. First of all, sorry, just to finish the point, first of all you've got to have a clearing of the decks of the old. Well that's what I was about to ask because does this have to be driven by a, I use the term somewhat lightly, a revolution by the proletariat, or can the established elites embrace enough of this kind of change to reach a more sustainable capitalism? Does it have to be them versus us or can the people here embrace enough of this radicalism that you actually have a sort of remaking of the social compact without something truly radical? I think it's going to be a bit of both. I don't think, I'm not advocating or believing in a revolutionary thing. I think it's an evolutionary process. I think what you're seeing, I hope what we're seeing is that the corporate liberal capitalists realise that it's overreached and these insecurities and inequalities are excessive. And they are going to roll back and encourage these new movements, new things, quietly give some funding base to some of these movements that are making sense. You know, we need structural change but you're not going to get structural change unless there's going to be a popular movement demanding those changes. And I think that it's going to be a bit of both. I think things like what I discussed in the book Sovereign Wealth Funds are going to have to be led by intellectuals who know the system. Do you see any politician embodying this? I mean we mentioned earlier, it's a little unfair of me to do that now on stage, but we mentioned Emmanuel Macron in France. Is that the kind of person who might be pushing this kind of agenda? I think as John Lies said, I think it's too early to tell, but he was speaking about the French Revolution being a success. I think he's come out so quickly, we must reserve judgement. If he forces a wedge between the far right and the far right, then from my perspective he's doing a good job. But I think we're seeing a number of young politicians coming through political movements which are more important than individuals and that energy and entrepreneurial thinking about alternatives I think is really exciting. You mentioned ten years ago, ten years ago it felt like a sterile debate. It was not interesting, but now you keep hearing of new initiatives like the rescuing of the commons which is a big subject in my third book. This sort of subject is suddenly becoming sexy and I think it's part of this re-energising, whether it's left, right, I don't know the old words that probably need replacing. But it's a sort of transformative agenda that's taking shape. It is taking shape. I think we have time for a few questions. Yes. Thank you very much. You pointed to this search for politics on behalf of the progressives and others. You've used the word politics, you used the word movement but not philosophy. I'm interested because the Marxism emerged in response to the first industrial revolution and here we are talking about the fourth industrial revolution. I wonder if the collapse of the left is going to continue until a new political and economic philosophy emerges and I'm curious if you are seeing any signs of such a thing coming, whether it's related to the commons or else wise because I feel like that's badly needed. If you have a look at the second book, the Precariat Charter, that's the core argument that the old social democrats in adopting third wayism of Blair and Clinton and the rest became utilitarians philosophically and majoritarians, if you wish, and that allows for the demonization and increased insecurities of the people near the bottom. As long as you appeal to the middle classes in some sense, that is your philosophical position. I think that's been discredited for all time by recent events and that the social democrats and the Labour parties are paying a heavy price and they deserve to pay a heavy price in my view, but philosophically you're having a resurgence of a sense of needing empathy and social solidarity, conviviality, all the classic enlightenment values are the things that I find Precariat groups and the philosophers and others are beginning to talk about much more fundamentally. And I think that's exciting. The second book is called The Precariat Charter and it was basically 29 policies that come from a philosophical position of anti-utilitarianism. I hope so. I hope so. I mean, because it must do. Gentleman here. My name's Calluia. I come from Denmark, which is generally considered a very equal country at least. But one question about the basic income. What makes you think that the Precariat would settle for a basic income and that this will not become a new battleground for it being raised year after year? Well, as a matter of fact, as you know, and I get a lot of limitations to Denmark, and the new party, the Precariat party is coming up. It's got 10% in the opinion polls growing, 20% in Copenhagen, and they've got basic income in their agenda. It's one of the countries where we could see a breakthrough. They're very much part of it. And you've seen in the last couple of years tremendous change in the trade union leadership in Denmark, the old trade unions leaders, the social democrat labourist views have all been swept aside by younger women leaders. And you're seeing that debate taking shape in Denmark in a quite interesting way. I can talk at length about how basic income is affordable, how basic income will do it. But just about the politics of it. The basic question is a political one. Won't this be the tool for evermore redistribution? Why would the Precariat be happy with just a basic income? Because I think it's going to be a base of equality. It's going to be a base of solidarity and affordability. And in a number of countries, I think, and I'm going to talk a bit about this tomorrow, it's got to be couched in a different way than what many conservatives with a small sea are couching it in, as a replacement for other forms of benefits. Because then it becomes tax you to pay for you, and then Mr Hardworker paying for Mr Lazy or something like that. It's got to be seen as a part of the new income distribution system where you say we are taxing the renties for the benefit of everybody in society to give you a base where you have control of your life in your mental state first and foremost. And I think that that will induce a much healthier discussion of a better system of equity and for freedom, for enhancing freedom. But it is something I will talk about tomorrow. One more question if there's one more. Yes. Hi, my name is Rajesh Chandy. I'm a professor at London Business School. Thank you for this fascinating conversation. I wanted to pick up on a strand from the earlier conversation. I just came out of a session with a group of CEOs talking about the need and importance of responsible business. Do you see in your, as you look around, any signs of hope where the challenges you point to can be solved through business, big business getting involved, and so what examples would you point to? Well, you're Indian, are you? Yes, from many years ago, yes. So, I mean, I want to take this opportunity to thank the Premji Foundation, YPRO, who've just given us extra funds in India because we've done pilots of basic income in India and the results, we've produced the results and we've provided basic income to thousands of people and monitored what happened. The Government of India is about to issue its economic report for 2017 when there's going to be a special chapter. Now, you can imagine, I feel, the corporations of India are actually playing a responsible role. Mr Premji talked to me here and his wife because his wife is fantastic and they basically said, look, we want to help with just some seed funding to get more pilots, more work done to see if this is a way for all. And I think that certain corporations in many countries can help with that. You know, okay, let's see. Let's see if we can help with pilots or with movements or with rethinking some of the things. And as it happens, I think in India, some of the corporations, I want to put my hand up and thank them. I'm afraid we have to stop there. Guy, thank you very much. I encourage you to read Guy's books because even if you don't disagree with everything and Guy knows that I don't, it's a really, really, at the very least extremely interesting way of thinking about the world. But there's some very, very interesting ideas and I predict confidently that you will be here in future years. And there will be, the case of India may be a case of the beginning of a broader trend to some of these things. So Guy, thank you very much. Thank you.


I'm Zor. Welcome to Unisor Education. Today's topic is linear equations. Well, linear equations are really simple. There is nothing much which we can really discuss in this particular lecture. Still, I will try to present something which might be interesting. I doubt it will be new, but at least interesting about linear equations. So, what is a linear equation? Obviously, this is something of this type. The first question which comes up when you are talking about any equation actually, including linear, is what's the domain where we would like to look for solutions of this particular equation? As you understand, it can be different, and certain equations might or might not have solutions in this or that domain. For instance, if I'm looking for a solution to this equation in the domain of integer numbers, which means I'm looking for an integer x, which is multiplied by 2 plus 3 gives 0, there are enough solutions here. If, however, I'm looking for a solution of this equation in the domain of rational numbers, then yes, obviously x equals to minus 3 second is a solution, but this is the rational number. So, in the domain of rational numbers, there is a solution. Now, what if I will ask about this particular equation, and I will tell that I'm looking for a solution in the domain of rational numbers? Well, we all know that square root of 2 is irrational number, so there is no solution in the area in the domain of rational numbers in this particular case. But in the domain of real numbers, the solution is and x is equal to minus square root of 2. And obviously, the same can be actually said about complex numbers. If I'm looking for a solution to 3 plus i times x minus 2 times i minus 7 equals to 0, well, obviously the solution to this particular equation does not exist in the domain of real numbers, but it does exist in the domain of complex numbers. Okay, so this was just an illustration of certain I would say peculiar things which might happen with solutions, and actually there are quite a number of very interesting problems related to this particular topic. For instance, you can have the problem solve this particular equation in the domain of let's say integer numbers. So that actually presents a certain problem. I'm not talking obviously about linear solutions, they are easy, but there are some more complicated equations where this definitely can be applied. Alright, so one important topic right now is that we always have to consider what's the domain of our equation. Now for this particular lecture, I will always use the domain of real numbers. For different reasons primarily because it's most frequently occurred case and also I would like to present certain graphical representation and graphical representation is obviously related to real numbers because real numbers are mapped exactly to all the points on the line on x-axis and the y-axis. Alright now, is any equation of this type is a linear equation? Well strictly speaking no, because we have to put a condition a is not equal to zero. Now, we will consider separately a case when a is equal to zero a little bit later but right now we should assume that a is not equal to zero also we assume that both a and b are real numbers and x belongs to domain of real numbers. So these are assumptions which I'm staging right now on the onset and keep it in mind and now we will go with easy solution to this equation in this particular case. Obviously we have to apply transformations as usually to solve the equation and the first transformation should be I am converting both sides by subtracting b. Transformation which corresponds to each number, that number minus b now if I will apply this transformation to the left part I will obviously get this and right part will be this one. This is obviously reduced so we have a times x equals to minus b. Next transformation again quite obvious, I divide by a. Now that's exactly where a not equal to zero comes handy because otherwise I wouldn't be able to do this. So applying this transformation I'm getting x equals to minus b over a. That's it, no more than that. Simple straightforward without any kind of losing solutions, gaining solutions because all the transformations are invariant considering a is not equal to zero as we have assumed from the very beginning. So everything is okay in this particular case. Now our next job is to represent this particular equation and its solution geometrically using code and the taxes. So let me just write down only the solution to this equation x is equal to minus b over a and let's go to graphical representation. Now let's start with y is equal to x and next we will go to y is equal to a times x and next we will go to a times x plus b. So these are three steps which we are going to make. Well y is equal to x, everybody knows what that is. This is line which bisects this straight angle and this is 45 degrees so we all know that this is y equals to x y because obviously for every x if I would go up the length of this will be exactly the same as the length of this. If this length is x and this length is y then y is equal to x. So for every point here this is an obvious property. Okay now what happens if I multiply it by a? Well let's consider two cases, three cases actually. a is equal to zero which we have assumed in the very beginning which is not but here I would like actually to present the graph with a equals to zero and then the positive a and the negative a. With positive a it's actually quite simple because right now if this length and this length are exactly the same so this is x but now I don't want x, I want a times x which means this length becomes a times longer if a is greater than one or shorter is if a is less than one. So we are right now assumed that a is positive. Let's say a is equal to two. Well the graph will be twice as steep so instead of this length I will get up to this and the function will be like this so this is y is equal to two x. Now if my a is let's say one half this segment becomes smaller it will be half of this and the function will be graph will be like this so this is y is equal to one half x and now you understand basically the principle the larger a the steeper this particular line goes and the smaller a it goes more horizontally and here is when a is equal to zero when a is equal to zero it just coincides with this line so this is y equals zero times x which means for any x y is equal to zero so every point on this particular x axis is actually a representation of the graph y is equal to zero times x or y is equal to zero basically. Now let's move further down if a is negative well quite obviously if a is equal to let's say minus one so y is equal to minus x it will bisect this angle so this will be y is equal to minus x and same thing here this will be y is equal to minus one half x and a steeper one will be y is equal to two x alright so we have all the different angles depending on the a and I would like actually to have only one we have too many lines here you understand the point so I will just draw one particular line with one particular value of a I'll choose the positive a because it's easier so again this is my graph and this is y is equal to a times x this is zero this is x axis this is y axis alright now so we finished with this one how about this well obviously again every y is getting lifted by b well up if b is positive and down if b is negative let's assume b is positive and then the whole thing becomes like this where this particular point on the y axis is basically the b we took this line and shifted it up by b so this particular segment is always b so this represents the function a is equal to y is equal to ax plus b that's exactly what we wanted to build and now when we have actually when we have this graph now we can solve graphically the equation ax plus b is equal to zero if this is a y is equal to ax plus b question is when y is equal to zero because when y is equal to zero that actually means that ax plus b is equal to zero so under what conditions y is equal to zero well obviously if this is all the different values of y then y is equal to zero is this one so this particular point represents y is equal to zero and question is what is x in this particular case well again let's make a slide with better graph not better I'll just clean up this piece which we don't need anymore ok now we know that this particular segment is equal to b now this particular segment is that particular x which brings y to zero so what's the ratio between this segment and this segment well let's put point m this is b and this is point m so what I'm interested right now is what is all m ratio to all m well remember when a was equal to one it was bisecting the line was bisecting the straight angle and these two segments were always equal to each other and for any a the line actually stretched upwards so basically what it represents it represents that the ratio becomes instead of being one in case a is equal to one it becomes whatever a value is so this is always a that what it means to stretch it vertically by a if you multiply a by x so in this particular case since the ratio between this segment and this segment is a now all m is equal to b and all n is equal to that particular x which is a solution to our equation when ax plus b is equal to zero well obviously from here and x is equal to b divided by a now we have here a slight difference between this and this now why is this such a case because you see x is actually to the left of the zero so I shouldn't really say it's x it's the absolute value of x here and b again is considered positive so I have to really use only positive values here if we are talking about geometry but in real life if you will take a look at this particular b and this particular x you see that x is negative and b is positive so that's why we will get rid of all these absolute values my x is really negative and to get it positive I have to multiply it by minus one and that actually corresponds to this formula so this is a graphical solution in case a is positive b is positive x actually becomes negative in this case so a is positive because we have it steeped that way because if a is negative it will be a way around and b is positive it means we shifted it upwards and that would shift the solution to the left of the zero to the negative values so that's basically the graphical representation of the solution now let's go back to a small case when a is equal to zero I promise to consider it and I will do it graphically right now again this is not a real linear equation however from the general approach to use the graphics for solving these particular equations you can save the following what is y is equal to zero times x plus d well you remember that y is equal to zero times x which is zero is the horizontal line which coincides with the x axis and if you add b to this it will be the line which is parallel and the b is this particular segment ok now what is the value of x which brings y to zero well as you see we never cross the x axis which means y is never equal to zero which means that if b is not equal to zero if b is positive or negative it basically means that there are no solutions here so obviously if b is not equal to zero there is no such y which can bring it to zero and finally if b does if b is equal to zero we have a solution actually of this particular equation now think about this this is the line which is exactly coincides with x axis which means it's always equal to zero so no matter what x is y is always equal to zero which means we have an infinite number of solutions any x is basically a solution so if a is equal to zero we have either no solutions at all if b is not equal to zero or infinite number of solutions when b is equal to zero so it's not really an interesting point to consider about this particular case so that's why in the very beginning at the onset we are stating that a is not equal to zero to make it a real equation that's what actually is important real equation always has a solution in this particular case when a is not equal to zero and it's only one solution well that concludes this exercise about linear equations thank you very much


A beginner's guide to start a successful YouTube channel for your online business. Hey, get this, every day, every day, there are one billion hours of videos watched on YouTube. Crazy, right? But get this, only 9% of all businesses have a YouTube channel. Nine, I said nine, 9%. In this video, I'm gonna show you how to start a successful channel on YouTube for your business and actually make money. So you're gonna wanna stick in there to the very end. You're not gonna wanna miss any of this. Thanks so much for watching this video. Do me a favor, subscribe. Hit that subscribe button down there right now. Turn it from red to gray and ring the bell. Turn on all bell notifications so you're notified each and every time I do a new video. Or if I go live, and I do go live a lot, you can actually talk to me in the chat section. I'd be happy to talk to you. All right, so let's get into this. This is important stuff. So I think what we'll do is we will run over to YouTube and I'll do a couple screen shots here and show you each step because I want you to know step by step what you need to do. Okay, so the first thing you're gonna need to do is visit YouTube, okay?  But you should see what accounts you already have, okay? So you're gonna see your personal account, any brand accounts you currently manage, and the option to create a new channel. Okay, number three, when you click on create a new channel, you're gonna be taken to a screen to create a new brand account. Now choose a channel name for your new brand account and click create. This can be changed later, so don't freak out over that, don't worry about it. Okay, number four, congratulations. You're now the proud owner of a YouTube channel for your business. Now, the next thing we're gonna do is we're gonna create your channel art, okay? So now that you know how to create YouTube channel for your business, let's take some time to get it looking at its absolute best, okay? We want it to look good. The channel art is super, super important. It doesn't have to be complicated, but it's gotta look good. It's gotta look professional, so we wanna do that. When you start a YouTube channel from scratch, your channel icon will be linked to your brand account's profile photo. To change it, YouTube will direct you to update your brand account, just like you see right here. Clicking edit will take you directly to the upload photo screen in your brand account. Then you can pick a photo right here and upload it into your account. It is recommended that you use a picture that is a JPG, a BMP, a PNG, or a non-animated GIF, okay? Saved to about 800 by 800 pixels is the optimal amount.  I think mine is just a picture of me. In fact, I know it is, it's a picture of me. But the next thing we're gonna get into is the channel art. Channel art's a whole different animal, and it's gotta be set a certain way, so let's take a look at that now. Channel art is gonna need to be 2560 by 1440 pixels for the best results. Your channel art should be under four megabytes, but it should at least be 2048 by 1152 pixels, okay? But they do recommend, like I say, 2560 by 1440. So YouTube will give you a preview of each image you load to show you how it will display on different devices. So you can edit or crop it, your image, whatever you wanna do.  Your profile's super important. And guys, I know this takes some time, but you only have to do this once, and you can always add to it later on. You just gotta get on it. The biggest problem I see is people are going, oh my gosh, it's so much to do. I just, I can't do this, it's too much work. Just take it a little at a time. You don't have to do it all at once, okay? Just a little at a time. Okay, so the next one, of course, is going to be your profile. And it's gonna say to unlock the customization options for your channel, you'll need to click the gear icon in this section beneath your channel art, okay? Which you'll see right here. And then a pop up title channel settings will then appear. Look for the customize the layout of your channel option and enable it. Click save. You'll now be given a wider range of options sorted into five tabs. Home, videos, playlist, channels, and about. Head over to the about tab to edit your store's details. Now under description, give a brief outline of your store. And even though I'm saying brief, I would say make it more detailed if you could. Use up all the characters that you've got. Keep any core elements for your store in mind and make sure to use them in the channel description to help people find you when they search YouTube. Now be sure to include your contact email as well. Some people will want to contact you through YouTube. You should also include links to your social media accounts in your store since these links can be set to appear over your channel art and will be highly visible to your audience. Now most of your links will default to just the favicon, the small image that shows up, and you can see that right here on this banner. So make sure that most of the 30 characters, like 100% pure, has done with its shop now call to action. You can see that right here. On the top right hand side, you'll find a section titled featured channel where you can feature other YouTube channels, I don't do that, that are owned by your brand or managed by your employees. Now my brands don't go together. One survival food is how to make money online, so they just don't go together. While this section may not be useful when starting a YouTube channel from scratch, once you expand your YouTube presence, it could be later on. Now the next thing you wanna do is plan your content. That's what it's all about, okay? It's about people coming here watching your videos. So you wanna plan your content. Content is so very important. And understand, YouTube is the second largest search engine in the world, okay? It's considered a search engine. People would much rather watch videos anymore. And you can get through a video pretty fast because you can just hit the settings button there and you can increase it one time or two times, whatever you want, and watch the video a lot faster. You can't do that on a blog, can't do that reading, can you? But you can on a video, so that's very helpful. But keep that in mind that you wanna have good content. Let's talk about some of the different kinds of content too. The first one is education, okay? People come to YouTube for education about 60% of the time. They usually how-to videos, and over the last 13 years, how to search on YouTube has grown 140%. People are going there to learn things. For example, on my channel, people are going to my channel to learn how to make money online. And as you can see from the screenshot right there, I make videos on how to make money online. There's so many added things to making money online. It could be a website, it could be SEO, could be finding products, could be building your audience, could be emailing, but they're all under that how to make money online blanket. The next type of videos you can do is brand storytelling. That's huge, you know. I'll give you an example right now. Let's check out the screen here for GoPro. GoPro has become a leader in this arena with a diverse amount of YouTube content that builds an identity of adventure, exploration, and adrenaline rush, okay? From helicopter skydiving to a fireman saving a kitchen, its videos showcase the many ways GoPro customers use the products and brand tagline be a hero. The next area that people do videos in is entertainment. Entertainment's very, very important. And you know, here's the thing with entertainment. People go there to kind of escape, right? They go there to kind of escape. Maybe they want to watch comedy. Maybe they want to watch prank videos. Maybe they like watching cooking because it's entertaining to them, but it can also be educational. So don't pigeonhole yourself and say, well, this video is just this.  It can be something that's educational and it can be entertaining at the same time. That's what I'm trying to do right here. We're trying to do all three of those. If we can do all three of those, you're hitting on all cylinders and that's really important. Next thing, number five, is create a trailer video for your YouTube page. Do not do a trailer video that says, hello world, this is my first video. Don't do that, okay? Basically what you want to do in a minute or two is just tell them what they're gonna get if they subscribe to your channel. That's a really good one because you're getting people to subscribe and they're learning about your channel. So it's a really simple thing to do. Now here's an example of a Shopify channel right here and they've got their trailer right there, but here's the steps basically. Upload the video you want to be on your channel trailer. That's it. Go to the channel you want to manage. Select customize channel. Go to the home tab. Click the four new visitors tab. Click edit and select change trailer or remove trailer. When you're creating your trailer video, think about what makes your channel unique, your brand personality and why people should subscribe to your channel. There is no one right way to make a YouTube channel trailer, but start with trying to hook your visitors in the first few seconds. Make a good impression on videos and finish off with asking them to subscribe to your channel. Okay, we've got that far. What's next? Let's upload your first video, okay? Let's get your first video up. I think this is the most earth-shattering part is getting your first video up. My first video was awful. Don't go back and watch that one, please, but it was awful. And understand yours probably will be too. Now, maybe you're great at this and it won't be, but for the most part, most people, their first video is awful. And I think a lot of people won't upload their first video because they're afraid it's gonna be awful. Understand it will be awful. It's okay to be awful. It's okay. Do it. Just upload the video. Number seven is optimize your video. Do the SEO, do your titles. I have other videos on my channel you can watch on this. The titles, the meta tags, all your keywords, your description, make sure all that is done properly. Understand that every minute, every minute, 500 hours of video are uploaded to YouTube. If you're gonna compete with these other people, you've got to do the SEO on your video. And I'll put a link to mine right below here where you can actually see a link to a video where I show you how to do that. Now, once you've got your videos up and loaded, it's time to engage. You cannot, cannot, let me repeat, just post videos and never engage with your audience. I like to pin a comment at the top right below my video so that I can ask people a question so I can get them engaging.  You wanna ask them to subscribe. Hey, subscribe, by the way. And ring the bell, turn on all bell notifications so that you are notified every time I do a video and make sure you like it. See what I just did there? Those things are important. And I also ask you to comment below. Would you think of this video? Would you get out of it? And you want to respond to these people.   You stopped it, right there, okay? What I like to do is I like to comment back with a question. So if somebody's saying, I don't, you know, I had a comment, I just thought of a comment I had. Somebody said, how do you add an unsubscribe button to the emails I send out in Cartra? And I'm gonna respond to them and basically Cartra automatically. And if you don't have Cartra, by the way, you can watch a video below on Cartra. You're gonna want to check this out. But Cartra automatically puts an unsubscribe on their emails. So I'm gonna respond to them. I'm gonna say, Cartra automatically puts an unsubscribe on your emails. But my question to you is, are you using Cartra? And what do you think of it? Now, why would I do that? I would do that because I've answered their question, but then I've asked them another question, which gets them to ask me another question or answer that question. And in doing so, I increase the engagement. You have to engage with your audience. I know you don't want to. I know it's tough. I know it's sometimes boring. It's tedious, but it has to be done. Because the other thing is if they post a comment on one of your videos and you don't respond, obviously they're not gonna comment again, but it also tells other people that you don't respond. And if they see that you don't respond, guess what they're not gonna do? They're not gonna put comments on your videos. Now, why do you want comments? Because YouTube loves interaction. If you have interaction, that tells YouTube that people like your videos. You gotta respond to the comments and you gotta get them to engage with you. Okay, so that gives you a brief overview on starting your channel. I hope you do it. Remember, only 9% of all businesses do it. That's a shame. Only 9%. But the good thing is, since only 9% do it, it helps you because the competition isn't doing what they're supposed to do. Get that YouTube channel started. Let me know how it worked out for you. Put your comments below. Let me know how your YouTube channel worked out. Did you get some good results? Do you need some more help? Put that question down there too. I'll be happy to answer you. Thank you so much for watching this video. Don't forget to subscribe, bring the bell, turn on all bell notifications so you're notified each and every time I go live, or I upload a video just like this. Thanks so much for watching and I'll see you in the next video. Hey, thanks for watching my video. Don't forget to subscribe to my channel and click that little bell right here so you can be notified every time I do a new video. Also, click on one of those videos there. Keep watching on my channel.