Web link

2025-04-21 WR

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

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

✅Match
max ⊢0⊣ ≤ 4
⟨⋯ a ⋯ 5 ⋯⟩, a = 1|2|3
4th → a, 3rd → b, |a-b|=2
median {p4, p3, p2} = 1

⛔Avoid
⟦3,5⟧ ∋ 0,1,2
{p5, p4, p3} = ? + {0,1,2}
⟨ ⁵ᵗʰ↓ ⁴ᵗʰ↑ ³ʳᵈ↑ ²ⁿᵈ↑ ¹ˢᵗ↓ ⁰ᵗʰ↓ ⟩ after 5−⟨⋯⟩

#125034_v2.8


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

Proof of 2025-04-21 WR
══════════════════════

Notation: if Nth -> a, then we write pN = a.

Observe that ✅「median {p4, p3, p2} = 1」 implies

(1) 0,1 ∈ {p4, p3, p2}.

(2) We show that 0 = p2.

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

Suppose (2) does not hold. Then, it follows from (1) that 0 = p4|p3. In view of ✅「4th → a, 3rd → b, |a-b|=2」, we have {p4,p3} = {0,2}. Combining this with (1), we have {p4,p3,p2} = {0,1,2}:

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

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

However, it follows that we cannot avoid ⛔「⟨ ⁵ᵗʰ↓ ⁴ᵗʰ↑ ³ʳᵈ↑ ²ⁿᵈ↑ ¹ˢᵗ↓ ⁰ᵗʰ↓ ⟩ after 5−⟨⋯⟩」, which is a contradiction.

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

We have verified (2). Accordingly, we get

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

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

Then, using (1) and ✅「4th → a, 3rd → b, |a-b|=2」, we have

(3) {p4,p3} = {1,3}.

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

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

As a consequence, p5 = 2|4|5.

Actually p5 = 4. For, if p5 = 2, then by (3) we would match ⛔「{p5, p4, p3} = ? + {0,1,2}」; while if p5 = 5, then we cannot match ✅「⟨⋯ a ⋯ 5 ⋯⟩, a = 1|2|3」.

So, we get

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

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

Given (3), we have 5 = p1|p0. To match ✅「max ⊢0⊣ ≤ 4」, 5 is not at 1st, so 5 = p0: 

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

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

Then (3) implies 2 = p1:

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

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

Finally, to avoid ⛔「⟦3,5⟧ ∋ 0,1,2」, we finish by

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

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

Q.E.D.

#125034_v2.8