What's up guys, my name's Michael and welcome to my YouTube channel. Today we're going to do the next problem, which is ternary XOR, which is actually a misnomer because the solution doesn't use XOR at all. But whatever, we're going to do this problem. So a number is ternary if it contains only digits 0, 1, and 2. So for example the digits 1, 0, 2, 2, 1, 0, 22, 11, 21, 2002. And the reason this is because they all contain only the digits 0, 1, and 2. So you're given a long number X, a long ternary number X, and you know that the leftmost digit is going to be 2. And the rest of the digits are going to be 0, 1, or 2. Well define the XOR operation of A and B as C is equal to A, X, or B of length M, where C of I is equal to A of I plus B of I mod 3. So what they're doing is they're going to take the digits, add the digits up, and then divide by 3. Find the remainder when they divide it by 3. So that's what they're doing here. This is actually not how the XOR operator works, but they redefined it as a ternary XOR like this. Your task is to find numbers A and B, ternary numbers A and B of both length N, both without leading 0s, that A ternary XOR B is going to equal to X. And max AB is the minimum as possible. So they basically want you to minimize the max of AB. So that basically means that AB has to be about the same, the magnitude has to be around the same. And you want to minimize that. So you want to minimize that. Alright so you have the first line of input contains test cases and the rest contains just ternary number X considered of N digits 0, 1, and 2. And yeah, it's guaranteed that sum of N does not exceed 5 times 10 to the fourth. Okay that's good to know.  So I'm going to show you guys how I came up with the solution. I got AC, which means if I had skipped a second problem, I probably would have solved this question and I probably would have scored way higher than I did on the contest. So without further ado, I'll tell you guys what you see in the pattern. Basically compare the inputs and then the outputs and then you will see the pattern. Let's look at the first input statement 22222. And then they split the 22222 into this A and B and we see that all the values are all ones. OK, so it splits the 22222 into<PHONE_NUMBER>1111111. OK so from the first input statement, I could probably guess that if I see a 2, I could probably split into 1-1. Just from looking at the first input statement. Okay, maybe that's right. I don't know. Okay, let's assume it is, okay? I still got the second input statement. Okay, so I have a two and they split the first digit two into one, one. Okay, that seems exactly like our first, what we assume it was, which is split the two into one, one. I see a one and they split into one, zero. Okay, so that means that if I want to have two numbers where it's the minimum of max A and B, right? One of them has to be larger than the other, but I want both of them to be as small as possible, if that makes sense, right? Yeah, okay, so that's, because I want to minimize A and B, but I want the, like I know one of them is gonna be larger than the other one, and I want to minimize both of the two numbers, okay? So that's what I wanna do. So this one, this one became one, zero, right? So that means I know the top one is gonna be larger than the bottom one. So I know A is gonna be larger than B, just I'm seeing at this. So if I see a one, maybe I'll split it as one, zero. Okay, I'll set the first of two strings. I'll set the first one to have one and the second one to have zero. Okay, maybe that will do. Okay, that seems reasonable. Okay, I see a two again, but instead of splitting one, one, I see zero and two. So there must be either, there must be certain condition that caused me to split the two to become zero and two instead of one, one in the above, in the above. Because we saw that in the above, they split into one, one evenly. So it might have to do with evens or something, I don't know. So that's what we have to think about. We have to think about this, okay? We have to think about this. Okay, then I see a one and it split between zero and one. Okay, that makes sense. That's exactly what we assumed that we got from the first number one. But instead of putting one on the top and zero on the bottom, they put zero on the top and one on the bottom. Okay? Well, what does that tell me? Well, I know that the first A is gonna be larger than B, right? Because they put a one on the top and then zero on the bottom for the second digit, right? So I know that what they're doing is they're making A larger value than B, okay? And then they put, instead of putting the larger digit of splitting the one into zero and one, they put the smaller digit of zero on the larger number. That's what they're doing, okay? So instead of putting the one, like the large digit of one in the larger number, let's see, in A, instead of putting the larger digit of one in A, they put the smaller digit, they put the zero in A and they put the larger number in the smaller number B. Right? Okay, I'm gonna reiterate that. It's the same thing. Okay, we saw from the second digit that they put the large digit one in A and the small digit zero in B, okay? When we saw one, they split it between one and zero. Okay? So what they're doing is they're saying this, they're making sure A is a larger number and B as a smaller number based on the places that they put, right? From adding, like, you know, comparing the values of ones and zeros. So they've set A as a larger number and then B as a smaller number. So when they saw the one again, instead of putting the zero in the larger number, instead of putting the zero in the smaller number, they put zero in the larger number, okay? So from this statement, I know that a certain condition happened and they're gonna put, to balance out the values of these two strings to prevent one to being super duper large and the other being super duper small, what they did was they put the larger digit, the smaller digit in the larger value and the larger digit in the smaller value, okay? If that makes any sense to you guys, I hope that makes any sense, okay? So that's what they did here. They did that the same thing for the next one. And the next one, instead of putting the larger digit in A, they put zero in A again, okay? So they put the smaller digit, they put zero in A and put one in B. That's what they did. They put zero in A and they put one in B. So they're not maximizing A. We know they're not maximizing A. Otherwise, they would put all the ones into A, right? They would put the zeros into B. So we're not maximizing the A as a larger size possible, okay? So what they're doing is we're gonna make sure we're balancing these two values of A's and B's to make sure that when I do a minimum of the minimum as possible of max A and B, that'll be the minimum as possible, okay? So that's what they're doing. They're making sure that these values are balanced, okay? Okay, so that's what we got from the second input string. Okay, the third input string, they put two. What does that tell us? Well, they split two into one and one. So that's exactly what we guessed in the first input statement. Whenever we see a two, we're gonna split to one and one, all right? Except in this case, in the second input statement, we saw that for a certain condition, this two split between zero and two, okay? So only in the second condition that this anomaly happened, so we're gonna ignore that for now, but we are going to come back to it later as we develop more of a pattern, okay? All right, in the third, in the fourth, the last test case, okay? We saw a two and they split between one and one. Okay, that makes sense. That's exactly what we saw in the other two statements. Then they saw a two and they split to one and one again. Okay, that makes sense, makes sense. Okay, we see a zero and they split between zero and zero. Okay, so if I see a zero, I'm gonna split it between zero and zero. So that's what we know now. Okay, so what we know, I'm gonna put a note. This is what we know. If C two split one one, split A to equal one, B to equal to one. If C zero split A is equal to zero, B is equal to zero. Okay, so digit, when I say A equal to zero, B equal to zero, A equals one, B equal one, this is like adding the digit, right? I'm seeing like, this is just like notes. Yeah, okay, let's look at the next digit. Two becomes one, one again, okay, that makes sense. Two becomes one, the next one is two. Two becomes one, one, okay. Two becomes one, one, zero becomes zero, zero, okay. Two becomes one, one, and then one becomes one, zero. Okay, well, this seems exactly what we saw already. So this like further solidifies what we saw. So we saw that one splits between one and zero. So if C one split one, one, one, one, one, one, one, one, and split to one and zero, except if, except later on, we put, we switch it to zero and one, except if, on the second condition, except if condition, whatever condition that happened in the second one, we are going to put zero and one instead, okay? So let's look back, we have to look back at the second, because this is the second input statement that is an anomaly to us, that is causing some strange things to happen, okay? So let's look back at it again, okay? If we see a one and a zero, they put one and zero, okay? So they have a larger number and they put one and zero. Then later on, there's a two here for some reason and I don't know why, but that's just how it is. Then they put, let's see, zero and one, for one, they put zero, one, but differently, differently. They put zero, one, differently. So they put zero into the larger value and one into the smaller value, that's what they did. So what our condition is, is right here, split into one, zero, except if already occurred, occurred put zero in larger value, one put one in smaller value. Okay, so let's look back at it again, okay? It must be a certain pattern that is occurring. Why did they put two here, zero and two? Why did they put zero and two here? Now that's the big issue. Why would they put zero and two here? And then why would they put zero and one here? And why would they put zero and one here again? Wait a minute, what do we see here? We see that in A, everything afterwards is our zeros and everything for B, the smaller value, everything afterwards is two, one, one. Wait a minute, two on one is exactly the same digits as this. So can we say that if we hit a one, zero, we put zeros in all of the values of the larger value and then put the rest of the digits in the smaller value? So that's what we're gonna say here. See, I'm not actually gonna put, so I'm gonna change this if C one split one, zero, zero. So I'm gonna change this, okay? We're gonna change this and say, sorry guys, if you already wrote this down, every time you see patterns, it could change. All right, so if you see a one in your digit here, put one, zero, put a digit one in the larger value, digit one in larger and rest zeros, then put rest of digits from input into the other string. Okay, so that's basically how you would do this problem. We are now going to go to the computer and then code this up. We're not gonna use my code. My code was just really long. So I'm actually gonna follow the editorials code because their code is really short and it's really efficient. So yeah, let's use the editorials code, okay? So right here, what I did was I created the input statement to T, which is the number of test cases. And then I had a string S and then a number N, okay? And this N is the length of the string. So I read in N and S and I did wild T minus minus and they're read at each test case, which is N and S from the input statement right here, okay? From these, okay? So what am I gonna do first? I'm going to loop from zero to the end, okay? So I'm gonna loop from zero to the end, okay? And then what am I gonna do? If my string at I is equal to, let's look at our C, let's look at the test case one, okay? If we see a one, then we have to put one in the larger and then the rest of the zeros and then put the rest of the digits from the input into the other string. So if we see a one, what am I gonna do? Okay, first of all, what am I gonna do? What am I going to do? Hmm, let me think, let me think, let me think. Okay, well, I need a large value, right? I need a large string and a small string. So I'm gonna to create string large and then string small. And I'm gonna fill these up with values from the our input statement.   Okay, this is just like, what's the problem here? Missing close parentheses, what? Something's not right. Wait, what is wrong with something? Smaller, larger, yeah, okay. And then what am I gonna do? Actually, I'm not gonna put a's, I'm gonna put zeroes. This is just like the beginning of, so I'm gonna create two strings and I'm gonna put zeroes. The reason why, because like zeroes is zero and then we don't have to deal with anything with zeroes because you have to, there's zeroes anyway in the string. So this is good for as a placeholder, all right? You can put anything. All right, so if we put, if we see a one, we're gonna put digit one in the larger number. So larger i is going to equal to one, okay? And then the rest are gonna be zeroes. So I'm gonna loop from, what is my current index? My current index is i. So I'm gonna loop from i plus one to the end and then set the rest as zeroes. Then I also have to set the rest of the digits from the input into the other string. So I'm gonna do a four int, let's say, j is equal to i plus one, j is less than n, j plus plus. So I'm gonna loop from here, this is the rest. I'm gonna put zeroes in the rest of the larger. So larger's at i is gonna be zero. Actually technically we don't have to put zeroes in larger because it's already zero, so we don't have to put that. So I'm not gonna put larger that because we already initialize larger to have all zeroes. So let's just leave that as it is. And then we just have to put the rest of the digits from the input into the other string. So the other string is smaller, so I'm gonna do j is going to equal to s at i. So smaller at j is the smaller string of the smaller string, right? And I'm gonna set each digit to be the same digit as our input string at i, okay? Or, no, not i, it's not i, it's j. Whoops, sorry, at j, okay? Smaller's gonna have the same values as the input string, okay? Okay, now we have to think about another thing. Oh yeah, then we should break because then we don't need to do this again. Yeah, we don't have to do this again after we see a one. We could just set it and then just be done with it, okay? Let's see. Hold up. Otherwise, let's do this. We have to set, let's look at the editorial code. Okay, so else, what they did in their code was do larger at i. They're gonna set all of them to zero, right? So what they did in the editorial is what, so if we see a two, so okay, so remember there's three cases, right? If we see a two, we split it to have one one. If we see a zero, we split it to have zero zero. And then if you see a one, we did what we did, right? We already did the case of if we see a one. So what the editorial did for the in case of a zero is that instead of checking to have two more if statements of checking, if we see a two, we split to one one. We see a zero, we split to zero zero. What they're gonna do is they're gonna set both of these values to have the value zero plus input string at i minus zero. So they're gonna convert the input string or input string into its corresponding number form. And they're gonna divide by two. So what does this do? I forgot a parentheses. Okay, so how does this accomplish what we do? So instead of doing two if statements, let's look at it. If we see a two, right, we're gonna split into one one. So what they're gonna do is they're going to, so how assignment works is actually left to right. So we evaluate the right side first and then we assign left to the right value. So let's evaluate the right side first. If we see a, so let's say we see a two, right? And our answer is supposed to be split it to one one. So what happens is if we see a two, we're gonna convert two into its corresponding number, which is two, right? If you subtract zero, the character zero, you convert the character two to become the actual value two and then we're gonna divide by two. So that will be the have a value one and then we're gonna add one with our character zero and then that'll set larger and smaller to have one, one one, one and one, right? Because we set smaller to have value one and then larger is gonna equal to smaller, which is the same value one. Now let's see what happens if we put zero, if we see a zero. Well, if we put, if we see a zero, then we're gonna convert the corresponding zero into its corresponding number character, right? Ascii value and we convert the character zero to its corresponding number value and zero divided by two is zero. And then so zero plus the character zero is still gonna be zero, right? So then smaller is still gonna equal zero and larger is gonna equal zero. So this is actually a cool trick that you could use to prevent using two more if statements in this case. They use a trick of computing it numerically so you don't have to put two more if statements. But yeah, this basically accomplishes it because if you see a two, it becomes one one and if you see a zero, it becomes zero and zero. Smaller and larger and smaller become both add zero, zero. So yeah, that's how this code works. Then after that, what we're gonna do is we are going to print larger and smaller. And L, okay. Oh, whoops. My fault guys, I'm keeping making mistakes. It's actually like this. That's actually, this is how you're supposed to initialize. Whoops, whoopsie daisies. Yeah, it wasn't the parentheses issue. That was just how you're supposed to initialize. You're supposed to put size and then the character you're initializing for a string. So I'm supposed to put size n and then all the characters that I'm initializing. It's not the other way around. Okay, yeah, now I got accepted. Okay, yeah, so that's how you do this problem. I hope I explained it correct with you guys. Now I have to edit this video. Rate, comment, subscribe, I'll check you guys later. Peace.


So anyway, these things are so stinking dry. Look at that. Like the paint doesn't even come out Yeah, that's that's the point. They're dry paints. Did you read the bottle? No, I mean I just threw them all away, so Right. Okay. Sure. That's definitely a good idea. Anyways, what are you working on man? What are you painting? I think I'm gonna paint another death guard. Oh good more death guard You mean like that thing you robbed me of a crystal brush with a few years ago like that kind of death guard? Yeah, I mean, what can I say the judges just identified the better painter, so I See I see that's what it was, huh? They identified the better painter. All right, John I see how this is gonna be look. There's only one thing we can do here. Okay, you're the better painter We're gonna have to settle this We're gonna settle this the only way we can high noon internet Dry brush showdown The strict technomancer that is Vinci V. Let us get to the technique and learn it Vinci V style Welcome to another hobby cheating video and as you saw this one's gonna be a little different So Ninjahn and I decided to do a little challenge with each other To see who could paint a better manager just using dry brushes now Dry brushes and dry brushing are often aligned as being something only for newbies or that's something that Display painters or high-end painters or I don't know pro painters or whatever stupid term you want to use look down on And I've always thought that's silly dry brushing is incredibly versatile as we're gonna see in this video So as I paint this emperors champion What I really want to show you is that this humble tool the dry brush comes in many different forms and can be used in many different ways so Let's get into it All right, so let's start out and actually talk about dry brushes they come in lots of different sizes some are more flat like these This is sort of the classic dry brush you often get from game companies Some have angles things like that, but they generally present a more flat face This is kind of the first dry brush most people have The other types of dry brushes around they have like large rounded tips These are often are makeup brushes or there's a specialty line from artists opus In either case They both have their different uses one thing I will say is don't buy gaming dry brushes Just go buy makeup brushes or cheap brushes. Don't overpay for a very simple thing Now since this is a dry brush only challenge Some of our very fine details, especially like things that need to be metallic present me some real challenges because if I get metal paint On things that it shouldn't be on it's gonna stand out So I'm actually just painting all the little steel stuff with metal first I'm also trying to work from the inside out Just hitting those tiny details and if I spill over like I did there with the red. I don't care I'm not gonna talk about paints those will scroll up in the top what I want to talk about here is techniques So here with the dry brush you notice I've worked almost all of my paint off like I mean I really wiped this on the paper towel And you'll notice that I'm just really grinding the paint in and that's the first thing I'll say when you're dry brushing one of the things you can do is simply Really get a lot lot lot less paint one of the things I usually see people go wrong with Especially people who are new in painting when they're dry brushing is they keep way too much paint on the brush It's fine. If you're doing some base coating type work like I'm doing here just to set the color for this Cloak to brown because I want to make it lighter and so I need to work it up So here it's fine to have a little bit more paint on the brush But often when you're trying to dry brush for fine detail or only hit edges you want to work a lot of paint off of that brush You'll see me use a combination of both flat and round dry brushes. We'll talk about why Here with the flats whenever I'm trying to do something That's a little more detailed that I want to catch just on the very very edges or using a more controlled fashion I'm using a flat dry brush because I can turn that sideways and use the flat edge of it to my advantage Effectively using it almost like a scraping tool to just scrape paint along the few raised surfaces that I want When I'm trying to do larger areas You'll usually see me go to the rounded brushes because there I have a lot more even application In both cases, I'm always wiping so much more of the paint off Then you think wipe until you think there's no paint left and then test on something like the back of your hand The natural ridges in your hand if you make a fist are the perfect place to test a dry brush For how much paint is going to come off and usually you'll be surprised You'll see how I'm using a dry brush much in the same way we would use layers here One of the cool things about dry brushing is that it can actually make blending really super easy Because if you just work up colors You'll naturally get some pretty organic blends each time I had less and less paint on the brush and each time I was using a brighter and brighter color Now you can also use dry brushes just to stipple or to edge highlight So you see here what I'm doing is a mix of both I drug very little paint across that leather hitting just the edges and then stippled in the middle to create a random pattern of wear Dry brushes don't have to simply move back and forth. You can also stab and dab like you see me often doing in this paint job Stabbing and dabbing is a perfectly fine use of a dry brush In fact the natural texture it provides can be very powerful You can use that to create things like some natural texture in metal or on things like armor You'll see people like Richard Gray actually use this quite a bit where he uses larger dry brushes to set down a base texture And then we'll sometimes layer paint or glaze over the top to somewhat soften it You still have the impression that it's not a perfect smooth surface and those little micro inconsistencies Create visual confusion that makes the blend look smoother than it is When the paint is applied completely Solidly on a layer. It's very easy to notice a break between one layer and the other When it's applied roughly with this sort of stippling motion like you see me using here or on the cloak It actually becomes very hard for your eye to distinguish inconsistencies in the paint layers because they're not even there's not a straight line between them There's a host of visual confusion that's tricking your eye into thinking it's much more much more smooth than it is You'll notice that I go back and forth between the stabbing and the swiping and that's really what dry brushing is stabbing and swiping and As I work smaller and smaller areas to build up my highlights You'll see how I never did a glaze or anything like that Of course, this is dry brushing only and yet even with whites I was able to build it up to a nice bright color and have it look rather smooth in its effect where I want it to Now a couple times I did get a little too much red or sorry white where I didn't want it onto my red symbol So I just went back and repaired that real quick again with almost no paint on the brush Now we're gonna start hitting the actual armor itself And there is no easier way to paint black armor than with some dry brushing By simply going over it with this light gray color I'm able to very easily pick out all of the edges and effectively edge highlight this guy in seconds now Note I'm using soft makeup brushes and as I mentioned earlier. Those are really the key Soft makeup brushes mean that you only deposit a very small amount of paint You can work it repeatedly Without getting any paint anywhere. You don't want it I want to jump in here in the middle and just say as you're watching this you're probably thinking It seems like you're going to a lot of effort in some steps when it would be easier to just use a different technique And that's exactly right because the nature of this challenge We had to stick to only dry brushes and dry brushing and that does create some fun limitations The point of dry brushing isn't to be used all the time like we're doing here. This is just a bit of fun Dry brushing is a tool a tool in your toolbox.  I'm probably working harder just for the purposes of this challenge But I hope you see all the different ways that this application that this brush that this technique Can be used and maybe integrate some of that in here Let's get back to the action. You see how as I continue to work the dry brush all over the figure I'm just getting all those edges and Because I'm always working in a motion where I'm not trying to hit every part of the miniature I'm basically working from the top down just as though I was almost zenithaling the thing basically with this One you see how little paint goes anywhere but the edge and two You notice how easy it is for me to create the impression of highlighted black armor I can however go back in with a darker color like I did here and dry brush in the opposite direction To control that shadow and tint it so by using this darker color and then working up or stippling I can actually then tint the armor of color in the same way I would with a glaze But I'm just doing it with a dry brush and it's a lot faster and a lot easier You just work with very very little paint now. I didn't want to get out my secret weapon this early But let's get into it The other thing to do with dry brushing is work on something dry dry pigment with a dry brush So here I'm using some straight black pigment to deepen my shadows I start by just applying a fair amount of it And then I use a brush that doesn't have any pigment to wipe it away and smooth it out Dry pigment is a fantastic tool with a dry brush You can actually just apply it push it into the miniature and then smooth it down It won't leave a whole lot on there But it'll leave enough to soft and soften the transition in the same way as a glaze that the best part is it's way easier Here I'm just doing some cleanup again You notice I'm using the flat dry brush here because I want to hit a specific area whenever I'm trying to be very precise It's time to get out the flat dry brush when I want to hit a bigger area a rounded tip works With the metallics I make sure to just go in and scrape them very very lightly There's very little metal paint on there And I want to leave some of the natural shadows of the matte paint to create my deep shadows With the other colors here where I want to hit the edges. It's the same trick as with the black So here I'm using this lighter brown and I'm just touching the edges and making sure that those details are popped Here I work with a very very very small dry brush, but effectively the same thing in the same motions When I want to create texture I start stabbing dabbing and moving the brush in random directions because then the pattern it leaves is Also random making it look very natural Working in shadows is as easy as taking a matte paint and then dry brushing it from below just like you saw me do with the armor Highlighting it is exactly the same thing again very little silver paint But I'm just taking it and very lightly touching it and pulling down from above The important part to remember here, and you're going to see it a lot as I work on the sword is Directionality matters One of the things you always want to be thinking about when you're dry brushing is what direction am I moving my brush? How is that angle and then whether I have a flat or a rounded brush going to interact with the surface? So as I work the sword you'll see not only do I work the sword only in a particular angle Notice how I only drag Horizontally across the sword and that's because I want those edges that are naturally sculpted to be catching the majority of paint as I create This non-metallic effect with a dry brush But also you'll see me rotate the flat brush to have more or less surface area of the brush touching the miniature This is another advantage of a flat dry brush versus a round one with the flat I can rotate it sideways and get a very thin working area effectively with the same color Creating a transition. So I started with a couple of swipes just all the way in an area Flip to the brush vertically and instantly I had a more tight highlight You can also edge highlight as you saw me do there just by dragging the side of your dry brush Now OSL effects are normally kind of a pain, but with a dry brush and dry pigment We can actually just easily create a simple blue glow down by this little Reliquary or whatever it is took some of that blue pigment worked it into the base of the thing and then worked it into the area around it Used and brush without any pigment to then soften that blue transition out and what we get is a nice soft blue glow in the shadows Once that's done I go back in with some steel and just very lightly dry brush over the metal to actually recreate the frame easy peasy So you can work back and forth when dry brushing to still create the same effect She would if you were being a lot more careful with a layer brush. It's just a lot faster The last thing to do is of course the base and this is pretty easy with the base I start with some dry paint dry. I'm sorry some dry pigment Scrape that all in get that brown up on his feet and up getting a little too much up there So I correct that but that's fine. So just tinting that all brown Work some up onto his cloak again. We want this guy to feel this is the embers champion, but he's on a crusade mission This is lengthy. It's tiring. It's exhausting. He's fought through the muck and the mire And the cool part is even though I got a little too much brown up there and softened some of my transitions I can just build them back in no problem I can also do some fun effects here with water. He's on an island. Let's say so with the dry brush This becomes incredibly easy To just of course pick out the texture on the base as well as create some nice color transitions in the water underneath Rocks and things like that. We all classically know are a perfect area for dry brushing and exactly where probably we most use it Never be too good to dry brush a rock that a miniature standing on. It's just the easiest effect and it looks great I can also go back to my stippling technique here where I'm just stabbing to create the effect of movement in the water Notice I don't want it to be super smooth I want there to be some kind of transitions and breaks and things like that because you can create texture You can create movement. You can create all those things just by the application of the brush So instead of trying to apply a smooth layer, which would actually be worse in this case I can just apply little stabs and dabs and create that transition When they work it in some red pigment and again pushing this up into the feet But especially in the shadows just to add more color to the lower parts of the miniature and some visual interest Dry brushing again with dry pigment.  There's no magic to this. It's the easiest thing in the world And that more or less has him ready to go I wanted to leave you with one final trick that isn't technically dry brushing I got a little bit of that red up onto his cloaks make it interesting, but I thought You know we said with the only brush work could be with a dry brush and that's fine, but we didn't say no cool water effects So I decided to get out some of my UV resin and have this guy standing on a little pond So I decided to create a little pool around him He's up on an island all alone and now we've got that nice transition of blue and red all over the miniature I thought hey, let's apply some of that UV resin You can smooth that out with a little brush or something similar once you've Gooped it on there, but it will self-level over a few minutes if you just let it sit there And then we just hit it with the UV light and it's good to go and with that That's gonna complete all the primary work on the miniature the last thing we got to do Black rim that base and there's no reason to switch from anything But a big dry brush for this one as we get in there and get that sweet sweet black rim on that many Mmm Always the best part and the greatest moment when you get to black rim that base Well, there you go. There's the finished model. I think he turned out pretty cool There's gonna be some pictures of him rolling here in just a moment Don't forget to go check out ninjans video. It's linked down in the description His channel if you're not already Give him a sub as well John is a truly great human being one of my best friends and just somebody I truly love And I thank him for offering to do this challenge it was a lot of fun and Honestly, I had a really great time painting this space green just with dry brushing It makes me think I could kind of do the whole black Templar army something like this Maybe with a few other techniques in there But thank you so much for watching if you liked this Hey, don't forget to hit that like button Subscribe for additional hobby cheating in the future. We have new videos here every Saturday Normally Saturday's happy Thanksgiving to those in the US And as always if you've got any questions drop those down in the comments, but as always Thank you so much for watching this one. We'll see you next time


and welcome to C-Tide, faster constant time C-Side. So what is C-Side? C-Side is a post-quantum key exchange protocol that is based on a group action on a certain set of elliptic curves. The secret keys sample from some key space give group elements and then we use the group elements to evaluate the group action to obtain public keys. What is C-Tide? C-Tide is a new key space and a new algorithm to compute the group action in C-Side. Moreover, our new algorithm is constant time and we verify this claim using Valgrind. In addition, we obtain significant speedups as compared to the previous best constant time implementations. So let's get started on C-Side. In C-Side, we use elliptic curves over a finite field Fp where P is chosen in a very special form. Then there is some mysterious abelian group acting on the set of elliptic curves in C-Side. All we need to know is that all these curves are represented by a moncomeriform, so we only need to keep track of this a coefficient. Then by construction in C-Side, for every one of these primes li, we have a group element in the mysterious group such that evaluating the group action can be done very efficiently using Li-sogenies. You can think of the group action as starting from one elliptic curve and by acting, being transported to a new elliptic curve. And isogenies are maps of elliptic curve. So starting from one curve, you map to another elliptic curve. Then the group action that we need to evaluate in C-Side is given by composing the small elements Gi that we know how to act with efficiently to get more group elements to act with. Moreover, we want to evaluate this group action in constant time. And what does it mean? We want to evaluate the group action in a way that the timing of the algorithm does not provide any information about the private key and does not provide information about the output. So that will be the goal for the constant time claims in this talk. First, we start with the new key space. Like I said, the group action that we want to compute, we want to compute the action by the small elements Gi taken EI times. So this information is captured in an exponent vector, which is just an integer vector. And these exponent vectors are sampled from some key space and we just need a key space to be large enough. In the original C-Side paper, you just take the same bound for every entry of the vector, bearing in mind that the resulting key space needs to be large enough. Sometimes you may want to only allow non-negative entries in your exponent vectors. And also because evaluation of the group action by Gi for different I's takes a different amount of effort, it's very useful to allow the bounds to vary for the bounds on the different entries of the vector to vary for efficiency. Now I'm going to explain to you how we change the key space in C-type. So for concreteness, we just take the C-Side of 512 prime just to have some numbers. So for every prime, there is a group element and we can look at the corresponding entry in the exponent vector. Then we batch these primes together. So we just pick any splitting of the set of primes and we consider all these primes as one batch. So we take them together and then we notice that this exponent vector is actually in the subset in which the subset of vectors, integer vectors in which we compute exactly three isogenes, three group actions for primes in this batch. And in which we compute exactly five isogenes, five group actions for primes in this batch and so on. To get a larger key space, we also know that the same exponent vector is in the subset where we compute up to three isogenes in this batch, up to five isogenes in this batch and so on. So this is our resulting new key space and it's not at all clear how this speeds up any of the computation, but the other, the second contribution of C-type is that we also change the algorithm to compute the group action evaluation in a way that we can really evaluate the group action for any prime in the batch efficiently. But to explain this, I first need to tell you how the group action is evaluated in general. So this is where the isogeny magic comes. So remember for all of these small primes, we have group elements that we can act with efficiently and the group action is taking from one curve to another. To get to isogenes, we know that this action is evaluated using isogenes that also take you from one curve to another. And isogenes are algebraic maps of elliptic curves. That is, if I have two elliptic curves, then the map is given by some rational functions, but they're also homomorphisms of groups. So if I have a point on an elliptic curve, then it gets mapped to another point on the new elliptic curve. And the special property that we will be using, that's inherent to C-type, is that if I take a point whose order is a multiple of Li, then if I evaluate it under the isogeny, I drop the Li in the order here. So the group action is given by isogenes and now I'm gonna give you more details on how to compute the group action. There are two steps. First, we find a point of order L on the first elliptic curve. And then we compute the isogeny with the kernel, that point of order L. The first step, finding the point, one easy way to do it is to just generate a random point of order p plus one. And then, which is rather easy. And then we multiply by suitable factor to get a point of exact order L. In the second step, computing the isogeny also splits into three different steps, depending on whether you use the value formulas or the scared value formulas. But in any case, we always enumerate some multiples of the point. Then we construct a polynomial that iterates over these multiples and takes the X coordinate. And then from this H polynomial, we somehow complete the coefficient of the new curve. The second part is really efficient. The second step, all of it takes less than six L multiplications in FP. But the first part is the crux of the matter because here is a very large scale multiplication. If the prime that we start with is a 500 bit prime and maybe we need to use larger primes for seaside, then this scale of multiplication is gonna be really much more costly than whatever happens in this intricate second step. The way to get around this is to compute the group action by several elements in one go. And hence only have to use this costly scale of multiplication once. What do I mean by that? Let's just do it on an example. Suppose we want to evaluate the exponent vector one, one, one, which means that we want to compute a three, five and seven isogenic. Then the procedure is similar. We first find a suitable point and then we compute the isogenes. But this time, instead of finding points of order three, five and seven, we find point of order three times five times seven. So from this costly multiplication, we get a point of order three times five times seven. And then if we compute the isogenes, we only ever have to do small scale multiplications to get the correct point of order three, five. And we also use that we can cheaply evaluate isogenes on points. And if we evaluate the isogenes on a point of order T one, which had exact order three, five, seven, then the resulting point drops the three in the order and has point of order five times seven. So in this way, we replace three very large scale multiplications by one large scale multiplication, two very small ones and two rather cheap point evaluations. And this is the way we evaluate isogenes, isogenic action always as a sequence of isogenes and pushing points through. The one disadvantage is that if you look at the timing, you can immediately tell that you computed a three, five and a seven isogenic because you know how long these individual steps take. Fortunately, it's very easy to adjust this algorithm or this procedure to not reveal which of the isogenes we computed. So how do we do that? Suppose we want to again evaluate a three and seven isogenic but no five isogenic. The only thing that changes is step for the five isogenic where we still do the same thing as before, but now we throw away the results. And remember the group action was moving from one curve to another. So if we stay on the same curve, then it's the same as not computing group action. But to fit into the flow, we need to make sure that the next step receives point of correct order. So that's why we use, we add a small line of code to always compute the correct multiple. Because then if you check it, this multiple then has the correct order and you can use it in the next step. So in this very simple way, albeit using dummy operations, you can turn the code that computes a three, five and seven isogenic into a code, a piece of code that computes any subset of these three, five and seven isogenes with the same timing. And in our paper, we formalize this into atomic blocks. So an atomic block is a probabilistic algorithm that computes the group action for any subset of indices in the exponent vector. In a way, the time distribution of the algorithm does not depend on the actual, on the input. So it does not depend on which curve you started with and it does not depend on whether you choose zeroes or ones for the exponents, but it only depends on the subset of the isogenic degrees if you were willing to compute. This might be a complicated definition, but we already saw it on the previous slide. We saw a way how to build an atomic block that always computed the three, five, seven isogenes. So the action by the first three elements in a way that didn't leak whether we actually computed or did not compute the isogenic. And once you have atomic blocks, it's actually rather easy to turn it into a constant time algorithm that computes the group action in C side. And so atomic blocks are a way to formalize the previous approaches to constant time isogenic implementation. Okay, so now how do we use these, how do we use this all computation with batching? So remember that for atomic blocks, we need to make sure that the information, the timing only depends on which of the actions we're computing and doesn't leak information about anything else. But with batches, there's one extra piece of information. We also need to protect which of the isogenes in the batch we use. Okay, so let me just give you the algorithm on how to extend what we just had, the computation for isogenes in batches and then tell you what we need to fix. So again, if you want to compute isogenes using batches, then we need to find a suitable point and we can make it so that the point has order that only depends on the batches and not on the individual primes. Then again, we need to take some scalar multiples. And in most of the steps, we can make it so that the procedures only depend on the batches. But you see that there's a bunch of scalar multiplications that depend on which prime in the batch we chose. And then there are isogenic evaluations that also depend on the isogenic, the actual degree that we chose. So those are the steps in red. Fixing the scale multiplication is easy because with very small overhead, we can just do it. We can just multiply by all the primes in the batch and multiplying by the chosen prime is done as a dummy operation. So that's with very small overhead. But how do we fix this five isogenic and this 11 isogenic? How do we do it so that this computation is the same for all primes in the batch in an efficient way? We could also just compute the three, five and the seven isogenic somehow and throw away the results, but that would be very inefficient. So the answer to that is the Matryoshka isogenic. And to explain it, again, we go into what actually happens when we're computing these isogenes. So to compute an 11 isogenic, we need to enumerate some multiples of the point. We construct some polynomial which is the product of linear factors that are taken from the x-coordinates of the points in step one. And then from this polynomial, we somehow derived this a coefficient. Well, but if we were computing 13 isogenic instead, we only need to add one multiple and we only need to multiply by one extra linear factor. If we do a 17 isogenic, then we need to add two more multiples and we need to multiply by two more linear factors. Or the other way around, if we're computing a seven isogenic, the code already computes everything that is needed to compute an 11 isogenic or a 13 isogenic. So for the primes in the batch, we can compute an isogenic for any prime in the batch at the cost of the largest prime, at the cost of using dummy operations. This Matryoshka property of isogenes, they somehow, you can just keep adding things to compute isogenes with larger degree. And this was already known. What is new is that we notice that this property is also for the new value square root formulas. And the reason why we're getting these speedups is that we realize that it's actually, this actually works well with batching because you don't want to, you don't want to pay the cost for a small isogenic at the cost of a large prime isogenic. But if you have batches, then if the primes in the batch have similar size, then paying the cost for a slightly larger prime is not such a big overhead. But of course, now you need to know how to set it up so that these batches actually give you the efficiency. Well, in general, we don't know how to set up batches efficiently. We don't know how to set it up because it looks like a very complicated optimization problem. Now, what we can do, we can estimate the cost of the whole group action evaluation for any batch configuration. So if you tell us, if we set up the number of batches or split the primes into batches and we give the bounds for each batch, then we can give a pretty accurate estimate of what the resulting cost will be. And then we can use this cost function to do a greedy algorithm to start from some configuration and adaptively try to change it so that we get a configuration with a smaller cost. And this way, we arrived, for instance at the, this is our best current batching for C-side 512. You see that the primes in one batch are usually pretty close to each other so that there's no big overhead. Remember that in batching, you pay the cost for the smallest isogenic is the same as the cost for the largest isogenic. That's why the first batches with small primes are rather small. And then you see that the batches get larger as the primes increase. And the one prime that's a lot larger than all the other primes is isolated because you don't want to pay the cost for this prime already for these smaller primes. Okay, we also claim that our algorithm is constant time. And beyond just understanding atomic blocks and having conceptually good ideas about how constant times should look like, we also use Valgrind to check it. So what can Valgrind do for us? We can check whether there's any flow from the secret data to any branches or any arrow indices, okay? So if you just execute your data, then the secret data might impact somehow the code execution. But if you declare them as undefined in Valgrind, then if they actually do impact the code execution, then Valgrind will complain. And then you can do a manual check and see what's happening with your code and fix it. So if do these checks with Valgrind, then you can have a pretty solid confirmation that your code does not leak timing information about secret data. Finally, let's talk about the speed of our C-type software. The green lines are the new C-type algorithm and here how to read the table. This is the size of the prime. This is the size of the public key. And depending on one or two in the third column, we either do the group evaluation or also public key validation for the C-type protocol. For the C-type protocol. And you see that if you count the number of multiplication, square, and sum additions, and depending on how you estimate the relative cost, every time we get significant speed ups compared to previous constant time implementations. We also measure the cycles on Skylake and even there, we also have a significant improvement. So to sum up, what is C-type? C-type is a new key space for C-side using batching. C-type is a new constant time algorithm to evaluate the group action using the Matryoshka isogenes. In C-type, we also formalize atomic blocks so we formalize the evaluation of the group action as a sequence of isogenes. We verify our constant time claims using Valkyrie and we obtain significant speed records. And you can see our article and you can get, most of all, you can get the code at our website. Thank you.


All right. Thank you. Welcome, everyone, to this brown bag on electric vehicles and plug-in vehicles and understanding the uptake of those. My name is Björn Nyckvist and I'm a researcher here in Stockholm Environment Institute that's in Stockholm for those listening in from other places. And with me today I have the presenter which is Frances Spray from Chalmers University. She's a researcher in this field and we actually share the same background from Chalmers where I was an undergrad and you also a while. All right. A PhD then. Yeah, it was a PhD and I was a master student but we have the same type of background in terms of undergrads. And so we knew each other back 10-15 years ago but and now we happen to be both in the area of electric vehicle research. So Frances did a postdoc at Stanford and now back at Chalmers as an associate professor. Assistant professor, sorry. And she will give a talk for about half an hour and I'll basically hand the word to you and yeah, mediate questions and pass the mic along later on. But I think we say questions to the end right for but if I guess there is an opportunity also during from the audience here if you have any pressing questions. All right. Thank you. Okay, so thank you very much for me to be able to present here. So as I said, this is a presentation about understanding potential plug-in hybrid electric vehicle and battery electric vehicle adoption through car movement data and it's I should say that it's a Swedish focus on it kind of. So the ones that are working it's not work just with me. We're a group working on these issues at Chalmers. So besides me it's also Stan Carlson who is associate professor and two PhD students, Niklas Jakobsson and Lars Henrik Bjarnsson. So they are highly contributing to the results that I'll be presenting today. So what we've done is that we've had the part of the work that we're doing that I'll present here is based on so-called car movement data projects that we have. So the idea is that when it comes to plug-in hybrids and battery electric vehicles how you actually use the vehicle is quite important both for limited range and economic viability. And so what we did was to start and especially Stan Carlson started the first work about gathering data of how vehicles are being used today. So car movement data. So the first step was between 2010 and 2012 in which about it was sent out to about over 700 vehicles but we have good data from about 500 vehicles in the west side of Sweden. I'll have a little bit more of a representative sample for that and we have GPS logging of how they moved around for average two months. Moving on we realized that when it comes to battery electric vehicles one important adoption group is households that have two vehicles because then you can address the limited range by having another conventional vehicle in it. So then the idea was in this one here we just logged one vehicle per household. So here was the idea to take both vehicles in the same household and log them. So we had about 100 households and about 60 of them with good data. And then this is an ongoing project that we're working on now in which we have taken these here the two car households some of them and replace one of their conventional vehicles with an EV and then log them while they're using the EV both the EV and the conventional vehicle to be able to see is there a difference in travel pattern between when you have one EV and a conventional vehicle compared to two conventional vehicles but we've also we are also performing interviews with these households both before and after to be able to see how they perceive having any be if this adoption has been any kind of problem and what differences they perceive that it is to have an EV versus a conventional vehicle. So just this is the first one where we have selected a region of Vestajötta, Lansdegunen, for those who are Swedish speaking this area here in Sweden because it is quite representative for Sweden in terms of city size distribution amount of urban and rural areas at least maybe not for up here in the north but yeah at least for where the majority of the Swedish people live. And all cars were selected that are representatives in terms of size fuel and location they're all privately driven so there are no company cars in here should be set out and it's one car in a household so it has if we look at this representation there's slightly more senior citizens that just happen to be there but not significantly more and then we have the vehicles have a higher annual VKT than the average slightly higher but the reason for that is also because we chose to have quite new vehicles so not older than eight years and they normally drive longer distances. VKT is vehicle kilometers travel so annual VKT so how much they travel and normally the average for all of Sweden is taken down because the older their vehicles are the less they are driven so we have up to eight years old vehicles and the reason why we chose that is because we presume that if you have any V the driving pattern is going to be more similar to a relatively new car than a car that is over eight years old that is maybe standing most of the time. So if we look at the different studies I'm going to present a little bit more in depth to of the studies in which we looked at the data briefly a third one and then just go with some preliminary results from the ongoing one. This one here we look at plug-in hybrid electric vehicles we use the first data set and we presume in this one we wanted to see if you presume in a plug-in hybrid electric vehicle that you would have like there would be an optimal battery size for that that you would have for them so in the plug-in hybrid you have a battery you have an electric engine and then you have a conventional engine as well and so we want to see okay but then you the question arise optimal battery size based on what and we started to looking at three different optimizations and one was the total cost of ownership savings for the users if you look at that the other was the maximization of total electric drive fraction so this we thought was kind of the user perspective is you would want to optimize total cost of ownership this we thought was more from a societal perspective so why do you want plug-in hybrid electric vehicles well you want to because you want to increase the amount of driving on electricity and so therefore we thought if you want to maximize this what would be an optimal battery size and then we instead look at well if you want to get as many plug-in hybrid vehicles in the market as possible what would then be the optimal battery size which could be from an OEM like from the car manufacturers perspectives or it could be in a more dynamic view is that you want to have many vehicles out in the beginning and just to get to market stimulate the uptake of it so before I go into our results I just want to point out a little bit what differences so we based our assumption a little bit on total cost of ownership like this trade-off of how much more battery capacity can be if you add another kilometer it can you get the savings replaced by that but when you look at that you see normally a lot of these analysis are based on battery price but battery prices will be very affect very differently depending on how energy prices are so this is actually just to show these actually individually optimized batteries it should say in this one because it's another paper in which we looked at that so not presuming that there's just one battery on the market but each individual driver has the battery size that is optimal for him or her and so these are averages and so you get if you look at you optimize there and you have different battery prices you see that you get a different share of PHEBs depending on if you're in Sweden Germany in the US so this is how even with the same battery price the influence of energy prices will have on the total cost of ownership what is the economic viability of the plug-in hybrid and so because of that well one reason for that we actually looked instead of marginal electricity distance instead so as I said at how much putting together some of these parameters that marginal and electricity driven per kilometer range and per year so what is the average distance for which one more kilometer of range is equivalent to the savings that you get for that because when you drive on electricity it costs less than driving on fuel and so this is just to show a little bit how it relates to battery prices because people are normally more common looking at battery prices as a economic viability and we see here again the difference between Sweden Germany and the US but in it what what I want to illustrate with this is in the current in the future graphs you'll have this parameter down here and so you'll see as this one gets lower it becomes better economic conditions for plug-in hybrid electric vehicles and so depending on which country is you can you can see what battery price it corresponds to so if you have this MED of 600 if you're in Germany well that's about the battery price maybe have about 700 but if you're in Sweden it's not even you would actually you are already down at around 500 you're already today you would have an MED that is much lower so that is just to relate it to you so you can understand the next graph which is actually our results so here are the results from that and which as you see so over here it's better better economic conditions for plug-in hybrid electric vehicles and if we see here this is the optimal battery size then so again presuming that there is actually one battery size just one battery size for plug-in hybrids on the home market and these are the different optimizations that I talked about so this is total cost of ownership for the users the black one here is electric drive fraction and this is the number of plug-in hybrids on the roads so what you see is if you want to optimize for the number of plug-in hybrids on the roads then small battery sizes are actually a bit more optimal well if you said want to optimize for electric drive fraction how long my share of the total kilometers driven you should actually go for larger battery sizes and then we see the effect if you look at well of course then if you look at the share of vehicles plug-in high if you optimize for plug-in hybrids they'll be more of them but the interesting thing I think here is this the potential electric drive fraction in which if you optimize for these then having many PHEVs on the road you get a lower share of electric drive fraction so there can be a trade-off between those two that having many plug-in hybrids on the road with small batteries can give us a smaller share of electric drive fractions should say one thing about this and that is what we've done one assumption here in these results that we've then looked that again to so we have presumed here that there's a small cost in going from what is today a hybrid a conventional hybrid which which cannot be plugged in to going to a plug-in hybrid and so basically we presume the case of which the Toyota Prius which has a hybrid model today and then goes in a plug-in hybrid and basically just adds a bigger a bigger battery to it and doesn't have to do any extra cost come connected with the driveline or increasing capacity so much of the electric engine we have another scenario in which we look at presumed that this cost is much higher and we we take it as an example the Chevy Volt which there is no equivalent hybrid along the way and which has a much larger battery and has much more capacity and the driveline is probably much more investment costs in it and if you add that investment cost then you actually have to have much lower MED costs a much better economic conditions for plug-in hybrids to to come true and then the differences between these scenarios are not so different that's because if you see if you if you shift this curve in this direction you would end up around in this area much more instead so this is presuming that the extra costs are going from a hybrid to a plug-in hybrid is not that much more than the battery cost so since I know there's not much time I'll move on and then I guess there'll be questions later and so that was plug-in hybrid electric vehicles then we wanted to look instead at battery electric vehicles and in this case here we we wanted to look at this this idea about multi car households and specifically then two car households and we wanted to see is there any difference between first and second car and in this case we define the first car as the car that's actually driven most in the household and the second car as the one that's driven less and so the idea is that first of all the second car we might our assumption was that the second car would be more suitable because it's it maybe doesn't drive as long distances so range is not as much of a problem and but then the question that the second question arose but if that's the case then maybe it may not be economical to actually shift the second car in this case we collaborate with Fraunhofer EC and besides our data they had a large German mobility panel in which they instead of having GPS measurements they had household survey of individuals movements and vehicles and this is just a little summary the first one here is from our data in which we see observation period is the mean is 58 days and the maximum 147 well they have all seven days so they only have one week of observations but just they don't have any slides with all our with equations and so on what they do then since 7th day is such a limited they fit those seven days to log normal distribution and use the log normal distribution to be able to update the vehicle kilometers travel to be able to do that analysis well we in our Swedish state actually extrapolate to one year from the measurements that we have so what we see here this is the Swedish data only here is the range of when we presume a certain range and we look at how many driving days are actually fulfilled so here we are presuming that you could only charge your electric vehicle at night nowhere no nowhere else during the day and so there what we see is as this blue line here is the share of cars in that we have looked that don't that have all driving days fulfilled so basically if there's a range of let's say 300 kilometers you go up there you're slightly close to 70% of all the cars it fits all their driving that they need to do these other lines here is if you accept that there are some days that needs some kind of adaptation so an average one day per month requiring some kind of adaptation in which you actually drive longer than the range is this light blue line and then you come up to one to two days per month and this is when you start getting per week and more than one per week and so these should actually at this line here some up to a hundred once you get or not really but almost when you come up to 400 kilometers there's some few some few people that have individual days ranging over 400 kilometers so that gives some kind of indication all vehicles in general if we look at this distinction between first car and second car in the two data sets we what we wanted to do we met this in days requiring adaptation so how many days do you need to have an alternative and this is a cumulative share of the vehicles so we see this is all cars here and we see this line up here is the second car so we see that there's a much larger CDF for the second car so there are many more second cars that have fewer days requiring adaptation compared to the first car which is down here which is an indication that when it comes to driving patterns the driving patterns of the second car are much better adopted to the limited range of the electric vehicle it said we have 120 kilometers range which is kind of based on the actual driving today of like actual range today of like a Nissan Leaf or Golf even if some of the stated ranges are longer and here's for the German data the German data is much smoother and that's because they base their calculations on a distribution in an hours on extrapolated data but the pattern is exactly the same that when it comes to second cars a much larger share of them have need fewer days requiring adaptation so then as I said our next question was then okay it might but it might be that they so they drive shorter distances and they drive less then maybe it's not economically viable to to have it as a second car so we went in and we looked at we made some conservative economic assumptions as discussed this with Bjorn who did battery prices we actually used much more conservative battery prices but just to give an indication and there we see that I mean the share of vehicles that are economically viable is the cars that they shift down dramatically but we see that the same pattern exists there that the second cars are the ones that are anyway best and the reason for that one reason for that should be said is that what we do is for the days that are not fulfilled we put an extra cost so we presume that if you want to anyway do that trip you get an extra cost of like renting a vehicle so we put up for each day requiring adaptation it is an extra cost in our total cost of ownership calculations and that means that since the first cars have more days that require adaptation the cost goes up for having an electric vehicle even if they might drive more on electricity and that goes through that the second car will be better economically so what in in this case here we have looked at the first and the second car as two independent two independent vehicles so we have not seen that we've presumed that what you drive with your second car you'll continue driving that and we drive with your first you continue driving that so no shifting in between the cars and so what we're in our in our second car measurement by measuring both vehicles we could actually see that because if you're going to shift trips you have to know be able to do that that the vehicles are back at the same house you have to know that it's possible to even to be able to do this so that's why we again looked at the facility and we looked at those who had two cars we wanted to have people that were commuting because that we saw was a potential group for for better electric vehicles and as these were the specifications of the cars so we wouldn't end up with big SUVs in which we thought we're not viable to replace anyways from electric vehicle and so we and we wanted both both right two people in the household who are actively driving so you have this kind of trade-off between the two so this is still on our analysis it's mainly Stan Carlson who is working with with this project but I just wanted to do it so these are the results here are this is if you replace the second car how many fleet average annual how much you would drive on electricity here's if you replace the first car and here is if you optimize between the two vehicles so you shift and the one so that you try to replace the vehicle that is best suited for an EV on that trip and so as we see there's a huge potential of actually increasing the number of electric miles if you optimize here and they're also making it more profitable for it but also having a better environmental impact and it should be said why the second car here is lower is compared to an in our previous result is because here we have kilometers traveled so they do travel shorter distances and that's why they replace fewer miles if you shift them towards I don't have no idea about time five more minutes yeah no okay but five is perfect and and so what the last five minutes when I do as I said so this slide here you actually look this is a potential that you can come up to but you don't actually know if people are prepared to shift between cars if in some households it might be that oh but this is my car and this is my wife or my husband's car I would never sit in it or you know I always have my stuff in the car I don't want to shift between them and so we actually wanted to to test to see how do households cope with this fact of electric vehicles how did they do it and I say why we are now working with replacing so we had one group ten be a ten households or in during the summer and we have ten more households now until January February and so we've carried out the first round of interviews and just these are very tentative results nothing that I would want to be quoted about because we haven't really done the analysis but from what we can see is that there is actually no major problem for adaptation they don't find it as problematic we've tried to ask is there any trip you've had to anytime you both go in a different direction and you know we've tried to see if there could be anything and they many answered no there's no problem with the range really because we have another car so we take that a car when we want to go on on long distance trips or one issue that's come up actually which is interesting is that towing is an important fact to have like this cat to be able to the capacity to tow which is also one of the reasons why for example when they've chosen which car to replace and things like that but mainly they don't perceive it as problematic some say yes maybe we've had to plan our trips a little bit more but it's not been a major issue but many so many are quite positive to electric vehicle they like it they don't feel that it's a major difference that they feel that it fits in quite well they are a bit unhappy about the range but that is because the range is not really like the stated range it goes down quite quickly so they they would want to have a little bit more but it's not been problematic for them anyway but when it comes to the question if they are willing to buy a electric vehicle many of them I say are very risk averse with that they are not willing to do the investment of actually buying an electric vehicle but are willing to lease and we know for sure that at least one of the families has actually gone in and lease an electric vehicle afterwards but if you ask them would you be willing to buy one they say no because they and the main reason for that is the high price and the risk of the battery that it will not have a long lifetime enough and they don't know what they can get on the second-hand market for the vehicle there's also a tendency what I call the clean conscience rebounds so it's not so much an economic rebound that the electric vehicle is cheaper to drive but they actually say that they use the EV a little bit more because you know you know it's an electric vehicle it doesn't it doesn't feel bad to drive it so so one couple had kids with driver's licenses that we're still living at home they're like yeah we would probably let our kids drive the electric vehicle more than the conventional vehicle because then it's an electric vehicle and feels okay so we otherwise maybe we would have said them take the bus but now I was okay that they took the electric vehicle some others that were in the countryside and they let their kids drive back to Gothenburg much more than that they would otherwise do because it's an electric vehicle so it doesn't pollute so you you can see that we haven't be able to quantify it to see anything on it but it's just from the interviews so there I think we're my extra my five minutes there this is just to say the other publication other studies that we are working using the same data sets around it looking at again battery sizes this is much more on the distribution of daily vehicle driving distances more theoretical paper and this is looking at the break energy regeneration so thank you so I'll just start with a question or two to get this going and then if you have more questions feel free to raise your hand so first thing I thought about was your total cost of ownership calculations what you include and perhaps don't include because there's a lot of things you could sort of account for lower service costs that insert that's quite uncertain and so I say if you want to comment a bit more on that and also in combination with that what you can say of the sort of current subsidies for electric vehicles and how they fare against this the cost level as you have looked at it so when it comes to total cost of ownership we have not taken into consideration maintenance and services at all so we have presumed that that's equal so it's investment costs and then it's running costs that we have taken into consideration into it and in the in the one for Swedish and German data we have for the Swedish case included the current subsidy for battery the supermiglia between me and Swedish so that's one of the reasons oh no I have too many things in my hands but and so what you see here is if you look at the shares here for Germany they are very very low compared to Sweden where you any can gay get around 12% and so on but here it's it's like one 2% so it's much lower for Germany and and when we've tried to look now I don't have my computer so I don't have the extra slide but when we try to look that at what is the effect of the subsidy versus electric the different energy prices we see that the effect is about the same so the fact that there are better condition economic conditions in Sweden is a combination and and it's about the same effect both the fact that you have a subsidy and when you start and the fact that the energy prices are different in Sweden so is that answers anyone who wants to yeah can you just clarify a little bit about what you mean when you say energy prices because there's lots of types of energy there's like oil biofuel and then electricity and it depends on each country so when it comes to energy prices we mainly looked at two and that's the average electricity price which the consumer actually pays for like private households average electricity prices for the household and then we've taken gasoline and diesel prices so I didn't go into it here but when we compare when we look at the vehicle if it's going to be a battery electric vehicle then we also have or if it's going to be a gasoline or a diesel vehicle so we have gasoline prices and in diesel prices I have a question on the methodology for the interviews what was said to the household that were interviewed because consumer behavior normally we don't like to change like it's really difficult to change habits so to what extent they were conscious of the potential benefits of trying out to optimize their use or was it really like here you have two cars this one is electrical this one is not try to make the most of it and they decide what's the most according to their understanding yeah so we actually also got questions from those that we were both interviewing and giving the vehicles in which they asked do you want us to drive a certain way or anything like that so we were quite open with that we said no we want you to drive it as if you would actually have bought the electric vehicle yourself whereas if it was so we wanted what we told them is that we want them to have as much normal driving as possible so kind of them putting into the mindset that they've decided to buy an electric vehicle and that how would they use it so they have not gotten any indications that what we're looking at is how they can optimize it or anything like that we've said just that we're curious to see how it fits in their daily life anyone else otherwise I'll chip in one and that is okay anyone from the from internet okay okay so from Sean Hobbs here at what point do you think consumers will become more confident in terms of battery life and resell values how quickly or slowly do you think this might happen oh a very good question but also very hard one to answer so I think when they I think when they might start getting confident is when you after a few years when you start having some consumer experience from it so to really create confidence you probably would need another five to ten years because then you start having electric vehicles more electric vehicles that I've actually been out for a long time and so consumers can actually see that hopefully if they actually have a longer lifespan that that it works with hybrid electric vehicles that's what happened with the Priuses there was a lot of worry in the beginning that they also would not have a longer battery lifespan and now you actually see that they are running they're still running you have quite a lot of old Priuses still running on the roads today so I think that's what is needed for it what might help and facilitate that is to have better good battery guarantees and that's also something that you have experiences from the hybrids like in California in which California State went in and prolonged boat when it comes to distances kilometers travel in years for the battery lifespan and I think that might like make that quicker for the consumer so I have one that might maybe to was summing this up but more questions are welcome we have a couple more minutes and that is if you take so the full picture here from your types of studies and your impressions of battery like vehicles and plug-ins what what is the most important barrier to people overall for for considering buying plug-ins or up your battery like vehicles directly from the research when it comes to at least second car households or like two car households it's actually the price because that comes up most often is that the price they still are presumed to be too expensive and I think that might be at an initial state even more than what ranges because when when the consumers when they get to try it they realize that range is not such a big limit as as it is at least if you have another vehicle that you can shift to so I would if I would single out one it would probably be price could you also qualitatively it's a relative related to that question could you also qualitatively compare the impact of like the oil market how right now oil prices are extremely low how that affects how people want to consume electric vehicles so it's actually interesting with the law with decreasing oil prices and gas prices if we look at the market today we actually don't see that much of a dent and I mean the electric vehicles continue to increase and so some say that might might there might be other factors behind since people are not always so rational I mean we use total cost of ownership in our analysis but they're not that many that I think maybe always do it otherwise an indication of that can just be if I can just find going through here is actually this one here when it comes to plug-in hybrids in which you can say the US compared to Germany and Sweden one of the big differences there and so when it comes to the economic profitability of these electric vehicles I mean the case of the US is much worse but then on the other hand US is one of the markets that has actually that is selling electric vehicles and plug-in hybrids so you see that there are other factors that are just as important that are coming in I could comment a bit on that as well that I think that there is some at least some indication of not as rapidly going sales number in the US no due to the all price lower all places and then gasoline prices but here in Europe we have a large much larger proportion of tax etc that keeps the price up at high levels even though the raw oil price goes down so it's a very different picture between different countries and regions so any final questions from from abroad or online or in the room otherwise I think we'll round off so thank you everyone and thanks again Francis for presenting and great happy year okay


I would like to welcome members to the 12th meeting in 2018 of the Standards, Procedures and Public Appointments Committee. Our first item today is for the committee to take evidence on the proposed cross-party group on basic income. I would like to welcome Ivan McKee, MSP, to the meeting. Ivan is the co-convener of the proposed group. I would like to invite Ivan to make an opening statement. Good morning, committee. The Citizens Basic Income is an issue that is gaining a lot of attention and traction. Different parties have talked about it. There are a lot of organisations looking at it, and the Scottish Government has expressed some interest in understanding more about it, and there are now four pilots running or being looked at or being ran in local authority areas. The purpose of the cross-party group is to bring together the various strands of thought in that area, because it is one subject that has many different perspectives on how it could or should operate. To bring different people that are interested together, to provide a forum for discussion, to bring in external speakers, to provide analysis of the theoretical and practical aspects, to look at international examples and to allow networking of the different groups and individuals in organisations that are involved in working in that space. We have, as you will see from the papers, a range of organisations that are interested in participating. We have cross-party selection of MSPs, and we do not believe that it crosses over or is duplicated by any other existing CPG. Thank you very much. Do the committee members have any questions? Eileen? Thanks very much, convener. I am welcome this morning. I just wonder if it is an interesting issue, obviously, and quite topical at the moment, but I just wonder where you have said that the cross-party group would seek to run in parallel with the developing pilots in Scotland. You do not think that it is maybe a bit soon to set up a cross-party group. You do not think that, for instance, you would then be doing the same work as the pilots? Do you think that it would add value to the pilots, for example? I think that it would add value to them, because I think that it would give a forum—clearly it allows MSPs to get involved and bring their perspective to it, but it also provides a forum in here where not just those involved in the pilots, which are going to be fairly practical hands-on, looking at a specific area, how they would go about it, but it also allows the theoretical aspects to be considered in the one place. All the people from the different pilots would come together if they want to make their input to that. Given that it is so topical, it is important that there is a forum in the Parliament where it can be discussed. Thanks, convener. I just wonder whether I should declare an interest as a member of the proposed cross-party group. What opportunity do you see for working with other cross-party groups in the Parliament? For example, I attended a meeting of the cross-party group in industrial communities last night, and I was represented from Fife in one of the pilot areas. There was a great interest in the citizens' basic income scheme. What opportunities would there be for the CPG to work with other CPGs in the Parliament? It is an interesting idea. Given that there are 98 other CPGs in the list, I figure out where the linkages are. However, there could be many. We are talking about health in here, which is an issue of physical health and mental wellbeing. Industrial community is an obvious area. Entrepreneurship in creative industries is something where we think that there is a potential crossover. Clearly, all the work on social security is very core to that. Also, another area that I am very interested in is automation, where transition to new industries to help smooth out that process is going to be fairly critical. I think that you are right that there are many different CPGs, potentially, where we could have common interests. The following question is from Elaine Smith. Have you reached out to the councils that are involved in the pilot, either at the officials or councillor level, to seek their membership? We have. There is an interesting discussion going on there that I need to get a bit better understanding on. There seems to be a feeling among some of those involved in the pilot so that they should not be officially part of the CPG because it might compromise. It is too strong a word, but it may be that there is a perception that they want to be separate but to understand what the CPG is doing. I think that the CPG could inform what they are doing, but some of the pilot groups are not clear whether they want to be officially part of the CPG at this stage. We are well aware that we have reached out and we are very keen to share whatever learnings we have with them. I can see that councillors corporately might take that view. Individual councillors might be less of a barrier. Potentially, yes. We are exploring how best to do that. There seems to be a single-issue policy group, as opposed to a general interest group. What would happen if the letter to relation was passed? What would happen to the group? Oh, okay. That is a good question. I think that we are a long way from that. That is the first point that I would make, because the Scottish Parliament does not even have all the powers yet to do that, so we are a long way from that. If that came to pass, there would still be issues around how the roll-out was working and issues that came on the back of that. As I said, the process could be the system as implemented could be tweaked, because that effectively would then be our welfare system. How that would work is broader than that, because it impacts on health agenda, on automation agenda, on business agenda. There is a whole range of agendas where it impacts. Even if that was implemented, which is still a long way off, there would still be scope for discussion about how it was working and how best to leverage it to best affect those other agendas. In my mind, I am still questioning whether there really is an interest group, as opposed to a lobby group, because it is so narrowly focused on just one policy issue. As I said, I think that the scope of it is huge. It is a completely different way of looking at how we do welfare, but it is broader than that as well, because it is very focused on the transition of society in terms of industries that we have at the moment and careers that we have at the moment to where we are going to go in the future. It allows that process to be smoothed. I think that if you consider welfare, in its widest sense, to be a single issue, you might have a point, but I think that it is much broader than just one policy issue. Because it is broader than that, as I have said, because it impacts on all those other areas, as well. I am having conversations with the FSB at the moment about how it might impact small businesses and what their members' perspective on it would be, which is a whole discussion that needs to be opened up and had. I think that, in terms of the future of what we want society to look like, conceptually and in practical terms, it is a forum that allows that discussion to take place. I think that some of the things that Tom is saying there, I would agree with it, that the policy itself is a narrow policy. I appreciate that you are looking to on that basis. The organisations that you have got involved with are, again, possibly quite narrow in their focus, but you have talked about meeting and discussing with the FSB. Will you be looking to widen out that group? Have you got other organisations that may not be signed up yet but that you are talking to them to demonstrate that? I think that that is one. The RSA is a fairly broad scope as well, and they look at a lot of stuff. I think that that will develop as we go forward. RSA is broader. I am keen to engage with business organisations. As we get more into the discussion, it will become a part of what other organisations there are, that we could SCDI is another potential organisation that has done a lot in the automation space, where that could have a direct impact on how that transition would operate. As we develop, I am keen to bring in a much broader range of organisations. I think that one of the key issues about one of the key objectives of the CPG is that there are those who come at it from an equalities perspective, which is great, but there are many other aspects to that as well. I think that sharing and cross-fertilising all of those ideas is a valuable function of the CPG. Just very quickly, as are Highlands and Islands MSP, I am obviously very concerned to make sure that people in my region can be involved in any cross-party group that feels involved in Parliament. How will you ensure that they are able to be involved? You are very welcome to come along and make sure that we are. Why don't they just come to me, but interested groups or people with experience that might be able to be of real benefit to the workings of the group? That is a good point. We can put an agenda to look at the geographical impact and make sure that we are reaching out to organisations that specifically focus in the Highlands and Islands, for example, absolutely. Thank you very much, Ivan McKee, for coming along today. The committee will make a decision on whether to approve the cross-party group at its next agenda item, but we will suspend briefly to allow you to leave. Thank you very much. We will move on to agenda item 2. It is for the committee to consider whether to accord recognition to the proposed cross-party group on basic income. Does anyone have any comments on the committee's content? Thank you very much. We agree to accord recognition to the proposed cross-party group on basic income. That ends the public part of the meeting and we will now move into private session, as previously agreed.