# Parity of permutations, impossible puzzles and the magical determinant

## Метаданные

- **Канал:** Mathologer
- **YouTube:** https://www.youtube.com/watch?v=rUiulWItECQ
- **Дата:** 11.04.2026
- **Длительность:** 38:56
- **Просмотры:** 38,546

## Описание

This is a video I've been meaning to do for a long, long time. I've used the parity of permutations in quite a few videos and I've repeatedly promised to give a proper explanation in a separate video. This is it! 

Parity of permutations, the distinction between even and odd permutations or rearrangements, is one of the simplest nontrivial invariants in mathematics, yet it has far-reaching consequences across many areas. This seemingly modest idea underpins the structure of the alternating group, a fundamental object in group theory that plays a key role in understanding symmetry.

In linear algebra, parity is built directly into the definition of the determinant, where alternating signs ensure that the determinant correctly captures orientation and volume. Without this distinction, the determinant would lose its essential properties. In geometry and topology, parity governs orientation: even permutations preserve orientation, while odd ones reverse it, a concept central to integration and manifold theory.

In combinatorics, parity enables powerful cancellation arguments, where terms paired by opposite parity eliminate each other, simplifying complex counts. It also appears in algorithms and puzzles, where parity acts as a hidden invariant determining whether certain configurations are reachable. In algebra, it influences objects such as polynomial discriminants and the structure of Galois groups.

Overall, parity serves as a unifying principle, linking symmetry, orientation, and invariance across mathematics. (Part of) the ying and yang of mathematics :)

Here is the link to my javascript app:
http://www.qedcat.com/parity

Things to watch out for: In the permutation diagrams you sometimes get less crossings than inversions. This is because of the presence of multi-crossings (more than two arrows forming a crossing). Usually you can resolve these multi-crossings with the "resolve multicross" button. 

One thing that I missed out on mentioning in the present video is that originally the 15-puzzle was sold with the 14 and 15 swapped, thereby making it into an impossible puzzle that took the world by storm very much like the Rubkik's cube one hundred years later. Find out about the history of the 15-puzzle in the early Mathologer video mentioned below.

At some point I say that no matter how many tiles we are shuffling there will always be the same number of odd and even permutations. Of course that's not true if there is only one tile.

00:00 Intro
01:21 Permutations, inversions and parity
03:55 Identity permutation and swaps flip parity
08:48 odd + odd = even
11:08 The 15-puzzle
16:41 My permutation visualiser app
18:49 The Rubik's cube (corners)
22:38 The Rubik's cube (edges)
25:00 The Rubik's cube (corners & edges)
29:27 The determinant
31:54 The proof
35:56 Postscript
36:43 Thank you!

Here are relevant earlier Mathologer videos for you to check out:

I Built an Original One-Glance Proof from Dice https://youtu.be/QbKMSH5CLZ8
If you take out the corner and edge pieces from a Rubik's cube and fit them in randomly into the leftover 3d cross there is only a 1/12 chance that the resulting permutation is solvable with legal moves/twists. 12=2x2x3. Among other things, this video justifies where the 3 comes from.

Why did they prove this amazing theorem in 200 different ways? Quadratic Reciprocity MASTERCLASS
https://youtu.be/X63MWZIN3gM
In this video I demonstrate how the quadratic reciprocity has the parity of permutations at its core. 

The 15 puzzle - solving the unsolvable 19th century Rubik's square
https://youtu.be/GXJOVoyZcXQ
A whole video about the 15-puzzle and its history. 

The parity of permutations and the Futurama theorem
https://youtu.be/w0mxdo5ur_A
A different visual proof for why parities add like numbers motivated by an argument I used in one of the earliest Mathologer videos.

The Futurama Theorem
https://youtu.be/J65GNFfL94c
One of the earliest Mathologer videos. All about permutations ... and Futurama :)

Music at the end by Ian Post: Dream instrumantal version
T-shirt: https://www.zazzle.com.au/math_i_cant_even_t_shirt-235002184636303112

Enjoy!

Burkard

## Содержание

### [0:00](https://www.youtube.com/watch?v=rUiulWItECQ) Intro

Welcome to another mythology video, a very special mythology video. Special how? We'll see. Today I'll talk about the parity of permutations, a very important concept within mathematics. Non-mathematicians don't know much about it. But it's really well, it's really the yin and yang of mathematics. It's incredibly important. Uh for example, for figuring out what's possible or not possible with these permutation puzzles, but also for figuring out a determinant. So, most of you many of you will have seen determinant in linear algebra. The explicit formula for the determinant involves permutations and the parity of permutations. And of course, the determinant itself is taking a square array of numbers and distilling all the entries in this array into one number. And that one number, although there's a lot of loss of information of course, that one number can tell you all kinds of amazing things about different important objects associated with the square array. For example, linear transformations or systems of equations or sets of vectors. But we'll get to all this. So, to start with, what's a permutation? And what's its parity?

### [1:21](https://www.youtube.com/watch?v=rUiulWItECQ&t=81s) Permutations, inversions and parity

Okay. So, here we've got tiles 1 to 8, could be more, could be less in their starting positions. Tile one is in position one, tile two is in position two. I've connected the starting position with the tile with an arrow. That arrow will follow the tile around all the way throughout, okay? Now, we're going to permute things, shuffle things up. That's a permutation and its parity is odd. Okay? That's another one. They're all odd permutations. There should be an even one somewhere here. Oh, even permutation, great. So, it's either odd or even parity, okay? Odd or even permutation. Okay. Now, why is this for example odd? Well, because it's got 17 inversions and 17 is an odd number. Now, of course, immediately I have to tell you what an inversion is. That's very easy. So, you just look at pairs of tiles. If they're in order in ascending order, then no inversion, otherwise inversion. So, seven and five, that's an inversion because the seven is greater than the five. Five and eight, not an inversion, five smaller than eight. Eight and three, that's an inversion. Five Eight and one, two, that's an inversion. Two and six, not an inversion. You get the picture, okay? So, you look at all possible pairs of tiles at the bottom. And some are inversions, some are not. Just count them up. 17 in this case. And 17 is an odd number, so the parity of our permutation is odd. Okay. Now, we're mythologia people, so we want to see this as visual as possible. And actually, you can see those inversions at a glance in this permutation diagram. They correspond to these crossings here. And let's just count the crossings. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17. 17 inversions corresponds to these crossings. And why should a cross like this correspond to an inversion? Easy, right? Because the initial positions here, they're in ascending order. So, for example, one and four, right? So, one and four, ascending order. But at the bottom, you know, four and one are switched, right? Inversion. And then of course, because the arrows are pointing this way, the arrows have to cross. Okay. And then if they're in ascending order at the bottom, then the arrows won't cross. All right. Now, reset.

### [3:55](https://www.youtube.com/watch?v=rUiulWItECQ&t=235s) Identity permutation and swaps flip parity

This is actually doesn't look like it, but that's actually an permutation. This is called the identity permutation, do-nothing permutation. Mathematicians love this sort of stuff. And of course, there's no crossings here, so there's zero inversions. And so, zero is even, so the identity permutation has uh parity even, it's an even permutation. Okay. There's other special permutations, swaps. If you just have two tiles swapped like this, that's a swap. Or like that, that's a swap. Actually turns out that swaps are always odd. Let's have a look. So, that one is for example odd. That one's odd. Okay. So, I mean, just kind of looking at the symmetry of something like this. It's probably pretty easy to figure out why they're odd, right? But we also get to a more detailed view later on. Okay. Now, there's something else I have to tell you about swaps. If you have a random permutation and now you take two of the tiles and swap them, the permutation changes. And actually, it changes in such a way that the parity will flip. Have a look at this. So, we're doing a random swap, parity is flipped, okay? Swap, parity is flipped. flipped. Not clear why this is happening, not clear at all. It will all become clear later on. Just remember it for the moment. Okay. So, things to remember, you know what a permutation is, you know what inversions are, you know what parity is, and you know how to figure it out just by kind of looking at the diagram, for example. Okay. And then the other thing that's really important, probably the most important thing to remember so far, is that when you do a swap after a permutation, the parity flips. Okay. One more thing I have to tell you about uh permutations and swaps. It's like this. If you do If you start out with a random permutation, you can take this back to the identity permutation by just doing a couple of swaps. Why? Well, how? Well, one is currently not in the right place. So, we could just kind of take the five and the one and swap those two guys. Then, two is in the right place, we don't have to worry about it. Then we can take another swap that swaps the eight and the three, and that takes the three in the right place, and keep on going like this. And let me just show you how this works. So, there, one and two in place, three, four, five, six all in place just by doing a couple of swaps. Okay. So, now, uh of course, there's, you know, we can do this again just for this one maybe again, okay? Uh that's one scheme, but here's another scheme of putting those two guys back in order. So, there, there, there. And in fact, I mean, I could just kind of start out kind of going blindly and not get anywhere with getting back to the identity and get maybe like a one million missteps and then by chance get back to the identity. So, lots and lots of different ways to get back from this permutation here to the identity. Yeah. Very different ways, but there's one thing that all of them have in common, and that is this. If the parity of our permutation is odd, then it will take an odd number of steps. All right. So, you will absolutely not be able to get back to the identity with, say, four steps or four swaps. Okay. So, why is that the case? And let's just check it quickly. So, for this one here for example, let's just count, right? 1 2 3 4 5 swaps, okay? And with that scheme here, we've got 1 2 3 4 5 6 7 8 9 swaps. Both are odd numbers, odd, okay? And pretty easy to see. Why should this be the case? Well, we're starting out here with an odd permutation, okay? And we're aiming for identity, so that's an even permutation. So, we're going odd. Every swap, we flip our parity. Odd, even, odd, even, odd, even. And so, to get from odd to even will take an odd number of swaps. And to get from an even number uh from an even parity permutation to another even parity permutation will also take an even number of steps. So, that's really important. Okay. So, two things to keep in mind. So, just etch it into your memory. The first one is a swap flips parity. And the second one is it will always take an even number of swaps to sort out a an even permutation and odd number of swaps to sort out an odd permutation. Cool. Now, just want to mention this. So, we have a random permutation here. We do um random swap that flips the parity. That's just a special case of something much more general.

### [8:48](https://www.youtube.com/watch?v=rUiulWItECQ&t=528s) odd + odd = even

So, instead of having a random permutation followed by a swap, we can actually have two random permutation in sequence like this and combine them. Okay? So, what actually gets permuted here and how? Well, let's just animate it. Um start out with the tile in the original positions, then the first permutation permutes them, shuffles them around. And then wherever they are, you know, you start out and apply the second permutation, and that's the result of putting both permutations together. And kind of just as a permutation diagram, it looks like this. You can put the crosses in, can count them. And in this case, we're going to have 19 crosses. And if you had counted the first one, it would have been 14 and 13 crosses. And 14 and 13 and 19, well, I don't know what they have to do with each other, I don't know. Here's another scenario, 10 22 and 20. There doesn't seem to be a real pattern there, but there is a pattern here in the parities. We just have a look. Even even even. Even even. Come on, give me something else. Odd, even, odd. Even, even, odd, even, odd. Ah, even, odd, odd. And actually, you probably guessed it already. So, these things add like numbers. So, even number plus odd number is odd number. Even parity, odd parity. Even plus odd is odd. Odd plus even is odd. Come on, get me Give another one. Give me another one. Go, go. Ah. Ah. I don't I want one even plus even is even. There we go. Okay. So, anyways, this always works. It's not clear why is it the case to start with and kind of when you think back to what I said about second permutations being a swap and therefore this being odd, well, then it's kind of fits in with what I said before that things flip, right? Because if you say even plus odd, that's odd. Or odd plus odd, that's even. Things always flip when you add an odd to it. Okay. So, pretty good. So, now we're actually in a pretty good position to actually apply all this stuff. And first, I'm going to apply it to something very famous, the

### [11:08](https://www.youtube.com/watch?v=rUiulWItECQ&t=668s) The 15-puzzle

15 puzzle. Okay, so you've all played with this sort of thing. These days, the way we play with the 15 puzzle is we've got a box 4 * 4. We've got tiles numbered from 1 to 15 in order in the box, okay? And now, we shuffle it up by taking uh tile adjacent to the empty square and just kind of push it in. Push it in. And kind of keep on going like this until we're kind of back with the empty square in the lower right corner. Okay, now if you have a look here, it says 12 steps. Well, it was 12 times pushing, that's clear. But then it also says inversions and parity even. So, we're somehow talking about um permutations here. But what's being permuted here? So, for example, if I'm here, right? I mean, the tiles are sort of not in the same place. The empty tile is somewhere else. So, this is still supposed to be, you know, inversions here somewhere. Well, what's really happening actually is that we've got one more tile here and this is a ghost tile. So, we actually interpret this empty square as a ghost tile 16. And then kind of pushing into the empty square corresponds to just a swap of two tiles, isn't that neat? So, that really fits in nicely with what we've been talking about so far. So, we are we're permuting things. We're permuting 16 tiles by swaps, okay? So, let's just do this. So, we're starting out like this, okay? this. And now, we're going for um shuffling up, okay? So, shuffling up. So, as we shuffle up, the empty square is kind of travels around here. Kind of speed it up a bit. Okay. And then, the 16 is back in the lower right corner. And now, what it says up here is we're dealing with an even permutation, okay? So, now it's clear what it means, okay? And well, let's just do it again. So, just shuffle it up again. So, random number of steps and also random walk in here and the parity is even again. Okay, round trip again. Okay, very nice. Even again. And just in case you're wondering, is this a coincidence? No, it's not a coincidence. When we do the shuffling like this, 16 starting here and ending here, we're always going to have an even permutation. Hm. Okay. And actually, I can prove this to you fairly quickly now based on what I told you before about swaps and swaps flipping parity. Uh it goes like this. So, what you do is you highlight a checkerboard here. And then, let's just see what happens to the 16 as it kind of moves around as we shuffle things, right? So, slow motion on. Round trip. So, at the moment, 16 is green. Now it's red, green, red, green, red and so on. Okay. So then, what happens throughout here is so it's green, red, green, red, green, red and then green again. So, what that means since things alternate green, red, you've got the same number of greens as reds in here. And that means that the number of steps is always two times the number of green or red. It's an even number, okay? So, we are taking an even number of steps always to get from here back to here. And of course, every step corresponds to a swap. We're starting with the identity, okay? So, which is even. And we're taking even number of swaps. And what I said before is that we then automatically end up with an even permutation. How neat is that? Okay. So, what we've just proved, assuming that this whole flip business works, is using parity of permutation, that in the 15 puzzle, using legal moves, you can only ever produce even permutations. So, what that means, for example, is that if I, you know, just pop out the box, all the tiles, and put them back in randomly, you know, there might also be odd permutations coming out of it. And that odd permutation can then not be solved kind of just shuffling tiles around um as it's allowed. Pretty good, right? In fact, um it turns out, and it's easy to see, there's an equal number always. It doesn't matter how many tiles you have. There's an even there's an equal number of odd and even permutations. Easy to see. So, say all the odd permutations are here, all the even permutations are here. Uh take a swap, one swap, and apply it to all those even permutations, then all the even permutations will turn into all the odd permutations. And if you take the odd permutation and apply the swap to this one, it will turn into even permutation. So, they have to be the same, right? There's the same number of even and odd permutations. So then, in the case of this 15 puzzle, you know, when you kind of toss it out, you have a 50/50 chance of ending up with an even permutation. And actually, that's a fairly easy puzzle. It's actually very easy to figure out that all even permutations can be solved. And so, you've got a 50/50 chance of actually being able to solve this puzzle here, which is nice. Okay. So, how far how we going so far?

### [16:41](https://www.youtube.com/watch?v=rUiulWItECQ&t=1001s) My permutation visualiser app

Pretty nice, pretty understandable. Hopefully, I didn't get uh lose you anywhere. Now, I should probably say something about this app that I'm using here. So, here, uh I built this myself. And what I want you to do at the end of this video is just go to the description and click on the link there, which will take you to a page that has this app. It's actually a JavaScript app. So, you know, if you feel like doing so, if you're like really, you know, keen on trying something deep with this, you can just download the code and you can actually extend it. You can put other features and other permutation puzzles that will work with this. So, there's all kinds of other features that you can explore to start with. So, for example, I've also have this puzzle in here. So, you can do all of these sorts of things. You can checkerboard it. You can do round trip. Uh all of these things. Um you can go maybe to that single view again and play with, you know, 16 tiles or, you know, 24 tiles or whatever. Um There's different color schemes there even for the 15 puzzle. So, there's ways to kind of look at it in terms of a permutation diagram. All of this stuff will also still work. So, there's lots and lots of stuff to explore. Um And I hope that this will actually prove very useful for people who actually teach this stuff, right? So, people who want to teach about permutations, parity, they can use this app. At the end of the video, tell me what you think of this idea and how it worked out. So, I would say today's is quite different. I'm not going on a script. I kind of just say whatever I feel like saying. I mean, this is all sort of the app itself is sort of scripted as it is, but I what I say now is sort of off the cuff. All right. Now, I still want to do a proof of the swap property by swaps flip. Um and I also still want to do something about the Rubik's Cube. And let's just

### [18:49](https://www.youtube.com/watch?v=rUiulWItECQ&t=1129s) The Rubik's cube (corners)

do the Rubik's Cube first. Again, the way I've presented it here in the app is very different from what you can see anywhere else. So, what I've got here is I've got different views of this, actually four different views. The first view focuses on the corner pieces and I've just uh labeled them. So, 1 2 3 4 5 6 7 8, right? So, there's they all start out there here here here and here. And then, I've got the six different ways of shuffling the cube using quarter turns, right? So, there's you know, turn of the right side, quarter side. Or there's a left side. Or up, down, front, back, okay? Now, all of those, let's have a look. Um in terms of permutations, right? So, I mean, I've got, you know, those things kind of translated into a permutation diagram here on top. Right? So, if I kind of do right, I can actually check out so, what is this in of parity? It's odd. And in fact, all of those guys are odd, which is interesting, isn't it? So, all of those guys are odd. And well, let's just permute this around. Let's talk a little bit about this. All right, so this it's very neat, right? So, it's cabled up all of this stuff so that we've got things turning and permuting and shuffling in unison here in the Rubik's Cube, but then also here in the permutation diagram. And actually, in the permutation diagram, you can now can extract some information. So, for example, here what this says is that at the moment, the piece that starts out in position one should now be in position four. Okay, so one is here, four is there. So, this guy here is blue, yellow, red. So, blue, yellow, red should now be here, so over here. So, there's blue and red. And let's just turn it. And yep, there's the yellow, okay? Or for example, the six Yeah, the six should still be in six position. Okay, Have a look. Oh, yellow here, orange there. That doesn't look promising. But actually, we're just talking about position, right? Not orientation of the pieces. So, this piece here is what? Well, that piece at the moment is Well, at the bottom is the opposite of blue, which is green. Okay, so the green should be here. And that should be orange. So, orange, green, yellow. So, this should be orange, green, yellow. Where is this orange in here? Let's just take it. There's the green, okay? And if I go like this, there's the yellow. Okay, that's right. That's quite nice. But actually, more important for us here is that all these permutations are odd. Because then quarter turns just like swaps, they did they behave just like swaps when it comes to parity, right? So, when you kind of do, you know, one swap and another swap then another swap, parity flips flips flips. But of course, it's going to be exactly the same here for these quarter turns. So, have a look here. Even I do a quarter turn, odd, even, odd, even, odd. Right? And so, one of the things that's also going to be true is that if I'm say dealing with an odd permutation of the Rubik's Cube in terms of locations of the pieces, it will take me an odd number of quarter turns to get it back to you know, the initial position solved sort of. Yeah? And well, let's just keep this in mind for the moment. Now, when I shuffle the Rubik's Cube and I kind of twist it up like this, of course, I'm not only permuting the corner pieces, I'm also permuting the edge pieces

### [22:38](https://www.youtube.com/watch?v=rUiulWItECQ&t=1358s) The Rubik's cube (edges)

right? And so, there's 12 edges, so there's 12 edge pieces. Corresponding permutation diagram. Let's just have a look at what happens here. So, if I do a right quarter turn that's also of odd parity. So, even when it comes to permuting the edge pieces, quarter turns correspond to odd permutations. Not clear from the beginning, but you know, it is, right? So, both in terms of corner piece permutations and edge piece permutations quarter turns are odd. Okay? And so, let's just see whether you got this all. So, if I kind of go like this, right? So, there, there, there, there. So, at the moment, we've got an even permutation. So, what that means is we it took us an even number of steps, quarter turns to get here. What can you tell me about the corresponding uh parity of the corners? All right? Is it odd or even? Well, obviously, also even, right? Cuz we're doing a quarter turn that flips the both both parities, okay? Another quarter turn flips both parities. So, they both move from identity permutation to even to odd even odd. So, they're linked, right? So, the parities of those two permutations, they're linked. They're always the same. So, what that means, for example, about possible and impossible for a Rubik's Cube is this. So, at the moment it's completely solved, right? So, if I take these two pieces here and swap them in the Rubik's Cube, so you take them out and swap them over, and basically, we're we're really flipping we're flipping the parity of the corners. And so, the parities are no longer the same. And so, what that means is that no matter what we do here, we can never get back to solved. Same here. If I take these two edge pieces and swap them, okay? Swap them. Then the parity of the edge permutation is odd. The corner permutation is still even, so we can't solve this sort of thing. So, quite nice. All right. Now, something funny. So, I don't know if have anybody talk about

### [25:00](https://www.youtube.com/watch?v=rUiulWItECQ&t=1500s) The Rubik's cube (corners & edges)

it this way. We can actually do both at the same time, the corners and the edges at the same time. So, I've labeled all the edges as before. It's they're basically 1 to 12. And then I've also labeled the corners 13 to 20. And now, okay. Now, as we uh permute these up as we do quarter turns, things get permuted up. But see, the parity always stays even. And actually, when you think about this for a moment, that's probably not that surprising. Right? Because I mean these corner pieces, they can't miraculously become edge pieces and edge pieces can't become corner pieces. So, really what happens here is completely independent here on the left side, those first 12, and the right side, those last eight. And so, if you've got to do this one here, you've basically got separately here the um the edge permutation happening and the other one happening. And of course, since this is odd and they don't have anything to do with each other, odd plus odd is even. So, all of these guys here have got to be even, right? So, uh a right quarter turn corresponds to an even parity permutation and so on. Okay. And so, now that's another way of looking at it. So, you've got a Rubik's Cube, you kind of pull it apart, put the pieces back in and then try to put the put them back into the positions where they started out from. And you know, if you happen to end up with an odd permutation after you put it together, you can be absolutely sure it can't be done. So, that's very similar to the the setup that we had with the 15 puzzle where all permutations that we're dealing with are even. And then the one conclusion in this case was that, you know, when you kind of rip it apart and put it back together again, you've got a one in two chance of being able to put pieces back in order. And is that the same here, right? Is it the same here? You kind of pull it apart, put it back together again. Um yes and no. Yes, in terms of locations. So, if you kind of pull this thing apart and say, well, just put the pieces back into their original locations then if the permutation is odd, we can be absolutely sure it's not not the thing. But to conclude from that to solve the thing, we need um Yeah, anyway. So, it's not the complete picture. And why is that? Because we still have to worry about uh orientations of those pieces, right? So, this can go in like three different orientations here in the corners, can go in two different orientations. And so, actually, when you kind of pull the Rubik's Cube apart and put it back randomly, you've got a one in 12 chance of being able to solve this. Uh and for the moment, within that 12, 12 is 2 * 3, we've actually only accounted for this one two, the first two. The first two in the 12 has to do with the parities, those two parities of the corners and the edge permutations have to be the same. So, that says, okay. So, some some two there. Um the second two we can actually also get out of the parity, and that has to do with the fact that we can also label the stickers on the edges. So, I've just done this here. Okay, cuz label the stickers on the edges, and they will get permuted around. And it turns out that a permutation like this is also always even, okay? So, then what that means is uh you know, if you kind of do a swap like this, which would correspond to an odd permutation of the stickers, that's also impossible. And so, this outcome or upshot of the parity of permutations, that actually accounts for the second two in our 12. And then the last one, can't really do this with parity of permutation immediately. Uh I need a slightly different argument. I actually did that in the last video. Let's just go into this. Anyway, you get the idea, right? Main thing is for permutation puzzles like this you know, it's the wonder weapon. Parity of permutation is the wonder weapon to figure out what's possible and what's not possible. So, only even permutations here, and there's a bit more involved stuff with the Rubik's Cube. Okay. All right. Now, before I do the proof um [snorts] let me just quickly switch to

### [29:27](https://www.youtube.com/watch?v=rUiulWItECQ&t=1767s) The determinant

the determinant business that I mentioned before. Okay, let's quickly. Okay, just to give you a bit of a insight into how you use the permutations and the parity to actually calculate a determinant because most people when they get talked about the determinant, they never get to this. So, it's taught in a different way and you'll never see the permutations, parity business. Uh well, as I said, uh you've got these square matrices and you take all of the entries and distill them into this one number and then one the one number that has lots to say about different objects associated with the square array of numbers, the square matrix. Now, how exactly is this calculated? What's the function right, that associates to these nine numbers that one number here? Well, goes like this. You write down all the permutations on the three numbers 1 2 3. So, there's six of them, okay? Then half of them uh even, half of them are odd. The green ones are the even ones. The red ones are the odd ones. And now underneath those permutations, you copy this matrix once, twice. So, all these matrices are the same. And then you say, well, one is this one here, two three is this one here. one is this one here, three is this one here. So, you get the picture how these squares are highlighted, right? According to the permutations above the arrays. And now we just take the numbers in here and multiply them together. So, 0 * 8 * 3 is 0. 8 * 6 * 3 is 144. 8 * -8 * -5 is 220 and so on. One more step. If it's an even permutation, you get a plus one here. If it's an odd permutation, you get a minus one here. Gives you six numbers, just add them up. That gives you the determinant. Pretty nifty, right? Pretty nifty. Okay, that was for 3 * 3. Of course, for 4 * 4 gets a bit more complicated, right? There's a few more permutations here for uh four numbers and then for five it gets pretty crazy here. There's like 120, but the scheme is exactly the same. And so, for any n * n matrix, you can calculate the determinant like this and it's magical. And why is it magical? Well, I'm going to talk about this in a separate video about determinants, which is hopefully not too far away. All right. Enough with this. Let's just finish up

### [31:54](https://www.youtube.com/watch?v=rUiulWItECQ&t=1914s) The proof

with this business of swaps flip the parity. So, how can we see this easily? All right, let me show you. So, I've got a proof button here. Let's just press the proof button. So, we've got two tiles. They're about to be swapped and well, basically these two arrows in here, imagine that they're part of a permutation diagram, right? So, diagram. And now let's just see what happens when I swap those two tiles, okay? well, the arrows started out not crossing, they're now automatically crossing. So, there's one extra inversion happening here and definitely that would change the parity, okay? But now, this is not happening in isolation. Those two arrows, as we swap the tiles, they also interact with all kinds of other arrows here in the permutation diagram and we have to actually have a close look at what happens there, okay? So, um those two arrows, the tails, they separate the top into an interior part and that's the exterior. And here the bottom, the tips separate into an interior part and exterior part. And now there's a couple of cases for those extra arrows depending on where their tails and tips end up in the interior and exterior. Okay, so that's the first case here. Exterior exterior. So, this kind of arrow doesn't have anything to do with those two. And actually, when you swap, you can see it's not going to interact with anything, right? So, the only effect here on the parity is really that extra um red crossing. Okay, next case. You could go from the outside at the top to the inside at the bottom. What happens when we swap? Well, we've got that green crossing here. We've still got one green crossing. Nothing's changed, right? So, there's no effect uh on the parity. And next case, yeah, so you know, crosses twice. So, outside to outside here, uh but in a different way. And so now we've got two crossings here, two green ones. When we cross those two, the result is still there. No effect on the parity, okay? So, I think it's the last case. Oh, no, this one still. Okay, so one crossing here after the swap, still there's one crossing and this is definitely last case. So, inside to inside and so far nothing is crossing, but you can actually see what's going to happen, right? Um how many green crosses will there be at the end? Well, obviously two. But two, when you add two to, you know, that doesn't change the parity. So, in the end, the only thing that has any effect on the parity is this. Going in, going out, okay? And so, so at a glance, you can basically see uh why swaps flip the parity. And then this additional property that parities add like numbers, uh well, that's sort of an immediate consequence of this. And maybe I leave this as a bit of an exercise for you to figure out. So, why is this the case? Just it's pretty obvious, right? I mean, you've got first a permutation, you've got second permutation, right? And so, the second permutation kind of now breaks down into, if it's an odd permutation, odd number of swaps. So, then to see what actually happens when we combine those two guys, you just go first permutation might be even and then you kind of do an odd number of swaps and where do we end up with, right? And then kind of just think about it a little bit and it's going to be obvious that odd plus odd is even, even plus odd is yeah, and so on. Anyway, uh maybe sort out the formal proof in the comments. So, this is the end of it. Uh hope you enjoyed it, but let me know anyway whether this worked for you or whether it didn't work for you. And uh well, until next time. Maybe with determinants, maybe with something else.

### [35:56](https://www.youtube.com/watch?v=rUiulWItECQ&t=2156s) Postscript

—

---
*Источник: https://ekstraktznaniy.ru/video/51517*