Skip to content

Same Finger N-gram

A same-finger n-gram (SFN) is a n-gram that is typed entirely with one finger.

Take a look at the left middle finger’s column in QWERTY:

~`
!1
@2
#3
$4
%5
^6
&7
*8
(9
)0
_-
+=
Q
W
E
R
T
Y
U
I
O
P
{[
}]
|\
A
S
D
F
G
H
J
K
L
:;
"'
Z
X
C
V
B
N
M
<,
>.
?/

On this column:

  • ed (as in “tied”) is a same-finger bigram,
  • dec (as in “decor”) is a same-finger trigram,
  • c_d (as in “cod”) is a same-finger skipgram.

A same-finger bigram (SFB) is a bigram in which both keystrokes are made with the same finger. In some older sources, this metric is called same-finger utilization (SFU). The metric “same-finger bigram” is the percentage of all bigrams that are SFBs.

Following established convention within the alt keyboard layout community, bigrams that are produced with two repeated strokes of the same key, such as the ee bigram in the word “feed,” are not counted as SFBs. Instead, these are reported separately as same-key bigrams.

AKL Discord doctrine prioritizes SFB minimization as the most important goal of keyboard layout optimization. As a result, layouts from the AKL Discord tend to have lower SFBs than the vast majority of layouts created elsewhere.

The 2021 layout Whorf has 0.38% SFBs, the lowest achieved among ANSI layouts without introducing unreasonable row change patterns.

_-
F
L
H
D
M
V
W
O
U
<,
S
R
N
T
K
G
Y
A
E
I
?/
X
J
B
Z
Q
P
C
"'
:;
>.

For ANSI layouts that optimize the main 30 keys, quote, hyphen, and space without adjusting shift pairs, the minimum possible SFB ratio is 0.37%. This requires the following finger assignments:

o a '
e ; -
h b n
s f v
r l x
u i , . / (right pinky)
q w y p g c (left or right index)
t d j k z m (left or right index)

Note that Whorf is only 0.01 percentage points above this global minimum. Note also that this global minimum requires an unreasonably high-movement ui pinky; this demonstrates how optimizing for a single metric leads to worse overall result. Later popular layouts from the AKL Discord tend to range between 0.5% and 0.7% SFBs in exchange for better optimization on other metrics.

For reference, QWERTY has 3.97% SFBs, Dvorak has 1.88% SFBs, and Colemak has 0.95% SFBs.

Putting a letter on a thumb enables even lower SFBs. Night achieves 0.35% without sacrificing on scissors like Whorf:

!1
@2
#3
$4
%5
B
F
L
K
Q
N
S
H
T
M
X
V
J
D
Z
^6
&7
*8
(9
)0
P
G
O
U
>.
Y
C
A
E
I
_-
"'
W
?/
:;
<,
R

The lowest possible SFB ratio for a layout with one letter on thumb is 0.24%, with the following finger assignments:

e (left or right thumb)
o a '
y u -
t d k
s f v
h n m
i , . / (left or right pinky)
w p g ; c b (left or right index)
q r j l z x (left or right index)

As with the minimum SFB finger assignments for ANSI layouts, there is no obvious way to arrange these columns into a well-rounded layout. Any viable thumb alpha layout will need to adjust some of these columns to allow for optimization of other factors.

Adding more thumb keys does not decrease the minimum SFB ratio. With one more thumb key, for example, the minimum SFB ratio actually increases to 0.25%:

y u (left or right thumb)
o a '
e ; -
h b n
r l x
s z v
i , . / (left or right pinky)
q t d k m (left or right index)
w p f g j c (left or right index)

Further thumb keys similarly increase the minimum SFB ratio. The optimal number of letters on the thumb for SFB minimization is almost certainly exactly 1.

A same-key bigram (SKB) is a bigram in which both keystrokes are made on the same key. It is also called same-finger repeat (SFR), or simply a repeat. The matric “same-key bigram” is the percentage of all bigrams that are SKBs.

For layouts without a magic or repeat key, total SKB% is constant—1.88% on the Reddit Small corpus. The main point of comparison here is how SKBs are distributed across fingers, since the weaker fingers become fatigued more easily. Right pinky SKBs are a major problem on Dvorak, for example, since ss and ll are both very common in English (0.72% of all bigrams):

~`
!1
@2
#3
$4
%5
^6
&7
*8
(9
)0
{[
}]
"'
<,
>.
P
Y
F
G
C
R
L
?/
+=
|\
A
O
E
U
I
D
H
T
N
S
_-
:;
Q
J
K
X
B
M
W
V
Z

The extent to which weak finger SKBs should be minimized varies with personal preference. The 2024 layout Kuntem, which has some devoted fans, loads up e and t on the pinkies. This results in 0.40% pinky SKBs from ee and tt:

~`
!1
@2
#3
$4
%5
^6
&7
*8
(9
)0
_-
+=
V
L
N
D
K
J
W
O
U
Q
{[
}]
|\
T
S
R
H
F
G
C
A
I
E
:;
Z
X
P
B
"'
M
Y
>.
<,
?/

This is still significantly better than Dvorak, and spread across two pinkies instead of one, but is relatively high in comparison to some other contemporary layouts. Graphite, for example, has only 0.05% pinky SKBs:

~`
!1
@2
#3
$4
%5
^6
&7
*8
(9
)0
{[
}]
B
L
D
W
Z
_'
F
O
U
J
:;
+=
|\
N
R
T
S
G
Y
H
A
E
I
?,
Q
X
M
C
V
K
P
>.
"-
</

For layouts that place a letter on the thumb, it is commonly said that r on thumb is superior to e on thumb because rr is less common on ee, with the reasoning that even though thumbs are strong, they are relatively slow and easily fatigued compared to the other fingers at repeated motions. This is not universally accepted; some maintain that the thumbs are strong, fast, and hard to fatigue. Additionally, ee thumb repeats can be solved using a repeat key for someone who prefers lower repeats on thumb. (There are other reasons to prefer r on thumb; see the “Thumb Layouts” Google Doc, author unknown.)

For layouts with a repeat key (or a magic key that defaults to repeat), SKBs can be optimized to near zero. Whirl, for example, has 0.04% total SKBs thanks to the magic/repeat key on the right thumb:

Q
G
D
F/
V
N
S
T
H
M
B
C
P-
W
K
Z
L
U
O
Y
"'
R
E
A
I?
X
J
:;
>.
<,

A same-finger skipgram (SFS) is a skipgram typed with one finger.

SFS is also called disjoint same-finger bigram (dSFB) in some older literature, especially among AKL Discord members.

A same-finger trigram (SFT) a trigram typed with one finger.

SFT%=# of same-finger trigrams# of trigrams\text{SFT}\% = \dfrac {\text{\# of same-finger trigrams}} {\text{\# of trigrams}}

SFTs are common on legacy layouts such as QWERTY. Contemporary optimized layouts have a very low SFT ratio, so they are typically not an issue.

Higher order SFSs are also possible:

SFSn%=# of n-th order same-finger skipgrams# of (n+2)-grams\text{SFS}_n\% = \dfrac {\text{\# of } n\text{-th order same-finger skipgrams}} {\text{\# of } (n+2)\text{-grams}}

Semi pioneered the use of SFS in keyboard layout analysis. In Semi’s analysis:

SFS%=i=0SFSi%21i\text{SFS}\% = \sum_{i=0}^\infty \text{SFS}_i\%\cdot2^\frac1i

For computational complexity purposes, Keygen Pro only analyzes SFS1%.

Going back to the QWERTY example,

~`
!1
@2
#3
$4
%5
^6
&7
*8
(9
)0
_-
+=
Q
W
E
R
T
Y
U
I
O
P
{[
}]
|\
A
S
D
F
G
H
J
K
L
:;
"'
Z
X
C
V
B
N
M
<,
>.
?/

We call ed a 1u SFB, since the finger travels a distance of 1 unit to move from the e key to the d key.

~`
!1
@2
#3
$4
%5
^6
&7
*8
(9
)0
_-
+=
Q
W
E
R
T
Y
U
I
O
P
{[
}]
|\
A
S
D
F
G
H
J
K
L
:;
"'
Z
X
C
V
B
N
M
<,
>.
?/

The bigram ec takes longer to type than ed because the e and c keys are farther away from each other than the e and d keys. On ortholinear keyboards, the distance is exactly 2u. On row-staggered keyboards, the distance is 22+342\sqrt{2^2+\frac34^2}, or about 2.14u; we count this as a 2u SFB after rounding to the nearest 0.5u.