5D Library › 计算美学、视觉显著性图谱与人机界面认知工程 · English

第二章 决定与指向:席克—海曼定律与菲茨定律

用户在界面上完成一次操作,至少要做两件事:在几个选项中决定点哪一个,再把光标或手指移到它上面。心理学为这两段时间各提供了一条以信息论语言写成的经验定律:选择反应时的席克—海曼定律与指向动作的菲茨定律。二者都在 1950 年代提出,都以「比特」为单位,所以常被并列,甚至被直接相加成一个「总耗时方程」。本章核对两条定律的原始形式,再看相加之后的最优化问题在什么条件下有意义。

席克与海曼:两种写法

席克 1952:log(n + 1)

席克 1952 年让被试面对最多 10 盏灯,每盏灯对应一个按键,灯亮时按下对应的键。他发现,选择反应时随备择数 nn 的增加大致按对数增长,并用 RT=blog⁡(n+1)RT = b\log(n+1) 拟合 (Hick 1952)。其中的 +1+1 有明确的含义:被试不仅要判断「是哪一个」,还要判断「有没有信号」,所以实际的不确定性包括一个额外的「无信号」备择 (Proctor and Schneider 2018)。后来更常见的写法是 RT=a+blog⁡2nRT = a + b\log_2 n,把截距单列。

海曼 1953:信息熵

海曼 1953 年把问题推进了一步:如果各个备择出现的概率不相等,反应时是否仍随「信息量」线性增长?他操纵备择数、出现概率与序列依存关系,发现每位被试的反应时都与刺激所传递的信息量 HH 呈线性关系 (Hyman 1953):

RT=a+bH,H=∑i=1npilog⁡21pi.RT = a + bH,\qquad H = \sum_{i=1}^{n} p_i\log_2\frac{1}{p_i}.

等概时 H=log⁡2nH = \log_2 n。这就是「席克—海曼定律」:反应时与选择的不确定性(熵)成线性关系。卡德、莫兰与纽厄尔 1983 年的《人机交互心理学》把它纳入「模型人类处理器」,等概时写作 log⁡2(n+1)\log_2(n+1) (Card et al. 1983)。

作者框架中的式子

作者框架写作

RT=a+b∑ipilog⁡2(1pi+1).RT = a + b\sum_{i} p_i\log_2\!\left(\frac{1}{p_i} + 1\right).

据本轮检索,这一写法见于某些大学课程讲义(未注出处),但它不是席克的,也不是海曼的。可以直接验证:等概时 pi=1/np_i = 1/n,它等于 log⁡2(n+1)\log_2(n+1),与席克式相同;不等概时,它既不等于 log⁡2(n+1)\log_2(n+1),也不等于海曼的熵。下面的程序在 8 种菜单上比较三种写法(A),再用按海曼定律生成的模拟数据拟合三种写法(B)。

推导

# Three ways of writing the "decision entropy" in the Hick-Hyman law RT = a + b H.
#   Hick (1952):   H = log2(n + 1)           (+1: the extra "no signal" alternative)
#   Hyman (1953):  H = sum p_i log2(1/p_i)   (Shannon entropy, no +1)
#   framework:     H = sum p_i log2(1/p_i + 1)
# A: the three on uniform and skewed menus. B: synthetic choice-RT data generated by
# Hyman's law (a = 200 ms, b = 150 ms/bit, noise sd 20 ms; illustrative values), fitted
# by least squares with each measure as predictor.
import math, random, statistics

def hick(p):  return math.log2(len(p) + 1)
def hyman(p): return sum(q * math.log2(1 / q) for q in p if q > 0)
def frame(p): return sum(q * math.log2(1 / q + 1) for q in p if q > 0)

def zipf(n, s=1.0):
    w = [1 / (k + 1) ** s for k in range(n)]; t = sum(w)
    return [x / t for x in w]

MENUS = [("uniform n = 2", [.5, .5]), ("uniform n = 4", [.25] * 4),
         ("uniform n = 8", [.125] * 8), ("8 items, Zipf s = 1", zipf(8)),
         ("8 items, Zipf s = 2", zipf(8, 2)), ("8 items, one at 0.93", [.93] + [.01] * 7),
         ("2 items, 0.99 / 0.01", [.99, .01]), ("1 item", [1.0])]

def fit(x, y):
    mx, my = statistics.fmean(x), statistics.fmean(y)
    b = sum((u - mx) * (v - my) for u, v in zip(x, y)) / sum((u - mx) ** 2 for u in x)
    a = my - b * mx; ss = sum((v - a - b * u) ** 2 for u, v in zip(x, y))
    return a, b, 1 - ss / sum((v - my) ** 2 for v in y)

if __name__ == "__main__":
    print("A. bits                       Hick log2(n+1)  Hyman H  framework  frame - H")
    for name, p in MENUS:
        print(f"   {name:24s} {hick(p):14.3f} {hyman(p):8.3f} {frame(p):10.3f}"
              f" {frame(p) - hyman(p):10.3f}")
    rng = random.Random(1953); x = {"hick": [], "hyman": [], "frame": []}; y = []
    for name, p in MENUS:
        for _ in range(200):
            y.append(200 + 150 * hyman(p) + rng.gauss(0, 20))
            for k, f in (("hick", hick), ("hyman", hyman), ("frame", frame)):
                x[k].append(f(p))
    print("B. fits to data generated by Hyman's law (1,600 trials, 8 menus)")
    for k, lab in (("hyman", "Hyman H"), ("frame", "framework"),
                   ("hick", "Hick log2(n+1)")):
        a, b, r2 = fit(x[k], y)
        print(f"   {lab:15s} a = {a:6.1f} ms  b = {b:6.1f} ms/bit  R^2 = {r2:.3f}")
# A. bits                       Hick log2(n+1)  Hyman H  framework  frame - H
#    uniform n = 2                     1.585    1.000      1.585      0.585
#    uniform n = 4                     2.322    2.000      2.322      0.322
#    uniform n = 8                     3.170    3.000      3.170      0.170
#    8 items, Zipf s = 1               3.170    2.620      2.883      0.263
#    8 items, Zipf s = 2               3.170    1.685      2.208      0.523
#    8 items, one at 0.93              3.170    0.562      1.446      0.883
#    2 items, 0.99 / 0.01              1.585    0.081      1.064      0.983
#    1 item                            1.000    0.000      1.000      1.000
# B. fits to data generated by Hyman's law (1,600 trials, 8 menus)
#    Hyman H         a =  200.0 ms  b =  149.7 ms/bit  R^2 = 0.985
#    framework       a =   -3.5 ms  b =  208.4 ms/bit  R^2 = 0.979
#    Hick log2(n+1)  a =   84.8 ms  b =  133.6 ms/bit  R^2 = 0.491

A 部分中,等概的 2、4、8 个选项上,框架式与席克式完全相同(1.585、2.322、3.170 比特),比海曼熵多出 0.585、0.322、0.170 比特。不等概时差别变大:8 个选项中一个出现概率为 0.93 时,海曼熵只有 0.562 比特,框架式为 1.446 比特;两个选项、概率 0.99 对 0.01 时,熵为 0.081 比特,框架式为 1.064 比特;只有一个选项时,熵为 0,框架式与席克式都是 1 比特。也就是说,+1+1 把「有没有信号」的不确定性加到了每一个选项上,即使选择本身已经没有任何不确定性。

B 部分中,数据按海曼定律生成(截距 200 毫秒,斜率 150 毫秒/比特)。用熵拟合,恢复出 200.0 毫秒与 149.7 毫秒/比特,R2=0.985R^2 = 0.985;用框架式拟合,R2R^2 也有 0.979,但截距变成 −3.5 毫秒、斜率变成 208.4 毫秒/比特;用 log⁡2(n+1)\log_2(n+1) 拟合,R2R^2 只有 0.491,因为它看不到概率的差别。这说明,框架式在拟合优度上可能「看起来不错」,但它估计出的参数没有直接的解释。图 2 左画出了三种写法随最常见选项概率的变化。

注

+1+1 什么时候合理。 如果任务确实包含「不响应」的可能(例如有时没有目标出现),把这一备择计入不确定性是合理的,但正确的做法是把它当作一个有自己概率的备择放进熵里,而不是给每一项加 1。界面中的许多选择没有这一备择:用户已经决定要点某个东西了。

定律的适用范围

席克—海曼定律在实验室中稳健,但它的斜率不是常数。普罗克特与施奈德 2018 年的综述总结了几个重要的限定 (Proctor and Schneider 2018):斜率随练习下降(以下数字据该综述转述,原始文献本书未核:海尔 1968 年的数据中,八选与二选之差从第一次的近 500 毫秒降到第五次的 300 毫秒多;塞贝尔 1963 年经过大量练习后,1,023 个备择只比 31 个慢 20–30 毫秒);刺激与反应的对应越自然(「相容性」越高),斜率越小,有些高相容任务几乎没有集合大小效应;对眼睛直接注视目标位置的扫视,集合大小效应甚至可以消失或反转。对界面设计而言,这意味着「选项越多越慢」在熟练、映射自然的情况下可能很弱。

还有一个更根本的限定:席克定律描述的是已知目标时在若干备择中做决定的时间,而不是在一列不熟悉的标签中寻找目标的时间。「菜单项越多越慢,所以要少放选项」这一说法常被归于席克定律,但在随机排列的菜单中找一个不熟悉的命令需要逐项扫视,时间随项目数线性增加,席克定律并不适用 (Cockburn et al. 2007)。

菲茨定律:原式与香农式

菲茨 1954 年让被试用笔在两块宽为 WW、中心相距 DD 的金属板之间来回敲击,发现运动时间与 log⁡2(2D/W)\log_2(2D/W) 成线性关系 (Fitts 1954):

MT=a+b⋅ID,IDFitts=log⁡22DW.MT = a + b\cdot ID,\qquad ID_{\text{Fitts}} = \log_2\frac{2D}{W}.

麦肯齐 1989 年提出香农形式 ID=log⁡2(D/W+1)ID = \log_2(D/W + 1),理由是它与香农信道容量公式(香农定理 17)的形式一致,并且难度指数永远不为负 (MacKenzie 1989);他 1992 年的综述对此作了系统论证 (MacKenzie 1992)。他重新分析菲茨的数据,发现香农形式(配合按落点分布计算的有效宽度)的相关最高、标准误最低,但也指出预测上的改进很小,主要的优点是理论上的一致性。第 43 本已经讨论过两种写法的区别与迈耶等人的最优子运动模型,这里只补充对界面最重要的一点:当目标很宽、距离很近时,原式会给出负的难度。

推导

# Fitts (1954) ID = log2(2D/W) against the Shannon form log2(D/W + 1) (MacKenzie 1992),
# and a "search - decide - point" chain for a toolbar of n buttons (the author's model).
# Strip of length L = 600 px at distance D = 400 px from the cursor; click probabilities
# p_i (Zipf); widths W_i with sum W_i = L. Expected pointing time a + b sum p_i ID_i.
# With log2(D/W) (large D/W) the minimum is W_i = p_i L, and then the expected ID equals
# log2(D/L) + H(p), a constant plus Hyman's entropy (the "identity" column checks this
# algebra; optimality follows from Gibbs' inequality). D/W >= 2.7 here, so the
# long-distance form is only an approximation. With the Shannon form the optimum
# (Lagrange: W_i (D + W_i) = c p_i, with sum W_i = L) is found by bisection. Illustrative
# constants: Fitts a = 100 ms, b = 150 ms/bit; Hick a = 200 ms, b = 150 ms/bit;
# novice serial reading 300 ms per label.
import math

def id_fitts(D, W):   return math.log2(2 * D / W)
def id_shannon(D, W): return math.log2(D / W + 1)

def zipf(n, s=1.0):
    w = [1 / (k + 1) ** s for k in range(n)]; t = sum(w)
    return [x / t for x in w]

def shannon_opt(p, D, L):            # W_i = (sqrt(D^2 + 4 c p_i) - D)/2, bisect on c
    w = lambda c: [(math.sqrt(D * D + 4 * c * q) - D) / 2 for q in p]
    lo, hi = 0.0, 1e12
    for _ in range(200):
        c = (lo + hi) / 2
        lo, hi = (lo, c) if sum(w(c)) > L else (c, hi)
    return w(lo)

def ept(p, W, D, f):
    return sum(q * f(D, w) for q, w in zip(p, W))

if __name__ == "__main__":
    print("A. index of difficulty (bits)  D/W:  0.25    0.5      1      4     16     64")
    for lab, f in (("Fitts log2(2D/W)", id_fitts), ("Shannon log2(D/W+1)", id_shannon)):
        row = "".join(f"{f(r, 1):7.2f}" for r in (.25, .5, 1, 4, 16, 64))
        print(f"   {lab:30s}{row}")
    D, L = 400.0, 600.0
    print("B. toolbar, expected pointing ID (bits); H = Hyman entropy of the clicks")
    print("   n  Zipf  H(p)  equal W  W = pL  identity  Shannon opt  rarest item ID")
    for n, s in ((4, 1.0), (8, 1.0), (16, 1.0), (16, 2.0)):
        p = zipf(n, s); H = -sum(q * math.log2(q) for q in p)
        eq = [L / n] * n; pr = [q * L for q in p]; so = shannon_opt(p, D, L)
        chk = ept(p, pr, D, lambda d, w: math.log2(d / w)) - math.log2(D / L)
        print(f"  {n:2d}  {s:4.1f} {H:5.2f} {ept(p, eq, D, id_shannon):8.2f}"
              f" {ept(p, pr, D, id_shannon):7.2f} {chk:9.2f}"
              f" {ept(p, so, D, id_shannon):12.2f}"
              f"  {id_shannon(D, eq[-1]):5.2f} -> {id_shannon(D, so[-1]):5.2f}")
    print("C. chain time for n buttons, equal widths (ms): search + decide + point")
    print("    n   expert (Hyman)  novice (serial)")
    for n in (2, 4, 8, 16, 32):
        point = 100 + 150 * id_shannon(D, L / n)
        expert = 200 + 150 * math.log2(n) + point
        novice = 300 * (n + 1) / 2 + point
        print(f"   {n:2d} {expert:15.0f} {novice:17.0f}")
# A. index of difficulty (bits)  D/W:  0.25    0.5      1      4     16     64
#    Fitts log2(2D/W)                -1.00   0.00   1.00   3.00   5.00   7.00
#    Shannon log2(D/W+1)              0.32   0.58   1.00   2.32   4.09   6.02
# B. toolbar, expected pointing ID (bits); H = Hyman entropy of the clicks
#    n  Zipf  H(p)  equal W  W = pL  identity  Shannon opt  rarest item ID
#    4   1.0  1.79     1.87    1.77      1.79         1.76   1.87 ->  2.50
#    8   1.0  2.62     2.66    2.41      2.62         2.40   2.66 ->  3.74
#   16   1.0  3.40     3.54    3.08      3.40         3.07   3.54 ->  5.03
#   16   2.0  1.95     3.54    2.04      1.95         2.01   3.54 ->  7.52
# C. chain time for n buttons, equal widths (ms): search + decide + point
#     n   expert (Hyman)  novice (serial)
#     2             633               733
#     4             881              1131
#     8            1149              1849
#    16            1432              3182
#    32            1722              5722

A 部分中,D/W=0.25D/W = 0.25 时原式给出 −1.00 比特,香农式为 0.32;D/W=0.5D/W = 0.5 时原式为 0,香农式为 0.58;D/W≥4D/W \ge 4 时二者的差别不到 1 比特,但始终是原式更大。界面中的大按钮、贴近光标的上下文菜单常常落在 D/W<1D/W < 1 的区域,这时只能用香农式。

搜索—决策—指向:在什么条件下可以「最小化」

作者框架提出联立两条定律,构建「视觉搜索—认知消歧—光标点击」全链路的总耗时最小化方程。这个想法有价值,但「最小化」需要先回答三个问题:优化的变量是什么(按钮的宽度、位置、数目还是层级)?点击概率的分布是什么?用户是逐项搜索的新手还是知道目标位置的熟练者?答案不同,最优解就不同。科伯恩、古特温与格林伯格 2007 年的菜单性能模型正是这样处理的:新手的时间由视觉搜索决定,熟练用户由席克—海曼决策决定,再加上菲茨指向时间,以及从新手到熟练的过渡 (Cockburn et al. 2007);西奥 2005 年比较了两条定律在信息论上的异同 (Seow 2005)。

上面程序的 B 部分是一个可以精确求解的例子(作者的模型):一条长 L=600L = 600 像素的工具栏,距离光标 D=400D = 400 像素,nn 个按钮的点击概率按齐普夫分布,宽度可调但总和固定为 LL。目标是最小化期望指向时间 a+b∑ipiIDia + b\sum_i p_i\,ID_i。

若用 log⁡2(D/W)\log_2(D/W)(远距离近似;本例中 D/WD/W 最小约 2.7,所以这只是近似,香农式的精确最优见下文),由拉格朗日乘数法立得最优宽度 Wi=piLW_i = p_iL,代回去得到

min⁡∑ipilog⁡2DWi=log⁡2DL+∑ipilog⁡21pi=log⁡2DL+H(p).\min\sum_i p_i\log_2\frac{D}{W_i} = \log_2\frac{D}{L} + \sum_i p_i\log_2\frac{1}{p_i} = \log_2\frac{D}{L} + H(p).

也就是说,在这个设定下,最优布局的期望指向难度等于一个常数加上海曼熵:决策与指向的「信息」在数学上合流了。程序中「identity」一列核对的是这一代数恒等式(1.79、2.62、3.40、1.95 比特,按定义等于 H(p)H(p)),不是对最优性的独立验证;最优性由拉格朗日条件或吉布斯不等式保证。若用香农式,一阶条件变为 Wi(D+Wi)=cpiW_i(D + W_i) = c\,p_i,最优宽度要数值求解。

结果显示:8 个按钮、齐普夫指数 1 时,等宽布局的期望难度为 2.66 比特,香农式最优为 2.40 比特,按概率分配宽度(W=pLW = pL)为 2.41 比特,二者几乎相同;代价是最少用的按钮变窄,它的难度从 2.66 升到 3.74 比特。齐普夫指数为 2(点击极为集中)的 16 个按钮上,等宽为 3.54 比特,最优为 2.01 比特,最少用按钮的难度升到 7.52 比特。所以「按点击概率放大按钮」在平均意义上有利,但会让少数操作明显变难,这是一个需要明说的取舍。

C 部分把搜索也加进来(等宽按钮):熟练用户的总时间从 2 个按钮的 633 毫秒增加到 32 个按钮的 1,722 毫秒,近似对数;逐项阅读的新手从 733 毫秒增加到 5,722 毫秒,近似线性。图 2 右画出了这两条曲线。同一个「总耗时方程」,对新手与熟练用户给出的最优按钮数完全不同;不写明用户类型,就谈不上最小化。

左:在 8 个选项的菜单中,随着最常见选项的概率从 1/8 增加到 1,席克式 \log_2(n+1) 不变,海曼熵降到 0,作者框架中的式子停在 1 比特。右:作者的工具栏模型中,等宽按钮的「搜索—决策—指向」总时间;熟练用户(席克—海曼决策)近似对数增长,逐项阅读的新手近似线性增长(示意参数)。

假说 · 尚未验证 · 按概率分配宽度的净效应

作者的假说(尚未确立): 在一个用户已熟悉的工具栏中,按历史点击概率分配按钮宽度(总宽不变),能使熟练用户的平均点击时间缩短,但会使最少用按钮的时间与误点率明显上升,以至于整体任务时间的改善小于 5%。什么样的结果能证明它是错的: 在事先登记的受试者内实验中,按概率分配宽度使整体任务时间缩短 5% 以上(置信区间下限高于 5%),且最少用按钮的误点率没有上升。

本章小结

席克 1952 年的 log⁡(n+1)\log(n+1) 中的 +1+1 对应「无信号」备择;海曼 1953 年的熵 H=∑pilog⁡2(1/pi)H = \sum p_i\log_2(1/p_i) 不加 1。作者框架中的 ∑pilog⁡2(1/pi+1)\sum p_i\log_2(1/p_i + 1) 在等概时等于 log⁡2(n+1)\log_2(n+1),不等概时两种定律都不是,应改用海曼熵。席克—海曼定律描述已知目标时的决策,不描述在陌生标签中的搜索,其斜率随练习与相容性而变。菲茨原式在 D/W<1/2D/W < 1/2 时为负,界面中应用香农式。把搜索、决策与指向相加的「最小化」只在写明变量、概率分布与用户类型之后才有意义:在对数式下,最优宽度与点击概率成正比,期望难度等于一个常数加海曼熵;新手的总时间近似线性、熟练用户近似对数,二者的最优设计不同。

参考文献

Card, Stuart K., Thomas P. Moran, and Allen Newell. 1983. The Psychology of Human-Computer Interaction. Lawrence Erlbaum Associates.
Cockburn, Andy, Carl Gutwin, and Saul Greenberg. 2007. “A Predictive Model of Menu Performance.” Proceedings of the SIGCHI Conference on Human Factors in Computing Systems (CHI ’07), 627–36. https://doi.org/10.1145/1240624.1240723.
Fitts, Paul M. 1954. “The Information Capacity of the Human Motor System in Controlling the Amplitude of Movement.” Journal of Experimental Psychology 47 (6): 381–91.
Hick, W. E. 1952. “On the Rate of Gain of Information.” Quarterly Journal of Experimental Psychology 4 (1): 11–26. https://doi.org/10.1080/17470215208416600.
Hyman, Ray. 1953. “Stimulus Information as a Determinant of Reaction Time.” Journal of Experimental Psychology 45 (3): 188–96. https://doi.org/10.1037/h0056940.
MacKenzie, I. Scott. 1989. “A Note on the Information-Theoretic Basis for Fitts’ Law.” Journal of Motor Behavior 21 (3): 323–30. https://doi.org/10.1080/00222895.1989.10735486.
MacKenzie, I. Scott. 1992. “Fitts’ Law as a Research and Design Tool in Human-Computer Interaction.” Human-Computer Interaction 7 (1): 91–139. https://doi.org/10.1207/s15327051hci0701_3.
Proctor, Robert W., and Darryl W. Schneider. 2018. “Hick’s Law for Choice Reaction Time: A Review.” Quarterly Journal of Experimental Psychology 71 (6): 1281–99. https://doi.org/10.1080/17470218.2017.1322622.
Seow, Steven C. 2005. “Information Theoretic Models of HCI: A Comparison of the Hick-Hyman Law and Fitts’ Law.” Human-Computer Interaction 20 (3): 315–52.

Fan, Y. (2026). Computational Aesthetics, Visual Saliency Maps and Cognitive Ergonomics in User Interface Design: From the Hick–Hyman Law and Spatial Frequency Channels to Saccadic Trajectory Modelling, Read Beside the Kaogongji and Classical Treatise on Architectural Methods [计算美学、视觉显著性图谱与人机界面认知工程] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23836258 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).