sniffnoy: (Dead face)
So! I haven't posted here in a while. Several things I mean to post but I've been busy with other stuff. And most recently I've been busy with a return to the Snake problem!

So, at the suggestion of [personal profile] joshuazelinsky, I submitted the Snake problem as a second-year research problem to PROMYS. And the students (unfortunately I don't know their names, aside from one Rakesh Rivera) found that I made some incorrect claims! Here's a big one -- I said that Θ2,2,k was winnable, but in fact it's only winnable for k=1 and k=2!

So, yeah, I had to reevaluate some things. Was the family that Justin found actually winnable? Yes, it was. OK, but then how does one minimize it? (On here and on the webpage I only described the minimized version, but that's not how he described it to me; see the webpage, which now describes the non-minimized version.)

I haven't thoroughly checked it, but I think I have a corrected answer. My previous answer (again, see the webpage) was correct... when k≤m. For m>k, it's a bit more complicated. This is why Θ2,2,1 and Θ2,2,2 are winnable, but Θ2,2,k is not for k≥3. (In fact, Justin's graph is already minimal when m=2 and k≥3.)

But like I said, I think I've fixed it now!

Now to update more stuff. I'll be back with more posts later...
sniffnoy: (Kirby)
So, not about the tree anymore per se, but more about Zeckendorf! Well -- this question arose out of the study of the tree, obviously. You see (to use briefly the terminology I was using to discuss the trees so I can state the original motivation), the v function has an oddness center (i.e. a point (h,k) st v(h+x)+v(h-x)=2k), but it also has a bunch of "pseudo-oddness centers", points (h,k) st v(h+x)+v(h-x) is usually 2k but not always. And whether it is or not is governed by the equation S(n+x)=S(n)+S(x).

Here by S I mean the Zeckendorf left-shift operation -- although, as you may recall from previous entries, it's actually well-defined even if you allow pseudo-Zeckendorf representations without consecutivity restrictions. (And thus in particular it also works for dual Zeckendorf.)

Anyway, so we have the question: When is S(n+m)=S(n)+S(m)? More generally, how can we determine S(n)+S(m)-S(n+m), without actually doing the addition? (We can also ask the same for S(n-m)+S(m)-S(n).) And, given n, what is the natural density of {m: S(n+m)≠S(n)+S(m)}?

Well, I have answers to all these questions! Likely this is already known, but I figured it out the other night and I thought it was neat.

Note that the difference S(n)+S(m)-S(n+m) is always one of 0, 1, or -1. Now, my actual rule for how to compute this quantity is a little complicated, so I'm going to hold off on stating it for a moment. But, the resulting rule for d({m: S(n+m)≠S(n)+S(m)}) is actually quite simple!

Namely, write n in Zeckendorf; let's say n = ΣiFki for i≥2, ki increasing (so k0 is the smallest), and the usual consecutivity restriction.

Then, the natural density that we're looking for is simply Σi(-1)ki-k0φ-ki.

Another thing worth noting, btw, is that for each n, the only nonzero value taken on by S(n)+S(m)-S(n+m) will be (-1)k, where k is the number of zeroes on the end of the Zeckendorf representation of n. Now you may say here, wait, just n? What about m? This function is symmetric, surely m must also have an effect? Well, that's the thing! The value can only be nonzero when this zero count has the same parity for both numbers! If they disagree, it's necessarily 0. (And of course it's always 0 when n=0, for which the count is undefined.)

Btw, a neat little thing about this parity: Did you know that the parity of the number of 0s on the end of the Zeckendorf representation of n, is always the opposite of the last digit of the dual Zeckendorf representation of n? Similarly, if you look at the parity of the number of 1s on the end of the dual Zeckendorf representation of n, this is always the same as the last digit of the Zeckendorf representation of n.

So, we could also say that you can only get a nonzero result if n and m have the same last digit in dual Zeckendorf, in which case the potential nonzero value is (-1)1+d (d being the digit), although I don't actually think that's a good way to think about this.

OK, so, what's the actual rule? Well, this is a little annoying to state properly. Heh, I realized the other day that it can be given as a finite state machine, but I'm not going to subject you to that.

I think the easiest way I've come up with to state it is: First, write n and m in Zeckendorf, and then take the digit-wise sum -- just add them up straight, yes you'll get 2s, you'll get consecutive 1s, it doesn't matter. Then, find the largest k such that there is a suffix of the form (2(01)*00)k2(01)*0ℓ≤1 (if there even is such a k, which there may not be). (Note: The exponents on the 01 may be different between the different copies of 2(01)*00, they don't need to all match or anything like that, otherwise it wouldn't be finite-state.) If there is no such k, or if k is odd, then S(n)+S(m)-S(n+m)=0. If k is even, then S(n)+S(m)-S(n+m)=(-1).

So yay, an answer!

EDIT next day: I guess we could write this as -- assuming no leading zeroes and valid input -- it's an exception iff the digit-wise sum satisfies the regex
/^(.*(1(10)*0|0(01)*00))?((2(01)*00){2})*2(01)*0?$/
but hoo boy personally I find that less clear than the above description.

Now, what about subtraction? Well, first off, let's dispense with the natural density question. If we fix n and look at {k: S(k-n)≠S(k)-S(n)}, well, this is just a translation of the set {k: S(k+n)≠S(k)+S(n)}, so we already know the answer to that. And if on the other hand we look at {k: S(n-k)≠S(n)-S(k)}, well, then we're just looking at finite sets, so this question is uninteresting.

But, we can still ask about a rule for determining S(n-m)+S(m)-S(n), where want to determine this without actually performing the subtraction. And, this too has an answer! It's very similar to the above, except that, while we write m in Zeckendorf as before, we have to write n in dual Zeckendorf.

Then, we perform the subtraction to get a string of 1s, 0s, and -1s. If we simply subtract each of these digits from 1, to get 0s, 1s, and 2s, we can then apply the same algorithm as before.

So, in order to get a nonzero value, it must be the case that the parity of the number of 0s on the end of m in Zeckendorf, must be the same as the parity of the number of 1s on the end of n in dual Zeckendorf. Or -- for a less useful rephrasing -- the last digit of m in dual Zeckendorf must be opposite the last digit of n in Zeckendorf. Hm.

So anyway yeah that's neat!

Now, where does this addition rule even come from, anyway? Why does it work? This is going to be the handwavy explanation I used to originally come up with it; I can prove it, too, although not from scratch, but I can if I make use of this paper. But I don't want to get into formalism here.

Anyway, fundamentally it comes down to, if you were to actually carry out the addition in Zeckendorf, is there any part that would not commute with left-shift? And the answer is yes. Simply performing the addition of digits with no transformations is obviously no problem. And we already know that handling consecutive 1s commutes with left-shift, that's why left-shift is well-defined on pseudo-Zeckendorf representations. But what about handling of 2s? In most places, 0200 becomes 1001; that commutes with left-shift. But what doesn't is how it works in the 2s place and the 1s place. 20 is equal to 101, and 2 is equal to 10. The former gives you a difference of -1, the latter gives you a difference of 1.

So, to get S(n+m)≠S(n)+S(m), you must either have both with a 1 in the 1s place, or both with a 1 in the 2s place, right? Not so fast! Remember, adding two 1s in most places yields not only a carry upwards of 1, but also a carry of 1 downwards two places. This means that it's possible to get one of these problematic additions by adding, say, 101 (4) and 100 (3). The carry in the 3s place yields a problematic addition in the 1s place. Or imagine you add 10100 (11) and 10001 (9); the carry in the 8s place causes a carry in the 3s place, which cascades into a problematic carry in the 1s place.

Of course, these chains can get longer than that! But as long as you have 2(01)*, you get an exception with a value of 1, or if you have 2(01)*0, you get an exception with a value of -1.

Except, not so fast! What if something else up above could nullify that 2? Well, that can happen! Look at what happens if you add 1001 (6) to itself. That 2 in the 1s place should generate an exception... except, that the 2 in the 5s place results in a downward carry to put a 1 in the 2s place. The consecutivity drains a 1 away from the 1s place, up to the 3s place, leaving nothing that can generate an exception in the 1s place. So, we get an exception to the exception -- a value of 0 after all.

And just as with our chains of 1s that can generate an exception, we can have longer chains here too; for instance, if you were to add 101001 (19) and 100001 (14), the carry in the 13s place would generate a carry in the 5s place, into the 2s place, which would still prevent the problematic carry in the 1s place.

But wait! If an offset chain up above can drain away a 1 from a problematic carry... then a further offset chain even higher can drain away a 1 from the carry that would prevent the problematic carry, resulting in an exception after all! An exception to the exception to the exception. For instance, if you were to add 1001001 (27) to itself, the carry from the 21s place into the 8s place would prevent the carry in the 5s place, allowing the carry in the 1s place to happen after all, yielding a value of 1. You see?

And so forth; one can have more and more such offset chains, each of which deactivates the one coming after it. So whether you get an exception or not is determined by the parity of the count of them. And whether you get 1 or -1 is determined by whether the problematic carry, if it occurs, ultimately occurs in the 1s place or the 2s place. So that's why this is the correct rule; and that's not a proof, exactly, but using the paper linked above it can be turned into one.

Josh says Steven Miller might be a good person to talk to determine whether any of this is original and where I can find references for whatever might need citing... well, I'm not going to even think about writing a paper on this until various other papers are out of the way!

EDIT much later: Btw, if we want the overall natural two-dimensional natural density for the different possibilities -- well, actually proving it seems annoying, but for a difference of 0, it ought to be 2φ-5/2 (i.e. √5-3/2), for a difference of 1 it should be 1-φ/2, and for -1 it should be 5/2-3φ/2. (And for 1 or -1, it should be 7/2-2φ, or 5/2-√5.)
sniffnoy: (Kirby)
OK, I think I'm finally actually done with the tree stuff for now. I mean, I'm not done, I still have questions. But I think I have reached a point where I can finally rest and get back to other things! I have finall figured out a conjecture for what's going on for higher c. I guess I'll tell you about that here.

(I haven't yet proven it -- maybe it's actually easy, idk, but I am dead tired right now. I do have something of a heuristic explanation for why it should work. It also seems to explain every other phenomenon I've noticed about these trees, except for some ones that are easy to prove by other means.)

(And no I'm not putting this on the tree page. Too complicated and too far away from the original point.)

Anyway! I should actually state this rule. So the way I'm thinking of things, right, is that, we've got our tree, it's 0-rooted, it uses an additive constant of c>=1 (so R(n)=n+L(n)+c), and given n we want to predict L(n) without having to compute the whole tree.

Now, if we define v(n) = S(n+c-1)+3-2c, where S(n) is the Zeckendorf left-shift operation, the idea is that L(n) "ought" to equal v(n), and so what I'm really trying to predict is the difference L-v. (Here, the v function is essentially a sort of stabilized L. So I'm looking at how the real thing differs from the stabilized thing.)

As an example of what this looks like for small c -- for c=1, this difference is always 0. Same for c=2. For c=3, it's 0 unless n=Fk-3, then it's (-1)^k. From there on it gets more complicated.

Oh, one more definition: I'll use T(n) to mean the *dual* Zeckendorf right-shift operation. (Left shift is well-defined for all pseudo-Zeckendorf representations, so it doesn't matter whether you use ordinary Zeckendorf or dual, but this isn't true for right-shift! Here it matters.) This is also equal to ⌊n/φ⌋.

So: Our initial condition is that, for n<T(c-1), L(n)=n+1. Of course this is true rather further out; L(n)=n+1 for all n<c. But we only need it this far out for our initial condition.

(This initial condition is frankly a bit too complicated for my liking, but, I don't see any way to simplify it. Oh well.)

Then, the rule is that for n≥T(c-1), we have

L(n)-v(n) =
|{m<n: L(m)<v(m), S(m+c-1)-c+2+L(m)-v(m)<=n<=(m+c-1)-c+1}| -
|{m<n: L(m)>v(m), S(m+c-1)-c+2<=n<=(m+c-1)-c+1+L(m)-v(m)}|

OK, that probably warrants some explaining. (There's also something misleading about the expression above. I wrote it as a difference, but in fact, one of those two sets will always be empty. You either have all positive contributions or all negative contributions, never cancellation.)

Anyway, the way I'm thinking about it is this. We start with a bunch of positive exceptions (n such that L(n)>v(n)) in our initial condition, with appropriate multiplicities (values of |L(n)-v(n)|).

Then, a positive exception at n results in a negative exception at S(n+c-1)+2-c. If n has multiplicity k, it results in negative exceptions at S(n+c-1)+2-c, S(n+c-1)+3-c, ..., S(n+c-1)+c+L(n)-v(n). And if some m ends up being an exception due to multiple different sources, well, those different sources add up; since each one contributes -1, you just get the negative of the number of them.

Similarly, a negative exception at n results in a positive exception at S(n+c-1)+1-c. And if n has multiplicity k, this time it extends downwards, resulting in positive exceptions at S(n+c-1)+1-c, S(n+c-1)-c, ..., S(n+c-1)+2-c+L(n)-v(n).

OK, actually, that's not quite the way I'm thinking about it. All of this gets much nicer if we adjust all the numbers by adding c-1 to all of them. (So the numbering now starts at c-1 instead of 0, and our additive constant is effectively 1.) So now, positive exceptions generate negative exceptions at S(n)+1, and negative exceptions generate positive exceptions at S(n).

Well, that's still not quite the way I'm thinking about it. Remember I mentioned there's never any cancellation? I think of that initial condition as being an initial "run", a contiguous segment where L(n)-v(n) maintains the same sign or is 0. It's a positive run. This run then generates the next run, which is a negative run; which then in turn generates the next run, which is positive, etc. Runs never overlap; each one comes purely from the previous one.

Anyway this rule explains a lot of things like, why is it that for each c there are only finitely many n st |L(n)-v(n)|>1? And why is it that the behavior of L(Fk-c) depends on whether the smallest Fibonacci number greater than or equal to c has even or odd index? I won't go into that here, but it answers that question! Although as mentioned I haven't actually proven this yet.

There is sort of an intuitive explanation of why this rule should be true. Our initial condition is forced -- all those numbers are positive exceptions because the baseline v value for them is *negative* (or 0, or just too low due to the other positive exceptions in the initial condition) and so they get forced upwards.

Then, well, each positive exception generates a negative exception after it. That is, if some n has L(n) bumped up by 1, then R(n) is also bumped up by 1, which means it's bumped *out* of the spot it would normally occupy; so the later m such that v(m)=R(n) instead takes L(m)=R(n)-1, since that's been left free.

Correspondingly, each negative exception generates a later positive exception; if some L(n) is bumped down by 1, then R(n) is also bumped down by 1, which them of course means that if v(m)=R(n) then L(m) must be bumped *up* by 1.

And if |L(n)-v(n)|>1, well, then, this causes a cascade of sorts. And if multiple of these affect the same number it adds up I guess? Yeah idk -- actually proving it this way sounds annoying. But this is the heuristic explanation of why this rule should work.

Anyway it seems to check out and it explains everything else I'm seeing! Now I'd better get back to other things...
sniffnoy: (Chu-Chu Zig)
OK I updated the tree page one more time, this time it should actually be the last time. I noted some more empirics regarding what happens for c≥4, and then concluded with an open question about this case.

...and now I really better get back to other things I'm behind on! >_>

Um, meanwhile, we're down to 24 books till next shelf clear (not counting the tall two). And on Saturday I'm going to go see Lizz and bring them two more books, so! :)

EDIT next day: OK, turns out I still wasn't quite done. I refined the conjecture at the end, and added some computations. Now I'm probably done though... unless I go back and compute expicitly what v is when c=3. Which I just might do...

EDIT that night: OK I added explicit formulae. Blech. Now, I think, there is truly nothing to add! I should explore T4 and up further later, but I think I can finally stop for now.
sniffnoy: (Chu-Chu Zig)
I updated the tree page to talk about what happens when you increase the additive constant!

By that I mean, what if, instead of n+L(n)=R(n), we did n+L(n)+c=R(n)? Actually, that's how I'll do things for the 0-rooted case; for the 1-rooted case I'll adjust things by one, say n+L(n)+(c-1)=R(n), so that it's just the 0-rooted version plus one.

Then c=1 is what we started with -- the 0-rooted version is the dual Zeckendorf tree, while the 1-rooted version is Beren's original tree, the Zeckendorf parity tree.

Meanwhile c=2 yields the other variants I discussed; the 0-rooted version is the dual Zeckendorf parity tree, while the 1-rooted version is the plain old Zeckendorf tree.

But what about c=3, and higher? Well, for c=3 I have a description, see the page. (Well, I have a fairly nice description for the 0-rooted version, not so much for the 1-rooted version; I'm going to stick to the 0-rooted versions for c≥3, I think.) But for c≥4... it's a mess. I tried c=4 and c=5 and don't see any nice description for either of them.

That said, despite this fact, these trees still appear to be full of Fibonacci patterns! Hopefully someone can figure out what's up with that, but I think I need to put this problem down for now -- I'm still so behind on other things...
sniffnoy: (Kirby)
1. The description in terms of even/odd number of zeroes doesn't have to be proven via dual Zeckendorf; it can also be proven directly by Ophelia's cold/hot argument, rephrased for this purpose.

2. Speaking of which -- one could define an analogous tree for dual Zeckendorf starting from the empty string. I don't know of any way to relate that to any of these other trees, though, nor am I aware of its reading permutation or its inverse being anything interesting.

(There's one almost-match for the inverse on OEIS, namely A303765, but it doesn't match. Not unless I've seriously messed up.)

3. I put up a page about it on my website!

EDIT: Ugh, the tree totally does relate after all. Gonna need to go back and edit this page...

EDIT: OK, did a quick edit to account for the new stuff... go just read about it there, I guess! (There's a new parity-based tree. :P )

EDIT again next day: OMG there's 8 more trees I missed. Well now they're in there too, which meant some rewriting. Geez. Yay, more ASCII art.
sniffnoy: (Kirby)
So, I have answer to the questions from my previous post! No need to ask MathOverflow. :) I'll have to go write this up as a page on my website later. (I mean, notionally it could be a short paper somewhere to the extent these observations are original, but that adds a bunch of work and when it comes to actual math papers I've got higher priorities than this! I just want something that I can cite when I go to update OEIS with this information, an webpage with quick proofs should suffice for that. :P )

OK, so, let's start with the big one: Why is the reading sequence of Beren's tree identical to A232560, the inverse permutation of A232559, the reading sequence of the double-or-increment tree? (Where only even numbers have the option to increment, to prevent redundancy.)

Well, before we answer that, let's make an observation about the shape of this second tree. Beren's tree is Fibonacci based in terms of content, but it's a binary tree in shape. While the double-or-increment tree is based on binary... but in shape, it's Fibonacci. The lengths of the rows are Fibonacci numbers, because it's doing the Fibonacci rabbit thing, where only even-valued nodes (adult rabbits) can have two children, with odd-valued nodes (juvenile rabbits) having only one.

So, we have a Fibonacci binary tree and a binary Fibonacci tree. Less strange now that they're inverse, isn't it?

OK, but that doesn't explain why they actually are. Consider especially -- these trees do have different shapes. If the trees had the same shape, then we could regard these two permutations not as being on the linearly-ordered natural numbers, but rather on the spots of the unlabeled tree of that shape, and show that the permutations were inverse that way, without having to ever involve ourselves with the whole "reading sequence" business. Since that is not the case, however, we can't take that approach, and we will have to involve the reading order at some point.

Anyway, before we go any further, let's subtract 1 from each number in both trees, so we'll now be dealing with permutations of the whole numbers {0, 1, 2, ...} rather than of the positive integers {1, 2, 3, ...}. We do this because, as mentioned, Beren's tree, when you subtract 1 from each number, becomes this dual-Zeckendorf tree.

So: On the one hand, we have our dual Zeckendorf tree. In this tree, 0 is the root (the empty string in dual Zeckendorf), taking the left child corresponds to appending 1 (to the dual-Zeckendorf representation), and taking the right child corresponds to appending 01.

What about our other tree? Well, if we don't subtract 1, then it's a tree of binary representations; 1 is the root; even numbers have two children, with the left child corresponding to changing the final 0 to a 1, and the right child corresponding to appending 0; and odd numbers have one child, corresponding to appending 0.

OK, but what if we do subtract 1? Well, then it's a tree of bijective binary representations! The doubling operation becomes double-and-increment. So now 0 (the empty string) is the root; it's odd numbers that have two children, with the left child meaning you change the final 1 to a 2, and the right child meaning you append a 1; and even numbers have only one child, corresponding to appending a 1.

In order to see that these trees have inverse reading permutations, I want to introduce two auxiliary trees. We have a Fibonacci binary tree and a binary Fibonacci tree, but for comaprison, I'm going to introduce a binary binary tree and a Fibonacci Fibonacci tree.

That is to say -- consider the binary tree that, when read across, simply yields 0, 1, 2, 3, etc. This, if we look at it in bijective binary, can be described as a tree with root 0 (the empty string), where the left child is append a 1, and the right child is append a 2.

We can do the same thing on the other side; we can take a tree as the same shape as our Fibonacci-shaped tree of bijective binary numbers, but one whose reading sequence is simply 0, 1, 2, 3, etc. This similarly has a natural interpretation in terms of dual Zeckendorf; left children mean append a zero, right (or only) children mean you append a 1. Only numbers that are a 1-child can have a 0-child. (The identity of these two descriptions of the tree might not be obvious, but it follows from the fact that to compare two numbers written in dual Zeckendorf, you just do so lexicographically.)

So: Let us consider the permutation that takes our binary binary tree (whose reading sequence is just the whole numbers) to our Fibonacci (dual-Zeckendorf) binary tree (which has the same shape). What does it do to the number at any given spot? Well, what you do to the number is, you write the number in bijective binary; then you change each 2 to a 10 while leaving each 1 as a 1; then you interpret the string as dual Zeckendorf. So that's our permutation one way.

Now, we consider the permutation that takes our Fibonacci Fibonacci tree (whose reading sequence is just the whole numbers) to our binary Fibonacci tree (which has the same shape). What does this do to the number at any given spot? Well, you write the number in bijective binary; then, starting with the empty string, you interpret each 1 as an "append 1" and each 0 as a "change the final 1 to a 2" (because a 0-child must have a parent that is a 1-child, this is well-defined); then you interpret the string as bijective binary. That's our permutation the other way.

And, well, those two operations are inverse to each other, so there you go! Where did we use the reading order? How did we deal with the fact that the two trees are different shapes? By setting up two auxiliary trees which, although they had different shapes from each other, had identical reading sequences. Basically we had a chain of four trees, FB-BB-FF-BF, where the pairs FB-BB and FF-BF have the same shape, while the pairs BB-FF have the same reading sequence.

Now, you may have noticed here that we used dual Zeckendorf and bijective binary, with roots starting from 0. But what if we had used ordinary Zeckendorf, with root starting from 1? Where the left child meant "append 0" and the right child meant "append 01"? Well, in that case, the same proof as above implies that our corresponding "inverse" tree would be a tree based on ordinary binary, with 1 as the root... a tree that is almost the same as our original double-or-increment tree, before we subtracted 1 from everything. The only difference? It'd be flipped left-to-right. That tree had the left child meaning "change the final 0 to a 1" (when there were two children) and the right child meaning "append a 0"; here it would be the other way around.

To summarize, here's a list of the (nontrivial) involved trees and the relations between them. Here, "B" stands for "binary", "Z" stands for "Zeckendorf", "D" stands for "dual Zeckendorf", and "J" stands for "bijective binary". The first letter describes the representation used to make the numbers in the tree, while the second letter represents the shape of the tree (note "J" is not a separate shape from "B"). And Beren's original tree I'm just going to label "TB" because uh I dunno. :P

List of involved trees, excluding trivial trees (those whose reading sequences are just consecutive whole numbers or positive integers):

TB: Beren's original tree. Has 1 as the root.
DB: Dual-Zeckendorf binary tree. Has 0 as the root.
BD: The original double-or-increment tree. Has 1 as the root.
JD: Double-and-increment-or-just-increment tree. Has 0 as the root.
BZ: Double-or-increment tree, but reversed. Has 1 as the root.
ZB: Zeckendorf binary tree. Has 1 as the root.

Relations among involved trees:

TB = DB + 1
BD = JD + 1
BD = flip(BZ)
TB and BD have inverse reading permutations (starting from 1).
DB and JD have inverse reading permutations (starting from 0).
ZB and BZ have inverse reading permutations (starting from 1).

Um, I realize that's likely a bit confusing, but I hope it clears things up somewhat? Here's a diagram:
      inverse
DB(0) ------- JD(0)
 |-1            |-1
 |              |
 |+1  inverse   |+1
TB(1) ------- BD(1)
                |
                |flip
      inverse   |
ZB(1) ------- BZ(1)
...where the left column is binary trees with Fibonacci contents, and the right column is Fibonacci-shaped trees with binary contents.

(One would of course get more relations if one looked at reverse reading permutations, where you read each row right-to-left, but I don't see a need to discuss that... all that is implied from the above.)

Now you'll notice that nowhere above did I discuss bijective Zeckendorf, because, well, it doesn't seem to really fit into the above very well. But I do have something to say about it, that answers my other two questions from last time!

So, one of the things that's special about binary, that doesn't hold for higher bases, is the close relation between ordinary binary and bijective binary. Namely, for n≥1, the bijective binary for n-1, is the same as the binary for n, but with the leading 1 removed and with 1 added to each digit.

Bijective Zeckendorf was frustrating me because I expected there to be a similar relation, but I wasn't seeing one. Except, oops, it's actually really easy, not sure how I missed it! Namely, for n≥2, the bijective Zeckendorf for n-2, is the same as the Zeckendorf for n, but with the leading 10 removed and with 1 added to each digit. This immediately answers both of my questions about bijective Zeckendorf from the previous post! As in the case of binary, one can see this either by examining how sums of Fibonacci works, or by examining how counting works.

So, yay, all three questions answered! Now when I have some time I need to go make a webpage about this...
sniffnoy: (Sonic)
OK so Beren Gunsolus came up with this really cool tree of numbers that is full of Fibonacci patterns and he and I and some others (Astra Kolomatskaia, Ophelia) have been spending much of the past few days looking at it.

Now, originally I had started writing a long post where I gave Beren's definition of the tree, as well as a long list of (often Fibonacci-related) patterns we had found in it, not all of which we had proved. Yesterday, though, I figured out a much nicer description of the tree than Beren's original one (but which we can prove is equivalent), and with this nicer description, a lot of the patterns that we'd found become easy to show.

I'm not going to bother listing these easy patterns; you can go looking for them yourself, and proving them yourself -- there are quite a few to find. Not all of what we spotted is so trivial, though! We've still got some big questions about this tree.

[EDIT August 17th: These questions now have answers! I've written about them here. I've left the rest of the entry unchanged, note.]

Anyway, to get to the point quickly, I'll start by giving this new definition of the tree and a big question it raises; after that I'll give Beren's original definition of the tree and some of the other questions about it (or just inspired by it) that I don't have an answer to (as well as a third description of the tree, and a conjectural fourth one). Some of these later questions are probably solved in the existing literature, I haven't searched.

So: You've heard of Zeckendorf representation, right? Well it turns out there's such a thing as dual Zeckendorf, which is like Zeckendorf representation, except that instead of the restriction being that you can't have two 1's in a row, the restriction is that you can't have two 0's in a row (the implicit 0's before the initial 1 don't count).

One can build up the dual Zeckendorf representation for any whole number, then, by concatenating together some combination of the strings "1" and "10". (Remember, if it's not empty, it has to start with a 1.) This naturally puts the whole numbers into a tree; 0 is the root with dual Zeckendorf representation being the emptpy string, and to get the left child of a node you append a 0, and to get the right child of a node you append 10. I'll call this the "dual Zeckendorf tree".

Beren's tree was this, with 1 added to all the nodes, covering the positive integers instead of the nonnegative integers. I'll call this the "adjusted dual Zeckendorf tree". I'll use here the convention that m is a number in the dual Zeckendorf tree, while n is a number in the adjusted dual Zeckendorf tree, so n=m+1.

If you read across the rows of this tree, from left to right, you get the sequence

1, 2, 3, 4, 6, 5, 8, 7, 11, 10, 16, 9, 14, 13, 21...

This appears to be OEIS sequence A232560, which is defined as the inverse permutation of A232559, which is in turn obtained from reading across a different tree. This other tree that ours is "inverse" to is not based on anything Fibonacci or Zeckendorf, but instead is based on doubling and adding 1. Why would these two permutations be inverse to one another? I have no idea!

So, question number one: Is this sequence actually A232560, and why?

OK. That's the big question; I'm guessing there's no currently known answer to this one, or else it'd be listed in OEIS. (I might post it to MathOverflow, if Beren doesn't, which I doubt he will.) But it's not the only question.

Anyway, before I get to the other questions, let me give Beren's original definition of the tree.

Beren's original definition was based on constructing it a little bit at a time, starting from the root, which is the number 1.

Then, at each step, we will look for the lowest number in the tree that so far has no children (as the tree has no repeats, this will be well-defined), and we'll give it two children. The left child will be the smallest number not yet in the tree, and the right child will be the sum of the parent and the left child.

Now, as mentioned above, I've sinced proved the equivalence of this original definition, and the more explicit definition above in terms of dual Zeckendorf. But my proof is actually just a slight adaptation of one devised by Ophelia of something very slightly different (well, arguably it's the same, but, one thing at a time).

See, before we thought to look at dual Zeckendorf, we were looking at Zeckendorf, because, I mean, that's much better known. And what Ophelia proved is that, if we let Z(n) be the left-shift operator on Zeckendorf representations, then the left child of n is Z(n-1)+2, which means the right child is Z(Z(n-1))+3.

Now you'll notice that, once you write things in terms of m instead of n, this is almost the same description that I gave above; the only difference is that we're using this Z operation, left-shift on Zeckendorf, instead of, call it Z', left-shift on dual Zeckendorf (although the output of that won't be a well-formed dual Zeckendorf representation). Except actually these are the same thing!

More generally, given finite sets S,T⊆{2,3,4,...}, if Σi∈SFii∈TFi, then Σi∈SFi+1i∈TFi+1. So left shift is in general well-defined on these "pseudo-Zeckendorf" representations. (I'm assuming this is known, though I haven't checked and it wasn't previously known to me. But I'm pretty sure I can prove it.)

That means that Ophelia's description, and my description, are in fact the same.

Now, Ophelia's coming up with this started with the two of us observing that whenever n is a left child in the tree, n-2(= m-1) ends in a 0 in Zeckendorf, while when n is a right child, n-2(= m-1) ends in a 1 in Zeckendorf.

Of course, by my reformulation above, we can could also say that n is a left child when n-1(= m) ends in a 1 in dual Zeckendorf, and n is a right child when n-1(= m) ends in a 0 in dual Zeckendorf.

So that's interesting -- the last digit of k in Zeckendorf, and of k+1 in dual Zeckendorf, are always opposite. Of course, going through Beren's tree definition is a pretty roundabout way to see this... actually, this is easy to prove from the fact I stated above about the well-definedness of left-shift. (Again, I assume this has to be known.)

But here's a question, not involving the tree, but inspired by the tree. We've talked about Zeckendorf and dual Zeckendorf, but there's also bijective Zeckendorf, using 1s and 2s instead of 0s and 1s, with consecutive 2's prohibited. This isn't something I've seen anywhere before, but it's kind of obvious so I assume it has to be known. (Note there's no such thing as dual bijective Zeckendorf... such a system would have no way to represent the number 3, for instance.)

(Btw: Seems that the well-definedness of left-shift works just as well for "pseudo-bijective-Zeckendorf" representations, using an arbitrary mix of 1's and 2's with no restrictions; however, it doesn't work if you allow all three of 0's, 1's, and 2's in the inputs. E.g., 2Fib=10Fib=2, but 4=20Fib≠100Fib=3.)

Anyway, here's something a bit odd. It appears that given r>2, the last digit of r-2 in bijective Zeckendorf is one plus the last digit of r in Zeckendorf. Why's that? Well, OK... this seems like the sort of thing that would probably be known, and my guess is that it's probably not too had to do it by showing these sequences of final digits are identical because both form the Fibonacci word (although the bijective one has some of the beginning cut off), although I'm having some trouble carrying that out right now, due to not knowing the Fibonacci word well enough... still, I feel like that's kind of a disappointing way to go about it.

OK, that question didn't actually involve the tree, but let's ask one more question that does.

As noted above, the tree has a nice representation if you write m in dual Zeckendorf. But let's say we look at Beren's original tree, the adjusted dual Zeckendorf tree, and write n in ordinary Zeckendorf.

Then in fact, the tree ends up having a pretty nice description in ordinary Zeckendorf! And this isn't too hard to show based on the description above.

We put 1 at the root. Then, for each n in the tree, count how many 0s its Zeckendorf representation ends in (since we've excluded 0, this is well-defined). If it ends in an even number of 0s, then its left child will be formed by appending a 0, and its right child will be formed by appending 00. Whereas if it ends in an odd number of 0s, then its left child is formed by appending a 1, and its right child is formed by appending 01.

You can check that this description in terms of the Zeckendorf representation of n is equivalent to the description in terms of the dual Zeckendorf representation of m.

Now, here's where it gets a bit weird. Suppose we again turn to bijective Zeckendorf; we'll form a tree where we write down the bijective Zeckendorf representation of n-2(= m-1). So now we've taken our dual Zeckendorf tree and adjusted it in the other direction, subtracting 1 instead of adding 1; let's introduce the convention t=m-1=n-2. Anyway, we look at this new tree, and we write each number tree in bijective Zeckendorf.

Then, it appears that the left and right (respectively) children of t can be formed by either appending 1 and 11 (respectively) or 2 and 12 (respectively), depending on the (ordinary) Zeckendorf representation of n(= t+2), in the same way as above (former case is even zeroes case, latter case is odd zeroes case). Why is this, and can we come up with a description of the case breakdown that looks just at the bijective Zeckendorf representation of t, rather than passing through t+2? This, well, maybe it's known, but it wouldn't surprise me if it wasn't.

So yeah! That's Beren's tree, and three (or four) descriptions of it. We've figured out a lot going on with it, but there's still quite a bit we haven't!

-Harry

Upsnake!

Jun. 29th, 2022 09:46 pm
sniffnoy: (Kirby)
So one Justin Kopinsky managed to find some new minimal winnables, so I've updated the Snake page!

(...and yeah, I still haven't written about Slay the Spire like I meant to, or anything in a while...)
sniffnoy: (Kirby)
So, background. Given a finite partial order P, consider all linearizations of P; then for any pair {a,b} of distinct elements of P, we can look at which fraction of linearizations order the two elements one way (a<b) vs the other way (b<a). Well, we have two fractions here, the fraction that do a<b and the fraction that do b<a; in order to associate a specific number, we'll go with whichever is smaller. We can then define the "balance constant" of P, denoted b(P) or δ(P) [I'll go with b(P)], to be the largest of these fractions over all pairs {a, b} of distinct elements of P.

The famous 1/3-2/3 conjecture states that, if b(P) is not zero (i.e., if P is not a total order), then b(P)≥1/3.

Now, as I've written about before, my opinion is that when you see a gap (even just a conjectured one :) ), you should ask if that gap is the start of a well-ordering! And one of my examples was the 1/3-2/3 conjecture. So: Are balance constants well-ordered?

Well, I just learned from Felix Bauckholt that they are not! Their argument, skipping a lot of the details to establish this stuff, went as follows:

Define the ladder poset Ln to be the ordering on {1, 2, ..., n} defined by taking the transitive closure of k<k+2 and k<k+3. So the only pairs not ordered are pairs of the form {k, k+1}. Then:

1. The number of linearizations of Ln is Fn+1, where Fk denotes the Fibonacci numbers.
2. Of these linearizations, FkFn-k have k<k+1, while Fk+1Fn-k+1 have k+1<k; so the fraction for this pair is FkFn-k/Fn+1;
3. Applying Vadja's identity, we can see that this is maximized when k=1, so the balance constant of Ln is Fn-1/Fn+1;
4. And if we restrict to the case of n odd, then we can apply it again in the form of Catalan's identity and see that this subsequence is strictly decreasing (which as we know has limit 1/φ², where φ is the golden ratio). (To be more general, the whole series converges to 1/φ² in an alternating manner.)

So that does it! Balance constants are not well-ordered! Kind of disappointing that they're not, but I still think that's a really cool resolution! Thanks so much to Felix for showing me this!

Admittedly this doesn't leave me with many examples for "when you see a gap you should look for a well-order". :P Those various classes of real algebraics were already ruled out when I wrote my previous entry on the subject, and here goes this one. That just leaves me with generalizations of integer complexity defects, and word satisfaction probabilities in groups. Both of which contain endless examples, admittedly, but I would like more distinct ones. Well, if you know any I should add to my list, do let me know. :)

-Harry

Addendum October 10: Actually, now I'm really wondering whether 1/φ² might be the smallest limit of balance constants. Well, if it is, presumably it won't be proven for a long time...
sniffnoy: (Sonic)
So, a while ago I wrote here about the following open problem: Is there a finite coloring of the positive integers such that, for each (n,m)≠(2,2), n+m always gets a different color from nm? (With the expected answer being no.) In particular I wrote about a weaker variant suggested by [personal profile] joshuazelinsky; if one defines a greedy coloring obeying this latter constraint, can we at least show that this uses infinitely many colors? (Later I copied this entry to my website.)

Anyway, Josh informs me that the original problem is now solved! The paper is here.

I was going to take down the page on my website, but Josh said leave it up because it's not like everything has been resolved about his modified problem. In particular, it's still not clear what the growth rate of the function g is, nor if the interleaving pattern I observed holds up.

Anyway yay that's resolved!

And should hopefully have time to write about Mystery Hunt soon...
sniffnoy: (Chu-Chu Zig)
So I emailed the authors of that Snake paper, and in the resulting discussion it turns out I made a serious mistake earlier! (I've updated my page on the matter.)

Earlier I wrote that Θ1,1,k, Θ1,2,k, and Θ2,2,k are all winnable, but in fact Θ1,2,k is not winnable! (Unless k=1 or k=2, obviously.) Not sure how I missed that one earlier. Basically the computer can exploit the difference in lengths to set up a trap, much as how the computer can exploit the difference in sizes if you take two unequally-sized complete graphs and join them at a vertex.

This also means my question about subdivision now has an answer; the answer is no! I'm surprised, I really thought that one would turn out to be true.

Unfortunately this also means my claim to have checked all graphs of up to 8 vertices is also false, because the method I used assumed the winnability of Θ1,2,k. So actually my method was only valid up to 7 vertices. Maybe I'll try to redo the check for 8 vertices? I expect it to just be too difficult, though... :-/

-Harry
sniffnoy: (Kirby)
Following up to this entry, I want to report: Yes, we can indeed construct a group of order pp+1 where the fraction of elements of order p is 1-1/p+1/p². Thanks to Hunter and to Julian for figuring out an important part of the construction.

Although, first I should point out David Speyer's construction from the comments, which does achieve the desired fraction but uses a larger order to do so; it has order p(p choose 2) + 2. The group consists of all (p+1)×(p+1) upper-triangular matrices over Fp with 1's on the diagonal such that the first superdiagonal is an arithmetic progression.

But, OK, how can you do it with only pp+1 elements?

EDIT: Actually Julian came up with an even simpler description; skip to the end if you just want to see that.

Well, I was inspired by the p=3 case. In the p=3 case, there's a unique group of order 81 that achieves the fraction 7/9, and it has the form (C9×C3)⋊C3. And of course for p=2 our group D8 has the form C4⋊C2. So, I decided to try to generalize this. I wondered, can we do it as a group of the form (C×Cpp-2)⋊Cp?

Let's say A = C×Cpp-2 and G is our group. We need to specify some automorphism of A of order p. But that's not enough; in order to get it to work, we need that all the elements of G\A have order p, which is not something that happens automatically.

So, what do we actually need here? Let's consider A additively; then our automorphism is given by a matrix M. We can consider this as a matrix over Z, if we want to be lazy, or over Z/(p²), if we want to be slightly less lazy, but really it's a sort of mixed matrix; the first row consists of elements of Z/(p²), while the other rows can be taken to be over Z/(p). Moreover, in the first row, all the off-diagonal elements must be divisible by p. (And also the diagonal element in the first row had better not be divisible by p, but that's not exactly a tough restriction and also it's redundant with the additional requirement I'm about to tack on.)

Now, we said it has to be of order p, right? So we need Mp=1. Except as mentioned above, that's not strong enough; in order to get that all elements of G\A have order p, what we want is the stronger condition 1 + M + M2 + ... + Mp-1 = 0. Except, what do I mean by these matrix equations? Equal mod what? Well, they need to be equal mod p² in the first row, and equal mod p in the rest.

So the problem remains to construct such a matrix! Whether considered as a mixed matrix like I described above or as a matrix over Z or whatever. This is the problem as I posed it to various people I know the other day. (Figuring I'd take it to MathOverflow if I didn't get an answer, but I did.)

Hunter came up with a way of doing it first, and his way is definitely more direct conceptually, but I'm going to go with Julian's construction because it's really nice and also easier to carry out; no need to go finding eigenvectors or extending things to free bases. Note that this construction (both Hunter's and Julian's, actually) only work if p>2, but of course we already know how to handle the p=2 case (you take the 1x1 matrix (-1) and get the group D8).

Julian's construction is as follows: Let's construct the transpose MT instead. Take the ring Zp], where ζp is a primitive p'th root of unity. As an abelian group this has a free basis 1, ζp-1, (ζp-1)2, ..., (ζp-1)p-2. Let's reverse that, so (ζp-1)p-2 is the first basis element and 1 is the last. Now consider the additive endomorphism that is multiplication by (1-p)ζp. Then the matrix of this, with respect to the basis I just gave, satisfies the transposed version of all the requirements. (It's a matrix over Z of course but you reduce it down.) So you transpose it and you get M.

I'll skip his proof, I don't think it should be too hard to rederive. :) (If you just use the fact that vpp-1) = 1/(p-1).)

So there you go! Take M as above, take the semidirect product, and you've got your group. (Julian also asked an interesting question: Since he found a way to construct M by means of Zp], can the group G be naturally expressed in terms of this ring somehow?)

EDIT: Yes it can, at least somewhat. We can write A as Zp]/((ζp-1)p), and then our automorphism is just multiplication by ζp, and then we construct the semidirect product with that. No need to construct any fancy matrix, hooray! And unlike the other two constructions, this one still works when p=2. :)

Anyway, that question at least is answered: You can achieve 1-1/p+1/p², and you can do it with only pp+1 elements. Unfortunately that was the easy half, of a watered-down version, of a special case, of my original question! But hey, like I said, I'm not really planning on tackling any of the hard versions, so I'll take it. :)

-Harry
sniffnoy: (Chu-Chu Zig)
I posted a series of tweets about this the other day, but, y'know what, let's write this up a little more properly on DW.

Whenever I see a theorem or conjecture about a gap, between the smallest element of a set and the second-smallest, I ask if this is the start of a well-ordering. Obviously, this applies in reverse too; if there's a gap between the largest and second-largest, I ask if it's a reverse well-ordering.

(And remember, when asking about your set's order type, don't forget to ask if it's closed, or to consider the closure if it's not!)

What are some examples of this? Well, of course, there's all my theorems and/or conjectures on integer complexity and addition chains (and all sorts of variants), but I'll skip going into that for now, because I've discussed that at length here already.

There's the group theory problem I mentioned in my last entry. That's certainly a good one; the numerical data looks promising there.

Here are some others I can think of, off the top of my head:

The 1/3-2/3 conjecture: Given a finite poset P, define δ(P) to be the maximum over all pairs of distinct elements (x,y) of the minimum of the fraction of linearizations in which x<y and the fraction of linearizations in which y<x. (So, δ(P)=0 iff P is already a total order.) Then the 1/3-2/3 conjecture says that any P with δ(P)>0 in fact has δ(P)≥1/3. I.e., it's a gap conjecture. Could the values of δ be well-ordered?

(Maybe they can't! I don't know a lot about this sort of thing, maybe there's already a counterexample.)

(EDIT October 2021: Yup, they're not.)

What about various number-theoretic sets of real algebraic integers? Like, there's Lehmer's conjecture, which conjectures that there's a gap between 1 and the next-smallest Mahler measure. However, Mahler measures can't be well-ordered, because the include the Pisot numbers. That said, we can still ask about order type! In particular, the order type of the Pisot numbers is known, and it's a nifty one! Though it begins with an initial ω, it isn't a well-order after that. Still, like I said, it's a nifty order.

In fact, I'd conjecture that if you considered integer complexity or addition chains with subtraction allowed, and considered the defects arising from those, and then either took the closure or added whole numbers (because those should probably give the same set), that the result would be order-isomorphic to the Pisot numbers. But I'm not trying to prove that right now; I tried briefly and found that, total orders get much harder once they're not well-orders! Someday, I hope to get back to this, but certainly not now.

Anyway, they won't be well-ordered, but one could still ask about order types of (or closures of) Salem numbers or Mahler measures or Perron numbers.

(EDIT October 2021: No, not really; it turns out that each Pisot number is approached on boy sides by Salem numbers, and so Salem numbers are not well-ordered either; and Mahler measures and Perron numbers include the Salem and Pisot numbers and so are definitely not well-ordered either. Indeed, I already noted this for Mahler measures above...? This entry seems a bit inconsistent...)

Of course maybe you get nothing like that. Like in the theorem mentioned in this MathOverflow answer, where you start out with a gap, then another gap, but then you just get all real numbers past that point. What can I say, nothing's guaranteed.

Still, I think this is a question people should ask more often. So: What are other examples of sets of numbers with gap theorems, that we could ask if they're well-ordered? I'm sure I must have missed a ton.

-Harry
sniffnoy: (Chu-Chu Zig)
So I've recently been wondering again about this question (yes, this was originally a post here, but I decided it deserved a page on my website). Just mostly idly wondering about it, not seriously studying it; I'm no group theorist, and I don't really have time to think about such a problem what with everything else that needs doing (both in terms of old math that needs getting back to or writing up, and non-math stuff).

Anyway. As mentioned in the linked page, the simplest place to start would be words of the from an, so we're counting all elements of order dividing n. Or really the simplest place to start would be words of the form ap, for p prime, so you're just counting elements of order p (together with the identity). (Or maybe prime power order if you want to be a little more general.)

Also as mentioned, for p=2, it's known that there really is a gap between ¾ and 1, with ¾ being achievable as D8; I'm using the convention here that the dihedral group with 2n elements is D2n, not Dn.

What I'm wondering is, what's the best known fraction (less than 1) for other p (or maybe other n)? Even if we can't prove a gap, it would still be nice to see how high we can find, to maybe get some idea of what the best might be (assuming that there really is a best like I'm hypothesizing).

Like, sticking to primes first -- for p=2, the best is ¾, that's a theorem. What about for p=3? I can again get ¾ by looking at A4; I don't know offhand how to do better than that. And for p=5, uh, no clue. Well, I mean, obviously one can get ½ for any n (take C2n), but I'm considering that baseline -- can we do better?

Since for p=2 you get a good fraction by looking at D8, i.e., C4⋊C2, you might think more generally to try looking at C⋊Cp; however, this doesn't work so well when p≠2 -- you don't get lots of elements of order p like you do when p=2. Like so many other differences between 2 and the other primes, this one once again basically comes down to the fact that 2 is the only prime p for which p does not divide (p choose 2). (I really think this is an underappreciated point, it really does seem to underlie so many of the differences, but I've never seen anyone else point this out!)

If we allow more general n then of course for any even n we can get ¾ by looking at D4n. But mostly I don't want to look at more general n because this quickly gets kind of silly. I guess powers of primes might be kind of noteworthy? In which case that's how to get ¾ for arbitrary powers of 2? But like let's say you look at powers of 3 -- well then A4 still does the job, you don't need to change the example at all! This sort of thing is part of why I say more general n is kind of silly. I guess more generally this gets you anything divisible by 3 but not 2, so we've now covered all n divisible by either 2 or 3. And of course in the trivial case of n=1 the best you can do is the baseline ½. But this is kind of why I said more general n is kind of silly.

Anyway, I dunno, that's what I've got. Anyone know anything about this?

ADDENDUM: OK, doing some quick computations with GAP here's what I get for some small primes based on groups of size less than 256 (haven't attempted to determine what groups witness these; also man I really do not know GAP, using it is a pain):

p=2: 3/4 (as we know)
p=3: 7/9
p=5: 9/11
p=7: 7/8
p=11: 21/23
p=13: 1/2
p=17: 1/2
p=19: 1/2

(EDIT: See the comments for some updates here)

Surprising, if you ask me! My offhand suspicion is that those ½'s at the end are spurious, an artifact of me not using large enough groups, but who knows? And it's not at all clear what pattern might be going on in the first few...

FURTHER ADDENDUM: Wow, after plotting the results from above for p=2 on a graph and doing the same for p=3... yeah, I'd totally bet on well-ordering, for this simple case at least. But I don't think I can go further and actually attempt to discern the order type from the graph, as I'd like to.

(Like I said I have no intent of trying to prove this. Maybe I will run some more numerical experiments to gather more empirical evidence, but that's it.)

YET MORE: You know what, just see the comments for more regarding the numbers.

-Harry
sniffnoy: (SMPTE)
EDIT: See further discussion of this question in this SSC thread, particularly this comment by uau. Based on this I decided to ask this MathOverflow question.

EDIT AGAIN: See this /r/smashbros post for a summary of my ultimate conclusions. (No pun intended. :P )

So here's a question I've been wondering about: The stage-striking problem. Partly "what's the answer", but also, how do we even formalize this?

The stage-striking problem comes from competitive Super Smash Bros (or platform fighters more generally). There, the first game of a match ("set", in their terminology, but what other people would call a "match") is played on a stage chosen by stage-striking. Unlike in a traditional fighting game, the stage matters, remember! Stage-striking means that there is a list of available starting stages, and the two players take turns -- in some order, not necessarily in strict alternation -- striking off stages they don't want to play on; the last stage left is the one the game is played on. So with an n-stage list, you strike n-1 stages.

The question then becomes, what is the fairest way to do stage-striking? With a 5-stage list, if we denote one player by 0 and the other by 1, it's done in the order 0110; one player strikes first and last, the other player strikes the two inbetween. But what about with an n-stage list?

I had basically assumed that the correct answer to this was to use the Thue-Morse sequence. I mean that's kind of the obvious generalization, right? In the problem of equitable sequencing -- you have n things that are to be divided up between two people, what's the fairest way to have them take turns choosing things -- there are indeed theorems to the effect that Thue-Morse is the right answer here (possibly after restricting to a set of items which is contested, on which the participants agree on the relative order of the values). So I assumed that would naturally transfer over to this context as well.

And I still suspect it does... but the problem is I realized that I don't actually know how to formalize the problem. After all, when dividing up items, each player might value the items differently, and importantly, you're trying to minimize the discrepancy between the sums of what each player chooses.

But the setting of the stage-striking problem is rather different. You don't get the sum of what you choose; you get the one thing that wasn't struck -- and importantly, when a stage is struck, it doesn't matter who struck it. In fact, if players agree on the relative order of the values of the stages ("value" here being in terms of how much of an advantage it gives to one player over the other), the order that they strike in will be irrelevant, because they'll always end up with the median stage regardless.

So it would seem that, unlike with the problem of fair division, here the interesting, contested case is when the players disagree on the relative order of the stages' values. But what would that mean? If both players have perfect information, they should agree; we have to assume some sort of imperfect information in order for this to make sense, and imperfect information is a pain in the butt to formalize. If instead we assume by fiat that the two players don't necessarily agree on the values, then we have the problem of, what does it even mean to choose fairly? What we want, I think, is for the result to be the median stage (or to maximize the probability of picking the median?), but if stages don't have "true" valuations, then what does it mean to pick the median? I think in order for this to make sense, there have to be true valuations for the stages, but the players have limited (but nonzero) information about them -- perhaps their valuations are a random perturbation of the real valuations? (This is probably easier to formalize if we assume cardinal valuations -- in which case we maybe want not "maximize the probability of picking the median" but rather "get the expected value as close as possible to the median" -- but could probably also be formalized for ordinal valuations.) Again, the players have to have some information about the real values, or the order is once again irrelevant.

(Actually, on that note -- what is a good probability distribution to use on Sn, to have permutations further from the identity to be less likely? Note that we care about the order here, not about being further from the identity on an abstract unordered set; swapping the first and last elements should be a higher distance from the identity than just swapping two adjacent elements. It's likely that the right notion of distance here is just the obvious thing, i.e., number of inversions, but it's not obvious.)

So, yeah, it looks like a mess. Thus the question -- is there any way to formalize the stage-striking problem, that results in a particular answer (up to swapping of the players), and not "the order is irrelevant"? And does the answer end up then being the Thue-Morse sequence?

Beats me, at the moment...

(I think the usual heuristic for why it should be Thue-Morse applies, though. So I do think it should be.)

EDIT: Actually, maybe it should be reverse Thue-Morse? Because going later, rather than earlier, gives an advantage? Not that this matters if n=2k+1.
sniffnoy: (Golden Apple)
So, the past few days I've been thinking again about an old problem from MathOverflow. Or a related problem, anyway, seeing as I answered the original problem.

The original MathOverflow question is this one. Vladimir Reshetnikov asked about this strange way of recursively constructing functions from N to N, and asked if the resulting set of functions is well-ordered or something like that. Now, they might indeed be well-ordered or something like that if we modify his problem in one simple way: We exclude 0 from N (and drop the constant 0 function from our starting set).

But with 0 included... hoo boy. I realized that we could use the old λ-calculus trick of iterating a constant function to distinguish 0 from other numbers. And once you can tell whether a given number is 0, well, then you can start to do some rudimentary programming and completely wreck well-ordering.

In particular I was able to bootstrap this into showing that you can construct any eventually periodic function, and then show that you can, for any k, construct the function n↦max(0,2n-k). (I guess in there I only did it for even k, but obviously odd k is just a simple modification!)

The thing is that the programming you can do is indeed pretty fricking rudimentary. It was good enough for that but it's pretty hard to do a lot of things. Like, you know what would be a nice way of showing that it's not well-ordered? Construct the predecessor function! This class of functions is closed under composition so that would do it right there. As far as I can tell, though, this is impossible. I haven't been able to prove it, though, and I don't expect to be able to. But, my attempts to prove it led to the following question: What sets can we detect? I.e., what functions can we construct whose image is contained in {0,1}?

As mentioned above we can construct any function which is eventually periodic. It's also easy to see we can do basic set operations. But, rather than thinking in terms of sets, let's just think in terms of bounded functions more generally, and ask the question: Can we construct a bounded function which is *not* eventually periodic? Or are (eventual) arithmetic progressions the only sets we can detect?

This is not so easy! Like, there's all sorts of simple aperiodic sequences -- the set of squares, the set of powers of 2, whatever, right? But how do you make those? I don't see any way. In fact for a while last night I thought I could prove that you can indeed only get eventually periodic bounded functions (and my proof would have led if correct to a proof of predecessor being impossible) but my proof was wrong.

But, I think I now have a candidate for an aperiodic bounded function. Or, for a function which is aperiodic mod 3, so you can just mod out by 3 (i.e. compose with the mod-out-by-3 function) and get an aperiodic bounded function. The thing is that it's kind of ridiculous and I have no idea how to prove that it works.

(You'd think the fact that all you have to do is construct a function which is aperiodic modulo *some* m would make it easy, but no, obvious things don't seem to work...)

Here's my candidate: Start by defining f(n) as follows:
f(0)=0
f(n)=2n-8 for 10|n and n>0
f(n)=n+1 otherwise
This is pretty easy to make given the things I constructed above.
(The value of f(0) is irrelevant, as is the value of f(n) for n=1 mod 10, but whatever.)

Now define g(n)=fn(10). Finally, define h(n)=gn(n).

EDIT: The following variant may be very slightly nicer:
f(n)=2n-16 for n=8 (mod 10)
f(n)=n+1 otherwise

This way g(9q+r) (0≤r<9) works out to be 10⋅2q+r.

I think h(n) should not have any eventual period modulo 3. Well -- it may be more useful to think of this mod 6 rather than mod 3. So, whatever, no eventual period mod 6, that's a weaker statement actually and so maybe a better proof target, although I think all the real action is basically going on mod 3 anyway, so whatever.

The problem is, I have no idea how I would prove this. (Of course maybe I'm wrong and this doesn't work at all and maybe it really all bounded functions you can make must be eventually periodic, who knows.)

Here's why I think this might work, though. Let's start with an example of what doesn't work. Obviously f(n)=an doesn't work; we all know that's periodic mod any m. But what about tetration? f(n)=H4(a,n)?

Well as best I can tell mod any m that's eventually constant! Because, look -- an mod m, that depends on n mod φ(m), right? (At worst.) So if you have, like, aaan, mod m, well that depends on aan mod φ(m), which depends on an mod φ(φ(m)), which depends on n mod φ(φ(φ(m))). After enough φ's you hit 1 at which point your n no longer matters. And then n effectively stays at 0.

So what I concluded, I think, is that so long as for sufficiently large m the period mod m is always at most m, iterating your function will not get you away from periodicity. (The more general argument is more complicated, but the above is a simple case.) But what if we could make a function whose periodicity mod m were larger than m, for arbitrarily large m? What if, more specifically, you had some m such that its period mod m was equal to m1>m, and its period mod m1 was some m2>m1, and so forth? That's what my function g is. And so the hope is that by iterating it -- while simultaneously varying the starting point, so that there's an actual dependence on that thing all the way on the inside, rather than it stabilizing in some relevant way -- we should be unable to find any period that works.

FURTHER EDIT: Actually, experimentally, it looks like just using gn(0) might work, without having to vary the starting point like I suggested above. That might be easier to analyze, but I still don't see how to prove it.

Specifically, here, m=6, or more generally, mi=2⋅3i+1. (Here i starts from 0, with m0=m.) Right, this works because, OK, mod any 3k (here k≥1), 2 is a generator, right? It has order 2⋅3k-1.

So what if we were to artificially slow things down? That function f I described has the property that, for 10|n, f9(n)=2n. And since 10 is relatively prime to 3, we don't run into any problems here with the two moduli interfering with one another. So you start with 10, and then the idea is that g(n), mod 3k, should have period 2⋅3k+1, because we've taken that 2⋅3k-1 and stretched it out by a factor of 9. (And this should also be the case mod 2⋅3k because e.g. the mod 2 is determined by the mod 10.)

So g does what I want; its period mod 2⋅3k (for k≥1) is 2⋅3k+1, and we get the sequence of mi above.

Of course, all this only shows that g does what I want. None of this shows that h does what I want. I don't know how to prove that. But that's why I think it's a good candidate, anyway.

But this is a pretty silly problem, so I'm not really intending to work on this further...
sniffnoy: (SMPTE)
So do you remember a while ago I posted some questions about the game of Snake? Well, here's another one. Or perhaps I should really say, here's a rephrasing of one of them.

The broad question about Snake, which earlier I wrote might just be too broad to answer, was "Which graphs are winnable?" (Weakly or strongly.) But it is possible -- not likely, I don't think, but possible -- that this might have a not-too-complicated answer.

Let's reformulate the question first. If a graph has a spanning subgraph which is winnable, then the graph is winnable. Hence, rather than focusing on all winnable graphs, let's focus just on minimal winnables -- ones where deleting any edge renders the graph unwinnable. (Note: I'm going to assume the strong game unless I say otherwise.) Characterizing these would characterizing all winnable graphs, as a graph is winnable iff it contains some minimal winnable.

Then so far I've only managed to find a few types of minimal winnable graphs! And, more generally, every winnable graph I know of contains one of these as a spanning subgraph. There are of course the trivial ones -- the zero-vertex graph, the one-vertex graph, the path P2. But the interesting ones are the following:
1. For n≥3, the cycle Cn. (In the weak game, we should restrict to n≥4, as there C3 is not minimal.)
2. For n≥3, two copies of Kn joined at a vertex. (In the weak game, we should instead say n≥2, as n=2 yields the path P3.)
3. For 1≤i≤j≤k, define Gi,j,k to be the graph consisting of two vertices and three paths between them, with i, j, and k vertices in the interior of the three paths (respectively). Then G1,1,k, G1,2,k, and G2,2,k are examples of minimal winnable graphs.

So, the question: Could this possibly be all of them? It seems unlikely, but it might just be possible. I have in fact verified that these are all of them up to 8 vertices, so any counterexample will have to be at least 9 vertices, unless I've messed up.

EDIT 4 July 2015: I may indeed have messed up about the 8-vertex case. I'm certain about the 7-vertex case, though. Will update if I fully solve the 8-vertex case. (9-vertex is out of reach, I think.)

Note that a positive answer to this question would also imply that subdivisions of unwinnable graphs are unwinnable, answering that question from the previous post. (It would also answer the question of whether weak and strong winnability coincide aside from P3, but that's because this proposition essentially just includes that; it isn't a nontrivial implication.) I should say, if this is true, I don't expect it to be at all easy to prove; it's not actually something I expect at all to solve...

(I will update my website with all this later.)

(Also, "minimal winnable" is really fun to say. :) )

-Harry
sniffnoy: (SMPTE)
Obviously, I haven't been posting much here lately. Here's another entry for the "problem dump" series -- two math problems I don't really intend to work on (at least not at the moment). I'll probably put this up on my website later.

Actually, I'm a little surprised to find that I haven't written anything about this here earlier. Oh well. Here we go.

Let's consider the game of Snake; except instead of playing it on a grid, we're going to play it on an arbitrary finite [simple] graph. We assume the snake starts at length 1 -- the game begins by the "computer" (who acts adversarially) picking a starting spot for the snake and a starting spot for the fruit. When the snake consumes the fruit (and thereby grows by 1), the computer picks a new spot for the fruit, which cannot be somewhere currently covered by the snake. We'll say the player wins if the snake covers the whole graph. If the game goes on infinitely, I guess that's a draw, but we'll give it to the computer.

(Here are some obvious ones -- if a spanning subgraph of a graph is winnable, then so is the whole thing; any cycle is winnable, so so is any graph with a Hamilton cycle; in order to be winnable, a graph must have a Hamilton path. But like I said, I'm not going to put all my notes here.)

So the general question then is, for which graphs can the player always win? (Hence why I said draws go to the computer.) Now this question is not necessarily that concrete; there might not be any nice characterization. I have bunch of notes about necessary conditions and sufficient conditions for this, but I'm not going to list them all here. I do, however, have two specific questions about this that I'd like to ask.

So -- you'll notice I didn't give a totally formal specification of the rules above, and there's a reason for that. When you formalize the rules, you realize there's the question: Should a snake of length 2 be allowed to turn around? As in, move its head to the current location of the tail. If you write the rules in the obvious manner, this is entirely legal, but it seems kind of unintuitive. So we can have two variants of the game: The weak game, where this is allowed; and the strong game, where it is not. (Note that you could consider graphs with multiple edges, and say that then in the strong game you're allowed to turn around if there's a double edge; but I'm restricting to simple graphs for reasons you'll see shortly.)

There is at least one graph that is weakly winnable but not strongly winnable, namely, a path of length 3. So, question number one: Are there any other such graphs? I suspect the answer is no but have been unable to prove it. Hence the restriction to simple graphs -- if I'm right, then unless the "underlying simple graph" is P3, adding multiple edges simply won't affect anything. (And it's easy to see how it affects P3.)

Here's a second question. When I initially mentioned this problem to John, he suggested that whether a graph is winnable or not should depend only on its topology. But this is not so; I have examples of (weakly or strongly) winnable graphs that can be subdivided to be made non-winnable. However, I have been unable to find an example of a (weakly or strongly) non-winnable graph which can be subdivided to be made winnable. So, question number two: If a graph is non-winnable (weakly or strongly), is the same true of any subdivision of it? For this question I don't really have a good idea what the answer should be. My guess would be yes, but I wouldn't be all that surprised if someone found a counterexample.

By the way, someone -- I forget who, unfortunately -- suggested that you could also play Snake on infinite graphs, with the win condition being that you grow arbitrarily large (now it's only a "draw" if the game goes on infinitely but your size stays bounded). But that seems like a pretty different problem, so I'm not going to consider that here.

-Harry
sniffnoy: (Sonic)
By "irresponsible speculation", I mean "speculation without having done my homework first", i.e., without having even tried to look at the existing literature beyond this paper or actually really tried anything at all.

So, Juan Arias de Reyna recently pointed out to me the following paper: Commuting Probabilities of Finite Groups, by Sean Eberhard.

EDIT DEC 1: The paper has been updated; the following refers to the original version of the paper. See the comments for discussion of the updated version.

So: If you have a finite group, you can consider the probability that a randomly chosen ordered pair of elements from it commutes. You could then consider the set of all probabilities obtained this way; this is some set of rational numbers between 0 and 1.

In this paper, Eberhard shows that this set is in fact reverse well-ordered! Its order type is of the form ωα where 2≤α≤ω². (Though Juan Arias de Reyna points out that it's not too hard to find examples that show that in fact α≥ω, so the order type is at least ωω.) He also shows that all the limit points of this set are rational. I think it should be pretty obvious why I'm interested in this! (Even though I have no plans to actually study this, my hands are full as it is.)

Now for the irresponsible speculation:

1. Instead of just doing finite groups, one could generalize to compact groups; one can consider probabilities there as well. How would this affect the set? It would be really nice if this just gave you the closure of the probability set for finite groups! Though Arias de Reyna tells me it's conjectured that the finite group commuting probability set is closed in (0,1], so that would be saying that using general compact groups only gives you 0 in addition. (I mean, it certainly does give you 0 in addition!)

2. I'm reminded of some work of John Wiltshire-Gordon and Gene Kopp. They considered probabilities of randomly chosen elements from a compact group satisfying some general word; the case of commuting probabilities is the case where the word w is aba-1b-1. I wonder if the same phenomenon might be seen for other words.

Probably it would be best to first look at words in one variable. Obviously using w=a generates an ω if we stick to finite groups and an ω+1 if we allow general compact groups -- not ωω, but still well-ordered. As for a² or a³... well, I don't know, and I don't really intend to work on it as I said above, but it seems vaguely plausible and it's an interesting question!

So yeah that's basically all I have to say on the matter.

-Harry

June 2025

S M T W T F S
1234567
891011121314
15161718192021
2223 2425262728
2930     

Syndicate

RSS Atom
Page generated Jul. 2nd, 2025 10:18 am
Powered by Dreamwidth Studios