1 00:00:00,012 --> 00:00:02,730 'Kay. Welcome back. 2 00:00:02,730 --> 00:00:12,591 Still week six and we're doing some more examples and talking a little about 3 00:00:12,591 --> 00:00:18,196 minimal excluded. Okay, so let's, let's take a look at this 4 00:00:18,196 --> 00:00:22,237 quickly. We have some examples of minimal excluded 5 00:00:22,237 --> 00:00:25,475 and excuse me while I look around the camera. 6 00:00:25,475 --> 00:00:27,214 Okay. So let's see. 7 00:00:27,214 --> 00:00:33,070 Zero is here, one is here, two is here, three is here, four is here, five is here, 8 00:00:33,070 --> 00:00:36,639 six is here, seven is here, eight. 8 isn't. 9 00:00:36,639 --> 00:00:45,149 So the minimal excluded of this is 8. And so that's the solution from last time. 10 00:00:45,149 --> 00:00:53,628 Alright, here's the general result. If we have an impartial gain, all of whose 11 00:00:53,628 --> 00:00:59,839 moves are to nim heaps. And this game is equivalent to a nim heap 12 00:00:59,839 --> 00:01:07,469 of size d, where d is the minimal excluded natural number in the set consisting of 13 00:01:07,469 --> 00:01:10,970 this a, b, c, a, a, b, dot, dot, dot, up to c. 14 00:01:10,970 --> 00:01:18,387 So the example from last time fits this context here we have this. 15 00:01:18,387 --> 00:01:27,178 Here's a game, all of the options are nim heaps and 3 is the first missing number. 16 00:01:27,178 --> 00:01:33,223 And so this game is equivalent to nim heap of size 3. 17 00:01:33,223 --> 00:01:36,664 Okay. Let's take a look at, and Any, any of 18 00:01:36,664 --> 00:01:42,649 these things we can think of as, as min heaps, where we can add more coins, but 19 00:01:42,649 --> 00:01:47,776 you can reverse those moves by putting the coins in your pocket. 20 00:01:47,776 --> 00:01:51,148 Alright. Let's take a look at a, a, a, at a case 21 00:01:51,148 --> 00:01:57,388 yet another kind of case, another kind of game, it's called a subtraction game. 22 00:01:57,388 --> 00:02:03,350 So we start with a heap of size n, n may be 1, 2, 3 or 17 or 40 billion. 23 00:02:03,350 --> 00:02:10,193 A move for either player is to remove one, two or five Coins, or beans or dice, 24 00:02:10,193 --> 00:02:17,189 whatever they are or bicycles, we could have a heap of bicycles that would be fun 25 00:02:17,189 --> 00:02:21,186 to play. Okay, so let's take a look at that. 26 00:02:21,186 --> 00:02:28,808 If we have, start off with a hepa size 0, then there's no moves so that's equivalent 27 00:02:28,808 --> 00:02:33,732 to of size zero. If we start off with an in heap of size 1, 28 00:02:33,732 --> 00:02:37,761 I'm sorry. We start off with a heap of size 1 and 29 00:02:37,761 --> 00:02:44,372 play the subtraction game, 1, 2, or 5. Then our only move is to a nim, to a heap 30 00:02:44,372 --> 00:02:46,360 of size 0. That's 0. 31 00:02:46,360 --> 00:02:51,335 And the mex of zero all by itself is 1 so that's a 1. 32 00:02:51,335 --> 00:02:59,271 Now, with a heap of size 2, we can remove 1 coin, giving us a heap of size 1. 33 00:02:59,271 --> 00:03:06,787 Equivalent to a hepa nim heap of size 1 or we could remove 0 coins. 34 00:03:06,787 --> 00:03:10,563 Giving us equivalent to an in equal sign 0. 35 00:03:10,563 --> 00:03:16,076 The mex of 0 and 1 is 2. For three coins, we can remove 1 or 2, so 36 00:03:16,076 --> 00:03:20,818 we can replace this by, a heap of size 1 or 2. 37 00:03:20,818 --> 00:03:27,717 Which is equivalent to a nim heap of size 1 or 2, and the mex of 1 and 2 is 0 for a 38 00:03:27,717 --> 00:03:34,718 heap of size 4. We can remove 1 giving, an equivalent to a 39 00:03:34,718 --> 00:03:41,806 nim heap of size 0 or, 2, giving an equivalent of nim heap of size 2. 40 00:03:41,806 --> 00:03:48,272 The max of 0 and 2 is 1. For 5 we can, we move 0, 1 over 5, ooh, 41 00:03:48,272 --> 00:03:53,386 there we go. Alright I feel like I'm playing the piano 42 00:03:53,386 --> 00:03:59,869 or something. Alright and, and so the mex of zero, 0 and 43 00:03:59,869 --> 00:04:04,461 1 is 2. For 6 here, this is for you to figure out. 44 00:04:04,462 --> 00:04:09,376 An we'll start next time with the, the next module with this. 45 00:04:09,376 --> 00:04:16,696 So, I can, it goes back to removing one, removing two or removing three so what do 46 00:04:16,696 --> 00:04:19,499 you think that should be? Okay. 47 00:04:19,499 --> 00:04:23,756 Not too hard. So, what we can do You say the file, in 48 00:04:23,756 --> 00:04:30,173 general, we can have subtraction gain where we a, b, dot, dot, dot or c coins. 49 00:04:30,173 --> 00:04:36,202 First player with no moves loses. And g of n is d this, the, the size of a 50 00:04:36,202 --> 00:04:44,152 nim heap equivalent to this game. And this can be computed In exactly, this 51 00:04:44,152 --> 00:04:52,555 way and I think we're done. It only works if you make a noise, take 52 00:04:52,555 --> 00:04:53,282 care.