functional equations. This topic is I would say it doesn't have a you can say unique way or procedure or standard operating procedures to solve questions. They're very unpredictable type of questions. You have to you have to think in different way laterally to find your function out or whatever is the required condition out. So many a times these questions are tested in olympiats. If you look at international mathematical olympiats and all you'll find that there is a chapter of functional equations. So the fact that it is being tested in olympiats clearly suggests the fact that these topics are not that straightforward. They're not conventional that you have certain you know methods and formulas and you can apply it to get the function back. There are a lot of hidden trials you have to do. We have to see the periodicity of the function. We have to see what happens to the function when you change the name of the variable. Many times you need to do differentiation also. So I think you have already been exposed to functional equations before so I don't need to talk more about it.  But let me tell you that is just a list which you can just copy it on your notes but might not be useful at all.  The most commonly seen one is the one which is this one. f of x plus y is f of x into f of y. Mostly the functions which satisfy these kind of functional equations are of the type a to the power x. Okay so this is a commonly seen solution for this type of functional equation and I don't think so I need to tell you why.  Such kind of functional equation is satisfied by logarithmic functions. So log x with some base a. Okay where you have to figure out that a by the use of some additional condition given to you in the question. Okay needless to say if you if you have f of x minus f of y is equal to f x by y the same type of function will satisfy that is logarithmic function. If you have something like this f of x plus minus f of y okay a plus just consider plus to be once and then minus and same in the formula also the top part will correspond to the plus and the bottom part will correspond to the minus. So I'm writing it in one go. Can you tell me which function satisfies this function sign inverse x. Yeah which function satisfies this functioning equation. This is an inverse. Okay now the next one is the one which is most commonly asked f of x into f of 1 by x is f of x plus f of 1 by x. Okay now this is satisfied by a polynomial function which is given by plus minus x to the power n plus 1. So this function this is something which we need to know. You can easily verify it also. You can easily verify it also. So this type of functional equation is very commonly seen. Okay try to prove this proof is very simple just take a polynomial function in general and try to find the coefficients of that polynomial function which will meet this criteria. Okay you realize that only plus minus will come as a coefficient. That's all the terms would be zero. Do you want me to do this? Do you want me to prove this? Okay let's let's prove it. Prove for the seventh one. So if you have when we claim that a polynomial let's say the polynomial is this satisfies this. Okay now if you put it in this given functional equation f of x we all know is a0 x to the power n a1 x to the power n minus 1 all the way till let's say a n into f of 1 by x will be a0 by x to the power n a1 by x to the power n minus 1 all all the way till a n. And this is equal to sum of these two functions. Now if you compare the coefficients let's start comparing the coefficient of x to the power n on both the sides. Let's compare the coefficient of x to the power n on both the sides. What will I get on the left side? How will you generate x to the power n? Only when a0 multiplies with a n correct? So if a0 multiplies with a n you will get x to the power n. There's no other way to get it. And on the right side it will only come from a0. Yes or no? Now this means two things a0 could be 0 or a n could be 1 but this is not possible because in a in a polynomial expression the leading coefficient cannot be 0. So if you're considering it to a degree n a0 cannot be 0. Correct? Let's compare the coefficient of x to the power n minus 1. What do we get on the left side? Which term will contribute to a x to the power n minus 1 terms? Yeah sorry I was thrown out of the call. Can you see my screen now? Yes. So if you compare the coefficient of x to the power n minus 1 on the left side you will get a0 a n minus 1 correct? No because the term before this will be a n minus 1 by x and that multiplied to this will give you x to the power n minus 1. Can I say I will also get x to the power n minus 1 from a1 a n correct? And this should be equal to a1 on the right side because only this term will have x to the power n minus 1. Now remember a n is 1. a n is 1 means this term will be a1 again. So a1 a1 gets cancelled off that means a0 a n minus 1 is equal to 0. a0 cannot be 0. What does it mean? a n minus 1 has to be 0. Am I right? Similarly you realize that a n minus 2 would also be 0. a n minus 3 would also be 0 and so on. Now what about the last term? What about the last term? I think we had already figured out the last term is going to be 1. What about a 0? Sorry what about a 0? Let us compare the constant terms on both the sides. If you compare the constant terms on both the sides you would realize on this side you will get a n square. Let me write comparing constants on both the sides. Comparing constants on both the sides you will get a n square and on this side you will end up getting constant term as as as as as how much this into this sorry a n square and also a not sorry my bad a not square that will also give you constant term correct? Rest other terms they would be there but they would be 0 because a 1 square a 2 square etc they will all be 0 we have already seen that over here so those terms you need not write. On the right hand side on the right hand side the constant terms would be a n right? So this gives you a not square plus 1 is equal to 2 so a not square is equal to 1 so a not could be plus or minus 1. In other words you realize that a not is plus minus 1 rest a 1 a 2 all the way till a n minus 1 is equal to 0 right and your last term is 1 that means your given polynomial equation was plus minus x to the power n plus 1 so this becomes your solution for that functional equation okay other than this I would like you also to note down actually do you want to copy this or should I move wide you want to copy this please do so okay few things I would like you to add on to that list number one was was there any numbering for the same did I give you any numbering for the same okay just I would write that important points here if your function satisfies this functional equation that is f of a minus x is equal to f of a plus x remember the graph of such a function will be symmetrical about x equal to a line okay so if any function graph if any functional equation is satisfying this functional equation then it's graph would be symmetrical about x equal to a line please make a note of this very important concept several questions have been framed on this in past and if you realize your function f of a minus x is negative of f of a plus x then the graph of this function is symmetrical about the point a comma zero even function and odd functions are special cases for this if you're a is zero if you're a is zero then it becomes f of x becomes a even function okay here if you're a is zero then your f of x will become an odd function because a comma zero will become origin in that case and x equal to zero will become the y-axis in that case okay but these are the properties in general that we need to know these are the properties in general that we need to know okay so what I'll do is I'll take a quick break over here I'm sure most of you would be hungry now so let's take a break right now the time I'm assuming it's 11 17 am will meet at 11 32 am with more questions on functional equations I think I won't be able to do much in different definite integrals but I'll see if I can start the topic okay see you after the break so let us begin with some questions on functional equation again as I told you there is no you can say conventional way to solve questions you have to try a lot of things you have to try special values you have to try putting one value as the other and see whether you can solve it I think most more clear more clarity will come when we take questions let us begin with this question of x is x plus f of x minus 1 if f 0 is given to you as 1 find f 100 easy question to begin with okay that's not correct by the way correct richer but I'm here oh no he is he has made a mistake richer party is correct but I'm is correct that's deep again small mistake okay let's discuss this I think you would have got an idea how to do it hey do you realize that your f of 1 is 1 plus f of 0 that's nothing but 2 okay f of 2 is nothing but 2 plus f of 1 which is 4 right f of 3 is 3 plus f of 2 which is 7 right so the trend that is going here so your first term sorry your 0th term is 1 right this is your 0th term first term is 2 then 4 then 7 I think you can make out that the difference between these terms are in AP so 1 2 3 the next difference will be 4 so it will be 11 okay so this is your first term this is your second term and like that you need to go till your hundredth term which is your hundredth expression okay now how do I solve this question let's say I call the sum of these terms as let me write f 100 as s okay write the same as 1 shifted okay subtract it what you end up getting 0 as 1 plus 1 plus 2 plus 3 all the way f of 100 minus f of 99 will give you 100 if I'm not mistaken correct f of 100 f of 100 minus f of 99 will give you a hundred correct and this finally is minus f of 100 so take it on the other side so f of 100 will be 1 plus summation of 1 to 100 which is 100 into 101 by 2 so answer is 1 plus 5050 which is 5051 easy question you should have got it okay any questions here anybody okay let's move on to the next a function f of x is defined for all real x if f of a plus b is f of ab for all a and b are as inputs to the function f of minus half is minus half then find f 1005 okay Richard both the Richard's okay good okay Keaton okay let's check this out see let's say I put a as 0 in this let's say I put a as 0 so I'll get f b is equal to f 0 correct even if I put b as 0 I get f a is equal to f 0 okay what does it imply it implies f a is equal to f b for any a and b for all a and b right correct that means any two values you put there equal what does it comment on the nature of the function it comments that this function is actually a constant function if it is a constant function f of 1005 will be same as f of minus half the answer will be minus half only okay this is no clear cut defined way to solve it it's up to you how smart you are in lateral thinking that you can solve it okay the real fun in maths is when there is no method known to solve it and you're trying to solve a question okay else maths becomes physics and chemistry which is driven by laws and rules math is supposed to be an abstract concept that is why these topics are favorites in Olympiads is that fine can I move on to the next question any question that you would like to ask I'm just giving an exposure it's not like you know I can take all the different types of functional equation question no I'm just giving an exposure how to deal with such situations f of x satisfies f of x plus f 2x plus f of 2 minus x plus f of 1 minus sorry f of 1 plus x is x for all x belonging to real number find f 0 find f 0 correct here yeah I can read your message because yeah I can read your answers I can see which is things answer because answer he has answer which is thing we'll discuss yeah we'll discuss it others please respond okay Chaitanya I got your answer see sometimes what happens when the power goes off and I'm thrown out of the call it doesn't allow you to send messages to me so what is the approach here correct Ruchir Parik so what is the approach here you put x is 0 so if you put x is 0 you get f 0 plus f 0 plus f 2 plus f 1 is equal to 0 okay that means to f 0 plus f 1 plus f 2 is equal to 0 then what do you do you put x as 1 because you want to know f 1 and f 2 also so let's try putting x as 1 so f 1 plus f 2 plus again f 1 plus f 2 is equal to 1 that means 2 times f 1 plus f 2 is going to give you 1 which means f 1 plus f 2 is equal to half okay and from here I know that f 0 is negative half of f 1 plus f 2 so clearly your answer will become minus half into half which is minus 1 4th so if you have got minus 1 4th your answer is absolutely correct those who got a half or a minus half please check where you went wrong okay easy okay next problem if a function f satisfying f x y is equal to f x by y for all positive real all positive all positive real x and y if f 30 is given to you f 30 is given to us 20 find f 40 absolutely correct here because kdg adhrik ruchar parek padyat so how do I get this very simple if you want to get f 40 try writing 40 as such a combination which will give you 30 in its result so I think I can write it as 40 is 40 can be written as 30 into 4 by 3 right so if I write it like this I can write it as f of 30 divided by 4 by 3 that means 20 into 3 by 4 that's 15 15 is the right answer for this okay easy let's move on to the next okay this is our old function that we had derived which had proved a little while ago f of x is a polynomial function satisfying this condition f 4 is 65 find f 6 excellent okay again very easy question now you know that a function that satisfies this type of equation is of the nature x to the power n plus minus plus 1 now if f 4 is 65 that means you're claiming that this is 65 that means 64 is plus minus 4 cube oh sorry I already taken yeah yeah this can only happen when you have taken your sign as a plus okay sign should be plus and n value should be 3 that means your function is revised as x to the power 3 plus 1 so f 6 will be f 6 will be 6 cube plus 1 which is 270 absolutely correct any questions here easy next f is the real valued function says that f of x plus 2 f of 2000 by x is equal to 3x find f of x yes any success anybody f of x in terms of x what else what type of question f of x will be in terms of x only no or without x also it can be can be constant also no that's not correct which is saying but good you tried others correct sorry through I'm habituated to say Dhruva because of one student that we have correct Dhruva ah no because KTG also no what is the full form of KTG that it's Keethan Gopal Rishnan sir KTG I've heard of somewhere bike is it a bike those bikes so that's KTM those stupid of me sorry KTM okay see guys when these kind of questions are there the simplest way to solve this is one equation is this other equation is you replace your x with 2002 by x okay you can play with your inputs so this side will become f of 2002 by x and this side will become back f of x and of course this will become 2006 by x right correct now think as if you have a simultaneous equation x plus 2 y equal to something and y plus 2 x equal to something and you want to solve for x correct so what I will do is I'll multiply this with a 2 okay I'll multiply this with a 2 so I'll make it as 4 f of x plus 2 times f of 2002 by x plus I mean 12,012 whatever is it okay I think I put more zeros than required okay anyways we're now going to subtract the two results we're now going to subtract this result with this result okay so 3 f of x will give me this x minus 3x divided by 3 so your f of x will become 4004 by x minus x so this is your answer so your function is 4004 by x minus x this is a very commonly seen question okay it's not a difficult one is that fine any questions here anybody can I move on to the next one let me know once you're done with this done copied yes okay done I think Ruchir Singh is correct because that's not correct Ruchir Parik is correct oh I hope you have regained the internet now Baram yes it's back okay let's discuss this see here you can play with your x and y right you can play with your x and y now what I'll do is I will choose my x and y relation in such a way that this input here becomes same as this input that is I'll choose my x and y relation in such a way that 2x plus y is equal to 3x minus y in other words I'll choose y as x by 2 if I do that see what will happen this will become f of x this will become f of x square by 2 this will get already cancelled with this so I'm not writing it and this will remain 2x square plus 1 so directly you can get your f of x as x square by 2 in fact minus x square by 2 plus 1 this is your x so ultimately the trick was to substitute this in place of y let's take a slightly more difficult question on this then we can wrap this up so it is known that there is a function from natural numbers to natural numbers in fact I'll include 0 also so from whole numbers to whole numbers okay and 0 means including 0 natural numbers including 0 okay better I like whole numbers only else people will get confused so there's a function whose domain and co-domain are whole numbers and this function satisfies this criteria f of x square plus f of y y is x f of x plus y f of x square plus f y is x f of x plus y for all x and y belonging to whole numbers find the function correct Ruchir did you guess it use y as equal to 0 otherwise orders sound something like a because no yeah kind of guess is that yes okay correct Chaitanya correct KTG okay anybody wants more time or should I discuss it correct param let's discuss this I'll do it in a very rigorous way I think some of you would have also guessed it let me do it in a very rigorous way okay let's put x as 0 and y as x let's let's put x as 0 and y as x in the given in the given functional equation so that will give you f of f of x is equal to x f of f of x is equal to x let's say I call this as one of our findings now let me put x as 1 and y as 0 let's put x as 1 and y as 0 so it'll give you f of 1 plus f of 0 is equal to f of 1 right okay now let me do one thing let me take f of f of 1 plus f of 0 as f of f of 1 that is known to be 1 and here it really known to be 1 plus f of 0 because of the property number 1 see f of f of x is giving you x so here f of f of this guy should be this guy correct and here f of f of 1 should be 1 what does it mean it means f of 0 is 0 that means f of 0 is 0 no problem so far okay now what I'm going to do is I'm going to put x as 1 and y as f of x in the very same equation in the very same functional equation I'm going to put let me let me take it on the upside as I'll lose a track of it let's take x as 1 and y as f of x so this will give me 1 plus f of f of x it will become isn't it that is actually x and this will become f of x plus f of x oh my bad x is 1 right so f of 1 1 f of 1 f of 1 plus f of x so far so good okay now what does it say it says f of 1 plus x minus f of x is f of 1 always let's say I call f of 1 value as a okay let's start putting the values when you put 0 f of 1 will be a plus f of 0 f of 0 is known to be 0 so f of a is a f of 2 will be f of 2 will be put x as 1 here so it'll be 2a f of 3 will be 3a and so on okay so it gives me a general feeling that f of x would be xa correct now what is this a I have to figure out what is my a for that I can put this in the original equation I have so in the original equation in the parent equation that has been given to me I'll put these inputs in ax and find it out so my f of x is known to be xa so if I use here it becomes x so a times x square plus a times f of y f of y itself is a y so I can write this as a square y correct is equal to ax square plus y so if I see this condition I'll get a square is equal to 1 right so my a has to be plus minus 1 but it cannot be minus 1 because if it is minus 1 f of 2 would have been minus 2 and minus 2 is not allowed in the core domain so it can only be 1 right if it is only 1 your function here would actually be x this is your answer is that clear a very rigorous way to do it most of you would have taken a guess am I right how many of you did it rigorously very few I did like half rigorously half rigorously okay let's take another one again these are not easy questions let me tell you probably if you get them them in j advance the only option that you have is to take a clever guess so there's a function from integers to integers there's a function from integers to integers this satisfies we satisfies this condition f of f of n plus 2 is equal to n okay and it is also known that f 1 is 0 find f of n correct Mahit Richer Singh Richer Parik Vikas how did you guys do it correct pattern coming up okay yeah anybody who did it rigorously so it's my thing correct because I did it rigorously I don't know if it's correct yeah it's correct okay f of n is actually n minus 1 how do you do it actually now that I look at it and say it's kind of rigorous I don't think yeah if you put value in just start getting the previous summer okay so from there you figured out it's n minus 1 pattern yes okay anybody who did it without pattern I'm not saying that by knowing the pattern it's not correct absolutely correct anybody who did it without doing the pattern let's look into this in a rigorous way a lot of analysis is involved over here if you call this inside function as let's say g of n okay that means you are writing something like this now this is something which we call as f o g function isn't it so f o g function is equal to n right we know that n or you can say f of x is equal to x kind of a thing this is a 1 1 and on to function correct we all know that f of x equal to x even if your x is only allowed to take integers that will be a 1 1 and on to function okay no doubt about it okay now if composition of a function is one one and on to then tell me which one of them should necessarily be one one and which one of them should be necessarily be on to if f o g is one one which one of them should be necessarily be one one f no g yeah g is necessarily one one g must be one one g must be one one f may or may not be one one g must be one one because if g is not one one for two different values of the input g will show the same answer and f and hence f will show the same answer okay that will make the entire function become non one one or you can say uh non-injective right similarly if f o g is on to then which of them must be necessarily be on to f must be on to i think i had given this as a property to you when we did the types of functions please revisit those notes i think i had discussed with you uh in the chapter inverse functions because i was i needed this one one and on to concept to talk about inverse of the function okay so g must be one one okay and f must be on to now here one more thing that you'll see since g of n let me write over here since g of n is f of n plus two and if this is one one then can i say f of n must be one one yes sir and if f is if f of n is on to can i say g of n will also be on to in this short what i'm trying to say is that both these functions are one one and on to that means f n and g n both are one one and on to that means they are bijective and if they are bijective both are inverses of each other that means f and n are inverses of each other because they meet this criteria because they meet this criteria that means f o g is giving you an identity function right and they are both 1 and 2 that means f and g functions are inverses of each other I think till here nobody has any problem let's go further now it's given to me in the question that f1 is 0 f1 is 0 means what f0 is 1 sorry g0 is 1 isn't it because both the functions are inverses of each other am I right now g0 is what g0 is f0 plus 2 that means f0 is minus 1 is that fine agreed okay now since f of n plus 2 is g of n let us take let us take a composition with f okay so we have already seen that this isn't is already given to us right so what I'm going to do is let's not do this step this step is of no use let's start with f of n plus 2 is equal to gn let us replace n with f of n let us replace f with f of n so this will become f of f of n plus 2 is equal to g of f of n okay and g of f of n is known to be n yes sir that means f of f of n plus 2 is equal to n now replace your n here replace your n here by f of n plus 2 replace your n here by f of n plus 2 so what will happen f of n plus 2 I'm just writing the right side first on the left side you'll get f of f of f of n plus 2 plus 2 yes or no now remember f of f of n is given to us as n minus 2 from this equation so can I write can I write this term as can I write this term as the one on the right hand side as f of n plus 2 minus 2 plus 2 correct me if I'm wrong that is nothing but f of n plus 2 so what does it mean it means I have gone out of space it means f of n plus 2 is equal to f of n plus 2 now start putting some values let's start let's start our value with some let's say I start with a zero okay f of 2 f of 2 is f of 0 plus 2 f of 3 is f of 1 plus 2 f of 4 is equal to f of 2 plus 2 f of 5 is equal to f of 3 plus 2 and so on if I go on all the way till f of n it becomes f of n minus 2 plus 2 add them all you would realize that when you're adding terms starting from here will start going off this will go off with this this will go off with this okay yes or no so what will be left ultimately what will be left ultimately can I say f of n minus 1 will be left here and f of 0 and f of 1 will be left here so what do I get from there what do I get from there f of n minus 1 plus f of n will be equal to f 0 which is already 0 f 0 is minus 1 because there only sir oh f 0 is minus 1 and f 1 is 0 right so this term will go off completely what was f 0 value minus 1 yeah f 1 was 1 and how many 2s will you get so f 1 is 0 oh f 1 is 0 f 1 is 0 and how many 2s will you get n minus 2 n minus 2 plus 1 so okay minus 1 but does it help me to get f of n I'm still left with f of n minus 1 right yes so post this I think we need to check the pattern I think I mean we did all this thing to get back to the pattern checking n plus so f 0 is known to be minus 1 f 1 is known to be 0 f 2 would be 1 1 yeah I think is there any better way to reach the result after having got this relation it's a recursive relation can can you try x square minus x minus 2 is it factorizable no no this factorizable no yes so x minus 1 and we get x minus 2 right no sorry you take x x minus 2 plus 1 x minus 2 yeah x plus 1 and x minus 2 is equal to 0 so I think I got it from here so once we added those things if we add everything we get f of n plus f of n minus 1 is equal to 2 n minus 3 and then we add we added those things that you got right all of those they add up to f of n plus f of n minus 1 is equal to 2 n minus 3 you're talking about yes when we added all these equations we got f of n plus f of n minus 1 is equal to 2 n minus 3 okay and then when we substitute n as n plus 1 we get f of n plus 1 plus f of n is equal to n minus 1 and then we subtract these two and we get a constant value so we'll get it's a linear function f of n plus f of n minus 1 is 2 n minus 3 f of n f of n minus 1 is was it coming yeah it's n minus 1 times okay 2 n minus 3 correct yes so now we take n as n plus 1 so then we get f of n plus 1 plus f of n is equal to 2 n minus 1 okay then we subtract the 2 so we get f of n plus 1 minus f of n minus 1 as or 2 and that's a constant value so it doesn't depend on n so that is a linear function if you get f of n plus 1 minus f of n minus 1 yes that'll be equal to 2 so it's a linear function then anyways we got here no how do you see it's a linear function oh yeah sorry sir I'm not excited okay now see one thing that I can say here is it is alpha minus 1 to the power n beta 2 to the power n this is your f of n f f 0 was minus 1 right f 0 was minus 1 so alpha plus beta is minus 1 and f 1 was 0 f 1 was 0 okay so if you added beta becomes minus 1 third okay and and and and and alpha becomes minus 2 third so minus 2 third minus 1 to the power n minus 1 3rd 2 to the power n is your f of n okay let's check what are you what were you getting for f f 1 was 0 right yes is it coming out to be 0 yeah f 2 what were you getting for f 2 on f 2 was 4 by 3 so then it's not correct no no no it starts becoming corrupted so why did you take this to be f of n though actually I was trying a recursive relation so this is something called the auxiliary equation but you need not know all that thing anyways see in this case in this case in this case I think you have to take a guess I have to you have to take a call with the pattern so there's no other route to that so if you use that telescopic sum you'll only end up getting stuck with this relation so yes f 0 is minus 1 f 1 is 0 f 2 is 1 that will only leach to f n is equal to n minus 1 can't say anything but yes you can say from here that can you say from here that it's going to be a linear function can you say from this that is a linear function from here because quadratic term will generate a function of n right so as soon as you can prove linear then we already have enough because we have f of n is equal to y if you can prove it's linear then I think we can we can directly take in a function as a x plus b and proceed but is the question here is if a function satisfies a condition like this is it always linear let's say if you take a quadratic and if you subtract this will we get a n square minus b n and c will get cancelled off so this will become a yeah this will leave you with 2 n plus 2 into 2 plus 2 b which will leave a term of n at least yeah it has to be linear so Richard was not completely wrong yeah this has to be linear if it is linear then yes you can go ahead and prove that it is n minus 1 so if it is a linear term then a n plus 2 plus b is equal to a n plus b plus 2 so 2 a plus b is equal to b plus 2 so a is going to be 1 okay and if a is 1 that means your function your function is n plus b kind of a thing and you know f 0 is minus 1 right that means 0 plus b is minus 1 so b is minus 1 so this function was n minus okay so these are the type of questions you can expect in advanced version it will not come in j e main for sure fine so with this we close the chapter of functions for you


Today I had the honor of speaking with a bunch of high schoolers to talk about mental health and life in general. So I want to take some stuff from what happened today and provide all of you with some tips. So stay tuned. What is up everybody? This is Chris from the Rewired Soul where we talk about the problem, but focus on the solution. And if you're new to my channel, my channel is all about helping you improve your mental health no matter how old you are. So if you're into that kind of stuff, make sure you subscribe and ring that notification bell. So here's what happened. Basically one of my very, very good friends, Nikki, pictured here with me, invited me down to her high school to talk to kids to help them out with the project. And since I am pretty much just working from home doing freelance stuff and doing YouTube and all that, like I was like, sure, I would love to. I was like, what's it about? And basically the kids are writing essays about coming of age, right? So they needed to interview adults about this stuff. So I was like, sure, I'm more than happy to come down. So it was an amazing, amazing experience. It was actually at Desert Pines High School.  But yeah, it was so cool. And there were so many great questions. I introduced myself as a mental health YouTuber. And I also threw in there that I used to travel all over the world for professional video gaming. I knew I'd get some people who want to interview me because of that. So yeah, it was cool. I did, I did two classes. And there was probably about 15 or 20 kids who asked me questions and things like that. So in this video, like, there was a lot of good stuff that came out of it. So in this video, I want to talk about a few of the questions that they asked me. So if you're in high school, or even if you're a parent out there, and you have kids, like, I don't care if they're in high school or middle school or whatever, like, there were some great questions. And I want to share some of my answers with them to the best of my knowledge. But I have, you know, a pretty solid life philosophy. So I think they'll be pretty accurate to what I shared with the students this morning.  And now I'm invited to go talk to kids at a high school. Like, what? Like, man, life is amazing. But enough of that sappy stuff. Let's start out with the first question, as well as some tips. So one of the questions that some kids ask me is, who inspires you, right? And I basically told them, like, I am inspired by anybody, anybody who has overcome challenges. So, like, a great example was some of my friend's students. I told them, I said, Miss Whaley, I said, she inspires me. So my friend Nikki, like, she, you know, she had not the best childhood and neither did I and stuff. But like, that girl hustles and works so hard. Like, when I first met her, you know, we were working together somewhere, and she was working and she was going to school. She's also in a band. And like, she chose to work at Desert Pines High School because she really, really wants to help kids. And like, I admire that, you know, like, I'm inspired by anybody who has gone through any type of struggle in their life. So I look at that. Like, I love seeing people who have overcome adversity. And I told the kids, like, if any of them have overcome anything, whether it's a rough family life or childhood or, you know, the loss of somebody, like, they inspire me because it shows me that somebody else got through it. So maybe I can too. So I don't feel so, so, so hopeless. So like, if you're looking for inspiration, just look for anybody, anybody who has overcome a challenge, because I guarantee you know people, like, even if it's just like, you know, getting out of bed in the morning and going to school or going to work, like, and, and you're depressed, like, that's overcoming a challenge. And like, that kind of stuff really inspires me. So the next question was, what's my view about success, right? And I told him straight up, I said, happiness is my view of success. So a lot of you who follow my channel, you know that Mac Miller passed away. And I talked about that. And I asked how many of them knew who Mac Miller was. And I talked about other people and things. I said, we have to look at that. And I'm so glad I got to share this with students at a young age, like, I said, look at these people, like, they are a prime example that money, cars, houses, you know, women or men, whatever your thing is, like, that doesn't always mean that you're going to be happy. So for me personally, I focus on the happiness and then the success comes after. Because if you can get this thing right, everything comes along with it, all the success, job opportunities, friends, family members, like, but you got to work on your happiness because the problem is that we keep chasing and chasing and chasing. And we're never happy because there's never enough. There's never enough money. There's never a big enough house. There's never a nice enough car, all this other stuff. So we need to start working on our own happiness and then get all the other things. So this question came up a few times and it was like, what do you wish that you could tell your high school self? And believe it or not, like, I think about this all the time.  And what I wish I could tell my high school self was quit caring so much about what other people think, like, I was so anxious and so depressed in high school, like, I never knew who I was. I was just trying to make you like me, right? I was a social chameleon.  And like, I was always trying to validate myself with other people's opinions of me. And if people didn't like me, it crushed me. You know what I mean? And like, I just today, today that took me so many years to figure this out, like, I have to quit valuing other people's opinion more than my own. So this is an inside job. Once we start working on ourselves and we're happy with ourselves, we know that we're a good person, then I can take or leave other people's opinions of me, right? I now accept today that 100% of people are not going to like me. Not everybody is going to like me. Some people just don't like big guys with a beard. That's cool, right? Some of you like my voice.  That's cool. You know what I mean? But I cannot base how I feel about myself on other people's opinions. I just got to do the right thing. I got to work hard. I got to be kind, generous, honest.   And maybe I had to go through that. Maybe I've had to go through all that people pleasing and stuff like that to get to the place I am today, where people's opinions of me mean very, very little. I will link up in the info card above how to quit caring so much about what people think because I dive deeper into this subject. Another great question was what's something that you're proud of? And you know, I introduced myself. I also said I'm a drug addict and alcoholic in recovery. I have six years clean and sober. So like I told them that it changed for me, you know? When I first got clean, when I first got sober six years ago, like it was just staying sober for a day. Like if I could stay sober for a whole 24 hours, that was a big deal and I was proud of myself because my entire life revolved around alcohol and drugs, right? But like I got to a certain point where that wasn't good enough because I still wasn't a great person. I was what we call a dry drunk. I mentioned it in another video I did the other day, right? I was still lying to people. I still have a lot of anger issues. I was yelling at people, all sorts of stuff. I was stealing all those things. So like I had to raise the bar. So today, today, like I'm not, you know, I am proud of myself for staying clean and sober this long, but I wanted to do more, okay? So I am constantly proud of myself because I live in a way where I wake up in the morning asking what I can give to this world rather than take from this world. So I'm constantly trying to do random acts of kindness, do nice things for other people. Like those are the things that make me proud of myself. So it's not, it's not based on the subscribers. It's not based on the views, right? Like did I make a positive impact in this world today? Those are the things that make me proud of myself today. And I wish and I wish I wish more kids could get that through their head, man. Like I'm so glad I got to talk to them like even if I was able to get through to just one kid today, one kid with a message like that, my life is complete. Like if I, can you imagine, you know what I mean? We'll just start teaching this next generation to, to try to give back to this world, to try to make this world a better place, to try to be kinder, nicer, more generous, more empathetic towards others. Like man, this world will be awesome. So I really hope that I was able to get through to just one person today. So this is another question, the last question that came up a few times, right? And it was, have you ever had to confess something, right? And like how did they help you grow as a person? So I told them, you know, I asked them all, I said, do any of you know any drug addicts or alcoholics? I was surprised, but not surprised how many kids rose to their hands. Then I asked them, I said, do you know any drug addicts or alcoholics who are in recovery? And there were still some hands up. So that's good. That's good news, right? But I told them, you know, part of my recovery process was in 12-step programs. And the 10th step in 12-step programs, part of the 10th step is, when we go wrong, we promptly admit it. And I live my life that way today. Like one of the reasons that I used to beat myself up so much and talk down to myself was because I was a bad person doing bad things. I was lying, cheating, stealing, all these other things. So the way I live my life today is, I know I'm going to screw up. I'm not a perfect human being. But when I screw up, I admit it like that, okay? My goal at the end of the day is to go to sleep with a clean conscience, right? So I'm constantly confessing stuff. Well, not constantly because I'm a better person today. I don't got to confess things because I'm not doing shady things. But confessing to me is also like apologies and stuff.  Like, there's times where I apologize to my son. Like, maybe I'm having a bad day and I might snap at him. And I promptly apologize to him because I feel bad about it. You know what I mean? So I think it's important that on a daily basis we're looking at ourselves and saying, do I have anything that I need to apologize for? Did I yell at somebody? Did I lie to somebody? What did I do? So I do that every single day because I'm trying to keep this thing free and clear of guilt and shame. You know what I'm saying? So anyways, anyways, that's all I got. And again, I am so, so, so grateful for the experience I had today. Like, I don't interact with high school kids that much. And like, man, like, I need to make more videos for these kids. Like, not the kids specifically that I talked to, but just for kids in general. Like, my high school years was when my mental health just completely deteriorated. And like, I make a lot of my videos. I think my primary demographic is like 18 to 26, something like that, right? But like, man, I love being able to help high school kids and hopefully teach them some life lessons that I wish. I wish I knew when I was younger. You know what I'm saying? So actually, tomorrow, tomorrow, I'm going back there to talk to two more groups of students. So that'll be interesting if some new questions come up. Maybe I'll do a part two of this video. And again, actually, let me say this. All of you desert pine students who subscribe to me or you followed me here on YouTube or on Instagram or Twitter or whatever, thank you. You are all amazing. And I took a bunch of pictures with the students afterwards and I told them to tag me in it. So if you took a picture with me, you better tag me in it at the rewired. So look, it's up on the screen again, just for you, right? But anyways, there's more that I could talk about. Maybe I'll do a follow up tomorrow anyways. But that's all I got for you. Let's do this. Let's do this for all of the adults out there, right? Or anybody who's graduated high school even. Leave comments down below. What's something that you know now, right? What's something you know now that you wish you could tell your high school self? I love that question so much. All right. So leave comments down below. But that's all I got for you. So if you like this video, please give it a thumbs up. And if you're new here, I don't know what you're waiting for. Make sure you subscribe and ring that notification bell. And a huge thank you to everybody supporting the channel over on Patreon. You are all amazing. And there's still some sweet rewired soul merch up in the shop. If you want to get your hands on some, boom, click or tap right there. All right. Thanks so much for watching. I'll see you next time.


Telo what's poppin? We are on twitch. We are live Still live. I've been on twitch since 12 1130 p.m three hours later Come join us if you want if not that's cool, man Just leave a like comment subscribe turn on your post notification bells Let's continue to grow the family from Chicago to the UK. This is lad Bible Clam one of my favorite channels This is 19 minutes with I spent 34 years in prison for a murder I didn't commit Don't forget we do got the patreon man. This is a list of everything that's on there I don't know why it's popping up like this, but you know Y'all get the point, you know, I'm saying don't forget the discord the discord is down below the link to it and Yeah, that's all I got to say man Get in it is man Was born in Onkin on the Isle of Man 1950 Alamanna self-governing British Crown dependency on the IRC. I don't know what Alamanna is. I just wanted to read it 54 Yeah, we need if you were discretion for this you think I So You feel me? Few weeks after I was baptized my mother left me and my grandmother's door pumpkin on the Isle of Man 1954 few weeks after I was Baptized my mother left me and my grandmother's doorstep and she left never to return to the Isle My grandparents made plans with the the church on the Isle the Catholic church To have me sent away. I was sent away to Ottawa, Canada in august of 54 To a place called the st. Joseph's orphan asylum ran by the great nuns of st. Joseph's orphan asylum The cross Which I always tell people sounds warm and fuzzy. I'm sure um, but I was only there St. Joseph orphan asylum was the center of child abuse scandal in the 20th What a name like that, you know, I'm saying about six or eight months That turned out that the girl who took me to Canada had worked for my grandmother named Martha Virginia Boswell Who was one of the Boswell gypsies that used to come to the Isle of Man? She saw that my future there might not be good She took me illegally and took me into the u.s. Eventually we ended up going down these seaborne communities and landing in phoenix, Arizona I was wondering why you had an american accident. Okay, that tells me that and um She had my grandmother had given her my her passport to tell me in case I ever wanted to find her It was like a cookie crumb But she had taken my mom's picture out put her picture in so she used my mother's name So I was raised under my birth name. I I believe she was my birth mother. I called her I called her mom She was the one that had told me all about my being from the Isle of Man And funny enough all throughout my life all I could think about was getting back home at some point unfortunately due to bad relationships and The problem that she had she had drinking issues that She got real sick and when because of some of the people she worked towards well to do one particular family that called the wetmores They had adopted a boy and a girl and they had plans to move because Dr. Wetmore had just gotten his degree and he was going to be teaching at a university And something happened to the boy and the boy was 12 years old Even though I was 14. I was small because I'm out of nutrition And um I could actually fit into a 12 year old's clothes and stuff So he told her he would give me a good life and adopt me and stuff like that and he said that he paid her to take my custody and um I was given that child's identity his name his date of birth his social security number all the things that you need to be a person and um If your business kept employees on payroll throughout the pandemic innovation refunds can so you Okay Nobody knows what happened to that child even the the u.s. Government. Yeah, like what where did he go? And had looked and could not find any evidence of that child after I took his identity Jamie with the wet moors after being adopted into the family is john wetmore So You know, but dr. Wetmore was unique in his own ways Him and I we he used to try to beat me and things and that he used to try to look in his own ways Him and I we he used to try to beat me and things And that's kind of believed that what may have happened to the other child's he may have done it And the other boy may not survive the biggest This honestly this already died the literally we're three minutes and 40 seconds in this sound like it could be a movie script It's tough for me and him was because I grew up with this idea that I was something special through martha Because one of the things she'd always told me remember was I was a man of the isle Son of the sea and a brother of the storm and I could weather anything because the storm around me is my brother So I could weather anything That's a that's a w That's a w uh Mine frame to live in right there. Whoever martha Salute one particular instant and was really the last time he did a beating Was that he beat me with a belt while he had me hold a tree out in the back And he beat me on my legs and my lower back and stuff And I wouldn't shed a tear for him and when he was done I turned and said is that the best you got and he backed away and went inside and stared at me He was used to breaking men I'm from an age of time Where whoopings was regular that sound regular to me To me in my mind But if you wasn't doing nothing to deserve that that's a whole different thing, you know what I'm saying That's tough I remember one time I was getting a whooping and and I turned around and looked at my mom like Are you done?  I didn't get a whooping since that day in his uh Way of don't whoop your kids people just talk to him all whoopings do is is is is tell your children Violence gets an answer violence gets it done So try to talk for business and and stuff So he was having a problem with this this child that could stand up to him and No matter what I wasn't afraid of him and that was something that scared him more than anything else I signed up for the united states navy um It was I had a lot of friends going in the marine corps at the time because I was still rather small I didn't think I could make a more be a be a marine. I didn't think I was big enough Yeah, but the other side of the coin I didn't want to hurt people So I decided to enlist as a navy corpsman, which is a medical corps. How was your um, Like state of mind after that. Did you see anything that particularly affected you or or stuck with you? Well, just the fact that if if anybody really thinks about the vietnam era Uh vets that were in that time vietnam was not a popular um politically popular Engagement you most people wouldn't even say they were Were vietnam vets they they we or they would or they went to hide Some hid in the streets as homeless and drunks and drug addicts Some went into the woods. Some went to canada. Some went down to the jungles of south america Um, because you just couldn't fit in in places like that I hid in the world of motorcycles. I prefer to be around Okay, I mean I get it. Okay I mean that's that's like You had to hide there, but that's a decent place to hide I guess right? motorcycles the people because I learned with people if you say one wrong thing The relationship can be ruined forever. Yeah, so My personal relationships with people Uh, we're never very good. So in halloween in 1977 um My wife my first wife had abandoned me my son when he was nine months old I had my son until 1978 and then My ex my my first wife she had decided her parents her parents decided we should get divorced And she should get my son even though she didn't want my son.  I'll give him the proper life that you I bet you you was absolutely not mr. Wattmore buddy I'll raise him to be a doctor or a lawyer But I wouldn't do it in a fit of anger. He threw an envelope at me And it had my my what my mom's passport and it had my baptism certificate for the island man And uh told me you're not an american. You're not my son get out of here I never want to see you again And then he switched sides and he made sure my ex got my son I met the other girl my my second wife through a friend's mind. She was related to and um I started Getting my life back together We had a son And I just I thought maybe it's time for me to find go back to the isle now. I've got proof that I'm from there Uh, so I was going to get a passport To go back and try to find my family I didn't know if my family is alive or dead or you know, who was who was there or whatever But I I felt this calling that I need to go back And I told my wife this what I want to do and she kept saying no, and I don't think that's a good idea I don't think that's a good idea And I told her look it's not like I'm moving over there. I'm just going to go over for a trip And I was good man. I forgot I completely forgot what the title of this was I spent 34 years in prison of a murder I didn't commit If you did that on the isle of man, I They're very strict over there, right? You can't even litter without getting time You better find the garbage can Going to go by myself because I didn't want her to come with me in case everything went terribly wrong you know, and uh, anyway come to find out Years later that she had actually uh been telling dr. Wetmore things I was doing And dr. Wetmore realized that if I did go get a passport He would be likely in trouble because they would ask where'd I come from. I don't have a birth certificate I'm using this other kid's name, but at this time I was starting to take back my birth name with a once I had the passport um So he realized he might be in problem At which point in time he set in play, uh, dr. Wetmore is very manipulative I'm telling you that he could be he could it was a movie on him A number of other situations that came about That would eventually lead me to prison Wait, what did I just hear? 23 Say it again since it came about That would eventually lead me to prison 1983 obviously there was a day that Probably changed the course of your life forever. It actually it was December of 82 I had met a girl named Jackie who had been Martha's youngest daughter and I thought my half sister because I thought Martha was my mom and her Uncle her dad's brother who has been caring for a guy named Stanley John Kearns And then she had a son named Danny and they were living in LLA and they wanted to move up to be around me So I helped them move up in the six months. They were there from December till June It was just terribly terribly wrong. Uh, John and I got into one argument after another He used to come down my bike shop and try to tell me tell me and my crew how to do things um A few times he was drunk and he pulled knives I'd get an altercation when I used to put him in choke holds To make him subdued and stuff And though police had gotten called because neither of us pressed charges and they weren't there when the crimes were happening We never got neither of us got arrested But it was in the history. They the police reports. So there was a history of this um So in June of 83 I was out of town. He got into an altercation with Jackie and uh started choking her son and my wife and Jackie at that time took both of them to pull his hands off the boy And then the following day or so he was driving the car and he started punching Jackie and she stopped the car and ran into The marjorie mason Uh women's center. I come back. I'm found. He's arrested. I tell my wife under no circumstances.  I don't want you to have to put up with him You know, uh, I said if he does get out of jail, whatever, don't let him in There's about about a month later. Um I come home and um My wife's car is not there. It's like 11 30 at night And this is in california still, okay? No lights are on in the house and we always left the light on if i'm out and um Walked in I have a manless stretched out on my floor And like said having been a corpsman having been a you know medical corps I checked him and he was dead And I could see he was dead Yet there were no wounds. Um A lot of people said oh, why didn't you call the police and my response has always been Here's a man I have a history of fighting with I'm a biker and at that time I was over the a motorcycle club.  Uh, what was his wife's name? At the end of the day the man of the house said don't let this guy in he let him in and that The baby's here And she said that after he collapsed she got frightened and she went to a friend's house And she's been there and then she finally figured I she'd come home in case I was home And uh, she knew I would be able to figure out what to do And we start driving. I have no idea where I'm going I don't really know what I'm going to do. I just have to get him away from the house Um I get it. That's your wife.  She's gonna do she did all of the wrong things though.  She didn't bring a shovel What are you going to do the body? Are you going to bury it? Are you going to burn it? Are you what are you going to do where are you going to dump it? What are you going to do for four and a half hours to drive and try to think I've got this harping in my ear And next thing I know I see false dawn starting And we were driving down a rural road where a lot of farm workers would be coming to work soon And I just pulled over and I took his body out and I set him up against a post Right off the road where he'd be easily found because again It wasn't one of these things where I was trying to hide the body I just wanted it away from my house. It couldn't be found at my house and then And this will be always one of the things people will say one of the stupidest things I did and I'm not going to disagree Figuring he just got out of jail. I didn't figure He would have identifications and stuff with him So I took out a piece of paper and pencil and I wrote in case of emergency Call and I let put my name and phone number and I stuck it in his wall drove him away because he couldn't be found at your house then wrote a note with your name and You know where you're going? Now me Looking from the outside in it's easy for me to say like wow a lot of this was dumb A lot of this wasn't the right thing to do a lot of this wasn't smart, but in the moment You know I'm saying he was in the moment And I can't even I can't even lie. It's still dumb. I love I wanted to be on your side so bad Left that and we drove away So it was about three days later and once again, though Let this be known No, the police called and I said they found his body And they asked me when was the last time you saw stanley alive And I told him I was about a month ago. Maybe you know at least three three few weeks to a month And so everything seemed to be okay except for The moment that they also had contacted jackie because she had been the victim in his threes he was in jail And told him that he'd been he found dead She immediately grabbed some of his checks because she he'd lived at her place And got with my wife and they went down and they cashed checks on his bank account To get back what she said was money he had taken from her from her welfare or what they would call the dole over here um But this is three days after he's been found dead and of course the banks have been notified And they're going in there with the checks signed by him It was just about 30 days from the time they'd found the body that they came and arrested my wife and Jackie and I Found out that they had been arrested the initial coroner's report had come back for death by strangulation and Though there was no evidence the fact that the history was there that I had choked him out and because I was You know physically capable of being able to do that It immediately turned to the fact they thought I did it but they had no evidence They went to Jackie and told her they were going she was facing 18 years for Forge checks when they told her she was going to face possibly 18 years She said a little let let she got in there like gunna She was a number like Jackie Jackie older singer she got singing on let me tell you what happened and they went tell us what and said well I want immunity da da da And the da said okay and said um, well, here's what really happened Sandy uh, his wife Poisoned the man and then he helped her get rid of the body And when they said poison They went what do you mean? He was strangled. They said no. He was poisoned. They went back Did the coroner's report coroner's uh inquest thing again and sure enough potassium cyanide had been And this is just this is getting worse and worse But it had killed him they now charged my wife with murder one with two it was in the pills the asthma pills It had to be but the wife Jackie had to have done that. That's Who counts the special circumstances each one carries the death penalty Drivers in florida are ditching their car insurance. They shouldn't because paying nobody in florida drive you know One for uh, the poisoning and one for getting monetary gain Because apparently Jackie had given her a little bit of money on the side too. They stop Even bothering with me except that every couple weeks they keep changing my charges around accessory conspiracy All this stuff Lying to the police which was their favorite one. They tried my wife in december Jackie was their primary witness um The jury came back 11 to 1 to convict my wife on murder one with special circumstances But they didn't have a a complete jury So they had a hung jury So the da came to me. Uh, what jersey? What what plea jury? So they had a hung jury So the da came to me gotta be new unanimism And said look, we're gonna We lost this bite this much So we're gonna do it again and i'm gonna make sure that we don't have any moral, you know problems on the jury Unless you you want to take this deal i'm gonna offer you i'm gonna offer you a one time and one time only deal And my what my attorney was sitting there My wife's attorney was sitting there and da was sitting there And he said we feel you're responsible for whatever happens there. So here's the deal We'll offer you a 13 year prison sentence And he goes uh Now you have 10 minutes to make a decision think about this 10 minutes Are you going to be able to tell your son that you allowed his mom to be put to death because you would not step up for her Yeah, dang ain't that coercant you can't do that though Oh, by the way, you got five minutes left um Who do you think you do better time in prison you? veteran biker Where your wife was just a housewife and a mom. Oh and i'll sweeten the deal. I will never personally Oppose any parole for you And her attorney said, you know, this is the best we can get So I took it I would do 13 years so my wife would be released How 13 turning the 30 photo from all of her charges I'm giving we got a minute and 30 seconds to explain what happened to my son My wife got released two weeks after I took the deal And because she'd been in the county jail for like six months with these other girls One of them introduced her to her brother and a few weeks after she got out. She was gone I took my son You took a plea deal you took a bargain bit my boy you took You took a deal So your wife could avoid that penalty of death And she did you like this I ain't even gonna get into the I ain't even gonna get into a man Y'all y'all you see what happens, man A boy was willing to throw 13 years of his life away so you couldn't Unleaf the state With this other guy the way the sentence had been is I was getting 13 years If I stayed out of trouble worked Good time all that but what started the downfall on that was About three years after I went in The california legislature changed the law took all the good time and work time away from Life term inmates Well now I can't do half time because now they've just took it all the way so now No, I'm looking at 27 to life I did half my life and two-thirds of my adult life in prison.  I'm too involved for part two. I need this now T. I don't even like comment subscribe turn on your post note. Hey, listen. I ain't a man


And now, an Ig Nobel Prize favorite moment, with Jackie Bond and Stanley Eigen. Sure, we said, but outside. Hi, we're Jackie and Stanley. We host the Ig Nobel Party. Our most exciting party was 2007 when Dan Meyer went for sword swallowing. After swallowing the sword, he asked if we wanted to see his protege David Kessler eat fire. Sure, we said, but outside. Minutes later, the police arrived. The end. The Ig Nobel Prizes honor achievements that make people laugh, then think. This historic Ig Nobel favorite moment video stars Jackie Bond and Stanley Eigen, who hosted many Ig Nobel after parties. The 30th first annual Ig Nobel Prize ceremony will be webcast September 17, 2020. Details about the Ig Nobel Prizes can be found at www.improbable.com.


Okay, so can anyone hear me? Okay, cool. So my name is Krzysztof Opasiak for some non-polish speakers. I think there are some. Christopher, Chris would be good enough. I work for Samsung R&D Institute Poland. I do some USB support in Tizen operating system. It's based on the Linux kernel, so we share the same kernel as most Linux distributions. Today I'd like to tell you a few words about debugging, let's say, the most common problems with the USB. It's not going to be a very, let's say, advanced talk. It's rather for beginners, some tips and tricks, what you can do to add use to some common drivers to work with your specific hardware or where to start debugging those drivers and what are the most common mistakes. So in the beginning I would like to give you some brief introduction to the USB protocol. Then we will talk a few words about the plug and play functionality, how drivers are chosen, what we can do with this. We will do some tips and tricks with the driver, how we can modify the kernel policy, what can we do to force some driver to bind to our device even if it was not designed to bind to this device and how we can sniff what the driver is really talking to our device, how we can get this. In the end, some summary and the Q&A session. So to clarify, this presentation is generally about USB, about USB devices management, about sniffing the USB traffic, modifying drivers policy. It's not going to be a talk about the KGB or TracePoint or any other kernel debugging techniques. So if you came here to listen about this, now it's the time to change the room to some other presentation, they are also cool. So okay, so we are everyone here to talk about USB. That's great. So USB basics. First of all, to talk about the USB, we have to learn a few things about it. First of all, what USB is really about? Some people say that USB is rather a network than a bus because it's about pretty the same thing as the internet. It's about providing a service. Of course, it's a little bit different level of service because we have rather storage, printing, internet, camera, or any other services, but they are all provided by USB devices. So in internet world, we have a well-known architecture client server. In the USB world, we have our USB host, which is the master on the bus, which is the device which is being used by the end user. And we have our USB devices, which provides additional functionality to USB host. So that's a little bit equivalent of the server from the internet world. Single USB device may provide multiple functionalities. Single device may be connected only to one host in the same time, but single USB host may have multiple devices connected. Okay, so let's go to some basic entities from the USB world. Endpoints. In TCP world, or generally in the internet world, we have the abstraction of ports to identify the application which we want to communicate with. In the USB world, we have, let's say, a little bit equivalent of that ports. It calls endpoints. Single USB device may have up to 31 endpoints, including endpoint zero, which is the only one which is mandatory. Each endpoint, apart from endpoint zero, may transfer data only in one direction. It means that endpoint is in or out. If endpoint is in, it means that it may transfer the data from device to the host. If endpoint is out, it means that it is able to transfer the data from host to the device. So we always match the direction from the host perspective. Endpoint zero is the only one which is mandatory. It is different because it may transfer the data in both directions. So in internet world, generally we have to choose between TCP or between UDP, depending on our requirements. In USB world, we have four different types of endpoints possible. First of them is the control one. This is the type which is reserved for endpoint zero. So each device is able to speak using the control transfer. It is the only one which is bidirectional. It is used to discover USB device capabilities. The next one, bulk, is the most common one and it is used to transfer a large amount of non-time sensitive data. It means that you give a package of data until, okay, send it when the bus will have time to do this. Next two are endpoints which are transfer types which are called periodic because they reserve bandwidth on the bus. Interrupt is used to transfer a small amount of time sensitive data. In this one, and in all those two, the delivery is guaranteed and in isochronous which is used to transfer a large amount of time sensitive data, there is no guarantee of delivery. So it's, let's say, more or less equivalent of UDP and it is used to stream audio or video through the USB bus. How does endpoint fits into device? Endpoints are grouped into interfaces. Interface is a group of endpoints which are used to implement some well-defined functionality. Usually we place, let's say, two bulk endpoints to have bidirectional communication channel. Interfaces are grouped into configurations. Single USB configuration may have multiple interfaces and all of them are available in the same time. Single USB device may have multiple configurations but only one of them may be active in the same time. All interfaces from configuration may be used only if configuration is active. Endpoint zero is the only one which is not grouped into any interface. It's always available. How do we discover the capabilities of our device? We do this using the data structures called USB descriptors. What are the most important descriptors? First of all, the device descriptor. The most important fields for us from the perspective of choosing a driver are the vendor information and class information. ID vendor is a number which you can get from the USB org. Of course, you have to pay for it. It's not free. When you get your ID vendor, you get the whole pool of ID products so you may release your products with particular identification. You may use this to choose a driver which is specific for your device model. But of course, this is not the exact model of the device. It identifies the model from the USB point of view. For example, if you connect your Samsung phone to the computer, usually you will get that this is the, let's say, Galaxy S2. Because all galaxies from S2 to S7 are backward compatible from the USB point of view, so there is no reason to update the ID vendor because your operating system is used to that ID vendor and knows how to handle it. Class information. The same class information, this triple, is repeated in interface because single USB device may provide multiple functionalities. Those functionalities may be totally unrelated. So that's why on the device descriptor, we can say, okay, use the information for each interface from the interface descriptor. What kind of classes we have? Generally, all the stuff which is well known, mass storage, a pen drive, audio class, application specific and vendor specific that are one which are used when you do Arduino or some other stuff, which when you develop your own USB functions. Human interface, of course, the mouse, keyboard, et cetera. Okay. Then we have three strings, the string which identifies the manufacturer, product, the serial number, of course, any of these strings is not mandatory. You can place whatever you want and watch out for the serials because especially for cheap devices, they like to be almost the same like one, two, three, four, five because yes. Of course, the information about number of available configurations. In configurations, we have information about how many power the device needs to drain from the host to use this configuration and the number of interfaces. Then we have our interfaces with the class information and the string describing the interface functionality and of course, the endpoint descriptor which defines the endpoint address and defines the type of this endpoint. Is it bulk, is it bulk, interrupt, ISO? And of course, the maximum packet size which can be sent to this endpoint. Plug and play. This is one of the functionalities that the user likes the most in USB because you may simply connect your device and it's working out of the box. So how does it happen? First of all, we need to plug in the device. That's the mandatory step. Without this, it's not gonna work. Then your host needs to detect the connection, set address because each device on a USB bus has a unique address assigned by the host in the beginning of the communication. Then you need to get information about the device. It means getting the descriptors. Choose a configuration and then choose drivers for interfaces. Yes. Generally, Linux chooses drivers for interfaces not for the device as a whole. Each interface may provide different functionality so we need a different driver to provide this functionality to the user space. Valid addresses starts from one and ends at 128. Address zero is reserved for the new USB device which arrives to the system and has not before we set the address is used to communicate this. Usually it's just simply the next available address and nothing more. Device details, it means that the descriptors or the information will be later available to you via CcFS and which configuration we should choose. First of all, if the device has one configuration, there is no problem. If the device has multiple configuration, we choose the first one which first interface class is different than vendor specific. The comment in Linux kernel says that Linux is not the most popular operating system yet. So we are more likely to have a driver for some well-known standardized communication protocol done for some vendor specific protocol. So that's why we by default choose a configuration which provides well-known standardized functionality which belongs to some class like human interface or mass storage or that kind of stuff. When configuration is chosen, all interfaces from that configuration becomes available to our system. So now we have to choose a driver for each interface but what this driver really is? First of all, it's a piece of kernel code described using struct USB driver. It usually provides something to the user space because user connected some device to use it functionality. We connect our pen drive to use the flash memory which is on it. So that's why we have to provide something to the user space. Something means block device, something's mean network interface, all that kind of stuff which can be used in a standard way by our operating system. The driver itself is really a implementation of some communication protocol because what driver really does is just packing the generic calls from the user space like send me this packet to that network address. It packs it and send it via the USB bus to the USB device. That's nothing more. How we choose our driver? We're in a standard Linux way. It means that kernel maintains a list of registered drivers and each driver declares a list of compatible device identities. Then kernel goes through the list and if find a match calls a probe function. What does it mean that driver declares a list of known device IDs? Well, we have destruct USB device ID and here are all fields which can be used for matching with the device identity. Those values are similar to those from the USB descriptors, from the USB device descriptor for example, the ID vendor and ID product. And the one field which is here, the match flags, it is used to define which of fields from the structures contain valid data and should be used to match against. There is also additional field which is used to declare what kind of quirks should be used for this particular device model. It means that some device, generally we have a generic drivers, but some models of devices require some special handling. So drivers places information about required special handling in this field and that's why they can use the same driver it may be used for let's say multiple, quite similar but not really the same devices. How does it look on a big picture? We have our USB device, the host controller, driver for this host controller, structure which represents the USB device as a whole and the generic driver which simply creates our interfaces. We have interfaces, USB drivers bound to those interfaces and something provided to the user space which can be used by our generic user space entities like X11 or our web browser if it's network interface. So everything happens automatically. It's good, generally it's good because it's exactly what users like but what if we need to modify somehow some parts of this policy?  It means that there is a lot of attacks which does for example the host finger printing and check which drivers are available and then find the vulnerabilities and try to exploit them. There is a bad USB attack which simply introduce your pen drive as a keyboard and try to execute some code. So generally in secure systems we would like to limit the number of allowed USB devices or maybe limit the number to the list of functionalities. So we would like to use only particular interfaces. What can we do if wrong configuration has been chosen? Our colonner colonel choose the configuration which has which class of the first interface is not vendor specific and what if you would like to change it? What we can do if driver has not been found or wrong driver has been bound to our USB device. First of all, all information about connected USB devices is available via CISFS. We go to CISBUS USB devices and what can we find there? We have three types of catalogs. First of them, it's called USB and some number here. That's the directory which corresponds to the host controller which is built in in our machine. The second type is the USB device. How those names are created? X is the number of host controller to which this device is attached. Then we got the physical path to the port to which USB device is connected. For example, this printer is connected to third port of root hub, second port of next hub and the third port of the last hub. It means that its directory name would be three, two, three. Simple. Then we've got directories which corresponds to the interfaces. It starts with the USB device identity and then we've got the configuration number and the index of the interface inside this configuration. How can we limit the number of allowed USB devices? We can use the kernel feature which is called the USB device authorization. What does it mean? Each host, each USB device has an authorized attribute. If this attribute is set to zero, then configuration for this device is not being chosen. It means that this device is relatively unusable until we authorize it. Each host controller has an authorized default attribute which is the default value for the authorized attribute for each new device which arrives to the system. So this gives us time to execute, for example, LSU-SB and check what we have really connected and based on that information, we can decide if we really want to use this device or not. All that stuff can be automated using the USB Guard project which is the security project which I'm providing filtering for the USB devices. What if you would like to, let's say, improve this and allow only particular types of communication? For example, we want to allow only pendrives but we would like to use this for multiple USB devices. What if our device provides together a pendrive and keyboard functionality but we would like to use only the pendrive functionality? Then we can use the interface authorization. Pretty the same as for USB device but there are some difference. First of all, when you use the interface authorization, configuration for your USB device is chosen. It means that in device hierarchy, you will see also the USB interfaces but those interfaces are not available for drivers or not available for user space application to communicate using the Leap USB. They are simply filtered, kernel checks if the interface is authorized or not. If you decide to authorize the interface, there is no automatic driving driver probing like it was in device authorization case. It means that you have to manually trigger probing of driver for interfaces. What we can do if configuration which is chosen by kernel is not the most suitable for us? Well, we can simply just go to Ccfs and change it. No philosophy, it's single right to this attribute. So now let's go to some stuff related to the drivers. We have some set of drivers, for example on some vendor kernel on our board and then some new device appears on the market. It is backward compatible with some old driver but this old driver doesn't have a suitable entry in device ID table. It means that it didn't declare that it is compatible with this device because the driver is older than the device on the market. Generally, we can recompile the kernel and simply add this to the code and that's the way we should go. But sometimes we may not have the source code or the config file or all that kind of problems or we just simply want to make it work now without recompiling the kernel and uploading it. So we may add some vendor ID and product ID par to the driver using the Ccfs infrastructure. What is, what we can really do? We can add a simple vendor ID and product ID par. We can add vendor ID, product ID and the interface class or we can add vendor ID, product ID, interface class and the device information. You remember the field from the device ID table I told you which is used to store some quirks for the devices. This is exactly the data format which can be used to reference the quirks from another device. Those two fields are used to go through the device table in the driver and copy the value of the quirks to this entry. Remember that all numbers here are interpreted as hex. It means that when you execute the LSUSB you will get the interface class which is vendor specific for example 255. But if you will try to write the interface class 255 it will simply get an error. You should use the hex format and simply write ff. We add new device ID in the driver directory. We simply write the new ID file. To show the list we may simply just cut this file and remove the previous entry using the remove ID file. If you would like to check which driver is bound to our device we may just go to the device directory and check the driver symbolic link. If you would like to unbind the driver we just simply write the interface directory name to the unbind file in the drivers in the driver directory or to bind a driver we simply write the... Here is an error, here it should be bind, not unbind of course. We simply write the interface directory name to the bind file. Okay, so let's try to do this. What I have here is the Android board. It's let's say a little bit equivalent of Galaxy S3. It has the USB chip from the Synopsys. I'm running their Tizen, but I don't serial console, okay. So this is the serial console from my Android board. I will use now config.fs, lib.usb.g and gadget2 to construct some USB device on this. Okay, I have just created the USB device and now I will connect it to my system. Okay, first of all what we should do is to check the dmessage for the details about our device and we have the information that new device has been found, the vendor ID, product ID, strings and here we have information that some driver has been bound to interfaces from that device. What we can do now is to use lsusb to check what we have really connected and this is the device. Okay, what we got here? First of all is the data from the device descriptor together with strings. Then we have information about configurations. We see that this device has two configurations. First of them contains the internet function and the second one contains the vendor-specific interface but I know that this interface is simply a generic serial function so it provides a serial port. For now what is available in my system is network interface. If I do if config minus a, I've got the USB zero interface. We saw in our dmessage that this USB device is connected to port three dash two. So now let's go to the CISFS. I am in CISboss USB devices and go to three dash two. Okay, this is my device. What I would like to do now is to show you for example the interface authorization. I will write zero to USB three interface authorized default. Oops, of course zero. It means that each new interface which will appear on this bus will be unauthorized by default. So if I now go to the device directory and do eco to be configuration value then the network interface disappeared because I changed the configuration to the second one in which the serial is available and if I change back to the first configuration in which the network interface should be available it won't be available. Still, because all interfaces for example this one is not authorized. To authorize this interface I have to simply write one to authorize because this function use two interfaces. I have to do this also for the second one and then I have to trigger the driver probing for that interface. It means writing eco and the directory name three dash two colon one dot o two minus n of course because this is anyone see error eco. Now it's fine and if I do if config I have the USB interface once again. We can do also the modification of driver probing policy. So we just go to let's say I told you that I have the serial function and for now this serial function is not usable because the generic serial driver doesn't bind to my vendor ID and product ID pair. So I may go to serial function serial driver, generic drivers, generic eco for FF which is the interface class. This is the vendor ID and product ID of my USB device as you saw from the LS USB output and then I simply may do this to new ID. And now if I go back here and do eco, of course let's turn off the interface authorization. So it means that each new interface will be authorized by default and we now have to switch the configuration to the second one because serial function is available in second configuration and let's check our dmessage and we've got new serial port, new TTI available in our system which means that generic serial driver has now bound to this interface. Okay, so we know how to force a driver to bind to our USB device but what if something gets wrong? What if our drivers start behaving unexpectedly? Probably we would like to debug it but it's pretty hard to debug a code if we don't know what happened, our problem. So that's why it's really useful to know what kind of data device is sending to our driver that it gets into the trouble. So first of all, let's start with a little bit of theory. USB bus is a host control bus. It means that nothing on this bus can happen without host first initiating it. So if our driver will not ask for data, it will not get them. The same with the control transfers and all kind of transfer. If host doesn't ask for data, device is unable to send it. On very low level, USB transport, the transfer is divided into transaction. Transaction means delivery of single packet which is sized up to max packet size declared in endpoint descriptor. Transfer is set of consecutive transactions from which all of them are maximum size and the last one may be the short one, shorter than available data. And the level on which our drivers operate is the transfer. It means a bound of data which is sent from host to the device. The level of transaction is a level of on which USB host controller driver operates or the USB device driver operate. So it's a, let's say, it's very lower level. The base abstraction in Linux kernel for the USB transfer is the USB request block. Kernel provides the definition of structure which is a kind of envelope for our data which is sent by the driver through the USB bus. First of all, we have a pointer to the device. We have the pipe field which is encoded of the endpoint number, so the destination of our data. Status field which describes if this bunch of data has been successfully delivered or there were some problems and the transfer did not finish. Transfer flags which can be used to modify some transfer behaviors. The buffer, so the data which we would like to send over the USB bus, length of the data and the actual length which means how many data has been sent before, for example, error occurred. If we are using the control transfer we have to additionally provide a setup packet. It's a predefined structure which simply contains couple of integers which are used to identify the request type. I send you to the USB spads to find what those numbers exactly means. And we have the context which is the pointer to be used by the driver as the context of this particular data delivery and of course the complete routine which will be called when this bunch of data will be delivered or error occurred or for example it has been canceled. To allocate the USB request blog you should use this function and free it with a suitable function because your host controller may do some mapping to the memory, et cetera. So that's why you should not allocate this structure on your own in the driver. So how does typical USB driver looks like? Generally we have three USB related functions. It's a probe functions. It's a probe function which is used to check the device and allocate the resources. Then we've got the disconnect function which is used to release the resources. Complete routine which is used to check the status which should check the USB request block status and many drivers doesn't check it. Get the data from the USB request block and resubmit the work. Why is it resubmit? Well, generally drivers doesn't like to deallocate and allocate USB request blocks all the time. That's why driver usually allocate a bunch of USB requests and then just simply reuse them only placing the data in suitable position. All other functions will be related to other subsystem which is used to provide the USB device functionality to the user space. For example in pendrive it will be related to the block subsystem. Typical box in USB device. Missing the scriptors. Well, first of all, USB devices can do really unbelievable things. That's how the box are being found. For example, using the fuzzer, the UMAP tool or something. It means that device can be very different than what you expected. For example, device with your vendor ID and product ID may have zero endpoints or may have endpoints with very different types than you expected. So each time when probe function is called you should check if the device provides really what you expect and you should check of course for errors. There is no error paths on missing entities. So for example, if endpoint is missing then driver tries to get this endpoint and it gets the null and we simply have the null pointer of the reference then later in the code. Driver has problems with correct error handling in complete function. It means that when the device disappeared in the middle of USB transfer there is null pointer of the reference or accessing the data which has not been sent by the device. This was for example, the case with the driver to display link. The open source driver to display links. And of course, USB drivers are implementation of some communication protocol. They are vulnerable to some malformed packages. So remember that if you are communicating with the device you should always do some sanity checking of sizes declared by the device. For example, when we ask about the configuration, the scriptor, we ask for the total size to allocate the buffer. Then we allocate the buffer and then we ask once again with a different size and we assume that the device will send us the same amount of data. It may not. So how can we learn what device sends to us? First of all, there are some hardware solutions. They are pretty good. The one from LSS is the one I have on my desk. This one is also really good. And what is the benefit of having them? They will not only show you the data on the transfer level, they will also show you the low level data from the transaction level. It means that they will show you how many knocks there was from the device, what is the delay between single transactions, et cetera. So they are pretty good, but as you see, pretty expensive. There is a cheaper solution. It's called the OpenVis SLA. If someone is using it, I will be happy to have a conversation about it. I heard about this project. I didn't use it personally. I'm talking about here because I want to find some community of this board because the project, let's say, it's a mystery for me. It looks dead, but some people claim that they are using this board. And this is an open source communication analyzer on FPGA board. So that's the hardware solution. Fortunately, we have a cost-free solution, which is called the USB monitor. It's a simple logger for events like submit-urp-complete and submit-error. So you can get all the data on the transfer level and only on the transfer level. You are not going to get the data about single transactions from here because it's a simple logger. It's nothing more. We have text interface, the binary interface, and there will be one instance of the binary and text interface for each USB bus available in your system. Having a text interface is great. Having a binary interface is also great, but writing your own program to interpret this is really not a thing you want to do to debug your USB traffic. That's why we should go and use the wire shark. But remember that there are two kinds of events. We have submit when driver submits the USB request, which means asks for transfer, and then the complete routine that the transfer has been completed. And the data is not always valid. If you have endpoint which is in, which is used to send the data from the device to the host, the data is valid only in complete routine. If you have out endpoint, which is used to send the data from the host to the device, the valid data buffer is only on submit function. So don't check the data if it is not valid. Okay, so now let's try to catch something in our wire shark. You remember that we have serial device connected to our computer, to my computer. So now let's open the screen. Okay, so that's the serial output. Now let's go to the, this is the device control. Now I will, it would be better to run wire shark now. First of all, to use the USB monitor, you have to mod probe the USB module. And when you run your wire shark, you will see couple of USB mode devices. The number of the device is the bus identity. We use the third bus, so I will start listening on the USB mode three. And because that's not only device which is connected to the bus, I get a lot of mess and I don't want to play with it. So I will simply just filter it using the device address and the device address for my device was LSUSB. The device address is seven. Equals to seven. Go. Now I will just simply send the test message from the device. That's the serial console to the Odroid. And as you see, it appeared in the screen. So my host received the message from the USB device. And if I go to the wire shark, I will see that the in data has been sent. We have, this one is complete because driver submitted the in orbs when I opened the serial TTI. So now I have the complete routine. That's exactly the message which I sent from the device to the host. And then I have another event which is ARP submit which means that driver is waiting for more data from the device. Okay, so that's pretty all. So just to sum up, to identify your USB device, you generally use the values from the USB descriptors. You can get them using the LSUSB. It's really friendly and useful tool. Remember to check it. Each driver binds to the device based on the cloud compatible USB device list. But of course you can modify this and you can sniff what your driver is sending to the device for free using USB mode. So thank you. I think we have some time for let's say two questions if there are some, yeah, are there effective? Well, okay, so the question is that I used wire shark and the question is about the commercial USB analyzers if they are effective. Well, yes, generally they are effective. They can do not only the USB transfers. So because the transfer level is the level on which USB drivers operate. But if you'd like to write a driver for a host controller or device controller, probably you'd like to not only know the level of the USB protocol, but also the lower level, the level of sending single transactions, resaving NOx, et cetera. Yeah, yeah, exactly. That's the stuff for which you should do the hardware analyzers to check them. Of course there are desectors also for the protocols on the top, like mass storage, human interface, et cetera. But wire shark usually also have them. Of course they are much better and the performance is better, et cetera, but they cost a lot. Okay. Well, I don't know your USB. The question is if we can use logic analyzers for the USB. So, okay, so just to sum up and the logic analyzer can be used if it is fast enough and you have a suitable software to define, to desect the physical layer. Okay, any other questions? Okay, so thank you very much.