# 125034 v2.2 / 2023-12-21 Q1(m=6)

I am developing a game that generates puzzles every day. It's my opinion that these puzzles are like Einstein's Riddle in 1D.

Two weeks later, it will generate the following puzzle for players looking for a challenge:

2023-12-21 Q1(m=6)

Rearrange the digits in ⟨1263045⟩ to meet the rules below.

⟨6th 5th 4th 3rd 2nd 1st 0th⟩

✅Match
5th → 1|2|5|6
⟨? ⋯ 1 ⋯ (?+2) ⋯⟩ (?≠1)
⟨⋯ ? ⋯ 6 ⋯ (?+4)⟩ (?≠2)
6th → a, 5th → b, a+b=5+6n
⟨⋯ ? ⋯ 6 ⋯ (?+3)⟩ (?≠3)
Jump(1,4) = 1
3rd → 1|2|6

⛔Avoid
⟨         ²ⁿᵈa ¹ˢᵗb   ⟩, (ab)₁₀ ≥ 46

----- Information -----

🔲 「5th → 1|2|5|6」
2880 permutations match this pattern.
Examples: ⟨3542610⟩, ⟨3160524⟩, ⟨2634105⟩.

🔲 「⟨? ⋯ 1 ⋯ (?+2) ⋯⟩ (?≠1)」
?, 1, (?+2) are three different numbers.
1440 permutations match this pattern.
Examples: ⟨3026415⟩, ⟨4302156⟩, ⟨0615324⟩.

🔲 「⟨⋯ ? ⋯ 6 ⋯ (?+4)⟩ (?≠2)」
?, 6, (?+4) are three different numbers.
720 permutations match this pattern.
Examples: ⟨3012654⟩, ⟨1530624⟩, ⟨1623045⟩.

🔲 「6th → a, 5th → b, a+b=5+6n」
[6th] + [5th] = 5 | 11 | 17 | ⋯ .
960 permutations match this pattern.
Examples: ⟨5621034⟩, ⟨5063412⟩, ⟨0523146⟩.

🔲 「⟨⋯ ? ⋯ 6 ⋯ (?+3)⟩ (?≠3)」
?, 6, (?+3) are three different numbers.
1080 permutations match this pattern.
Examples: ⟨5013624⟩, ⟨2103654⟩, ⟨5012643⟩.

🔲 「Jump(1,4) = 1」
There is 1 number between 1 and 4.
1200 permutations match this pattern.
Examples: ⟨2401365⟩, ⟨5601243⟩, ⟨1543062⟩.

🔲 「3rd → 1|2|6」
2160 permutations match this pattern.
Examples: ⟨4236015⟩, ⟨4051236⟩, ⟨6132504⟩.

🔳 「⟨         ²ⁿᵈa ¹ˢᵗb   ⟩, (ab)₁₀ ≥ 46」
(ab)₁₀ ∶= 10a + b.
1560 permutations match this pattern.
Examples: ⟨3142650⟩, ⟨0543612⟩, ⟨6214503⟩.

#125034_v2.2


What is the answer and how do you approach it?

You can try the game at https://1263045.pages.dev/. Note that it will be an immediate “Game Over” if you submit a wrong digit, and that the game on 2023-12-18 will be another special one.

If it helps, you can find some examples at https://125034.blogspot.com/.

I will select an answer around Christmas time. I will pick the one having the most number of upvotes.

I have an approach which delighted me a lot when I first realized it. If no one else has similar thoughts, I would like to share it at the end as well.

• the rules are not that clear for me, especially the last one. Could you provide a full text explanation ? Dec 8, 2023 at 9:02
• On the one hand, to have (a,b) such that 10a+b >= 46, where a,b are distinct numbers of S:={0,1,2,3,4,5,6}, there are 13 possibilities: (a,b) = (4,6) / (5,?) / (6,?). Hence, the no. of permutations of S matching the pattern 🔳 「⟨ ²ⁿᵈa ¹ˢᵗb ⟩, (ab)₁₀ ≥ 46」is 13 * 5! = 1560. On the other hand, we are asked to find a permutation so that all of the ✅patterns are matched and all of the ⛔patterns are avoided at the same time. So, our answer should violate the preceding pattern. In other words, the no. of possible solution is reduced from 7! to (7! - 1560) = 3480 by the last rule. Dec 8, 2023 at 9:35
• I hope this clarification helps. If further information is needed please let me know. I'm glad someone is interested. Dec 8, 2023 at 9:42
• I suppose ⟨ ²ⁿᵈa ¹ˢᵗb ⟩ means b is at the first position and a is at the second ? That's the strange part, because there is a lot of space around them, so it feels strange compared to other rules. I also suppose ⟨⋯ ? ⋯ 6 ⋯ (?+3)⟩ means that ? is not at 6th position, and ?+3 is at 1st position ? Dec 8, 2023 at 9:48
• Sorry that the text-based message may be confusing. In the question, the leftmost corner is the 6th position while the rightmost is the 0th. Please treat them as labels only rather than the order of reading. It may seems reverse in western culture as one reads from left to right. But this direction of labelling is natural in other settings. E.g., consider 125034 as a number in the Arabic numeral system. It is actually 1*10^5 + 2*10^4 + 5*10^3 + 0*10^2 + 3*10^1 + 4*10^0. Also, when one handles function composition, e.g. f(g(x)), it is natural to calculate y = g(x) first and then f(y). etc. Dec 8, 2023 at 10:08

Here is a detailled step-by-step construction of the solution:

First step:

Because of ⟨⋯ ? ⋯ 6 ⋯ (?+4)⟩, the 0th digit must be at least 4, but not 6, so it's either 4 or 5. Let's assume it is 4. Jump(1,4) = 1 would make the 2nd digit 1, then ⟨⋯ ? ⋯ 6 ⋯ (?+3)⟩ would make the 1st digit 6. There is now only one possibility for the 3rd digit, which is 2, because of 3rd → 1|2|6, and that makes the 5th digit 5 because of 5th → 1|2|5|6. Now for the 6th → a, 5th → b, a+b=5+6n rule to be true, the 6th digit must be either 0 or 6, but 6 is already used, so it must be 0 - but that is a contradiction because of ⟨? ⋯ 1 ⋯ (?+2) ⋯⟩. Therefore, our assumption that the 0th digit is 4 must be wrong.

0th digit:

- - - - - - 5

Second step:

Now, we know that the 5th digit is either 1, 2 or 6. (5th → 1|2|5|6 and 5 is the 0th digit). Looking at the 6th → a, 5th → b, a+b=5+6n rule, the 5th digit can't be 6 because it would make the 6th digit a 5, and it can't be 1 because it would make the 6th digit a 4, contradicting Jump(1,4) = 1. Hence, the 5th digit must be a 2, which also makes the 6th digit a 3:

6th and 5th digits:

3 2 - - - - 5

Third step:

The 3rd digit is now either 1 or 6 (3rd → 1|2|6). Let's assume it is 1. Then the 1st digit must be 4 because of Jump(1,4) = 1, so 6 is either the 2nd or the 4th digit. But it can't be the 2nd digit because of ⟨ ²ⁿᵈa ¹ˢᵗb ⟩, (ab)₁₀ ≥ 46, and it can't be the 4th digit because of ⟨⋯ ? ⋯ 6 ⋯ (?+4)⟩. So:

3rd digit:

3 2 - 6 - - 5

Last step:

Because of Jump(1,4) = 1, we know that the 2nd and the 4th digit are 1 and 4 (not necessarily in this order), which makes the 1st digit a 0. Now, because of ⟨⋯ ? ⋯ 6 ⋯ (?+4)⟩, the 1 must be before the 6; which gives us:

Solution:

3 2 1 6 4 0 5

It's not too hard to check that this solution is compatible with every rule.

• Thanks for playing my game! I hope it brought you some good times. Dec 24, 2023 at 9:34

I am the OP. First of all, I would like to thank everyone who played my game and take this opportunity to wish you a merry Christmas.

I would like to share an approach that delighted me a lot when I first thought of it.

During the game, we transition from one partial answer to another. At each stage we want to make progress: submitting more digits to complete the answer. We do so by using some of the patterns (rules) that are given. We might treat this process as logical deduction, while computers can treat it as a task of performing set operations and counting. So, given a partial answer, we can ask, what is a minimal set of patterns we need in order to make some progress? By minimal set we mean no proper subset of it could bring us progress. It is a kind of a greedy approach.

With the help of computer, we have the following directed graph:

Using adjacency matrix of graph theory, we count that there are 31 paths from the root vertex to the answer vertex. Therefore, We have up to 31 ways to deduce the answer. There are more as we have different strategies. For example, players can use more than a minimal set of patterns to make progress; or if we want to make a specific progress rather than an arbitrary one at some stage, then we would have a different graph.

The riddle on 2023-12-18 is a good comparison. The riddle is

2023-12-18 Q1(m=6)

Rearrange the digits in ⟨1263045⟩ to meet the rules below.

⟨6th 5th 4th 3rd 2nd 1st 0th⟩

✅Match
4th → a, 2nd → b, a+b=3
⟦1,5⟧ ∋ 2,3
⟨       ³ʳᵈa     ⁰ᵗʰb ⟩, (ab)₁₀ ≥ 51
6th → a, 1st → b, a+b=1+4n

⛔Avoid
1st → 4

----- Information -----

🔲 「4th → a, 2nd → b, a+b=3」
480 permutations match this pattern.
Examples: ⟨6534021⟩, ⟨3415260⟩, ⟨0526143⟩.

🔲 「⟦1,5⟧ ∋ 2,3」
The closed interval given by 1 and 5 contains 2, 3.
840 permutations match this pattern.
Examples: ⟨5362104⟩, ⟨1624035⟩, ⟨1326450⟩.

🔲 「⟨       ³ʳᵈa     ⁰ᵗʰb ⟩, (ab)₁₀ ≥ 51」
(ab)₁₀ ∶= 10a + b.
1320 permutations match this pattern.
Examples: ⟨2135604⟩, ⟨6025341⟩, ⟨4256301⟩.

🔲 「6th → a, 1st → b, a+b=1+4n」
[6th] + [1st] = 1 | 5 | 9 | ⋯ .
1440 permutations match this pattern.
Examples: ⟨0613452⟩, ⟨5063142⟩, ⟨5621340⟩.

🔳 「1st → 4」
720 permutations match this pattern.
Examples: ⟨2530641⟩, ⟨6302145⟩, ⟨1362045⟩.

#125034_v2.2


The associated graph is

That is, in this riddle we cannot make any progress (according to our definition) without using all of the patterns. All positional digits have the same level of difficulty in a certain sense.

(A solution to this riddle is available at https://125034.blogspot.com/2023/12/2023-12-18-q1m6.html)

Trying to analyze the games this way gives me a number of new ideas, both in theory and application, and I gained a better understanding of Einstein's Riddle and similar games in particular. The 1D setting is without loss of generality, because we can encode a $$m\times n$$ matrix into a $$1\times mn$$ vector and add rules to preserve information.

I end this post by writing down a solution to the puzzle I learnt from the graph.

(Please visit https://125034.blogspot.com/2023/12/2023-12-21-q1m6.html if the following monospaced fonts cannot be displayed properly)

       ┌───┬───┬───┬───┬───┬───┬───┐
│6th│5th│4th│3rd│2nd│1st│0th│▒
╞═══╪═══╪═══╪═══╪═══╪═══╪═══╡▒
Step 1 │   │   │   │ 6 │   │   │   │▒
├───┼───┼───┼───┼───┼───┼───┤▒
Step 2 │   │   │   │ 6 │   │   │ 5 │▒
├───┼───┼───┼───┼───┼───┼───┤▒
Step 3 │   │ 2 │   │ 6 │   │   │ 5 │▒
├───┼───┼───┼───┼───┼───┼───┤▒
Step 4 │   │ 2 │ 1 │ 6 │   │   │ 5 │▒
├───┼───┼───┼───┼───┼───┼───┤▒
Step 5 │ 3 │ 2 │ 1 │ 6 │   │   │ 5 │▒
├───┼───┼───┼───┼───┼───┼───┤▒
Step 6 │ 3 │ 2 │ 1 │ 6 │ 4 │   │ 5 │▒
├───┼───┼───┼───┼───┼───┼───┤▒
Step 7 │ 3 │ 2 │ 1 │ 6 │ 4 │ 0 │ 5 │▒
└───┴───┴───┴───┴───┴───┴───┘▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

Proof of 2023-12-21 Q1(m=6)
═══════════════════════════

Notation: if nth -> a, then we write [nth] = a.

We begin with two observations. Firstly, we have

(1) [5th] = 2|5|6.

It is because of ✅「5th → 1|2|5|6」,
and that if [5th] = 1, then ✅「Jump(1,4) = 1」 implies [3rd] = 4:

┌───┬───┬───┬───┬───┬───┬───┐
│6th│ 5▲│4th│ 3▲│2nd│1st│0th│
╞═══╪═══╪═══╪═══╪═══╪═══╪═══╡
│   │ 1 │   │ 4 │   │   │   │
└───┴───┴───┴───┴───┴───┴───┘

which contradicts ✅「3rd → 1|2|6」.

Secondly, by ✅「⟨⋯ ? ⋯ 6 ⋯ (?+4)⟩ (?≠2)」, exactly one of the following holds:

(2) ⟨⋯ 0 ⋯ 6 ⋯ 4⟩ or ⟨⋯ 1 ⋯ 6 ⋯ 5⟩.

Now, let us determine where to place 6.
By ✅「⟨⋯ ? ⋯ 6 ⋯ (?+4)⟩ (?≠2)」, 6 is not in corners;
and to avoid ⛔「⟨         ²ⁿᵈa ¹ˢᵗb   ⟩, (ab)₁₀ ≥ 46」, we need 6 ≠ [2nd]. Hence

(3) 6 = [5th] or [4th] or [3rd] or [1st]. We claim that 6 = [3rd] actually.

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

(3.1) Case "6 = [5th] or [4th]":

┌───┬───┬───┬───┬───┬───┬───┐
│6th│ 5▲│ 4▲│3rd│2nd│1st│0th│
╞═══╪═══╪═══╪═══╪═══╪═══╪═══╡
│   │ * │ * │   │   │   │   │
└───┴───┴───┴───┴───┴───┴───┘

Suppose 6 = [5th] or [4th]. By ✅「⟨? ⋯ 1 ⋯ (?+2) ⋯⟩ (?≠1)」 and (1),
we have [6th] ≠ 1, [5th] ≠ 1, and [5th] ≠ 0.
Therefore, it follows from (2) that:

┌───┬───┬───┬───┬───┬───┬───┐
│ 6▲│5th│4th│3rd│2nd│1st│ 0▲│
╞═══╪═══╪═══╪═══╪═══╪═══╪═══╡
│ 0 │ * │ * │   │   │   │ 4 │
└───┴───┴───┴───┴───┴───┴───┘

Then, by ✅「Jump(1,4) = 1」 and ✅「3rd → 1|2|6」, we have

┌───┬───┬───┬───┬───┬───┬───┐
│6th│5th│4th│ 3▲│ 2▲│1st│0th│
╞═══╪═══╪═══╪═══╪═══╪═══╪═══╡
│ 0 │ * │ * │ 2 │ 1 │   │ 4 │
└───┴───┴───┴───┴───┴───┴───┘

It is a contradiction, however, as we fail to match ✅「⟨? ⋯ 1 ⋯ (?+2) ⋯⟩ (?≠1)」.

(3.2) Case "6 = [1st]":

┌───┬───┬───┬───┬───┬───┬───┐
│6th│5th│4th│3rd│2nd│ 1▲│0th│
╞═══╪═══╪═══╪═══╪═══╪═══╪═══╡
│   │   │   │   │   │ 6 │   │
└───┴───┴───┴───┴───┴───┴───┘

Suppose 6 = [1st]. By ✅「3rd → 1|2|6」, we have [3rd] = 1|2.
It is not 1, for otherwise by ✅「Jump(1,4) = 1」 we have [5th] = 4:

┌───┬───┬───┬───┬───┬───┬───┐
│6th│*5 │4th│*3 │2nd│1st│0th│
╞═══╪═══╪═══╪═══╪═══╪═══╪═══╡
│   │ 4 │   │ 1 │   │ 6 │   │
└───┴───┴───┴───┴───┴───┴───┘

which contradicts (1). Accordingly, [3rd] = 2.

┌───┬───┬───┬───┬───┬───┬───┐
│6th│5th│4th│ 3▲│2nd│1st│0th│
╞═══╪═══╪═══╪═══╪═══╪═══╪═══╡
│   │   │   │ 2 │   │ 6 │   │
└───┴───┴───┴───┴───┴───┴───┘

By (1), we have [5th] = 2|5|6. So, we see that [5th] = 5.

┌───┬───┬───┬───┬───┬───┬───┐
│6th│ 5▲│4th│3rd│2nd│1st│0th│
╞═══╪═══╪═══╪═══╪═══╪═══╪═══╡
│   │ 5 │   │ 2 │   │ 6 │   │
└───┴───┴───┴───┴───┴───┴───┘

Then, matching (2) becomes matching ⟨⋯ 0 ⋯ 6 ⋯ 4⟩.
It implies [0th] = 4, and using ✅「Jump(1,4) = 1」 we have [2nd] = 1 as well:

┌───┬───┬───┬───┬───┬───┬───┐
│6th│5th│4th│3rd│ 2▲│1st│ 0▲│
╞═══╪═══╪═══╪═══╪═══╪═══╪═══╡
│   │ 5 │   │ 2 │ 1 │ 6 │ 4 │
└───┴───┴───┴───┴───┴───┴───┘

--- Idle ---
┌───┬───┬───┬───┬───┬───┬───┐
│   │   │   │ 3 │ 0 │   │   │
└───┴───┴───┴───┴───┴───┴───┘

It is a contradiction because we cannot match ✅「⟨? ⋯ 1 ⋯ (?+2) ⋯⟩ (?≠1)」 anyway.

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

By (3.1) and (3.2), our claim in (3) is verified. Accordingly, we get our first step:

┌───┬───┬───┬───┬───┬───┬───┐
│6th│5th│4th│ 3■│2nd│1st│0th│▒
╞═══╪═══╪═══╪═══╪═══╪═══╪═══╡▒
Step 1 │   │   │   │ 6 │   │   │   │▒
└───┴───┴───┴───┴───┴───┴───┘▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

--- Idle ---
┌───┬───┬───┬───┬───┬───┬───┐
│ 1 │ 2 │   │ 3 │ 0 │ 4 │ 5 │
└───┴───┴───┴───┴───┴───┴───┘

We proceed to determine the value of [0th]. By (2), we have [0th] = 4|5.
Actually it is not 4, for otherwise it follows from ✅「Jump(1,4) = 1」 that

┌───┬───┬───┬───┬───┬───┬───┐
│6th│5th│4th│3rd│*2 │1st│*0 │
╞═══╪═══╪═══╪═══╪═══╪═══╪═══╡
│   │   │   │ 6 │ 1 │   │ 4 │
└───┴───┴───┴───┴───┴───┴───┘

which contradicts ✅「⟨⋯ ? ⋯ 6 ⋯ (?+3)⟩ (?≠3)」.

As a result, we have [0th] = 5. Recalling (1), we get [5th] = 2 as well.

┌───┬───┬───┬───┬───┬───┬───┐
│6th│ 5■│4th│3rd│2nd│1st│ 0■│▒
╞═══╪═══╪═══╪═══╪═══╪═══╪═══╡▒
│   │   │   │ 6 │   │   │   │▒
├───┼───┼───┼───┼───┼───┼───┤▒
Step 2 │   │   │   │ 6 │   │   │ 5 │▒
├───┼───┼───┼───┼───┼───┼───┤▒
Step 3 │   │ 2 │   │ 6 │   │   │ 5 │▒
└───┴───┴───┴───┴───┴───┴───┘▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

--- Idle ---
┌───┬───┬───┬───┬───┬───┬───┐
│ 1 │   │   │ 3 │ 0 │ 4 │   │
└───┴───┴───┴───┴───┴───┴───┘

By ✅「⟨⋯ ? ⋯ 6 ⋯ (?+4)⟩ (?≠2)」, 1 is at the left of 6, so 1 = [6th] or [4th].
It is not in corners by ✅「⟨? ⋯ 1 ⋯ (?+2) ⋯⟩ (?≠1)」, so 1 = [4th].

┌───┬───┬───┬───┬───┬───┬───┐
│6th│5th│ 4■│3rd│2nd│1st│0th│▒
╞═══╪═══╪═══╪═══╪═══╪═══╪═══╡▒
│   │ 2 │   │ 6 │   │   │ 5 │▒
├───┼───┼───┼───┼───┼───┼───┤▒
Step 4 │   │ 2 │ 1 │ 6 │   │   │ 5 │▒
└───┴───┴───┴───┴───┴───┴───┘▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

--- Idle ---
┌───┬───┬───┬───┬───┬───┬───┐
│   │   │   │ 3 │ 0 │ 4 │   │
└───┴───┴───┴───┴───┴───┴───┘

Now there is only one way to match ✅「6th → a, 5th → b, a+b=5+6n」:

┌───┬───┬───┬───┬───┬───┬───┐
│ 6■│5th│4th│3rd│2nd│1st│0th│▒
╞═══╪═══╪═══╪═══╪═══╪═══╪═══╡▒
│   │ 2 │ 1 │ 6 │   │   │ 5 │▒
├───┼───┼───┼───┼───┼───┼───┤▒
Step 5 │ 3 │ 2 │ 1 │ 6 │   │   │ 5 │▒
└───┴───┴───┴───┴───┴───┴───┘▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

--- Idle ---
┌───┬───┬───┬───┬───┬───┬───┐
│   │   │   │   │ 0 │ 4 │   │
└───┴───┴───┴───┴───┴───┴───┘

In view of ✅「Jump(1,4) = 1」, we finish by

┌───┬───┬───┬───┬───┬───┬───┐
│6th│5th│4th│3rd│ 2■│ 1■│0th│▒
╞═══╪═══╪═══╪═══╪═══╪═══╪═══╡▒
│ 3 │ 2 │ 1 │ 6 │   │   │ 5 │▒
├───┼───┼───┼───┼───┼───┼───┤▒
Step 6 │ 3 │ 2 │ 1 │ 6 │ 4 │   │ 5 │▒
├───┼───┼───┼───┼───┼───┼───┤▒
Step 7 │ 3 │ 2 │ 1 │ 6 │ 4 │ 0 │ 5 │▒
└───┴───┴───┴───┴───┴───┴───┘▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

--- Idle ---
┌───┬───┬───┬───┬───┬───┬───┐
│   │   │   │   │   │   │   │
└───┴───┴───┴───┴───┴───┴───┘

Q.E.D.

#125034_v2.2