Kolon Algoritması
Matematiksel Formülasyon
Column Algorithm
Mathematical Formulation
Bu doküman, Smartest Usta oracle motorunun temelini oluşturan sürecin adım adım matematiksel karşılığını açıklar: rastgele üretilen bir basamak dizisinden başlayıp, bir dizi geometrik ve döngüsel süzgeçten geçerek 1 ile 9 arasında tek bir sayıya indirgenir. Her adım kendi koşulunu sağlamazsa tüm süreç en baştan tekrar üretilir — nihai $Z$ değeri, ancak tüm koşullar aynı anda sağlandığında ortaya çıkar.
This document explains, step by step, the mathematical counterpart of the process behind the Smartest Usta oracle engine: starting from a randomly generated digit sequence, and through a series of geometric and cyclic filters, collapsing down to a single number between 1 and 9. If any step fails its condition, the entire process is regenerated from scratch — the final value $Z$ only emerges once every condition is satisfied simultaneously.
Temel Gösterim
Base Notation
Algoritmanın tamamı, tek bir uzun basamak dizisi üzerinde çalışır. Bu dizi,
arr listesinden rastgele seçimlerle inşa edilen 9 çift (birA, birB)
biriminin art arda eklenmesiyle oluşur.
The entire algorithm operates on a single long digit sequence. This sequence
is built by concatenating 9 pairs (birA, birB)
constructed from random choices out of the arr list.
$D$, kod içindeki digit_dizisi'dir. $n$, dizinin toplam uzunluğudur
(9 çiftin karakter sayılarının toplamı — arr içindeki bazı elemanlar
iki basamaklı olduğundan $n$ sabit değildir).
$D$ is digit_dizisi in the code. $n$ is the total length of the
sequence (the sum of the character counts of the 9 pairs — since some elements
in arr are two digits long, $n$ is not fixed).
Ana Üretim — birA / birB Çiftleri
Core Generation — birA / birB Pairs
arr dizisinden rastgele eleman çekilir; "0" gelene kadar devam edilir.
Bu, hem birA hem birB için ayrı ayrı yapılır ve toplam
9 kez tekrarlanarak $D$ inşa edilir.
Elements are drawn randomly from arr, continuing until a "0" appears.
This is done separately for both birA and birB, and the
whole process is repeated 9 times to build $D$.
Kaynak küme — arr: Her rastgele seçim bu sabit
18 elemanlı kümeden yapılır. Kümede tek basamaklı 0–9 rakamları ile birlikte,
8 adet iki basamaklı özel sayı da bulunur:
Source set — arr: Every random draw is made from
this fixed 18-element set. It contains the single digits 0–9 along with
8 special two-digit numbers:
Python listesi olarak: ["0","1","2","3","4","5","6","7","8","9","16","25","46","75","84","93","99","10"].
Rastgele seçim arr'den yapılırken "0" gelene kadar devam edildiğinden,
iki basamaklı elemanlar (örn. "16", "99") tek bir çekilişte
birden fazla rakamı $D$'ye ekleyebilir — bu da §A₁ koşulunun (0–9 tüm rakamların
kapsanması) daha hızlı sağlanmasına yardımcı olur.
As a Python list: ["0","1","2","3","4","5","6","7","8","9","16","25","46","75","84","93","99","10"].
Since the random draw from arr continues until a "0" appears,
two-digit elements (e.g. "16", "99") can contribute more
than one digit to $D$ in a single draw — which helps satisfy condition §A₁
(full coverage of digits 0–9) faster.
Tek bir üretim adımı:
A single generation step:
$$\text{birA} = \text{ilk\_rastgele\_eleman}(\texttt{arr})$$ $$\text{birB} = \text{son eleman, "0" gelmeden hemen önceki}$$ $$\text{sonuç}_j = (\text{birA}_j,\ \text{birB}_j), \qquad j = 1,\dots,9$$ $$D = \text{birA}_1 \Vert \text{birB}_1 \Vert \text{birA}_2 \Vert \text{birB}_2 \Vert \cdots \Vert \text{birA}_9 \Vert \text{birB}_9$$($\Vert$ = karakter dizisi birleştirme / concatenation)
($\Vert$ = string concatenation)
0'dan 9'a kadar her rakam en az bir kez $D$ içinde geçmelidir. Geçmiyorsa tüm süreç §A'dan itibaren tekrar başlar.
Every digit from 0 to 9 must appear at least once in $D$. If not, the entire process restarts from §A.
3 Fark İncelemesi
3-Difference Inspection
Dizi üzerinde, uçlar hariç ($i=2,\dots,n-1$) her orta eleman için sol ve sağ komşuları karşılaştırılır. Amaç, aralarında döngüsel fark 3 olan ya da özel çift sayılan komşu ikilileri bulmaktır.
Excluding the two endpoints ($i=2,\dots,n-1$), each middle element's left and right neighbors are compared. The goal is to find neighbor pairs whose cyclic difference is 3, or that count as a special pair.
Döngüsel fark (0–9 arası dairesel mesafe):
Cyclic difference (circular distance on 0–9):
$$\delta(a,b) = \min\big(|a-b|,\ 10-|a-b|\big)$$Özel çiftler — 0 zaten $D$ içinde bulunduğundan (§A₁ koşulu), sabit olarak:
Special pairs — since 0 is always present in $D$ (condition §A₁), fixed as:
$$\text{Özel} = \big\{\{7,0\},\ \{8,1\},\ \{9,2\}\big\}$$
Bu çiftler, döngüsel fark 3 olmasa bile "eşleşen" sayılır — kod içinde
0 in digit_dizisi her zaman doğru olduğundan bu sabit küme kullanılır.
These pairs count as a "match" even when the cyclic difference isn't 3 — since
0 in digit_dizisi is always true in the code, this fixed set is used.
Eşleşme koşulu ($i = 2,\dots,n-1$):
Match condition ($i = 2,\dots,n-1$):
$$M(i) \iff \delta(d_{i-1}, d_{i+1}) = 3 \ \ \lor\ \ \{d_{i-1}, d_{i+1}\} \in \text{Özel}$$ $$S = (i_1 < i_2 < \dots < i_k) = \{\, i : M(i) \,\}$$Her $i_m \in S$ bir satır oluşturur: $R_m = (d_{i_m-1},\ d_{i_m},\ d_{i_m+1})$ — yani (sol, orta, sağ).
Each $i_m \in S$ forms a row: $R_m = (d_{i_m-1},\ d_{i_m},\ d_{i_m+1})$ — i.e. (left, middle, right).
Satır toplamı:
Row sum:
$$\text{toplam}(m) = d_{i_m-1} + d_{i_m} + d_{i_m+1}$$Bulunan satırlar arasında toplamı tam olarak 11 olan yalnızca bir satır bulunmalıdır. Hiç yoksa ya da birden fazlaysa, tüm süreç §A'dan itibaren tekrar başlar.
Among the found rows, exactly one row must have a sum of 11. If there are zero or more than one, the entire process restarts from §A.
Toplamı 11 olan tek satırın indeksi $m^{\circ}$, bulunan satırlar listesinin ilki ya da sonuncusu olamaz. Aksi halde tekrar §A'dan başlanır.
The index $m^{\circ}$ of the single row with sum 11 cannot be the first or last row in the found list. Otherwise, the process restarts from §A.
Kolon Taraması — x ve y
Column Scan — x and y
§B'de bulunan $k$ adet satır, 3 sütunluk bir tablo oluşturur (sol / orta / sağ). $x$ hangi sütunun inceleneceğini, $y$ ise tarama yönünü belirler.
The $k$ rows found in §B form a 3-column table (left / middle / right). $x$ determines which column is examined, and $y$ determines the scan direction.
(incelenecek kolon)
(the column to be examined)
$$y \in \{1,2\} \Rightarrow \text{yön} = \begin{cases}\text{aşağı} & y = 1 \\ \text{yukarı} & y = 2\end{cases}$$Tarama sırası (satırların hangi yönde okunacağı):
Scan order (the direction rows are read in):
$$\text{sıra} = \begin{cases}(1, 2, \dots, k) & \text{aşağı } (y{=}1) \\[4pt] (k, k{-}1, \dots, 1) & \text{yukarı } (y{=}2)\end{cases}$$Döngüsel sayaç eşleştirmesi — 1'den 9'a kadar sayılırken, satırlar arasında $k$'dan büyükse baştan (döngüsel) devam edilir:
Cyclic counter matching — while counting from 1 to 9, if the count exceeds $k$, the row index wraps back to the start (cyclically):
$$\text{sıra}(p) = \text{sıra}\big[\, ((p-1) \bmod k) + 1 \,\big], \qquad p = 1,\dots,9$$ $$t_p = p \qquad$$(sayaç değeri, hep 1'den 9'a kadar)
(the counter value, always running from 1 to 9)
$$\text{eşleşme}(p) \iff t_p = \text{Kolon}_c\big(R_{\text{sıra}(p)}\big)$$9'a kadar sayarken, seçilen kolonda sayaç değeriyle aynı olan tam olarak bir satır olmalı. Değilse (0 ya da 2+), tüm süreç §A'dan itibaren tekrar başlar.
While counting up to 9, exactly one row in the selected column must equal the counter value. If not (0 or 2+ matches), the entire process restarts from §A.
Aynı satırın döngüsel tekrarda ($p$ ve $p+k$ gibi) iki kez sayaç değeriyle çakışması pratikte imkânsızdır, çünkü sabit bir kolon değeri yalnızca tek bir sayaç değerine ($t_p = $ o değer) eşit olabilir.
It is practically impossible for the same row to coincide with the counter value twice across a cyclic repeat (e.g. at $p$ and $p+k$), since a fixed column value can only equal one counter value ($t_p = $ that value).
(bulunan satır)
(the row found)
Tekrarsızlık Koşulu
No-Repetition Condition
Bulunan satır $R_{m^*}=(a,b,c_0)$ içinde aynı rakam birden fazla kez geçemez (örn. $6\text{-}9\text{-}9$ geçersizdir).
Within the found row $R_{m^*}=(a,b,c_0)$, the same digit cannot appear more than once (e.g. $6\text{-}9\text{-}9$ is invalid).
Sağlanmazsa tüm süreç §A'dan itibaren tekrar başlar.
If not satisfied, the entire process restarts from §A.
Döngüsel Yeniden Sıralama ve Δ
Cyclic Reordering and Δ
$(a,b,c_0)$ üçlüsü, aralarındaki en büyük döngüsel boşluğun hemen ardından başlayacak şekilde yeniden dizilir. Bu, bir "kırılma noktası" bulup çemberi orada açmaya benzer.
The triplet $(a,b,c_0)$ is reordered to begin right after the largest cyclic gap between the values. This is analogous to finding a "break point" and opening the circle there.
1. Artan sıralama:
1. Ascending sort:
$$v_1 < v_2 < v_3 \quad$$($a,b,c_0$'nin sıralanmış hali)
(the sorted form of $a,b,c_0$)
2. Döngüsel boşluklar (0–9 çemberinde):
2. Cyclic gaps (on the 0–9 circle):
$$g_1 = v_2 - v_1, \qquad g_2 = v_3 - v_2, \qquad g_3 = (10 - v_3) + v_1$$3. En büyük boşluğun hemen sonrasından başlayarak döngüsel dizilim:
3. Cyclic ordering starting right after the largest gap:
$$(a', b', c_0') = \text{cyclic\_rotate}(v_1,v_2,v_3;\ \arg\max(g_1,g_2,g_3))$$4. Pozisyon kayması:
4. Position shift:
$v^*$'nin ($=p^*$, bulunan sayı) orijinal satırdaki konumu ile yeniden sıralanmış satırdaki konumu karşılaştırılır:
The position of $v^*$ ($=p^*$, the found number) in the original row is compared with its position in the reordered row:
$$\text{pos}_{orig},\ \text{pos}_{new} \in \{1,2,3\}$$ $$\Delta = \Big(\big(\text{pos}_{new} - \text{pos}_{orig} + 1\big) \bmod 3\Big) - 1 \ \in \{-1, 0, +1\}$$$\Delta = -1$: değer bir konum geriye kaymış · $\Delta = 0$: aynı konumda kalmış · $\Delta = +1$: bir konum ileriye kaymış.
$\Delta = -1$: the value shifted one position back · $\Delta = 0$: stayed in the same position · $\Delta = +1$: shifted one position forward.
Aralık Koşulu — Nihai Sayı 1 ile 9 Arasında
Range Condition — Final Number Between 1 and 9
Nihai değer $Z = v^* + \Delta$ hesaplanır. Bu değer zorunlu olarak 1 ile 9 arasında (dahil) olmalıdır — 0 ya da 10 çıkması geçersizdir.
The final value $Z = v^* + \Delta$ is computed. This value must lie between 1 and 9 (inclusive) — a result of 0 or 10 is invalid.
Hatırlatma: $v^* \in \{1,\dots,9\}$ ve $\Delta \in \{-1,0,+1\}$ olduğundan teorik olarak $Z \in \{0,1,\dots,10\}$ aralığına düşebilir. $Z = 0$ ($v^*{=}1,\ \Delta{=}{-1}$) veya $Z = 10$ ($v^*{=}9,\ \Delta{=}{+1}$) çıkarsa sonuç geçersiz sayılır.
Reminder: since $v^* \in \{1,\dots,9\}$ and $\Delta \in \{-1,0,+1\}$, $Z$ can theoretically fall in $\{0,1,\dots,10\}$. If $Z = 0$ ($v^*{=}1,\ \Delta{=}{-1}$) or $Z = 10$ ($v^*{=}9,\ \Delta{=}{+1}$), the result is considered invalid.
Özet Sistem
System Summary
Tüm algoritma, tek bir while True döngüsü olarak aşağıdaki gibi özetlenebilir.
Altı koşuldan (A₁, B₁, B₂, C₁, D₁, F₁) herhangi biri sağlanmazsa,
süreç sıfırdan (yeni rastgele $D$ üretiminden) tekrar başlar.
The whole algorithm can be summarized as a single while True loop, as below.
If any of the six conditions (A₁, B₁, B₂, C₁, D₁, F₁) is not satisfied,
the process restarts from scratch (a fresh random $D$ generation).
while True:
D ← ana_bulucu() × 9 (§A)
if ¬(A₁): continue
S, toplamlar, R_m ← 3_fark_incelemesi(D) (§B)
if ¬(B₁ ∧ B₂): continue
x, y ← rastgele_seçim() (§C)
p*, m*, v*, R_m* ← kolon_taraması(x, y, S)
if ¬(C₁): continue
a, b, c₀ ← R_m* (§D)
if ¬(D₁): continue
Δ ← döngüsel_yeniden_sıralama(a, b, c₀, v*) (§E)
Z ← v* + Δ (§F)
if ¬(F₁): continue
break # Z geçerli — süreç tamamlandı
while True:
D ← core_generation() × 9 (§A)
if ¬(A1): continue
S, sums, R_m ← three_difference_inspection(D) (§B)
if ¬(B1 ∧ B2): continue
x, y ← random_selection() (§C)
p*, m*, v*, R_m* ← column_scan(x, y, S)
if ¬(C1): continue
a, b, c0 ← R_m* (§D)
if ¬(D1): continue
Δ ← cyclic_reordering(a, b, c0, v*) (§E)
Z ← v* + Δ (§F)
if ¬(F1): continue
break # Z is valid — process complete
| Sembol | Symbol | Anlamı | Meaning |
|---|---|---|---|
| $D$ | Ana basamak dizisi (9 çift birA/birB'nin birleşimi) | The main digit sequence (concatenation of 9 birA/birB pairs) | |
| $n$ | $D$'nin uzunluğu | The length of $D$ | |
| $\delta(a,b)$ | 0–9 arası döngüsel fark | Cyclic difference on 0–9 | |
| $S = (i_1,\dots,i_k)$ | 3 fark incelemesinde eşleşen orta-eleman indeksleri | Matched middle-element indices in the 3-difference inspection | |
| $R_m$ | $m$. eşleşen satır: (sol, orta, sağ) | The $m$-th matched row: (left, middle, right) | |
| $x, y$ | Rastgele seçilen kolon ($1$–$3$) ve yön ($1$=aşağı, $2$=yukarı) | Randomly chosen column ($1$–$3$) and direction ($1$=down, $2$=up) | |
| $p^*, m^*, v^*$ | Sayaç eşleşmesinin bulunduğu adım, satır ve değer | The step, row, and value where the counter match is found | |
| $\Delta$ | Döngüsel yeniden sıralama sonrası konum kayması ($-1,0,+1$) | Position shift after cyclic reordering ($-1,0,+1$) | |
| $Z$ | Nihai cevap, $1 \le Z \le 9$ | The final answer, $1 \le Z \le 9$ |