How to break Magic the Gathering.

How to break Magic the Gathering.

Stand-up Maths

0:00 Are you ready for the biggest number I believe has ever been used in a game?

0:04 And the way it's generated, I think is like super interesting.

0:07 It happens to come out of the game of Magic the Gathering,

0:11 which is why I have all these cards around me.

0:13 Now, I don't play Magic.

0:15 Um, friends of mine do, who are massive dorks,

0:17 and they assure me, and they're in the room right now.

0:20 They assure me it's a lot of fun, and I get it.

0:23 There's lots of cards.

0:24 The cards interact, which is how we get this ridiculous number.

0:27 You got some uh like creatures.

0:29 So, here I've got a worm spelled incorrectly.

0:31 And then you got spells you can play that change things

0:35 in the game because it's like a two-player game against someone else.

0:38 Uh strangling soot.

0:39 Don't know what that is.

0:43 Uh and Armageddon, destroy all lands.

0:47 There you are.

0:49 I'll play that.

0:51 I regret calling them dorks.

1:00 This video brought to you by Jane

1:04 Street and their brand new neural network puzzle.

1:07 Details later, we're going to need somewhere new to film.

1:10 Right, new location.

1:11 Now, the thing about Magic the Gathering is it's

1:14 been around for now over a third of a century.

1:17 And if you're thinking that's not right, Matt, it came out in 1993.

1:21 I have some terrible news about 1993 for you.

1:24 But the point is it started well it was

1:27 the brainchild of someone with a PhD in mathematics and it's

1:31 only got more complicated since and over the three

1:34 decades since then every possible edge case has come up.

1:38 There are now almost 30,000 different cards.

1:41 And so the way they interact has become just an unwieldy level of complex.

1:47 And for that reason,

1:49 they've had to introduce some rules to stop things from getting too out of hand.

1:55 Because a lot of the cards involve calculations and numbers,

1:58 regulation 107.1 states that only whole numbers are allowed, only integers.

2:04 Let's try and keep this nice and simple.

2:09 If it's something you can't calculate using integers,

2:12 well, regulation 107.2 says, tough.

2:14 If you can't calculate it, you get a zero.

2:18 We're keeping it neat.

2:19 Now, once you get to loads of cars interacting, you think, well, hang on.

2:23 What if there's like a runaway feedback loop?

2:26 Well, regulation 104.4B says no to that.

2:29 If you've got some kind of, you know, feedback cycle,

2:34 which is going to carry on infinitely long, no deal.

2:39 The game is officially a draw.

2:41 And that's assuming it's a cycle where no player can stop it.

2:45 If a player can stop it, then that's fine.

2:47 and they can choose some some arbitrary level at which at which they quit.

2:52 And so within those rules, in theory,

2:54 you can only play moves which will give you a manageable end result.

2:59 And that worked.

3:00 Everything was nice and manageable for a very long

3:03 time until someone found a loophole somewhere above big numbers,

3:07 but before infinity.

3:09 Our ridiculous combination involves these three cards which we

3:14 have managed to get our hands on the original.

3:18 However, for us non-magic the gathering people, h they are dense.

3:22 There's a lot of like wonderful artwork.

3:24 There's a lot of information on these.

3:26 And so what we've done is we've made three simplified standup maths

3:31 versions and we're going to use those to explain how it all works.

3:36 Starting uh with this one, card A, double it.

3:40 Now, this card doubles the number of tokens that are put into play.

3:44 And the one nuance here is you'll have like

3:47 your original creature cards or like you know, spell cards.

3:50 And you can also have copies of them that are called tokens.

3:54 And the game deals with them subtly differently.

3:56 The original and all the token copies.

3:58 This is if you're putting in token copies of something, they get doubled.

4:02 Now, we'll get to card B in a moment because before you play B,

4:05 you have to have card C in action.

4:06 And card C says once you do play B,

4:09 you're going to get another token copy of it appearing.

4:12 And once you've got A and C ready, our ridiculous loop is set to kick off.

4:18 Now, it's time for card B, which in the original is called Astral Dragon.

4:23 We've just called make two because when you

4:26 play this, you make two token copies of A.

4:29 So, in theory, we need two copies of this to now enter the game.

4:34 But because they're tokens entering the game,

4:36 card A's power is to take entering tokens and double them.

4:39 So, we'd actually get four.

4:41 So, just by playing this one card,

4:43 we should get four token copies of A appearing as if by magic, the gathering.

4:50 Now, to get those copies, well, okay,

4:53 this card over here, I know I'm going a little off.

4:56 Um, this mystical teachings card says I can search search your library.

5:04 So, I'm going to use that to head to the library.

5:12 So, at my local library, I was able to make some extra photo copies

5:16 of card A, which if I now cut them apart, gives us four token.

5:22 And you can tell they're token cuz they're now grayscale copies of of A.

5:28 So there we are.

5:29 We can put them all into play.

5:30 I'll just put them down here.

5:32 We're now going to resolve the C issue,

5:34 which is by playing B, we also get an extra token copy.

5:38 And I've got a couple down here.

5:40 I've made these a little smaller.

5:41 You'll see why in a moment.

5:42 So we put one token copy in of B because of C.

5:46 But look at this.

5:47 There's five A's over here.

5:48 And they all see this happening.

5:50 And each one of them, well,

5:52 the first one here decides that it's going to double this one coming in.

5:56 Okay, so now we got two of those.

5:58 And then the next one sees both of these coming in, so it doubles those.

6:02 And now we've got four of them.

6:03 And then the next one sees these four and doubles them.

6:06 Then we get eight.

6:07 And well, there's five of them.

6:08 So we have to double it five times.

6:10 So we get two to the power of five token copies of B.

6:16 There are now 32 extra B's in play.

6:19 We've just put in 32 newbies.

6:21 And every single one of these tokens says, "When this enters play,

6:24 put two token copies of A in." So, I need to add another two token copies of A.

6:29 But guess what's over here?

6:30 Already five A's.

6:31 And they're going to do the same thing

6:33 to the incoming two A's I did to the incoming 1B.

6:37 Now, a single B got doubled five times.

6:39 We had 32 of them.

6:41 If we have two A's coming in, it's going

6:44 to get doubled five times, which would be 64.

6:49 So, here we have this is 64 A's, which I'm now going to add in to our A pile.

6:58 Oh, no.

6:59 Because if I put these in, we now have a total of 69 A's over here.

7:06 And we've only deployed one.

7:08 We've done that one.

7:10 We've done one of our 32 Bs.

7:13 So now the next the next B comes in.

7:18 It's going to make two new A's and they're

7:22 going to be seen by 69 pre-existing A's.

7:26 So it's the two is going to get doubled 69 times.

7:31 Wow.

7:32 We're about we're going to have to add two to the 70 A's.

7:39 And here we go.

7:42 So, I have put these um we're now running 64 to a sheet and we have

7:47 an additional 2 to the 70 copies of A plus the 69 that were already here.

7:53 How many do we have?

7:54 Could we work it out?

7:56 I've worked it out.

7:57 Is that many?

7:59 Look at that.

8:00 It's a number with 22 digits.

8:02 Oh, little confession.

8:04 I didn't photocopy them all cuz if we wanted

8:06 to have This is basically 10 to the 21.

8:09 And if we wanted that many card A's at this scale,

8:12 the amount of paper it would take would fill

8:15 more than one entire shipping container with just paper.

8:20 In fact, it would fill multiple shipping containers.

8:24 It would fill enough shipping containers

8:27 to fill 1 million shipping container tankers.

8:30 Uh, that's a lot of paper.

8:32 We'll talk more about outrageously big numbers in a moment.

8:35 But just to complete this journey, we're going to keep going through B's.

8:39 And each time we go through B's, we get a number of additional A's equal to 2

8:44 to the power of the number we have already+ one.

8:47 So our sequence is each next term in the sequence is the previous

8:51 term plus 2 to the power of the previous term plus one.

8:55 And we should do that well through all 32 of the new bees that showed up.

9:03 And so the sequence goes five 69 that a lot and then a lot a lot a lot a lot.

9:11 You get the idea.

9:13 Now to deal with the elephantized number in the room.

9:17 What does a 22digit number even mean?

9:20 And a lot of people when I said a big number in a game might

9:23 be thinking about the classic 52 factorial because

9:25 if you take a deck of 52 cards, you give them a decent shuffle.

9:30 There's 52 factorial possible arrangements of this deck.

9:33 But here's the thing about that number and the card number.

9:37 We could write them down.

9:38 I mean, I have written that one down.

9:41 You could write down 52 factorial.

9:43 But the next step up of this, could you write that down?

9:47 because it's going to h well in binary it'll have

9:50 that many digits because that's the rate at which this is growing

9:55 and in base 10 we just divide it by it's about

9:59 a third going from base 2 to base 10 so it

10:01 would have a third of that many digits in base 10

10:04 the next one up and there's no way we can write

10:07 that down the one after that absolutely not the number of atoms

10:12 in the knowing universe we believe is about this many Now,

10:18 um, I've made that number up.

10:20 That's 81 random digits.

10:21 It's about 10 to the 80.

10:24 So, it could be this.

10:25 The exact number it happens to be right now will look exactly like this.

10:30 And anything above that, there aren't enough atoms in the universe,

10:34 one per digit, to write them down.

10:37 And this very quickly exceeds a power bigger

10:40 than the number of atoms in the universe.

10:43 So, the order of magnitude is just nuts.

10:46 In fact, if you put this whole recursion thing,

10:48 I mean, we tried it in Excel, that crashes real fast.

10:51 We put it into Python, that's as far as it gets.

10:54 We then use something called hypercal.

10:56 And if you do continue the number of iterations,

10:59 you can represent the number as this, a power tower that's 30 high.

11:04 So, what we have here, a power tower.

11:06 You start at the top, you work your way down.

11:09 At the top, we have 10^ 3.6* 10 20.

11:11 And we could write all those digits out.

11:13 There's a lot.

11:14 um if we could even work them out.

11:16 And then the next one down.

11:18 So you calculate each layer as you go down.

11:21 There are 30 of these.

11:22 As you go down each one,

11:23 the next one has as many digits as the value of the one above.

11:29 And it's nuts how fast you you run out of universe to write this in.

11:36 Like this is just an insanely large but finite and very specific number.

11:42 So, what's amazing about playing this in Magic the Gathering is

11:47 that you are technically playing an exact number of Astral Dragons.

11:50 And I reckon if you got that many, I mean, you might win this game.

11:55 And you can argue it's not infinitely large.

11:59 It's finite.

12:00 And it's an exact an exact value.

12:03 Now, this is a lot smaller than Graham's number.

12:08 Graham's number is just it's like iterative power towers

12:12 or power towers although it was just a threshold.

12:15 It was just like an upper bound below which the value to the problem must exist.

12:20 And even though this is vanishingly smaller

12:22 for some definition of vanishing and smaller,

12:25 it's an exact value that exactly solves this problem.

12:28 So, in that regard, this could arguably be the biggest

12:32 number that's ever actually been used by humans in this game.

12:36 It just so happens that it's so big, we're unable to compute it.

12:41 Oh, wait a minute.

12:43 You remember rule 107.2.

12:45 If you can't calculate a number, it equals zero.

12:50 You can't calculate this number.

12:52 It exists.

12:53 It's it's exists as much as the number seven does.

12:57 And compared to infinity, it's about as big as seven.

13:01 But as humans, we can't compute that.

13:03 So if you did ever play the shenanigans in an actual game,

13:07 and there's only three cards, easy to achieve.

13:09 We found them all.

13:10 Like some of them are a little obscure,

13:13 but these are all absolutely attainable cards.

13:15 If you somehow contrived to play this in a game,

13:18 depends if if the adjudicators will let you get away with this.

13:23 If they insist you need to be able to calculate

13:27 the integer value other than just proving the integer exists,

13:31 you've now got zero dragons.

13:34 And that's the smallest possible number of dragons.

13:38 Now, if you've enjoyed following along with Oh, this ridiculous.

13:42 My goodness, you might be the perfect person for what the sponsor of this video,

13:47 Jane Street, has in store for us.

13:49 Because speaking of shuffling things,

13:52 they have a machine learning neural network puzzle

13:55 which is going to be explained by exploded matt.

13:59 If you're not familiar with Jane Street,

14:02 they are a research-driven trading firm where curious people work on deep

14:06 problems and they believe that deep

14:09 learning is the future of quantitative trading.

14:12 and they have an in-house machine learning team who work

14:16 on neural network models which help drive their trading strategies.

14:21 They also have to build the infrastructure required

14:24 to make those inferences and continue that research.

14:27 If you're at all interested in this kind of neural network research,

14:31 Jane Street's machine learning team have put together a neural network puzzle.

14:35 They trained a neural network with 96 layers and then they

14:39 shuffled them and you got to put them back in order.

14:42 And you know, forget 52 factorial.

14:44 To my naive understanding, this is like 96 factorial.

14:48 That's not a hint.

14:49 I mean, I had a look at it.

14:52 I couldn't solve this.

14:53 But some people watching the video probably can.

14:55 If you do think you've solved it, please send your answer into Jane Street.

14:59 I would love to see how many viewers

15:02 of Standup Math videos can solve this neural network challenge.

15:06 Anyone can do the puzzle.

15:08 You don't have to care at all about a career in finance.

15:11 But if you are curious about Jane Street

15:13 and the work they do with machine learning,

15:15 I will have a link below and there's like a QR code somewhere on the screen.

15:20 You can check out their open roles and available programs.

15:23 That's the video.

15:23 Thank you so much for watching.

15:25 I really appreciate it.

15:26 I also want to thank Tabitha Grove who designed these phenomenal cards.

15:29 And if you support me on Patreon, we're going to put some extra content up

15:34 on there about how Tabitha designed uh these fantastical artworks.

15:38 And uh big thanks to Matthew Franklin who is the viewer

15:42 who wrote in and mentioned this ridiculous thing in Magic the Gathering.

15:47 And if you know any other ridiculous maths things in games,

15:51 gathering related or otherwise, please do let me know.

15:54 And um yeah, we'll also link to the original Reddit post and whatnot um below.

16:00 Uh that's it.

16:01 That's the whole video.

16:03 Um if you're wondering why the table's shaking slightly,

16:06 Skyabad the dog has come through.

16:08 Skye, over here, over here.

16:09 Over here, and around.

16:11 You got to say goodbye.

16:13 Over Sky, here.

16:15 And up.

16:15 And goodbye.

Study with Looplines Download Captions Watch on YouTube