The idea: try every combination of two levels
A system's speed depends on many settings: memory size, cache size, number of processors, and so on. Each setting is a factor, and each value we try is a level. A 2k factorial design picks just two levels for each of k factors, a low one (coded −1) and a high one (coded +1), and runs every combination: 2k experiments. From those runs it finds how much each factor matters, and also how much the factors interact.
The page uses the classic example from Jain's book. Factor A is memory size (4 MB or 16 MB), factor B is cache size (1 KB or 2 KB), and the response y is speed in MIPS. The four runs give 15, 45, 25 and 75. The goal is not to find the fastest machine (that is plain: 75), but to say why the runs differ.
The sign table and the effects
List the runs in standard order: A flips every row, B every two rows, C every four. Then build the sign table: a column I of all +1, a column for each factor with its levels, and a column for each interaction, which is the product of its factor columns row by row (AB = A × B). Demo: 2² sign table, built run by run fills it in one run at a time.
Each effect is its column times y, summed, divided by the number of runs:
q0 = ( 15 + 45 + 25 + 75) / 4 = 160 / 4 = 40 the mean
qA = (−15 + 45 − 25 + 75) / 4 = 80 / 4 = 20
qB = (−15 − 45 + 25 + 75) / 4 = 40 / 4 = 10
qAB = ( 15 − 45 − 25 + 75) / 4 = 20 / 4 = 5
y = q0 + qA·xA + qB·xB + qAB·xA·xB = 40 + 20xA + 10xB + 5xAxB
qA = 20 means: going from 4 MB to 16 MB adds 2 × 20 = 40 MIPS on average (from −1 to +1 is two steps). The model with xA, xB = ±1 gives back every run: at (−1, −1) it is 40 − 20 − 10 + 5 = 15. This works because every column has as many +1 as −1 and any two columns are orthogonal (their row-by-row product sums to 0), so each effect can be computed on its own (Demo: 2² effects column by column).
Allocation of variation
The total variation is how far the runs spread around their mean: SST = Σ(y − ȳ)² = 25² + 5² + 15² + 35² = 2100. Because the columns are orthogonal, it splits exactly into one share per effect, each 2k times the effect squared:
| Effect | Sum of squares | Share of SST |
|---|---|---|
| A (memory) | SSA = 4 · 20² = 1600 | 76.2 % |
| B (cache) | SSB = 4 · 10² = 400 | 19.0 % |
| AB (interaction) | SSAB = 4 · 5² = 100 | 4.8 % |
Memory explains three quarters of the differences, so that is where to spend effort. The share is the useful number: it says how important a factor is, whatever its units (Demo: 2² allocation of variation). The share is not a test of significance; that needs an error estimate, below.
Why not one factor at a time?
A common plan is to start with everything low and change one factor at a time. That takes only k + 1 runs: run 1 gives 15, more memory alone gives 45 (+30), a bigger cache alone gives 25 (+10). Adding the changes predicts 15 + 30 + 10 = 55 with both high. The real run gives 75 (Demo: one factor at a time misses the interaction).
The 20 it misses is exactly y(++) − y(+−) − y(−+) + y(−−) = 4 · qAB. A bigger cache helps more when memory is large too. One factor at a time measures each factor at one setting of the others only, so it cannot see interactions at all, and each of its estimates rests on two runs instead of all of them.
More factors: 2³
Add a third factor, C = number of processors (1 or 2). Now there are 8 runs and 8 columns: I, A, B, C, AB, AC, BC and ABC. The same rule gives q0 = 40, qA = 10, qB = 5, qC = 20, qAB = 5, qAC = 2, qBC = 3 and qABC = 1, with SST = 8 · Σq² = 4512. Processors explain 70.9 %, memory 17.7 %, cache and AB 4.4 % each, and the three-factor interaction only 0.2 % (Demo: 2³ design, seven effects). In most systems a few effects carry almost all the variation, and high-order interactions are small.
Fewer runs: the 2(k−p) fractional design
With k = 7 factors a full design needs 128 runs. A fractional factorial design 2(k−p) runs only 2k/2p of them. The half fraction 2(3−1) runs A and B in all four combinations and sets C by a generator, C = AB. Multiplying both sides by C gives I = ABC, the defining relation.
The price is confounding: in those four runs the C column is the AB column, so the effect it measures is qC + qAB, and the two can no longer be told apart. With the same eight responses as above, the half fraction gives 41, 13, 7 and 25, which are exactly q0 + qABC = 40 + 1, qA + qBC = 10 + 3, qB + qAC = 5 + 2 and qC + qAB = 20 + 5 (Demo: 2^(3−1) half fraction). A good fraction confounds main effects only with high-order interactions, which are usually small. How well it does that is its resolution; this one is resolution III (main effects alias two-factor interactions).
Replications, error and confidence intervals
With one run per combination the model fits perfectly, so there is no way to tell a small effect from noise. Run each combination r times. Jain's replicated example runs the 2² three times: (15, 18, 12), (45, 48, 51), (25, 28, 19) and (75, 75, 81). The effects use the row means ȳ: q0 = 41, qA = 21.5, qB = 9.5, qAB = 5. What the model cannot explain is the spread of the runs around their own row mean:
SSE = Σ (y − ȳ_row)² = 18 + 18 + 42 + 24 = 102 (1.5 % of SST = 7032)
s_e = √(SSE / (2²(r − 1))) = √(102 / 8) = 3.57
s_q = s_e / √(2² r) = 3.57 / √12 = 1.03
90 % interval: q ± t[0.95; 8] · s_q = q ± 1.860 · 1.03 = q ± 1.92
qA = 21.5 → (19.58, 23.42) qB = 9.5 → (7.58, 11.42) qAB = 5 → (3.08, 6.92)
No interval contains 0, so every effect is significant at 90 %. Shares of variation: A 78.9 %, B 15.4 %, AB 4.3 %, error 1.5 % (Demo: 2² with 3 replications). The interval logic is the one on Confidence Intervals; deciding between just two variants with a significance test is the topic of A/B testing, and testing counts in a table is the chi-square test.
Where it is used
Factorial designs plan performance studies: which settings of a server, a cache or a queue to measure. The response can come from a real machine, from a queueing model such as the M/M/1 queue or Mean Value Analysis, or from a discrete-event simulation. With a simulation, each run is itself random, and how long to run it and how to put an interval on its output is covered in Simulation Output Analysis.
See also Pooled Queues: M/M/c, where the number of servers and the load are the two factors that decide the wait.
See also Simulation Output Analysis, which shows how to get independent replications and valid intervals from a simulation.
What the page leaves out
The page keeps every factor at two levels, so it assumes the response changes roughly linearly between them; designs with three or more levels, and full analysis of variance (ANOVA) with F-tests, are left out. It does not check the model's assumptions (independent, normally distributed errors with the same variance; a log transform when effects multiply), and it shows only one 2(k−p) fraction, not how to choose generators for larger k or how to fold over a design to undo confounding.