Summer of Math Exposition

Presented by 3Blue1Brown 3blue1brown

I Used Linear Algebra to Find Shiny Pokemon

Audience:

Tags: linear-algebrarandom-number-generationgalois-fields

The Pokemon video games can spawn rare variants of each Pokemon called Shiny Pokemon, which simply have a different color scheme. By understanding how the game calculates the random numbers when spawning a Pokemon, we can influence the game to spawn Shiny Pokemon. This video demonstrates how computer random number generation works, how the game uses this to generate pokemon, and how we can represent the random number generation as a transformation using a GF2 matrix. It then demonstrates how we can invert the matrix and use information from the game to reverse engineer internal data to enable us to find the steps to force a shiny pokemon to spawn. This video contains some high level computer science and linear algebra topics, but is meant to be approachable by presenting these topics through the lens of a video game.


Analytics

6.3 Overall score*
65 Rank
19 Votes
12 Comments

Comments

4

That was a pretty interesting watch, and the explanation was quite good.

I definitely learned something new here!

Although the target audience is set to “high-school” (next to “undergraduate” and “graduate”) but the subject seems a little too advanced for high school if you ask me.

Update: unfortunately, I had to lower my score, because it seems some of the images used in the video are potentially AI-generated. The images appear at:

  • 1:43
  • 1:48
  • 2:11
  • 7:55
  • 8:01
  • 13:39
  • 16:07

These are my reasons:

  1. The art style looks similar to images generated using ChatGPT’s “cartoon” style.
  2. The images are in the “golden hour” color scheme, which is preferred by most AI image generators.
  3. The math equation at 16:07 is partially missing, which is indicative of multimodal AI’s limited text generation capabilities.

This is not in the spirit of the competition, see the AI policy on the SOME4 website.

7.6

If this isn’t a thing already (it probably is) it would be very useful for Pokémon speedrunners.

Thanks to your well done video I now better comprehend RNG and how to reverse engineer it. I feel like I understand the topic and the math behind it better than before. The applied context with the Pokémon game really helps conveying the importance of understanding how computers do RNG and this sort of math.

I personally come from the Minecraft speedrunning community and the reverse engineering of world seeds is also a big thing there. It’s more important than one might think. E.g. in “MCSR Ranked” (abbreviation: MSCR = MineCraft SpeedRunning) the reverse engineering of seeds allows for finding world seeds that are perfect for two people to play a world seed against each other to see who can beat it faster. So I understand the importance of the presented topic.

7.5

Very complete and informative, I failed to find any mayor problems to mention, however my minor critique is that it can tend towards boring as there is barely a reprieve from calculation. Overall, interesting and very much worth the time to watch it. It made me like linear algebra, which I find boring.

5

I believe average quality in terms of understanding the contents.

5

Hi, thanks for participating this year! As someone who’s studied computer science, I like how your video represents not just the concept of how RNG actually works, but also the concept of tractible versus intractible search problems, and how preliminary checks to narrow the field can be helpful. I also think it’s good that you’re showing people how matrices represent linear transformations in more abstract spaces.

That said, I did find myself slightly frustrated at certain points in your process that feel like black boxes. In particular, it’s not really clear to me how you’re able to reverse-engineer the matrix you’re using from the results you’re getting, or why there’s a unique outbreak seed we can get as the answer at the end, and as a result it’s really hard to come away with a takeaway about the problem-solving method as opposed to just the result you come to. I think this could potentially be improved if you were able to construct a smaller-scale version of the problem that you were able to more fully present a manual solution for, which you could use as you explained some of the concepts you were planning on using before showing the Kadabra example.

That said, I understand that balancing these things isn’t easy, and here you’re trying to communicate a lot of complex information to a broad audience, so I hope it’s clear I’m not trying to talk down on you. I hope you have a nice rest of your day.

8.6

A highly novel approach to a problem! The animation is amazing!

6

Interesting demo of an example use-case of linear algebra, and some of the interesting ways systems can fail to be cryptographically secure.

I don’t love the AI-generated style of some of your graphics.

Some of the complications about the particular game made this not as clean of a case study in linear algebra to generalize broadly, but I appreciate how well you highlighted those connections that did exist.

6

The visuals were fine and the subject interesting and memorable. There were some points that were not really clear for me. For instance, you present RNG as a function that match an input to an output, but surely this function must satisfy some properties, it is not sufficient to construct a function as a function that returns always 3 for instance is not really random. And then if the function is complex as the Xoshiro seems to be, is it really so simple to inverse?

7.4

Pokemon is a huge game and thus this video can attract people that either like the game or just math, making it more novel.

6.5

Enjoyed the link to the pokemon franchise. Relating this to everyday appliances was a fun way of understanding this mathematical theory.

2.1

Much too long explanation for the use case of matrices. And the actual matrix for inverting the RNG was not really shown at al…

6.5

This video does a very good job of explaining how RNG in games work, gives a helpful new perspective on Linear Algebra, and makes the case for why math can help with people’s everyday problems. However, it is somewhat ambitious and it’s difficult to cover this amount of content quickly and understandably. While it was great to get into the technical details, having to gloss over some of the details just raised questions in my head that made it hard to keep up with the video.