This puzzle took me three years and required thinking in 3721 dimensions

Поділитися
Вставка
  • Опубліковано 21 лис 2024

КОМЕНТАРІ • 1 тис.

  • @AlphaPhoenixChannel
    @AlphaPhoenixChannel  Місяць тому +257

    FAQ and corrections in this comment!
    1) Check out today's sponsor at brilliant.org/alphaphoenix/ for 20% off!
    2) Yes, there will be a part 2 video, but no, it's not coming out next. these programming videos are monstrous to edit because they're all animations and I can't stand to look at this project anymore. hopefully the next video is something fun with the high speed camera!
    3) I'd love to see more people take a crack at this! Someone on Patreon wrote a fantastic algorithm this week that could take loads of steps backwards on a glider, but apparently struggled with the larger "play button" pattern I was using.
    4) A LOT of people are complaining about the complexity section, but I chose my words very carefully there. I said “NP complete is AT WORST exponential”. I also said “there’s no KNOWN algorithm” to solve NP hard questions in polynomial time.
    5) AI would be awful for this problem. Neural nets also likes smooth parameter spaces, and they are good at finding “good” solutions not “exact” solutions.
    6) a lot of people are pointing out that there can be more than one GoL board that leads to any given desired GoL board. On the surface it feels like this would make the problem easier, because there are more solutions to find, but it’s also this property that guarantees you will have “Eden” game boards that cannot be produced by a previous step.
    7) Tile solver: a bunch of people have suggested pre solving tiles, and I love this idea - it’s one that I tossed around too late down my path of pixel-by-pixel SAT. You’re trading precompute time and memory to build an enormous library: find every way to back up a 3x3 area and save them, then catalog if a tile is used to back up a particular state, what tiles could be adjacent (this will chop down the long list to a less but still quite long list), then you can build a solution from tiles. Maybe by making tiles from tiles iteratively you could precompute solutions for quite large patterns. This may be an interesting way to cut down run-time complexity pretty massively. I didn’t initially go this way because I felt it would be difficult to keep the simulation small while taking multiple steps backwards, but that could be sorted by your tile selection method/biases (a sat solver would be faster but it’s not easily biasable)

    • @tomholroyd7519
      @tomholroyd7519 Місяць тому +10

      Garden of Eden patterns were proven to exist. So in the worst case it is irreversible. It may be hard to find examples of Gardens of Eden --- oh, it seems you found some!

    • @youngbloodbear9662
      @youngbloodbear9662 Місяць тому +1

      Why couldn’t you invert the rules and check the possibilities that meet those rules?

    • @yaksher
      @yaksher Місяць тому +7

      Minor correction is that "NP" (which as you say at one point) is "nondeterministic polynomial" which does _not_ mean it is not polynomial. We're "pretty sure" that NP-complete problems cannot be done in polynomial time, but proving it is literally a million dollar problem and it's not _known_ to be impossible to do in polynomial time.

    • @yorthundir7343
      @yorthundir7343 Місяць тому +1

      It's not really important to the eventual purpose of the video, but I got caught up by the map at 17:30. I assume the edges wrap, which would account for the odd shape of the ring, but a lot of the top points on the ring are unbalanced despite being of equal height to full solutions next to them. I also don't see any space for solutions that are 3/4 one density and 1/4 of the other. In the end it's either just an imperfect example that demonstrates what it needs to just fine and I shouldn't be thinking about it this hard, or I'm missing something glaring, which is equally possible.

    • @georhodiumgeo9827
      @georhodiumgeo9827 Місяць тому +3

      Can you say what that library was and maybe a link? Python I'm assuming?
      Great video! I watch everything p vs np related and all of your videos so today was a great watch.

  • @Tandanuu
    @Tandanuu Місяць тому +3195

    Bro just made a whole series about entropy and thermodynamics and now he’s surprised that reversing something like Game of Life is hard? :D

    • @Windows__2000
      @Windows__2000 Місяць тому +208

      It is kinda unintuitive that a system can be deterministic in only one direction...

    • @ckq
      @ckq Місяць тому +197

      @@Windows__2000not really if there's multiple ways to undo a step but 1 way to go forward.
      Or just create a measure of entropy

    • @GigsTaggart
      @GigsTaggart Місяць тому +82

      ​@@Windows__2000a little bit but it's the idea behind cryptographic hashing and RNGs and a lot of CS stuff.

    • @hadensnodgrass3472
      @hadensnodgrass3472 Місяць тому +55

      ​@Windows__2000 Hashing is the fundamental principle of privacy on the internet, computers in general. Hashing is crazy simple in one direction, while becoming an NP Hard problem in reverse.
      Large prime encryption key methods work in a similarly way. However they encryption is easily reverseable if you have the private prime key. To compute the private key is an NP Hard problem.
      Gotta love NP problems, that is why it is one of the Millennium Problems.

    • @321ooo123
      @321ooo123 Місяць тому +10

      Actually it's not as simple as that. Entropy can be decreased locally at the expense of an even bigger global increase. So it could be that you'd be able to reorder GoL at the expense of some other increase of entropy. (Not the case with GoL, however).

  • @brothertyler
    @brothertyler Місяць тому +2319

    Surpised you didn't show a solved rubics cube and ask the viewer to try to figure out what unsolved state it began from

    • @AlphaPhoenixChannel
      @AlphaPhoenixChannel  Місяць тому +783

      lol I love that

    • @DeadJDona
      @DeadJDona Місяць тому +50

      on step -1 of solving cube you could only rotate slices from single spatial direction, on step -2 from another (or same), etc. this kinda decrease field of possibilities

    • @HolmesHobbies
      @HolmesHobbies Місяць тому +35

      Perfect analogy!

    • @BryanLu0
      @BryanLu0 Місяць тому +9

      ​@@DeadJDonabut a Rubix cube solve could've taken 20+ moves

    • @Jone952
      @Jone952 Місяць тому +36

      @@HolmesHobbies Is it? Every starting state is a valid one for a solved rubics cube

  • @satibel
    @satibel Місяць тому +1311

    "we did it not because it was easy, but because we thought it would be easy"
    (Naive developer discovering that the algorithm they are trying to reverse is not bijective)

    •  Місяць тому +50

      Bijective or not doesn't necessarily make much of a difference for how hard it is to compute.
      Eg mapping between positive integers and their prime factorisation is bijective, but one direction is hard to compute.

    • @imsleepy620
      @imsleepy620 Місяць тому +37

      Bijectivity doesn't imply ease of computability in each direction, but lack of bijectivity might imply a lack of ease of computability to find the inverse image, for some general enough class of functions?

    • @gabrielfonseca1642
      @gabrielfonseca1642 17 днів тому +2

      @@imsleepy620 I don't think that's true either. As a simple example, consider the problem "for a source and a sink node, find the shortest path between them". There may be multiple shortest paths, but it's solved easily. The inverse "given a shortest path, find the source and the sink" is completely trivial, and has only one solution.

    • @imsleepy620
      @imsleepy620 17 днів тому +1

      @@gabrielfonseca1642 You're right, revisiting my comment I realize I was definitely wrong.

  • @procedurecall4219
    @procedurecall4219 Місяць тому +616

    Computer scientist here.
    If you're just using the SAT-solver built-in to Z3 (as opposed to SMT constraints), you should really instead be using a specialized sat solver like cadical or kissat. They're much much much faster. >1 week for one sat solve at the problem scale you're dealing with is almost always unnecessary. The annual sat competition does a good job keeping track of what's currently fastest.
    If you're actually using SMT constraints in Z3 (like you were previously with integers), you should almost certainly switch to CVC5. It is also much faster than Z3 in almost all cases (save for some theories that you won't use).
    Also, you almost certainly should not be doing manual a local search for multiple steps like you are now. It should be very straightforward and fairly efficient to encode multiple steps of your constraints at once into SAT (or SMT). Then you don't implement manual backtracking (which I'm assuming is what you're doing currently with your "edens") - that's already what DPLL does (and hence what CDCL emulates).
    I'm not sure what your constraint formulation looks like, but also see if you can add any "symmetry breaking constraints". It shouldn't be too hard to find good resources on why these are useful and what they look like.
    Not super important, but also the thing you're calling a "phase space" is what would be called a "reconfiguration graph" in my field, since it's a graph over the space of configurations whose edges correspond to a certain type of "reconfiguration move" (in this case, flipping the colour of a grid point). There are some much cooler reconfiguration graphs. Fun fact the simplex method for linear programming is a greedy reconfiguration graph traversal.

    • @AlphaPhoenixChannel
      @AlphaPhoenixChannel  Місяць тому +106

      The most successful algorithm I’ve tried takes a number of steps backwards at once - as many as I can until it hits a computational limit of multiple days. I’d be very interested to know if there’s a solver optimized for inequalities - my best-performing single-step iterative solver was seeking to leave as few live cells as possible.

    • @AlphaPhoenixChannel
      @AlphaPhoenixChannel  Місяць тому +100

      I know it’s not kosher, but I colloquially call phase spaces, configuration spaces, and parameter spaces the same thing

    • @procedurecall4219
      @procedurecall4219 Місяць тому +68

      @@AlphaPhoenixChannel You're much further along than I thought if you have a multi-step implementation, nice!
      For inequalities, ILP solvers are often recommended, but in my experience they don't perform very well on these sorts of highly combinatorial problems. Z3 has an optimizer built-in that I'm sure you've already found, but it is extremely slow, even on much smaller problems than what you're dealing with.
      Since actually finding the absolute minimum is actually a very strong constraint (requiring either exhaustion or a lower bound, or some combination of the two), you might get better results by relaxing it to some heuristic bound on the number of living cells - say, at most 10% more living cells than what you started with.
      Any chance you're planning to publish your code? I'm curious to see if there are low-hanging improvements.
      Also, if academic publications in overlapping math/cs ever interest you, this is exactly the kind of thing the folks at jcdcggg really like.

    • @AlphaPhoenixChannel
      @AlphaPhoenixChannel  Місяць тому +40

      @@procedurecall4219 I had luck with the SMT solver using an inequality to limit the number of live cells and slowly climbing with that limit until I got a solve. It didn’t work well (ground to a halt) for multi-step solves where I tried to limit the number of live cells in the final step, and I couldn’t come up with a way to limit the number of live cells once I went full Boolean (aside from just giving it a small bounding box)

    • @AlphaPhoenixChannel
      @AlphaPhoenixChannel  Місяць тому +47

      That 10% more limit is startlingly close to what I was actually able to attain lol

  • @Drawliphant
    @Drawliphant Місяць тому +595

    "Conways Game of Death" completely fair name because it kills the developer

  • @8bit_cat72
    @8bit_cat72 Місяць тому +203

    During the video I considered this "what if you just checked every possible combination" but turns out that with a 10 by 10 board, if each combination takes one microsecond it'll take 40 quadrillion years to check them all.

    • @AsmodeusMictian
      @AsmodeusMictian Місяць тому +10

      That's the weird thing about problems like this. There's almost always a solution that's intuitive. "Well of COURSE it would work like this!"
      Then you try it out and it fails almost immediately and you're left scratching your head like "how? how did that possibly fail??"
      I have to admit, it's that fact that keeps me endlessly fascinated even about math I can barely comprehend :D

  • @oafkad
    @oafkad Місяць тому +317

    That false solution thing is also the mechanism behind a lot of "Why didn't evolution lead to X!" conversations. You basically never will go down a hill, even if the evolutionary mountain on the other side is four times as high. Creates these feedback loops where animals keep terrible systems because in order to improve they'd have to "unwind" first.

    • @bozodragojevic
      @bozodragojevic Місяць тому +49

      Meteors are the "unwind"

    • @CoolAsFreya
      @CoolAsFreya Місяць тому +42

      The maths term is "local maxima" which might not be as high as the "global maxima" (largest peak)

    • @theapexsurvivor9538
      @theapexsurvivor9538 Місяць тому +36

      Yep, it's also what causes convergence, as certain local maxima are really massive in the phase space of selective pressure solutions, and thus regardless of how inefficient they might be, they continuously pull in more species.
      (Crabs aren't the ultimate body plan for most niches, but they're a Very attractive one due to how much their traits reinforce each other)

    • @Appletank8
      @Appletank8 Місяць тому +19

      my favorite fact is the laryngeal nerve needing to make a detour down to the heart before going to the neck. It'd be nice for the nerve to connect the right way from the start but there's no practical way to disconnect and reconnect elsewhere during embryo development. making it longer is way easier, which resulted in the poor giraffe not able to make proper sounds.

    • @VeryLostFisherman
      @VeryLostFisherman Місяць тому +11

      Yeah the common one I hear is, apart from flagella, why don't we see more wheels in nature for movement? Everything that is not quite a rotating wheel is bad. It requires walking down too much in phase space relative to competition

  • @moth.monster
    @moth.monster Місяць тому +405

    Another problem which is NP-hard is placing conveyor belts in Factorio.
    Someone made a modified SAT solver that just makes custom belt balancers for you.

    • @DackelDelay
      @DackelDelay Місяць тому +29

      got a link by chance?👀

    • @adrianozambranamarchetti2187
      @adrianozambranamarchetti2187 Місяць тому +3

      ​@@DackelDelayI concur

    • @user-nj1qc7uc9c
      @user-nj1qc7uc9c Місяць тому

      link plz

    • @submachinegun5737
      @submachinegun5737 Місяць тому +67

      Been playing factorio for a while now and I think I’ve mastered or at least understood most systems but compact belt balancers are just black magic to me, just grab a blueprint online and pray to the omnissiah it keeps working fine

    • @evanbarnes9984
      @evanbarnes9984 Місяць тому +1

      Dude I NEED that

  • @SkoddieAltair
    @SkoddieAltair Місяць тому +61

    I’m a software engineer, and I used to work with data that required n-dimensional arrays. At first I was really confused trying to imagine a hypercube of cubes in my brain. As you’ve noted, it’s extremely difficult. One day I was staring across my office at my file cabinet, and I realized that when dealing with arrays using grids & cubes are just an abstraction.
    There’s no reason to conceptualize arrays in dimensions, it’s much easier to imagine them as containers. Like squares -> grid -> cube -> drawer -> cabinet -> storage room -> building -> etc. It’s not a complex shift in metaphor, but for me it made the notion of distance between cells much easier to understand.
    I use the same logic when thinking about configuration space. Containers of containers of containers of containers. It’s surprisingly effective!

    • @alexpetrov3289
      @alexpetrov3289 Місяць тому +5

      Same for me, i wondered how to solve a place-time problem and while thinking about higher dimensions, i stumbled upon the realization, that it is just simply a matter of simplifying the complex system and separating each of the dimensions until we get something which is manageable by the human brain to comprehend. Basically shadow projections. And i have it noted somewhere (as this was a passion project more than anything), but transforming each dimension to a lower one takes some amount of calculations and translating between dimensions is a matter of reversing the calculations, and communicating between the created layers of lower dimension objects is a matter of finding the correct path. Somehow i thought about optimal path cost adjustment, but sadly it was quite some time ago and i need to revise my notes.

  • @joshuascholar3220
    @joshuascholar3220 Місяць тому +110

    I get SO frustrated with other people's videos because they DON'T understand the problem they're looking at to the depth you do and they don't explain it. Thank you for making the first video I've seen in a long time that lacks the hand waving of incomprehension.

  • @Axolotine
    @Axolotine Місяць тому +114

    Heartbreaking: someone has solved your non trivial problem but used completely different terminology you were unaware of meaning that if you just knew what you didn't know you didn't know you would have saved yourself endless headache

    • @AlphaPhoenixChannel
      @AlphaPhoenixChannel  Місяць тому +21

      Care to enlighten?

    • @Axolotine
      @Axolotine Місяць тому +56

      @@AlphaPhoenixChannel I mean to say, I didn't know about SAT solvers and it could have saved me a lot of time lol

    • @Houshalter
      @Houshalter Місяць тому +26

      ​@@Axolotinethere are people who have spent years writing custom solvers for problems that are easily done by SAT solvers. It is the worst marketed field of computer science.

  • @MooImABunny
    @MooImABunny Місяць тому +211

    I really love how Gerrymandering is relatively much more computationally easier than reversing GoL states.
    Like, oh, making this cool pattern pop out? insanely hard, computationally intensive.
    Abusing loopholes in a democratic system leading to political corruption? yeah dude, it's a walk in the park

    • @user-nj1qc7uc9c
      @user-nj1qc7uc9c Місяць тому +33

      the reason it is easier is because we are just looking for a "good" solution; we are okay with reaching false summits with our gradient ascent algorithm
      with reversing GOL, we are specifically looking for a *perfect* solution
      so yeah, as it turns out, election rigging is computationally easy! :D

    • @NgenDoesGaming
      @NgenDoesGaming Місяць тому +22

      Relevant XKCD: 1425

    • @Dong_Harvey
      @Dong_Harvey Місяць тому +2

      Get rid of the "representative" part, nobody can represent a group

    • @AsmodeusMictian
      @AsmodeusMictian Місяць тому +3

      @@Dong_Harvey Well, I'm convinced. No need for any context for your remark or data or that pesky "proof". Just a bold, clear, and very inaccurate statement.
      I'm SOLD!!!

  • @mshonle
    @mshonle Місяць тому +65

    The N always stands for Nondeterministic. The NP-hard problems in NP are those that can be *verified* in polynomial time. It’s an open problem (with a million dollar prize!) to prove or disprove if all the problems verifiable in polynomial time can be decided in polynomial time. - So, polynomials are still very much involved!
    (Note: the qualifier of “NP-hard in NP” in necessary, because there are undecidable problems that are NP-hard: the Halting problem is famously undecidable, but it’s trivially easy to reduce any NP problem to the halting problem: simply prepend a string representing a Turing machine that solves that NP problem. Likewise, if the N actually stood for “non” then it would include the halting problem as well.)

    • @3211learza
      @3211learza Місяць тому +3

      while that's *true* (and I would assume alphaphoenix knows it is), I read that "Not Polynomial" more as a simplification for the viewers that might be less involved in computer science; as all simplifications do, it leaves out some detail, but since we're not here to solve a millenium problem, we might as well treat NP problems as not solvable in polynomial time

    • @jacksonmagas9698
      @jacksonmagas9698 Місяць тому +1

      Its easier to just say NP complete, and only say NP hard if you actually mean to include EXP and beyond.

    • @MadocComadrin
      @MadocComadrin 25 днів тому

      ​@@3211learzaThe problem with using "Not" instead of "Nondeterministic" is that you actually make a statement that's kind of false if you use an equivalent definition of NP: the class of algoritms decided by a Nondeterministic Turing Machine in polynomial time. To say it's not polynomial is wrong without being more specific.

  • @Arkios64
    @Arkios64 Місяць тому +16

    I'm incredibly chuffed at the recent trend of not deciding that "this video idea takes way too long to arrive at the final stage to be worth a video" and instead adapting it to "this incredibly simple looking thing took me incredible effort, let me explain to you the surprising reasons why".
    A lot of my favourite channels have been putting out partial successes or outright failures and creating absolutely wonderful pieces of content.

  • @Kargoneth
    @Kargoneth Місяць тому +96

    It's like trying to reverse a hash.

    • @jimburton5592
      @jimburton5592 Місяць тому +7

      What season did Barry Allen finally defeat the Reverse Hash?

    • @dcnick3
      @dcnick3 Місяць тому +18

      Reversing a (cryptographically strong) hash is kinda even worse, because there's no metric of how close you are, the only real algorithm is an exhaustive search of the inputs

    • @deltamico
      @deltamico Місяць тому +1

      I searched if simple hashes are threatened by quantum computing and apparently not as much as assymetric keys

    • @jimburton5592
      @jimburton5592 Місяць тому +3

      @@deltamico I like adding color codes for an added layer of security. My favorite is hash browns

    • @spicybaguette7706
      @spicybaguette7706 Місяць тому +2

      Imagine using a game-of-life simulation as a hash function. It would perform terribly, but it would be super cool XD

  • @jonasmaier6631
    @jonasmaier6631 Місяць тому +73

    24:10 to be completely precise, it is not known if NP-complete problems require non-polynomial time to solve (but it is widely believed to require exponential time and all current SAT solvers are running in exponential time (with some heuristics to hopefully be fast in easy cases)). Just one of those open problems in computer science.

    • @columbus8myhw
      @columbus8myhw Місяць тому +12

      Arguably it's _the_ open problem in computer science. It's the most famous one: P=NP.

    • @Frank01985
      @Frank01985 Місяць тому +1

      In addition, although the entire class of SAT problems is NP-complete, that does not mean any one instance of a SAT problem can not be solved in polynomial time. In fact, it's quite easy to come up with subsets of SAT problems that can be solved in polynomial time (e.g. those that can be separated into smaller, fixed-size SAT problems because variables do not overlap).
      So it is very well possible that the problem of finding the previous state in game of life, expressed as a SAT problem, could be solved in polynomial time, even if it was proven that the entire class of SAT problems could not be solved in polynomial time.

    • @jonasmaier6631
      @jonasmaier6631 Місяць тому +3

      @@Frank01985 reversing game of life is NP-hard. You can do Turing machines in game of life, hence you can also do boolean circuits in game of life, and if you try to reverse those you're essentially solving SAT.

    • @Frank01985
      @Frank01985 Місяць тому

      @@jonasmaier6631 That makes sense when considering reversing more than one step. I wonder if this still holds for reversing just one step into one feasible solution (instead of enumerating all solutions). A boolean circuit will need more steps to compute a more complex circuit. I could see it being the case that reversing one step can be done in polynomial time, but considering the combinatorial explosion of all possibilities that need to be searched for multiple reverse steps, that that is not feasible in polynomial time.

    • @gabrielfonseca1642
      @gabrielfonseca1642 17 днів тому

      @@Frank01985 Yeah he reduced game of life into SAT, which doesn't say anything about game of life's complexity. But I don't think the point of the video was to show reversing game of life is NP-hard. Other people pointed him to the SAT solver already knowing the problem was NP-hard. I think solving even one time step is NP-hard. If it was solvable in polynomial time, I don't see why you couldn't just iteratively solve it to get the desired starting configuration "n time steps ago" (I could be wrong though).

  • @pykapuka
    @pykapuka Місяць тому +5

    Thanks Brian, I love this video so much! I didnt know something like Z3 existed. This is like telling me "Did you know: if you wiggle your arms like that, you can fly?"

  • @FAT9L
    @FAT9L 7 днів тому +1

    FINALLY, an answer to the burning question I've been asking myself for decades: whether it's more difficult to reverse Conway's Game of Life or to gerrymander the state of North Carolina

  • @NorthOfEarth
    @NorthOfEarth Місяць тому +12

    At 10:00 I noticed something interesting. Traversing diagonally across a face always flips the same two pixels. Look a the front face. The top two pixels change along each diagonal, but the bottom one is never affected. Along the top face, diagonals flip the left and bottom pixels, but never the right one. Similarly, traversing the 3D diagonal flips all 3 pixels. A 4D diagonal four flip 4 pixels, etc. This means a path length of sqrt(n) would always flip n pixels, making plotting a path much easier to calculate.
    You could imagine a large image with huge chunks of pixels being the wrong color. Instead of navigating through configuration space in cardinal directions only, you could take a shortcut by pre-calculating and caching the diagonal that corresponds to flipping that entire chunk. Maybe divide the whole pixel array into smaller square chunks for faster processing, etc, etc.

  • @jokebird6479
    @jokebird6479 Місяць тому +2

    This has given me a really good understanding of configuration space and p vs. np problems. I’ve always wondered about p vs. np problems but I could never find an explanation I found intuitive. Also, I can’t imagine just how useful configuration space will be to me, being able to think and compute higher dimensions! Thank you for this video, it’s awesome!

  • @manuelpena3988
    @manuelpena3988 Місяць тому +82

    I once heard a very clever computer scientist say:
    We programmers do no choose what we work on because it is easy. We choose it because we thought it would be easy!

  • @bretonkyle
    @bretonkyle Місяць тому +7

    You know you've watched too much This Old Tony when the music at 7:09 reminds you of TIG welding and drilling holes

  • @digantamukhopadhyaydex
    @digantamukhopadhyaydex Місяць тому +173

    also afaik z3 doesn't have any progress bar, did u find that at all anxiety inducing? like if you had stopped the solve 1.9wk after start, maybe you would have missed a solution that you could have found with just one more day of solving

    • @AlphaPhoenixChannel
      @AlphaPhoenixChannel  Місяць тому +216

      I don't even remember what its solving right now, but there's been one going for like the past month that I haven't wanted to shut down. it's got to be close... right??

    • @ignaloidas
      @ignaloidas Місяць тому +56

      It's the nature of the fact that the solving involves random guessing - you can't know how close to a solution are you. Some pure SAT solvers like Kissat can give you numbers on how many variables they have left, which essentially shows you the search space that is still left, but that still isn't that useful, because often that remaining search space could take until the heat death of the universe to complete.

    • @ivanovtv9817
      @ivanovtv9817 Місяць тому +163

      99% of z3 users terminate the program right before they find a solution

    • @Momi_V
      @Momi_V Місяць тому +12

      ​@@ivanovtv9817 *right before being a relative term in relation to the end of time itself

    • @Joonazan
      @Joonazan Місяць тому +6

      It has been shown that restarting after some (steadily increasing) time is optimal for certain SAT-solving algorithms. Probably Z3 already does this, though.

  • @steubens7
    @steubens7 Місяць тому +18

    did you hear about Golly during this investigation? it runs finite automata extremely quickly because of a method called hashlife. it memoizes computed blocks to advance larger and larger patterns more quickly than evaluating the rules. you can use it to look backwards by looking forwards, unless there's an *incredibly* improbable situation that can never happen under a certain sized starting condition, it will find it

    • @SimonClarkstone
      @SimonClarkstone Місяць тому +2

      I was wondering if you could do something like Hashlife too. It would start with all the ways to reverse a 2*2 configuration to get some 4*4 configurations, then try following back only the parts in the end image and matching the overlaps together to build up the ways to run the needed 4*4 configurations backwards 2 steps to get 8*8 configurations, then match up the edges of those (by the recursive hash) etc. I expect the hash tables would soon get impractically huge though.

    • @Avidiax
      @Avidiax Місяць тому +2

      For much of the video, I was wondering why there would not be a way to precompute all (k+1)*(k+1) automata as a way to stitch together a k*k solution. If k^2^2 ends up being too large for memory, then a variation of rainbow tables could be used, albeit with the problem that many states evolve to "everything dead", and for large k there are many states that are translations of each other that should ideally be coalesced.

    • @momom6197
      @momom6197 Місяць тому +2

      It would indeed help a lot for reversing large configurations when you have some canonical preceding configuration (e.g. there are a lot of gliders in the figure and you make their ancestor another glider), but it wouldn't help with the hard part of the problem which is finding some ancestor in the first place.

  • @ohadcohen9813
    @ohadcohen9813 Місяць тому +14

    5 minutes into the video and I was screaming at the screen USE SAT SOLVERS! Glad you went there eventually, and I hope you had a wonderful eureaka moment :)

    • @jacksonmagas9698
      @jacksonmagas9698 Місяць тому +5

      I saw the thumbnail, thought about it for about a minute, and then said "this is just SAT isn't it" Boolean variables (cells) with constraints, and you want to see if there is a satisfying assignment to those variables.

  • @carnac333
    @carnac333 Місяць тому +11

    Awesome video and explanation!! This reminds me of my research area of inverse problems, where one aims to reconstruct the object of interest from indirect measurements.
    As an example, in Computed Tomography (CT), we reconstruct the image of the imaged target from x-rays projected through the target. The information of the inner structures is encoded into the measured x-rays, which have been attenuated proportionally to the attenuation different tissues (for example very high in bones and lower in soft tissues). Commonly, the inverse problem is formulated using a model for the x-ray attenuation, known as the forward model and the sough after image is obtained by iteratively minimising the difference between the measured data and the predicted data produced by the forward model applied to the estimated image. Often, however, the problems are ill-posed, meaning that the solution might be non-unique, have many local maximum/minima, or noise can have a detrimental effect on the solution. In these cases we often employ regularisation, which imposes assumptions on the solution (such as smoothing) and makes the problem less ill-posed and more feasible to solve.
    Although this problem is completely different to ones I'm accustomed to, there are many parallels. The forward model is the algorithm that runs the game of life, the indirect measurements (measured x-rays in CT) are the starting point, the final sough after image (CT image) is the final image you are after for and problems with optimisation (local minima/maximima) are common. Very cool to video!

  • @Schlimbinger
    @Schlimbinger Місяць тому +25

    This reminds me of something. A while ago a buddy and me made something similar using langtons ant. We used multiple ants at different starting positions to “encrypt” a message.
    The world the ants reside in basically was a 2d-grid representation of the input message bytes. They then would do their thing for many iterations.
    Just a fun project, nothing serious. But it was nice to see your message emerge from “random” noise :D
    Never thought about how one could crack it but it would not surprise me if it’s relatively easy lol

    • @MrAppleGuySnake
      @MrAppleGuySnake Місяць тому +1

      That's amazing, how did you implement it?

  • @bennettpalmer1741
    @bennettpalmer1741 Місяць тому +8

    It's funny, because my first instinct when I saw this was "Oh, this is basically minesweeper, that's an NP complete problem we are pretty good at solving, you should just convert it to that to solve it" and after messing around with configuration space for a bit, making me worried I was doing it wrong, you eventually decided "this is basically the SAT problem, I'll just convert it to that to solve it". I basically had the solution right off the bat, but we picked different NP-complete problems to use. I wonder if one is better/more efficient?

    • @BetaDude40
      @BetaDude40 Місяць тому

      That's the thing about NP-Completeness, they're all basically the same problem just phrased a little differently. If you could solve one in polynomial time, you could apply the same algorithms to all of the problems in NP-Complete.

    • @Houshalter
      @Houshalter Місяць тому

      There has probably been a lot more work put into SAT solvers. They have competitions and investment from industries that use it. Also most computer scientists are familiar with boolean logic, and can probably figure out how to encode their problem into it. I wouldn't even know where to begin encoding something into minesweeper.

  • @OrangeC7
    @OrangeC7 Місяць тому +58

    Oh yeah! My favorite Blokus tile is the pentomino that's, like, a 2x2 square with another square attached to it. I don't really think it's the *coolest* one but, it's pretty unique all things considered so it ends up being my favorite

    • @AlphaPhoenixChannel
      @AlphaPhoenixChannel  Місяць тому +17

      i always thought that was one kind of a weird lump shape - granted when you can use it perfectly to flatten a rough wall, its extremely satisfying

    • @fuuryuuSKK
      @fuuryuuSKK Місяць тому +6

      so the P-pentomino.
      Also, the "r" mentioned earlier in the video is actually more commonly called the F-pentomino

    • @typicwhisper6569
      @typicwhisper6569 Місяць тому +6

      @fuuryuuSKK It's almost always referred to as an R-pentomino in the context of Conway's Game of life, as Conway had his own names for the pentominos.

    • @GDTerietto
      @GDTerietto Місяць тому +1

      i gotta go with the C-pentomino

    • @fuuryuuSKK
      @fuuryuuSKK Місяць тому +2

      @@GDTerietto Pretty sure that one's commonly called the U?

  • @JTCF
    @JTCF Місяць тому +8

    33:33
    "Eden found" did the computer just die and ascend to heaven?..

  • @harold2718
    @harold2718 Місяць тому +21

    Have you looked at zero-suppressed decision diagrams also, they "break down" (by running out of memory) more often than SAT solvers but when they work they enable you to ask questions about the entire space of solutions (instead of just getting one of them, as SAT would, making you generate them one-by-one with extra constraints). Such as you can ask how many solutions there are, or even a list of pairs of how many solutions there are for each number of "live" cells, or find the solutions with the most or least life cells.

    • @Mikee512
      @Mikee512 Місяць тому

      A ZDD is an efficient* way to encode solutions to a boolean function, but you still need to calculate the solutions, which I think is a significant portion of the difficulty here.
      *ZDDs are efficient in that they encode the solutions in the smallest possible datastructure which, because boolean logic, also turns out to be maximally efficient to search/query (assuming you can figure out how to write an efficient algorithm to query it for what you want to know, which is part of what SAT helps with in the first place.) However, just because it's maximally efficient doesn't mean a complete solution set (or even a sufficiently-interesting subset of solutions) will fit within storage/RAM constraints, or be traversable in a reasonable amount of time.
      The solutions the SAT solver finds could be used to build up a ZDD, perhaps incrementally, for efficient searching later? There's a software package called CUDD that helps working with ZDDs. Anyway, it's interesting to think about how it might be useful in this context. A few caveats may limit its usefulness:
      * Because building a ZDD presupposes having solutions to encode into it, if finding the raw solutions is the primary difficulty, then ZDD's usefulness may be limited
      * And while a ZDD is a highly efficient datastructure, whether you can express the precise query you want to ask in a form that runs efficiently, depends on whether you can reuse existing efficient queries or figure out how to craft your own, which can be non-trivial.

    • @harold2718
      @harold2718 Місяць тому

      @@Mikee512 You wouldn't create the ZDD by finding all the solutions and then converting them to a ZDD though (you could, but it's not efficient, as you identified), you'd build it by melding together ZDDs representing individual constraints

  • @heh2393
    @heh2393 Місяць тому +10

    27:48 in practice we encode such "sum" constraints for SAT solving in a different way that's much more succint; see Tseitin's encoding

  • @jeffpkamp
    @jeffpkamp Місяць тому +1

    Videos like this can destroy somebody's entire year!
    I'm glad you were able to set the project down every now and then.

  • @acf2802
    @acf2802 Місяць тому +47

    I bet reddit still thinks it can't be done after watching this video.

    • @guy9360
      @guy9360 Місяць тому +13

      "He didn't ACTUALLY do it, he simply ..."

  • @googleyoutubechannel8554
    @googleyoutubechannel8554 Місяць тому +2

    'SAT solvers' in general seem like some of the most useful frameworks humans have come up with for formulating problems. Most of the 'work' in any model or problem solving is just formulating the problem in a way that computers can apply their 'dumb' brute force processing to, there's something very deep about this reformulation that I think we've been uncovering ever since Turing lit the spark 80 years ago.

  • @andytroo
    @andytroo Місяць тому +70

    the game of life is turing complete - assuming you have enough grid space ... does that mean solving this is a limited space halting problem?
    also, solution to sat: "I can't get no satisfaction 'cause I try and i try and i try" - Description of brute force SAT solving strategies, [Jagger, Richards, et al.; published in "Out of Our Hands, 1965, available online]

    • @AlphaPhoenixChannel
      @AlphaPhoenixChannel  Місяць тому +16

      What a great application of lyrics 😂

    • @typeswitch
      @typeswitch Місяць тому +20

      > the game of life is Turing complete
      This only matters if you're running the game of life forwards for an indefinite number of steps (& an unbounded grid space). Trying to reverse a finite game of life configuration by a single step is in NP, so it can be solved using a SAT solver, as practically demonstrated in this video.

    • @jeffreyblack666
      @jeffreyblack666 Місяць тому +1

      This is going backwards, not forwards. Comparing it to the halting problem, this is more like looking at the "end state" of the halting problem, in this case a program which never halts, and asking what input gets there.

    • @gamekiller0123
      @gamekiller0123 Місяць тому

      It's not the halting problem. It's related to the existence of one-way functions, but the "reverse game of life" problem might be easy even if one way functions exist.
      The reason is that reductions rely on encoding Turing machines into the game of life, but you can reverse into states that aren't encoded Turing machines, which then won't give you the inverse of the one-way function.

  • @Т1000-м1и
    @Т1000-м1и 28 днів тому +1

    It was an interesting thing to discover that "blockus tile" pattern as a kid

  • @Krunked
    @Krunked Місяць тому +4

    that is extremely abstract. but i love it. tickles my brain. i dont get this sorta thing at my work (site reliability engineer), but this reminds me of cool science classes i loved in higher ed. i love these vids thank you for making them :)

  • @andersama2215
    @andersama2215 Місяць тому +1

    When you opened with this video and started to explain the project, my initial thought was, oh this is like backtracking algorithms to solve sudoku, and then immediately was reminded of SAT solvers like Z3.

  • @tonydai782
    @tonydai782 Місяць тому +5

    26:06 Hexagons *are* the Bestagons after all.

  • @talis1063
    @talis1063 Місяць тому +1

    Just did a university homework on local search yesterday. The algorithm that selects the best next step based on a heuristic from a neighborhood of nodes is called the hill climbing algorithm. Even if finding the optimal solution is NP-complete, finding a solution might not be with a metaheuristic algorithm like hill climbing with random restarts. But of course there is no guarantee that a solution is found in a reasonable time, especially if the solution space is very sparse (which seems to be the case here).
    Not trying to say that anything is wrong in the video, just find it cool that this video popped in my feed with perfect timing and wanted to share.

  • @JochemKuijpers
    @JochemKuijpers Місяць тому +11

    The main lesson from this video seems to be that you should use the right tool for the job 😄
    SAT problems are "too discrete" for a gradient descent algorithm. Arbitrary changes don't result in predictable increases in the result space as there's no real continuous output of a SAT-solver that can tell you how close you are to a solution. The number of requirements met is not a useful metric here, a single requirement may prevent you from solving a problem even if you hit all other requirements. So any notion of 'derivative' or 'gradient' doesn't really make sense for these types of problems.
    A couple times you referred to the configuration space as 'continuous', but it really isn't continuous at all. Even in the city example you're dealing with discrete cells and boolean assignments. The parameters you used to divide the city may have been continuous but the output is discrete, which should've been the first hint that gradient descent may not have been the best tool for the job. The parameter space also excluded many valid solutions, such as a checkerboard pattern, that would've evenly divided the city. Unless you're certain that your simplifications in parameter space don't exclude the valid solution you're looking for, that's almost always a bad idea. (though, I understand that was a simplified example to make a point 🙂).

    • @MrTomyCJ
      @MrTomyCJ Місяць тому +1

      I really wanted to see someone try a neural network approach to this. I feel like "deep intuition" may help traverse the messy configuration space.

    • @cannot-handle-handles
      @cannot-handle-handles Місяць тому

      True, it's not continuous, but it is at least Lipschitz.
      The checkerboard pattern isn't simply connected, however. Among the simply connected solutions, I would have liked to see those containing either 1 or 3 city quadrants.

  • @SpontaneousProcess
    @SpontaneousProcess Місяць тому +1

    Well, power to you! Discovering that your question is equivalent to SAT was already further than I would have gotten. When someone asks me “can you go backwards in the algorithm”, my usual answer is “no” without even thinking about it.

  • @lukatambourgi9372
    @lukatambourgi9372 Місяць тому +19

    4:00 its impossible to compute THE previous state. Easy example: an empty board. Was the previous state an empty board too? 1 cell? 2 cells aligned but spaced by 2 empty ones? Or the space between was 3? 4? 99999? Graams number? Tree(3)?????? We cant know

  • @ts4gv
    @ts4gv Місяць тому +1

    26:05 by hexagonalizing the banquet table problem you've made it CGP-complete.

  • @top1cpvper
    @top1cpvper Місяць тому +41

    Putting Alice and Bob outside of a cryptography problem should be considered a war crime

    • @AlphaPhoenixChannel
      @AlphaPhoenixChannel  Місяць тому +8

      😁

    • @dwightk.schrute8696
      @dwightk.schrute8696 Місяць тому +4

      You sound like Mallory!

    • @evannibbe9375
      @evannibbe9375 Місяць тому +4

      Using exile as punishment is now a crime under international law (similar to stripping Alice and Bob of their citizenship to Cryptography land).

    • @Dong_Harvey
      @Dong_Harvey Місяць тому

      They know what they did. Or maybe did not.

  • @Nevermind445
    @Nevermind445 Місяць тому +1

    There's no way this can't be improved on ima go do it

  • @jsbarretto
    @jsbarretto Місяць тому +6

    I've found it's very common for Redditors to over-generalise their knowledge. They might have read "solving P for all configurations of X is impossible in general" and will translate that, in their mind, to "solving P for any configuration of X is impossible". This video is a great example of the fact that 99% of the time you don't need to solve the general problem to find a solution that satisfies a more constrained subset of the problem!

    • @czer096
      @czer096 26 днів тому

      Yeah it's reddit
      Bunch of idiot with slightly more knowledge

    • @Rudxain
      @Rudxain 26 днів тому

      I guess that's known as "over-fitting"

  • @michaeltraynor5893
    @michaeltraynor5893 Місяць тому +2

    My first software job was at the company that convinced Microsoft to open-source Z3 :) we used it to find bugs in aerospace designs

  • @flexico64
    @flexico64 Місяць тому +3

    As much as I love math(s), the tables problem makes me want to say, "Shut up and eat."

  • @SamChaneyProductions
    @SamChaneyProductions Місяць тому

    You make some of the best content on the platform. Incredibly informative without being dry

  • @arc8dia
    @arc8dia Місяць тому +4

    Maybe this is why entropy and causality go in one direction, and we call it time.

  • @Wackylemon64
    @Wackylemon64 Місяць тому

    I love your explanations and visualizations! Your passion is clear! I've been trying to improve my intuition of latent/configuration spaces, and explanations like this are always welcome!

  • @H_fromDiscord_real
    @H_fromDiscord_real Місяць тому +3

    0:52 this is called the f-pentomino, and it's mirror image is called the e-pentomino

  • @SR-fm1ft
    @SR-fm1ft Місяць тому

    Seriously underrated UA-cam channel. Most this stuff is way above my intelligence but can’t stop watching these videos super interesting stuff!

  • @johnreiland9180
    @johnreiland9180 Місяць тому +61

    Around the 7:30 mark, when you are explaining Configuration Space, the music is quite loud, to the degree that I think it becomes an obstacle to cognition. Love your videos, not hating on you or them, just wanted to mention this small spot that I think can be improved.

    • @y00t00b3r
      @y00t00b3r Місяць тому +3

      grr, hate that

    • @StuartWoodwardJP
      @StuartWoodwardJP Місяць тому

      Yep. music behind an explanation is really distracting. I didn’t enjoy that segment.

  • @I.____.....__...__
    @I.____.....__...__ Місяць тому +2

    3:47 As Brian found out, that's a specious question. The fact that the GoL has stable loops in the finite-state-machine, means that there's no deterministic way to find a unique pattern that would result in anything in particular. For example, the standard solid 2×2 block configuration could arise as the next step from a very large number of permutations of states from even just the surround few cells, or… another 2×2 block. … 33:12 👍 This video is speeding into NP-completeness territory. … 23:30 👍
    34:19 Yeah, that makes sense, because the target pattern will be made from a LARGER pattern, which itself will be made from a larger pattern, and so on. You might get lucky and have a target pattern (or intermediate pattern) that can be made with gliders and spinners and such which can reduce the size of then parent pattern, but most patterns will usually be made from physically-larger non-repetetive patterns.

  • @duncanbyrne1134
    @duncanbyrne1134 Місяць тому +3

    To me this sounds like a perfect inverse problem. Pretty much how do we go from a current state and work our way backwards to find the initial state, given that the initial state has pretty much infinite possibilities and there are infinite solutions. Inverse problems are pretty heavily studied at least in geophysics and hence there are some solid algorithms for them. That might be another approach to solve this problem which could make it much faster.

  • @LightProgRock
    @LightProgRock 16 днів тому

    Amazing video ! I've been playing with the game of life a lot, to generate chords used in my music and now I know that I can decide that I want the last chord to be one specific chord, which is really useful !! Now I don't know if I will becaise it seems to be really hard, but… maybe one day 😅

  • @justindie7543
    @justindie7543 Місяць тому +27

    Gotta love redditors. Never ask reddit for advice with anything if you want to be optimistic about it in any way.

  • @AlmightyJu2
    @AlmightyJu2 Місяць тому

    As always this is such a good balance between complex, simplified but not too much that all the nuance of how it's complex is lost. Can't wait for the follow up!

  • @powndy24
    @powndy24 Місяць тому +21

    2^36 *1ms /16 cores =2 months. Just saying

    • @ivanjermakov
      @ivanjermakov Місяць тому +9

      Best case, don't forget parallelization overhead.

    • @AlphaPhoenixChannel
      @AlphaPhoenixChannel  Місяць тому +8

      And the fact we’ve got a LOT more than 36 pixels to consider

    • @GerinoMorn
      @GerinoMorn Місяць тому +2

      I know that it ain't gonna help for like doing many steps in parallel, but in general it looks like it could be GPU accelerated... Is this something the Z3 already leverages? Or at least maybe SIMD...

    • @AlphaPhoenixChannel
      @AlphaPhoenixChannel  Місяць тому +6

      @@GerinoMorn if you're literally just trying all the solutions, that's parallelization with zero loss. they can each work on a subset. the problem is that you double the number of cores you need each time you add a pixel to the solution space

    • @jmacd8817
      @jmacd8817 Місяць тому +1

      ​@AlphaPhoenixChannel but the 16,000 CUDA cores in a RTX 4090 can't hurt. I'm not sure if the ~2.2 Ghz would slow you down too much. With the likely pending of the 5090 and friends coming at some point in the not too distant future, more compute is coming.

  • @naukowiec
    @naukowiec Місяць тому +2

    Have you considered a wave function collapse in causality space ( populate the 2d prediction list with all possible 3x3 starter grids for the current state), solve for overlap in the 3x3 grids ( as graphs) and then run wave function collapse from a random starting point to see if it has a solution?

    • @straft5759
      @straft5759 28 днів тому

      Might actually work! But on the other hand WFC gets itself into situations where it needs to backtrack multiple times with a lot of rule sets, especially complicated ones, so I'm not too optimistic. Maybe a larger overlap area could do the trick? Maybe you could even use dynamic programming for that? I think I'd have to test it out

  • @stanleydodds9
    @stanleydodds9 Місяць тому +2

    Nobody knows that NP complete problems cannot be solved in polynomial time. It is generally considered unlikely that they could be, but we do not know any reason that NP complete problems cannot be solved in polynomial time; that is, NP may be no larger than P, which of course would make it equal to P (trivially all P problems are also non-deterministic P). All that "NP complete" or "NP hard" means is that it is a problem that can be solved non-deterministically in polynomial time (that is, it is in NP), and also it is maximally hard. A maximally hard NP problem is one where a solution to this problem can be reduced to a solution to any NP problem (with at most polynomial slow-down). The typical example of such a problem is, of course, SAT. It's no coincidence that we use SAT solvers to solve all NP problems - SAT being NP hard exactly means that a SAT solver can solve all NP problems without significant slow-down. We also know many other NP complete problems, i.e. many problems that can be reduced to all NP problems, including each other. It's just that SAT is quite probably the "simpl.
    Secondly (but similarly), EXP (algorithms that run in exponential time) is weakly larger than NP, and it is suspected to be strictly larger than NP. Or put another way, NP is closely related to polynomial time (it's about a more general idea of polynomial time than P); it is not really about exponential time per se, although it is trivial that NP problems can be solved in exponential time by the naive brute force algorithm of checking all possible solutions. But note that also P problems, or indeed any easy problems, can be solved in exponential time. It's trivial in the same way that solving NP problems in exponential time is trivial. That doesn't necessarily mean exponential time is the fastest we can do for NP problems, and it doesn't mean that all exponential time problems can be verified / solved non-deterministically in polynomial time (they probably can't all be).

  • @Sidewinder0010
    @Sidewinder0010 Місяць тому

    13:00 thank you so much! I have watched countless videos of people explaining higher dimensional spaces over the years and this finally clicked for me!

  • @typeswitch
    @typeswitch Місяць тому +12

    Oh when I started the video I thought "I hope he's using a SAT solver" and I wasn't disappointed hehe :-)
    24:35 NP-hard doesn't mean "not polynomial time" and NP-complete doesn't mean "it can be solved in exponential time". I know this isn't a CS channel but I wish you were a little more precise at explaining these concepts the first time for people who might not already be familiar with them.
    The visualisation of (CDCL) SAT solvers as crossing out whole swathes of solution space where only suboptimal solutions exist, is really good! Thanks for this insight.

    • @AlphaPhoenixChannel
      @AlphaPhoenixChannel  Місяць тому +5

      I know those aren't the rigorous definitions, but they are true statements. I went back and forth a LOT about that segment trying to say what needed to be said relevant to this video (and not too much), but not be incorrect.
      Edit:
      The verbiage I used to describe NP complete in the video was “at worst exponential time”, which is a very precise way to phrase it.
      Claiming that NP is “not polynomial time” in the graphic and saying “no known algorithm to solve in polynomial time” is also I think a very precise way to phrase it. The graphic annotation is practical and the part I said out loud was exact

    • @typeswitch
      @typeswitch Місяць тому +7

      @@AlphaPhoenixChannel Well, they're not entirely true, no. NP-hard doesn't imply "not polynomial time", it only implies "we don't know a polynomial time algorithm to solve this (and probably never will)". NP-complete does imply "can be solved in exponential time" but so does NP. So does P. etc. It just doesn't feel like a good explanation for why SAT in particular can be used to solve this problem. I think a better explanation would talk about how NP problems have easy to verify solutions, and how this problem has easy to verify solutions (just run the solution forward one step & check that it matches the desired output), and then link that to a brief discussion of NP-complete & SAT solvers (which you kinda already have in the video).

    • @ruroruro
      @ruroruro Місяць тому

      ​@@typeswitchmeh, I think that for all intents and purposes NP-hard does kind of imply "not polynomial time".
      Sure, it doesn't technically imply "we can prove that it's not polynomial time", but "there is no polynomial time algorithm" and "there is no known polynomial time algorithm and it's almost certain that there never will be" are basically equivalent in colloquial use (and I'd argue they are definitely equivalent in the Bayesian sense).

    • @theqwert3305
      @theqwert3305 Місяць тому +1

      I saw a *really* cool video recently that rephrased NP vs P as "Can you reverse every polynomial algorithm in polynomial time"
      The moment I saw the title I went "of course running it backwards is hard, it's NP!"

    • @AlphaPhoenixChannel
      @AlphaPhoenixChannel  Місяць тому +1

      @@typeswitch The verbiage I used to describe NP complete in the video was “at worst exponential time”, which is a very precise way to phrase it.
      Claiming that NP is “not polynomial time” in the graphic and saying “no known algorithm to solve in polynomial time” is also I think a very precise way to phrase it. The graphic annotation is practical and the part I said out loud was precise

  • @OtterSwims
    @OtterSwims Місяць тому

    incredible work on this video, you have made a major, meaningful contribution to educating the world about this!

  • @rieduciumaratonas
    @rieduciumaratonas Місяць тому +4

    I worked on a similar problem, difference being that my solution did not have to be exact, just similar. I used genetic programing, but didn't get anything. Maybe I will revisit it with new ideas.

  • @The-EJ-Factor
    @The-EJ-Factor 21 день тому +1

    6:03 this seems similar to situations like anti derivatives where data is lost during a derivative such as any constant, and are unable to retrieve the constant that was lost, which is why with anti derivatives you add a character that represents a constant such as c. To make it more understandable, generally if a*b=c then c/b = a. But if you multiply a number by 0 it would become 0 and you can’t use 0/0 to return it back to its original number.

    • @The-EJ-Factor
      @The-EJ-Factor 21 день тому +1

      This is also why 0/0 is undefined rather then 0,1 or infinity.
      Even when you look at the rules
      0 divided by any number is 0
      Any number decided by itself is 1
      And you can make a equation that uses limits to basically “prove” that 0/0 = any number

  • @BrianJorgensenAbides
    @BrianJorgensenAbides Місяць тому +4

    YOU underestimated this? My lecturing fingers were all ready to go for nothing. For everyone else, it's the exact thesis of Stephen Wolfram's entire life that you can't do this (I'm a fan, but poor guy, he'd never heard of church-turing, or long division, or the weather ;)

    • @backwashjoe7864
      @backwashjoe7864 Місяць тому +3

      I think I've been nerd sniped on whether or not Brian's comment has a dangling parenthesis.

  • @BoogsMcNoogs
    @BoogsMcNoogs Місяць тому

    I have no memory how I stumbled on your channel but I am very, very glad I did. Keep these coming, they make my brain satisfied.

  • @Veptis
    @Veptis Місяць тому +7

    So, Injective functions... now the fun part... This can be applied to Jpeg Compression as well.
    Which is a esoteric paper I want to write one day.
    Some configurations can't be reached, so they only ever are an initial setup. meaning there is some order to this too.

    • @AlphaPhoenixChannel
      @AlphaPhoenixChannel  Місяць тому +4

      hahahaha i didn't know there were jpeg edens

    • @Veptis
      @Veptis Місяць тому +1

      ​​@@AlphaPhoenixChannel Think about it this way: there are fewer possible compressed images than uncompressed sources.
      So you eventually have to map two slightly different images to the same compressed one. It's sorta a form of noise reduction.
      Jepg isn't deterministic, since you can chose the quantization tables arbitrarily (which means some jpegs look better than others, even if they are the same resulting file size/entropy). but you should be able to do the reverse and find a whole set of images that compress to the same result.
      Now one fun idea would be to figure out all of these (I assume mostly noise). But the more interesting idea would be finding a more appropriate comrpessed image you want.... And then finding it's input.
      You might think that all compressed versions are the best possible ones but that's not quite true. Things like text compressed with jepg look horrible. But by adding extract lines, you can improve how the compressed result looks by targeting a specific compression table. Maybe sorta think of it like the extreme patterns that were needed in near UV lithography? Or people putting thin cavities in their 3D models so the slicer adds internal walls for additional support.
      Since jepg is meant to be visually lossless, that means the mapping won't be uniform.

  • @hookumsnivey1696
    @hookumsnivey1696 5 днів тому

    I made a “Pong Shader” where going through either goal just incremented the entire screen to the location where the score was displayed correctly. It wasn’t actually allocated. The score was just a set of rules defining its coordinate display.

  • @Petch85
    @Petch85 Місяць тому +5

    Loved the video. I love optimization so I guess that is no surprise.
    But I think you failed in explaining (the first step of) why the rules in conway's game of life are so hard to run backwards.
    It seems like if you have a live pixel you could calculate one step back for the 8 pixels around it. And even if you get 2 or 3 possible configurations that could have birthed that pixel, you could just make a "tree" and explore all solutions, that might end up with milions of configurations to be calculated, depending on the number of steps back. But at least all the configurations you are trying will return back to your taget solution.
    Basically what I am trying to say is that you "fail" to show the views what you explain from 5:51 to 6:23.
    Not saying that I could do any better 😂. I know this to be true, but honestly I do not "understand" in detail why this is true. And even if I did I don't think it is possible to explain in a youtube comment without being able to show simple examples.
    I know it would have made the video even longer, but as the video is now the viewer just have to except this as being true and I think that is a little disappointing taking into account how well you explain the solution space over the next 15 minutes.
    To be fair I don't remember ever seeing a satisfying explanation, I only have a "feel" for it by trying the problem myself. (I tried finding stating solutions that would just keep going, and quickly realized that it was a much harder problem than I could have ever imagined and have not touched the game since. Burnt child dreads the fire 😂)

  • @estes_was_here
    @estes_was_here 25 днів тому

    As a kid i would hand draw conways game on graph paper because i didnt have access to a computer. I read about it in a book on novel mathematics from the library.
    This video is wonderful

  • @seshrut
    @seshrut Місяць тому +7

    Bestagonal, i immidiately paused. 26:05

    • @weasel.3683
      @weasel.3683 Місяць тому +1

      haha, nice!
      We all share a common space in the Internet ✨
      Even with high entropy!

    • @scttstnfld
      @scttstnfld Місяць тому

      Same, came here to see if anyone else heard it.

  • @yodxxx1
    @yodxxx1 Місяць тому

    Thanks dude, you are helping me a lot with this video, thanks to you i now have found a few new paths to solve a logic problem i had for some years now

  • @LunicLynx
    @LunicLynx Місяць тому +8

    It actually simple. Just reverse the animation. 🙈 .... joking

  • @dracuul78
    @dracuul78 Місяць тому

    This is a captivating topic and an amazing presentation, thanks for putting in so much effort!

  • @TimothyWhiteheadzm
    @TimothyWhiteheadzm Місяць тому +6

    The fun bit is reality is almost the opposite, ie it is much easier to 'predict' the past than the future. There are multiple possible pasts, but not many, whereas the number of possible futures is near infinite even on very short time scales. This is why we remember the past but not the future. So a life form in Conways game of life would actually 'live' in the opposite time direction from us and 'remember' what we see as its future.

    • @drdca8263
      @drdca8263 Місяць тому

      Eh? I don’t think that’s correct…
      Maybe you are referring to non-determinism?
      At the least, I’m fairly sure that entities in GoL can’t “remember the future”, because there is a communication speed limit in GoL , limiting how quickly one thing can influence another thing. You can’t respond ahead of time to a glider that would hit you in 100000 steps because the information that it is headed towards you hasn’t reached you yet. To remember something, one must be able to do something differently because of that remembering.
      As for the non-determinism, I think that like, it probably balances out equally as far as how undetermined the past and future are?
      Or…
      Hm.
      If you have some prior distribution over the state at time 0 ( i.e. P(S_0)) , and have a conditional probability distribution of P(S_t | S_{t-1} ) for each t…
      hm, I guess we could describe the amount of uncertainty as the entropy of the distribution?
      So, I guess the question is about how H(S_t | S_{t-1} , S_0) relates to H(S_{t-1} | S_t , S_0 )
      ?
      Err.. what exactly was the question I’m trying to answer???

    • @TimothyWhiteheadzm
      @TimothyWhiteheadzm Місяць тому

      @@drdca8263 I could be thinking about it wrong, but in GoL, the future is absolutely determined. It can be predicted with 100% accuracy. Whereas the past is not. There are many possible past states that could have lead to the current one. In real life it is past determinism (the ability to accurately predict what states lead to the current one) that allows us to remember. But on further thought I can't actually think of a mechanism for 'recording the future' in GoL so maybe I am wrong. Maybe past determinism allows for memory but isn't the only requirement.

    • @TimothyWhiteheadzm
      @TimothyWhiteheadzm Місяць тому

      I am fairly sure though that a highly complex entity in GoL could calculate what its future would be, but could not possibly calculate what its past was, although keeping a 'memory' of the past in a finite region might actually be a possibility. Although on small scales it is really hard to predict the prior states, on large scales it might actually be much easier for specific configurations.

    • @drdca8263
      @drdca8263 Місяць тому

      @@TimothyWhiteheadzm The future states in GoL are completely determined by the current entire state while the past states aren’t, yes, but a finite sized being in GoL can’t know the entire state of the GoL world.
      In reality, there is the idea that time evolves under unitary time evolution, in which case both the past and future are determined by the state at any one moment… except possibly for non-determinism in measurements.
      There is disagreement about how to interpret measurements. (“Is it fundamentally non-deterministic, or is the non-determinism just a subjective thing?”)
      But, the projections involved…
      I think they might produce the same kind of uncertainty about the past as they create about the future?
      Like, if something is in state (|0>+|1>)/sqrt(2) and it is measured in the basis |0>,|1> , there’s a 50% chance of it ending up being in state |0> and a 50% chance of |1> ,
      … but, suppose from the current state you know that it was just measured whether something was in state |0> or state |1> , and the result was |1>,
      even suppose you know that there was a 50:50 chance there.
      Well, from that, you can’t tell if the state before the measurement was state (|0>+|1>)/sqrt(2) or state (|0>-|1>)/sqrt(2) (or state (|0>+i |1>)/sqrt(2) or for that matter).
      With unitary time evolution, “information is conserved”,
      I suspect that the non-determinism of measurement has to essentially “erase” the same amount of information as it “creates”.

    • @drdca8263
      @drdca8263 Місяць тому

      @@TimothyWhiteheadzm Huh, your third comment didn’t show up for me until now. UA-cam is weird.
      If the GoL world is infinite (or merely much bigger than the entity living in it) and the entity’s internal state can be influenced from the outside, then it cannot know its future internal states, because it cannot know what will influence it in the future. Different things far away which it doesn’t know about would influence it in different ways, resulting in different futures (even though only one of the possibilities for the far-away part of the current state is actually true, and so what will happen is determined.)

  • @DIYBiotech
    @DIYBiotech Місяць тому +2

    There's a lot of overlap with the gradient ascent stuff and evolutionary biology. Comes into play a lot in genetic engineering, specifically enzyme engineering

  • @magie3490
    @magie3490 Місяць тому +3

    Am I mistacking or cant you solve this problem with a wave function collaps algorythem

    • @Majromax
      @Majromax Місяць тому

      Wavefunction collapse algorithms are essentially a greedy algorithm with backtracking. Given the same SAT problem, take the variable with the fewest still-admissible states, pick one, and repeat from there. When you have potentially many valid solutions and just need to find one (such as when you're doing an aesthetic tiling), then this works out pretty well. The typical example is tiling a game board, where your new cell to fit might have water on one side, a forest on another, and you have several options to choose from.
      However, Conway's game of unlife does not have that property; it's very constrained since a cell can be only alive or dead. A cell will either be forced by its neighbours (it _must_ be alive or dead, with only one option), or it has two still-unresolved outcomes. There's no obvious way to choose which cell is next-best to consider, so the greedy approach of wavefunction collapse doesn't help very much.

    • @magie3490
      @magie3490 Місяць тому +1

      @@Majromax yes fair. But what if you take the 3 by 3 grid araound a cell as a possible cell state? I think this could work but i dont have the courage to try out.

    • @Majromax
      @Majromax Місяць тому

      @@magie3490 Your problem then is that large grids would be overlapping, so you're not solving independent constraint problems.

    • @magie3490
      @magie3490 Місяць тому

      @@Majromax but isnt that te goal? Overlaping grids mean they depend on eaxh other. Meaning if you start comparing to overlapping grids you ll find out that there are only so many states these grids can take so that there are both still able to hold there state. Either dead or alive in the present. If you repeat this for every overlapp in case there exsists a pre state to the current state of the cellular automata, you would be left with a distribution of possible states vor every grid. Now you can start collapsing

  • @mushroomalien
    @mushroomalien Місяць тому

    Your "configuration hyperspace" reminds me of concepts I was grappling with about 20 years ago when I started learning about bioinformatics. The solution space for some of the problems are stupidly big with way too many dimensions. After working with the math for a while, I started getting a feel for imagining hyperspaces with many dimensions, similar to what one would do when you simply imagine objects in 3 dimensional space. The mind bending thing that happened, was that I started having dreams in hyper dimensional spaces... No halucinagenic drug could ever produce the dreams that math made me experience. Be careful when doing math kids!

  • @MrGryph78
    @MrGryph78 Місяць тому +4

    No wonder it took so long, you used Python!

  • @HerbertLandei
    @HerbertLandei 28 днів тому

    My approach would be to cache e.g. all 8x8 regions and what their future looks in 3 steps - that would be only 4x4 regions, because we don't want noise propagating from other regions. Now you cut your goal state in 4x4 blocks, look up all associated 8x8 regions, and try to find a solution that overlaps the start regions correctly. Still hard, but you can jump over several intermediate steps, which should be a huge time saver.

  • @MichaelKire
    @MichaelKire Місяць тому +1

    Right away I saw a similarity to trying to reverse engineer a hashing algorithm and thus making it a very hard problem.

  • @Ergosphere2357
    @Ergosphere2357 26 днів тому

    You managed to find a way to undo steps in Conway's Game of Life!? Hats off to you!

  • @fakesilver746
    @fakesilver746 Місяць тому

    this was so cool! I took a course in uni that included sat solvers and i always thought they were really cool but this is the first time I see someone using one in the wild. I didn't really understand how you encoded the pixels into numbers, with rules and everything, but i really liked the video! subscribed :)

  • @amdphreak
    @amdphreak Місяць тому +1

    Because something noisy devolves into something periodic and self-sustaining, it cannot be "undone" using an algorithm. It is similar to square-rooting a number: there are two possible answers to that one, but for this one, there could be an indefinite number of solutions.

  • @acters124
    @acters124 Місяць тому

    This is the best video on machine learning and how the LLMs work! AMAZING!

  • @anarchosnowflakist786
    @anarchosnowflakist786 11 днів тому

    for most of the video I was like wait isn't that method making the problem unnecessarily complicated and even harder than it was ? and then you mentioned sat solvers and I realized that I had had the exact same reaction when I learned to use them in my first year of engineering, so yeah funny, also great video !

  • @yanntal954
    @yanntal954 Місяць тому +1

    Rule 110 is much more impressive to me.
    Conway's game of life has 2D closest neighbors rules which is much less contrained than the 1D closest neighbors of rule 110. Yet, rule 110 is not only Turing complete, its also P-complete!
    You almost literally can't even compute anything much better than how rule 110 with all its limitations can!

  • @andreyzyablikov9891
    @andreyzyablikov9891 Місяць тому

    Спасибо за это увлекательное путешествие в мир NP-задач, теперь я стал понимать, в чём проблема NP. И ваше стремление найти решение в этой "тёмной комнате", где даже не известно, есть ли в ней "кошка", меня восхищает! Удачи и сил продолжать подобные поиски и спасибо за видео!

  • @DijaFix
    @DijaFix Місяць тому +1

    I watched Veritasium's video about QR codes before this and now I've come to realize I'm watching like what, an hours worth of videos, talking about black and white squares? That's my kind of 2024 hell yeah

  • @ryangeorge346
    @ryangeorge346 Місяць тому +1

    Something i think would be cooler is something that finds rules you can turn on or off to go from one on pixel to any given configuration in a certain number of steps

  • @iamsushi1056
    @iamsushi1056 24 дні тому

    I think a great way to deal with NP-complete problems is to use a neural net conditioned on fitness, but check it against the same neural net if it was conditioned using a novelty search and then train it based on that. That way, it puts equal priority on trying new things and getting to the goal. It’s like adding random noise, except the noise is smart.

  • @asdfasdf-dd9lk
    @asdfasdf-dd9lk Місяць тому +1

    I for one would absolutely love more on SAT solvers ! super interesting topic

  • @OvrcstYT
    @OvrcstYT Місяць тому

    Holy moley, this video was fascinating. Can't wait for the second part!

  • @simpli_A
    @simpli_A Місяць тому

    The SATisfiable section reminded me of one of my favorite board games. Its called décorum. Essentially, its a party game where everyone is roommates. They each have specific needs for them to be happy, and so you take turns changing the furniture to make you happy, all while simultaneously making everyone else happy. Here’s the problem, . Every move you make, your roommates can only say if they like it or hate it. No reason why. Id highly suggest giving it a try if you have any friends