You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NeuroKey approaches the keyboard layout problem as a Discrete Combinatorial Optimization task within a high-dimensional state space. This document details the rigorous mathematical frameworks used to resolve this space.
1. The State Space ($S$)
The keyboard is modeled as a set of positions $P = {1, 2, \dots, 30}$ and a set of characters $C = {c_1, c_2, \dots, c_{30}}$. A layout $L$ is a bijection (one-to-one mapping) between $C$ and $P$.
The size of the state space $S$ is the factorial of the number of keys:
$$ |S| = 30! \approx 2.652 \times 10^{32} $$
Navigating this space via brute force is computationally impossible; thus, we employ stochastic search methods.
2. The Objective Function ($f: S \rightarrow \mathbb{R}^+$)
We define a cost function (Energy) that the system seeks to minimize. This is a weighted linear combination of four ergonomic sub-metrics:
Let $B$ be the set of character bigrams and $\text{Freq}(b)$ their frequency. Let $\mathbb{1}_{\text{finger}}(p_1, p_2)$ be an indicator function that returns 1 if positions $p_1$ and $p_2$ are mapped to the same finger.
NeuroKey uses a Markov Chain Monte Carlo (MCMC) process. The transition from layout $s$ to $s'$ is governed by the Acceptance Probability$A(s, s', T)$:
3.1 Metropolis-Hastings Criterion
For a proposed move from $s$ to $s'$, where $\Delta E = E(s') - E(s)$:
Where $T$ is the temperature and $k_B$ is a scaling constant.
3.2 Convergence Analysis
To guarantee convergence to a Global Optimum, the cooling schedule must satisfy the Geman-Geman condition:
$$ T_k \geq \frac{C}{\ln(k + 1)} $$
Where $C$ is a constant proportional to the depth of the deepest local minimum. In practice, we use faster schedules (Exponential/Cosine) for computational efficiency.
The GPU engine treats layouts as Genotypes. Evolution is modeled as a directed search in the fitness landscape.
5.1 Permutation Crossover (PMX)
Since layouts are permutations, standard crossover would produce duplicates. We use Partially Mapped Crossover:
Select a random swath from Parent 1.
Map those elements into the Child.
Fill remaining slots from Parent 2, using a mapping table to resolve collisions.
5.2 Fitness Selection
The population $P_t$ evolves to $P_{t+1}$ via a selection operator $\mathcal{S}$:
$$ \mathcal{S}(P_t) = { L \in P_t \mid \text{Rank}(E(L)) < k } $$
Only layouts in the $k$-th percentile survive, ensuring the population's mean energy $\bar{E}$ decreases monotonically.
Important
The combination of MCMC for local refinement and Genetic Evolution for global exploration ensures that NeuroKey finds layouts that are mathematically superior to any human-designed configuration.