Showing posts with label Rose Problem. Show all posts
Showing posts with label Rose Problem. Show all posts

Saturday, March 23, 2019

Rose VIII: Those Pesky Even Rules

Now, it’s time to tackle those annoying even rules. Unlike the odd rules, they don’t play nice. I wasn’t able to find proofs or perfect colorings like I could with the other rules – it took a long, inelegant, case-by-case proof to show that ¾ coloring isn’t possible for the “four colored points in a row” case. It's summarized in this earlier post in flowchart form, if you're intensely curious. Here, I'm only going to explain how and why the standard technique doesn’t work.

Throughout these problems, our technique for coloring as much as possible has always been this: color as many as you can along one axis, leave one point uncolored, color as many as you can again, repeat. Then, do the same thing on the next row, but start a few points over, so you don’t have two uncolored points in a row in the other direction. That’s the technique that can never work for an even isometric rule.


The best way to explain this is to try it. Let’s say we pick some stagger, and we plan to repeat that stagger to get the best coloring for an even rule “n colored points in a row”. Now, the number of spaces you stagger it by must be relatively prime to n. Look at the example below, where the rule is n=4 (“4 colored points in a row is not allowed”) and the stagger is 2.


The stagger will never put an uncolored point in rows 1 and 3, so we have to use a stagger of 1 or 3, because they’re relatively prime to 4. But that doesn’t work either. Look at this same picture another way. A stagger of 2 in that direction is a stagger of 3 in this direction, and this direction works.


When you pick a stagger for the next line, you’re actually picking a stagger pair. The stagger in the two directions will always have a difference of 1, just due to the geometry of the isometric grid. And these two numbers have to be relatively prime to your n. And of course, of two consecutive numbers, one must be even, so you can never have a repeating stagger for an even rule. Odd rules work just fine, because they can be prime, and even if they aren’t, the stagger pair 1 and 2 will always be relatively prime with an odd number (which, non-coincidentally, was the stagger pair I used for the proof last time).

That’s a pretty important finding. The geometry of the grid prevents us from using that technique for even rules. As for other techniques, like varying the stagger per line, I haven’t had much success. I proved that a ¾ coloring isn’t possible with a rule of n = 4, but that doesn’t tell us that we can’t get very close to it.

So we’re left with the task of finding a decent lower bound for the even rules. The consistent bounds I found were just the optimal solutions for the n-1 rule case: the provably optimal solution to “five points in a row” is pretty good for “six points in a row”. I also tried a few interesting ideas, taking suboptimal staggers like the one above and leaving some extra points uncolored to make them follow the rules, and those squeezed out tiny improvements over the earlier bounds. The “four colored points” rule has the lower bound of 2/3 borrowed from the “three colored points” rule, but there’s a configuration with three rows of ¾ and one row of ½, which is 11/16 colored, making it a little better than our bound.


This is a really interesting coloring. Notice how there's a colored-colored-uncolored-uncolored pattern in every fourth diagonal, and in the rows it's a colored-uncolored-colored-uncolored pattern, which come together to satisfy the condition everywhere. There's definitely some good problem ore here, no matter how much tedious work it's buried behind.

But for now, here are my final conclusions on the Isometric Rose problems. Odd rules can be proven to have an optimal coloring given by a (1,2) stagger, with (n - 1)/n % of the space colored. Even rules may not have optimal colorings, and have weak lower bounds of (n - 2)/(n – 1) % of the space colored. Until next time, when I will hopefully have a new problem to talk about!

Friday, January 4, 2019

Rose VII: Odd Isometric Rules


Last time, we proved that the “four colored points in a row” rule can never reach the optimal ¾ coloring in isometric space. Yet somehow, the odd rules are optimal like clockwork.

We’ve got two main directions to go in, at this point. We can look at the simpler odd rules and try to prove that every odd rule has an optimal coloring, or we could look at the complicated even rules and try to find out why they don’t work as well, and try to figure out efficient colorings for them. Let’s do the former in this post.

Warning, there’s a dry-ish proof coming. It’s not thaaaat difficult to follow, but admittedly that’s coming from the guy who wrote it. I’ll try to be extra precise and descriptive, and will illustrate the steps as much as possible.

Wednesday, January 2, 2019

Rose VI: Even and Odd Rules in Isometric Space


Last time, we proved that 1/3 colored was the best you could do on an isometric grid, if your rule was “two colored points in a row are not allowed”. And that’s pretty interesting – it’s already very different from the squares we’re used to. So, let’s so how different other rules are.

The next logical rule to try is “three colored points in a row are not allowed”, so let’s jump in and try our old staircase technique on it. (The colored points are a light yellow, so it’s a little easier to see them.)



I just shifted each row over by one relative to the previous row, and it just works. Our technique didn’t work on the first rule we tried, but somehow it works on this one. We get a nice 2/3 coloring, and it’s very easy to prove it’s the most optimal coloring – 2/3 is the highest percent of any row you can color, so it’s the upper bound for how much of the space can be colored.

So the question here is – when does our shifting technique work, and when do we need to use some other technique / cleverness to get the optimal coloring? Let’s try the next rule, “four colored points in a row are not allowed”.


And as you can see, it just doesn’t work. I tried staggering the next row by different amounts, but they all don’t line up in one of the three directions. It’s interesting that both colorings are perfect in two of the three directions – looking at the patterns left to right and along one diagonal, they’re perfectly three-colored-one-uncolored in a row. But along the other diagonal, there’s one row of alternating colored-uncolored, and then a row of all colored (which breaks the rule).

This doesn’t necessarily mean that the rule doesn’t have a coloring that is ¾ colored, it just means that we haven’t found it. Before we delve too deep into this rule, let’s look at the next rule – some context of surrounding, similar problems often gives strong insight into a tough nut to crack.


And just like that, the next rule has a provably optimal coloring. All the diagonals work out, and you can kind of see that this is the isometric analogue to a square staircase.

So, a pattern is starting to emerge here. Rules with an odd number of colored points in a row seem to work out nicely, and rules with an even number of points don’t. I did a few more, to make sure the pattern held.

Let’s zoom back in on the “four colored points” rule case. The next logical thing I can think of to try is to try staggering the ¾ row in other ways. If ¾ colored is possible, it’s made of ¾ colored rows, so maybe we can stagger those rows in the right way to find a coloring. This turned out to be a pretty messy case-by-case proof, which I’ve summarized here.


The basic idea is to build up every possible way to stagger the pattern of three-colored-one-uncolored in rows to make the diagonals work out. Anytime a case leads to a situation where you can’t use the three-colored-one-uncolored pattern, you know that that case can’t ever produce a ¾ colored coloring.

I wrote out the first line, and then there are four different ways to stagger the next line, but the later two are just the first two flipped, so there’s two ways this pattern can start. Then, we break each of those into two cases, based on the existence of a particular colored point in the third row. As you can see, if that point, indicated by a red triangle, is in the final pattern, it means that there must be two uncolored points in the fourth row, so neither of those cases can achieve ¾ coloring. If those red points are uncolored, it turns out both of those cases also have two out of four points in the fourth row uncolored.

And so, with this very messy proof, we’ve proved that the optimal coloring of an isometric space with the rule “four colored points in a row is not allowed” can’t ever reach the theoretical maximum of ¾! More on that next time!

Saturday, November 17, 2018

Rose V: Square Wrap-Up and Isometric!


We’ve made a lot of progress on the Rose problems! Last time, we proved that given a rule of the form “N colored points in a row is not allowed”, we have optimal colorings for all square-grid spaces for as many dimensions as we want! That may sound pretty specific, but let’s take a broader look at just how many cases that covers.

I’m imagining sorting all possible rules into three different categories. They are: rules that prohibit only colored points, like “Three colored points in a row are not allowed”, rules that prohibit only uncolored points, like “Three uncolored points in a row are not allowed”, and rules that have some combination of those rules, like “an uncolored point between two colored points is not allowed”. Sidenote: If you remember from the Rose II definition, I decided to phrase all rules as negative, as “XYZ is not allowed”, because positive rules, like “you must have a colored point between two uncolored points” vanish as we go to infinity, or can be rephrased as negative rules.

If you think about these three categories, you’ll realize that we just solved the first one, for square grids of N dimensions, and the latter two are trivial: color the whole space and you’ll get an optimal coloring that won’t ever need an uncolored point for the rules to apply to.


What I’m saying is, give me a square grid of any dimension and any single 1D rule you can think of, and I can find and prove what the optimal coloring is!

But before we get to the more complicated “multiple rule” cases, let’s look at some alternatives to regular integer spaces. Namely, the isometric space!


This is a beautiful, interesting space. The purple triangles represent the points, and each point has six neighbors! The 2D square grid has two “directions” in which rules can be broken and adds a direction whenever you add a dimension. The 2D isometric grid has three directions from the get-go: one depicted horizontally here, and two on the 60° and 120° diagonals. And it’s even more interesting in other dimensions – I can sort of visualize a 3D isometric space, but it’s not clear to me if it’s well-defined or even exists in higher dimensions!

Let’s jump right in, as usual. For square grids, the easiest, quickest rule has been “Two colored points in a row are not allowed”. Let’s try our techniques on this new space.


And somehow, alternating colored points on the first row sort of… doesn’t work. Doing it means the entire next row must be uncolored. We can repeat this process on the next few rows to get a total of ¼ of the space colored. We can tell that it’s ¼ because of the trick we used for the square grids – find a tile that repeats. The red outlined parallelogram can be used to tile the whole pattern, and it’s ¼ colored, so the space is ¼ colored.


Then, I tried spacing them out more evenly, to get this configuration. It gets us 1/3 of the space colored, using the red outlined parallelogram.

After I found that one, I tried and tried and couldn’t find one that worked better. Maybe this is the best we can do in the isometric space. So then I went about trying to prove it when I hit upon this tile.


A simple, triangular tile, which you can alternate to cover every point in the space. But under our rules, the most colored that this tile can be is 1/3. If we color two points, that means there are two adjacent colored points, and that’s not allowed. And because this tile can tile the entire space, that means that the most colored the space can be is 1/3 colored!

So, we’ve proven that the 1/3 colored space above is the best you can do. We’ve done this by coming up with a space that is 1/3 colored, making 1/3 the lower bound, and using the pigeonhole principle to show that there can’t be anything better. If someone tells me they have a better fraction, I can break the space into these triangles with three points in them, and show that their coloring must have at least one triangle that has more than one colored point!

Next time we’ll look at some other rules for the isometric space, which is already looking much more complex than the square grids we’ve solved! With the rule we solved for today, we got ½ of the square grid colored easily!

Wednesday, October 3, 2018

Rose IV: 4 and N Dimensional Staircases



Yikes, four dimensions. As if visualizing a three-dimensional space of colored and uncolored points wasn’t complicated enough. In the last post, we showed that a 3D staircase coloring works as an optimal solution for the Rose Problems we were discussing, but now we have to try and extend that to higher dimensions. Luckily, we happen to live in a four-dimensional world: three spatial dimensions and one temporal dimension, and I find visualizations in this mixed space are actually not that bad.

Let me just start with a simple example to introduce the idea of thinking in this 4D space. I’m going to call it (3+1)space, because it’s three dimensions of one type and one dimension of another, as opposed to a true 4D space, with all four dimensions of the same type.

Imagine four blocks in a row horizontally across a table. Now imagine that you pick them up and lay them on the table so they’re oriented vertically along it. Or in a stack on top of each other. It doesn’t take much mental effort to view those changes as a “rotation”. They were along one axis, or dimension, and you aligned them with another axis, but kept the object itself very much the same. Now, imagine rotating the four blocks along the axis of time. You’d see one block, and then it would be replaced with the next one, and the next one, and the last one, and then there would be nothing.


These three shapes are the same, two along a spatial dimension, and one along a temporal dimension. There’s a lot of fun you can have with this, but perhaps we’ll talk about that another time. For now, let’s return to our transformation of the 3D staircases to 4D. We’re not rotating anything (yet), but you will need that (3+1)D visualization skill to picture the next part.

Let’s say we’re in four dimensions, and our rule is “two colored points in a row is not allowed”. The two dimensional solution to that is a 2D staircase that looks like this:
  


And the 3D solution is just layers of that solution, staggered so they don’t overlap. The (3+1)D solution will just be that 3D solution, swapping which dots are colored every unit of time!



We can easily verify this, too! We know that there will never be two in a row along any of the spatial directions, because that was point of the 3D staircase proof. Now, if we focus on a single point in time, there will never be two consecutive moments when it’s colored. And the wonderful thing about our (3+1)D system is that it’s completely equivalent to a 4D system. It’s a lot easier to visualize, but any rules or discoveries here apply there, too! Therefore, the 4D staircase works!

It’s pretty easy to show that 4D staircases work for other similar rules, too. Here’s animations of the “three-in-a-row” and “four-in-a-row” rules, if you’re still skeptical. I can’t show all four dimensions because of the limitations of computer screens, but you get the picture.





I find these mesmerizing. It’s “perfect”, in a way, how the length, width, and temporal height of the rows of colored points are all the same. Try staring at one point to see the temporal height, and you'll notice that it's the same pattern as the vertical and horizontal!

And now, the jump to N dimensions. The technique I’ll be using is based on the imagining 4D as (3+1)D discussion earlier, but it has a much wider scope. I can perform an easy-to-visualize inductive proof on the number of dimensions by using the following transformation: N dimensions à N dimensions + 1 temporal dimension à N+1 dimensions.

Let me break down the technique. Let’s say we have some N dimensional space on which something works, like our staircase configuration. I may not be able to visualize this space, but I can visualize a single point, line, or plane of this space varying in time. If I can verify that the rule works, I can say that the new space has N + 1 dimensions, and do the same thing again to inductively prove that it works for any number of dimensions. This technique isn’t exactly a revelation in terms of the simple induction behind it, but it is excellent for helping me (and hopefully you) visualize what’s going on. Math is at its best when we have that intuitive understanding of what’s happening, not just a surface level knowledge of what technique to use.

And there we have it. It doesn’t matter what dimension we start in; we can show that the temporal direction in any staircase will work if the space is staggered, so we have now shown, that for any rule of the form “X colored points in a row is not allowed” on any standard N-dimensional space, we have a solution for the greatest percentage of that space you can cover. The solution is given by the Staircase coloring specific to (X, N), and the percentage of the space covered is (X – 1) / X.

That’s… a big deal. There’s a lot more to figure out here, but we’ve conclusively knocked out a lot of cases of a huge problem. More on that next time.

Sunday, September 23, 2018

Rose III: 3-Dimensional Staircases


Phew, back to the good stuff. Let’s talk about higher dimensions – 3, 4, and eventually N dimensions – and how the Rose problem works with them. Right now we know that in our two-dimensional world, a rule of “four colored points in a row is not allowed” yields an optimal coloring that looks like a bunch of staircases, that I immediately named the Staircase Configuration. As a first step into higher dimensions, let’s see if the same problem (four colored points in a row is not allowed) in three dimensions can be solved by a staircase analogue.

Sidenote: the Fundamental Theorem of Geometry is in full effect for this post. For anyone who needs a refresher, the Fundamental Theorem of Geometry is that 3D things are hard to visualize. We’ll also be using the Strong Fundamental Theorem of Geometry, which is that difficulty of visualization scales with the number of dimensions, in the next post.

Okay, so we’re in three-dimensions and our rule is that four colored points in a row is not allowed. My best idea as to how to tackle three dimensions is somehow build up from the 2D solution we had before.


 Let’s say that this, our 2D solution, is one plane of the 3D solution. This might seem like a bit of a leap, but remember that the 1D solution is one line of the 2D solution. In fact, it’s all the lines, only a bit staggered. Will that method work with the 2D to 3D jump?


Turns out, yes it will! These four cross-sections should be visualized in a stack, the leftmost one on the bottom and the rightmost one on top. I’ve only drawn out sixteen points for each, but they represent an entire plane of points, extending infinitely in two directions. So, you can see that they’re identical; I’ve just “staggered” them, shifting the next plane over by one point.

Each plane by itself cannot break the rule of “four colored points in a row is not allowed”; they are the 2D solutions, after all. Now we only have to check the z-direction – the direction that crosses one point on each of these planes. For example, imagining this example as a 4x4x4 cube, we can check the top left point on each plane. The fifth plane up is identical to the first, so we can see the familiar pattern of colored, colored, colored, uncolored. And checking each and every point in this cube, we can see that they all work! In fact, if you slice the cube into four planes in any of the other ways, the planes will all be identical to our 2D solution!

So, 3D staircases work! At least for this case – let’s check the other simple rules: three-in-a-row is not allowed, and two-in-a-row is not allowed.

      

They may be a little harder to visualize, but they work too! Now, for a 3D space with a rule of “N-in-a-row is not allowed”, we want to prove that staircases work for them, too. And it’s not that difficult – we’ve proven that a staircase works for 2D, and by staggering those 2D cases so there’s a total of N incremental staggers before it loops back to the original staircase, we have a provably sufficient staircase. A “stagger” really just builds up a vertical tower of the row you’re staggering along, and because the row abides by the rule, every vertical tower built up by staggering a 2D space will abide by the rule as well.


We’ll tackle 4D and N Dimensions next time!

Sunday, July 22, 2018

Rose II: Signposts and Necessary Evil


The problem I discussed in the last post, the first of the inaptly named Rose problems, was just a small, very specific case of a big general problem. When I first discover a seemingly rich vein of problem ore, there appear to be hundreds of directions to dig in. Who knows which direction I have to dig in to get the best problem gems (the hardest ones, if you will); it’s only after you find some that you start to get an understanding of the layout of the deposit. So, I’m going to try digging in a bunch of directions, trying to see what I can find.

First, let me restate the problem, as generally as I can. You have some kind of discrete infinite space, and an infinite number of tokens to place on points, and there are rules about configurations of adjacent tokens that aren’t allowed, and your task is to cover the largest possible percentage of the space.

Now, I’ve solved this for the specific case of the discrete infinite space being an infinite 2D checkerboard, and for the rules being “you can have only 1 or 3 tokens in a row horizontally or vertically”. The solution to that case is that 75% of the space, and the proof is in Rose I

-----------------------------------------------------------------------------------------------------------------

The next thing to do is list a few promising directions to dig in, and then go explore them. Here goes.

Problem variable manipulations – we’ve solved it for a specific case, but let’s think about the heart of the problem so we can see how many specifics there really was.
  •        We could try solving the same problem in 3, 4, or N dimensions.
  •        We could change the rules (of what configurations aren’t allowed).
  •        We could add the concept of multi-dimensional rules (such as a two by two square of tokens are not allowed)
  •        We could change the layout of the grid to isometric / other more complicated tilings
  •        Etc. I’m sure we’ll think of more as we get deeper in.


Rule Obsolescence – Oddly enough, it looks like the rule “you’re not allowed to have exactly two tokens in a row” in Rose I didn’t matter at all. If we re-allow that, the end result doesn’t change. That means that given a set of rules, some of them may be made obsolete by the others – and that sounds like it’s worth exploring.

Alternate Coverings – There might be many equally efficient ways to cover a space; how many? Are they isomorphic to the original, or are they new and unique?

----------------------------------------------------------------------------------------------------------

Finally, a note on terminology before I conclude this post. Yeah, I know; this is the awful part, the fatal flaw that prevents a mainstream love for math. But I promise it’ll be quick. I’m sure you already know that it’s necessary.

A Rose Problem considers some discrete N-dimensional space, and asks what is the maximum percentage of that space that can be covered (colored, as you’ll see in a moment), subject to certain rules.

To make things more fundamental, let’s switch from the “tokens covering a chessboard” metaphor to one of points and colors. Discrete spaces are made of Points, and points can be Colored instead of covered with a token. So I might say that 75% of this space can be colored, given the rules. Also, this opens up the possibility of multiple colors used on a space, and that could lead to some interesting optimizations.

Finally, Rules are patterns of colors that are not allowed in the final coloring of the space. I’ve been thinking of rules as negative (as in, you’re not allowed to use this particular pattern) rather than positive (as in, you must use this pattern), and I think it makes sense to keep it that way. Positive rules won’t matter as we go to infinity, unless we impose some sort of regularity to it (such as, in every 10x10x10 cube, this pattern must exist once), and that feels horribly contrived.

Phew. That’s it. More good stuff and less necessary evil in the next post.

Monday, June 18, 2018

Three-In-A-Row (Rose I)


Imagine your garden-variety infinite chessboard, with an accompanying infinite number of tokens. Now, imagine your task is to cover as much of the board as possible with tokens, one token to a space, but there are two accompanying rules. You’re not allowed to have more than three tokens in a row horizontally or vertically, and you’re not allowed to have exactly two tokens in a row horizontally or vertically. That is, these configurations are allowed:


And these are not.


This is the form that this problem originally took for me. It happened when I was playing with the placement of apps on my phone’s home screen; I’d be willing to bet that 90% of these interesting problems I think of originate from some mundane task in my life.

In any case, let’s try to solve the problem. Given these placement rules, what is that maximum percent of the plane that you can cover?



Of course, there’s many many more problems waiting to be uncovered here. When I find a potentially rich vein of problem ore, I immediately give it a name that does not age well, and often ends up being completely irrelevant to the fully explored problem. So, let’s continue that tradition by naming this set of problems Rose problems, a corruption of “rows.” Three-in-a-row, rows, Rose. A terrible, annoyingly catchy name, which is an essential bit of character for a dry math problem set. I’m sure there’s much more to come on the Rose problems soon enough!