Sizing and TCO

ch22 · Comparing two TCOs

Builds on ch21 and ch18.

A video summary of this chapter, generated from the page by an AI tool (how it was made). The page is the authority; the video needs a network connection.

The question

Two quotes for the same workload, each with an interval on it. Which is cheaper, and how often would that turn out to be wrong?

ch21 put two designs side by side and called the difference between them a decision. This chapter is about the difference itself. Two totals with intervals on them overlap, and a reader shown the overlap concludes that nothing can be said. Something can. The two designs face the same future, and a difference taken future by future is far narrower than the totals it came from.

It is also the chapter for a comparison somebody else built. A vendor’s comparison arrives with one column already won. The last section says what such a comparison has to show before you believe it, and each item points at the chapter that says why.

The material

Two quotes for one workload

The incumbent is the design the plan was built on: the platform the team already runs, on the hosts ch12 sized and ch18 priced. The challenger is a second quote for the same workload. Its hosts are denser and cost more each, it licenses per host rather than per core, its support rate is higher, and moving to it costs something the incumbent does not pay.

Both are scenarios of the running example, and both hold every line of the quote exactly.

LineThe incumbent’s quoteThe challenger’s quote
cores per host◐ 16 cores per host◐ 64 cores per host
ram per host◐ 64 GiB per host◐ 256 GiB per host
disk per host◐ 2 TB per host◐ 8 TB per host
host price◐ $6,538 per host◐ $26,000 per host
host power◐ 310 W per host◐ 700 W per host
licence per core◐ $80.00 per core per year◐ $0 per core, declared
licence per host◐ $0 per host, declared◐ $2,600 per host per year
support rate◐ 11.8% of capital, per year◐ 13.0% of capital, per year
hosts in the fleet○ 54 hosts○ 14 hosts
one-off cost of moving to this design○ $0, declared○ $250,000
● traceable to a stamped measurement, an invoice or a published specification · ◐ stated by someone selling it; plausible, unverified, and never promoted · ○ a decision this model makes, which a reviewer may disagree with

Source — comparison, web_service-incumbent and web_service-challenger · sizing.evaluate

Read the marks in the quotes table first. Almost every line on both sides is marked as a vendor’s claim, whichever vendor it is. The three kinds of claim are the ones ch03 introduced. Everywhere else in the book the model gives the host price a wide band, because a host is a configuration rather than a commodity. A quote names one configuration and one price for it. So the band goes and the quoted number stays: every line of each quote is pinned. What is left uncertain is what no quote fixes: the workload, its growth, the electricity, the people.

Two lines are not the vendor’s. The host count is the model’s own sizing rule, applied to each host at the point estimate, so both designs are sized to the same margins by the same rule (ch12). The cost of the move is the team’s estimate, marked as an assumption, because the challenger did not quote it and the incumbent has nothing to move.

Here is the challenger’s quote as the toolkit holds it. A comparison starts from a file like this one, and the file is where the reasons for its numbers live.

scenario: challenger
title: The challenger's quote, held exactly
because: >-
  A second quote for the same workload: denser hosts at a higher price each, drawing more power
  each, licensed per host rather than per core, with a higher support rate, and a one-off cost
  of moving that the incumbent does not pay. Every line is pinned, because a quote is a number.
  The host count is what the model's own sizing rule recommends at the point estimate for this
  host, so both designs are sized to the same margins by the same rule; the licence per core is
  a declared zero because this quote has no such line; and the move is the team's estimate, not
  the vendor's. Same seed and the same pinned inputs as the incumbent, so that the two totals
  can be subtracted future by future (ch22).
samples: 100000
seed: 20260916
overrides:
  cores_per_host: 64
  ram_per_host: 256
  disk_per_host: 8
  host_price: 26000
  host_power: 700
  licence_per_core: 0
  licence_per_host: 2600
  support_rate: 0.13
  hosts: 14
  migration_cost: 250000

Every line on both sides

The challenger licenses per host. The incumbent’s quote has no such line. A line that one side does not have is a cost that side never pays, and a comparison with a line missing from one column is won by omission.

You have met both lines before. The full web service model carries a per-host licence and a one-off cost of moving, and ch21’s provenance table lists the licence, with its source. The move cost is one of the inputs that table does not list. On the single design earlier chapters priced, both lines were zero and moved nothing. This chapter is the first in which either carries a figure. On the incumbent’s side both are still zero. The zero is declared, with a source, rather than left out:

  licence_per_host:
    kind: input
    decided: outside
    unit: USD/host/year
    value: 0
    label: licence per host
    note: >-
      A declared zero, not an absent line. For a quote that licenses the platform software per core,
      as the design the plan was built on does, there is no per-host charge. For a quote that
      licenses per host, as ch22's challenger does, the per-host figure goes here and zero goes in
      `licence_per_core`. A comparison needs the same lines on both sides: a line one quote does not
      have is a cost that quote does not pay, and the way to leave it out is to put it in at zero
      (ch22).
    provenance:
      kind: vendor_claim
      source: >-
        The design the plan was built on is licensed per core, with no per-host charge. When a
        design licenses per host, that figure goes here and zero in `licence_per_core`, allowing the
        two to be compared like for like.
    range: [0, 12000]

The second line is the cost of the move. Neither side’s own figures carry it:

  migration_cost:
    kind: input
    decided: you
    unit: USD
    value: 0
    label: one-off cost of moving to this design
    note: >-
      A declared zero for the design the plan was built on, because it already runs on that
      platform. A design that would replace it carries the cost of the move here: the months of
      running both, the data copied twice, the people doing that instead of their jobs. The buyer
      pays for the move, not either vendor: a challenger's quote has no line for it, and a plan
      built on the incumbent has nothing to put in it. That is why it is a node with a source rather
      than a footnote (ch22).
    provenance:
      kind: assumption
      source: >-
        The design the plan was built on runs on that platform already, so there is nothing to
        migrate. A challenger's scenario overrides this with the team's own estimate of the move,
        marked as an assumption.
    range: [0, 1000000]

With both lines on both sides, the two totals contain the same things and can be subtracted line by line:

Over five yearsIncumbentChallengerChallenger minus incumbent
Hosts$353,071$364,000+$10,929
Network$68,144$17,667−$50,477
The move$0$250,000+$250,000
Energy$137,792$80,548−$57,244
Licences$345,600$182,000−$163,600
Support$248,415$248,083−$331
People$849,062$849,062none
Five-year total$2,002,083$1,991,361−$10,722

Source — comparison · sizing.evaluate

Read down the last column of the lines table. The challenger wins on licences, on energy and on network, and loses on the move. The hosts cost about the same in total, because fewer of them cost more each. Support is a share of capital on both quotes, and the challenger’s rate is higher. Yet the challenger’s capital, hosts plus network, is lower than the incumbent’s, mostly because its Network line is much smaller. A higher rate on less capital leaves the Support line barely changed.

The largest line in either total is people, and it does not appear in the difference at all. Both designs are run by the same engineers at the same cost, so the line is the same on both sides and cancels. That is the general rule. What both designs pay alike drops out of the comparison, however large it is. A comparison is about the lines that differ. The total is only where they are added up.

The last row is the whole comparison at the point estimate. The challenger is cheaper, by a sliver of either total. That is the number a spreadsheet stops at.

The challenger’s quote runs below as a model you can change. Drag hosts in the fleet up by one host and watch the five-year total pass the incumbent’s figure in the last row of the lines table above.

The challenger’s quote, running. An input has a slider when the model file gives it a range: hosts in the fleet, licence per host and one-off cost of moving to this design among them. The other quoted prices, including host price and support rate, are pinned by the scenario and have no slider. Each line’s Details show the note and source from the model file, written for the design the plan was built on. The challenger’s own reasons are in its scenario file, quoted in the previous section. The incumbent’s quote has a model of its own, linked under the quotes table and the ceilings table.

Subtract futures, not intervals

Each total has an interval of its own. The totals table below shows both: each five-year total at the point estimate and as a middle nine in ten. The two intervals are nearly the same.

Five-year totalAt the point estimateMiddle nine in ten
Incumbent$2,002,083$1,623,449 to $2,630,730
Challenger$1,991,361$1,616,827 to $2,609,453

Source — comparison · sizing.evaluate

That is not a coincidence. Most of what either total is uncertain about is shared. The electricity price, the building’s overhead, what an engineer costs and how many are needed are the same inputs on both sides, and the same draw of each reaches both designs. When the electricity price comes out high, it comes out high for both fleets. When an engineer costs more, both totals rise together.

So the difference between the totals is far less uncertain than either total. The toolkit takes it one future at a time: the same future, both fleets, subtract. Both scenarios pin the same inputs and share a seed. So every input neither quote fixes is drawn once, and the same draw reaches both designs. Before it subtracts anything, the toolkit checks that each shared input came out identical on both sides, and it refuses to subtract if one did not.

The interval on the difference is a fraction of the interval on either total. The challenger is cheaper in most of the futures the model thinks plausible, and dearer in a large minority of them. Both of those shares are the answer. A comparison that reports only the share in which the challenger wins is the one the challenger’s vendor would show you. A spreadsheet reports neither share. It shows one difference, at the point estimate: the first row of the table below.

Challenger minus incumbent, five-year total
At the point estimate−$10,722
Across the same futures, middle nine in ten−$72,389 to +$28,521
With each design in a future of its own−$734,933 to +$701,940
Subtracting the ends of the two intervals−$1,013,903 to +$986,004
Futures in which the challenger is cheaper69%
Futures in which the incumbent is cheaper31%

Source — comparison · sizing.evaluate

The third and fourth rows are what goes wrong when the futures are not shared. Draw each design in a future of its own and subtract, and the interval on the difference is many times wider, because the shared uncertainty is counted twice, once with each sign. Subtract the ends of the two intervals, which is what two totals side by side invite a reader to do, and it is wider still. Neither is a statement about the decision. Both are statements about how the arithmetic was done.

ch14 made the same point from the other side. Two inputs that move together, drawn independently, understate the width of a total. Two totals that move together, subtracted independently, overstate the width of their difference. It is one fact about shared uncertainty, and which way it cuts depends on which side of the subtraction it sits.

Problem 22.1 is that subtraction, and its test can tell which way you did it.

Cheaper at what risk

A total is the price of a fleet that works. Two fleets that cope different amounts of the time are not the same purchase at two prices, so a comparison carries the ceilings as well as the money.

CeilingIncumbentChallenger
working set against memory35% over its limit
49% past the allowed line
33% over its limit
47% past the allowed line
utilisation, counting coordination48% over its limit
64% past the allowed line
32% over its limit
48% past the allowed line
disk fill at horizon29% over its limit
44% past the allowed line
27% over its limit
42% past the allowed line
utilisation with one host down30% over its limit
47% past the allowed line
31% over its limit
47% past the allowed line
utilisation at the busy hour30% over its limit
46% past the allowed line
28% over its limit
44% past the allowed line
fraction of the fleet doing nothing useful0% over its limit
1% past the allowed line
0% over its limit
0% past the allowed line

Source — comparison, web_service-incumbent and web_service-challenger · sizing.evaluate

They cope about equally often, and that is by construction. Both were sized by the same rule to the same margins, so both are over their limit at the busy hour in about the same share of futures. A comparison that sized one design to the daily mean and the other to the busy hour would show a cheaper fleet that copes less often, and would not say so.

One row differs clearly: utilisation, counting coordination. The challenger is over that ceiling much less often, because it has fewer hosts and they spend less of their capacity agreeing with each other (ch07).

A mechanism pulls the other way on utilisation with one host down: losing one host of a small fleet removes a larger share of the fleet than losing one host of a large fleet (ch11). On this pair the effect is small. The row barely differs, by less than the working-set and busy-hour rows that the paragraph above calls about equal. The challenger’s fleet starts with more cores in total than the incumbent’s, so after losing its larger share it is left with about as many cores as the incumbent. You can check this from the quotes table: cores per host times hosts in the fleet. Neither difference shows up in the money. Both are part of what is being bought.

What would flip it

The difference is small, so the next question is what would reverse it. For each line the challenger could argue about, and for each input both designs share, the toolkit finds the value at which the two totals tie, with everything else at its point estimate.

InputWhoseAs quoted, or at the pointThe totals tie atVerdict
one-off cost of moving to this designan assumption, on the challenger’s side$250,000$260,722+4.3% on the assumption
host pricethe challenger’s quote$26,000 per host$26,464 per host+1.8% on the quote
licence per hostthe challenger’s quote$2,600 per host per year$2,753 per host per year+5.9% on the quote
hosts in the fleetan assumption, on the challenger’s side14 hosts14.2 hosts+1.2% on the assumption
engineers, full-time equivalenta claim about your people1.131.15+1.3% of an engineer’s time, on the challenger’s side
electricity priceshared by both$0.134 per kWh$0.109 per kWhinside the middle eighty per cent of what it could be
PUEshared by both1.41.14below every value the model draws
network price per hostshared by both$1,262 per host$1,091 per hostinside the middle eighty per cent of what it could be
annual growth factorshared by both1.34—no value of it moves the difference

Source — comparison · sizing.evaluate

Read the first four rows first: the lines on the challenger’s side. Each ties within a few per cent of the figure the comparison uses. Two of the four are the vendor’s quote: the host price and the licence per host. Two are assumptions: the cost of the move is the team’s estimate, and the host count is the model’s sizing rule. The Whose column marks which. The move can cost a little more than the team estimated, the host price and the licence can each rise a little, and the fleet can grow by less than one host before the ordering reverses. Take the hosts in the fleet row into the meeting. The challenger’s host count comes from the sizing rule applied to two things: its spec sheet, and the CPU time per request. The CPU time per request belongs on a rig, and it has not been measured on either design’s hosts (ch03). The comparison turns on a fraction of one host.

The row about people is a different kind of claim. Both quotes hold the engineers equal, because a vendor’s figure for how many people you will need is a claim about your organisation and not about their product. If the challenger cost a little more of an engineer’s time, the totals would tie. If it claimed to save some, the comparison would rest on that claim and on nothing else, since the people line is larger than every line the quotes differ on. A comparison that turns on a headcount the vendor supplied has a thumb on the scale, and this model refuses to take that number from a quote.

The shared inputs are next. Cheaper electricity favours the incumbent, because the challenger’s advantage on energy shrinks with the price. The tie sits inside the middle eighty per cent of what the price could be. The tie on the network price per host is inside its middle eighty per cent too. The building’s overhead, the PUE, would have to be better than every value the model draws for it before it flipped anything. Growth cannot flip the comparison at all, because it reaches neither total. The host count is a decision each quote pins, and the cost chain starts there, so nothing upstream of the fleet reaches the money. ch19 found the same thing for the five-year total: growth is not on its tornado at all. Growth still moves how often each fleet copes, which is the ceilings table’s business.

The chart has three bars and a count of inputs with no bar. The three bars are the shared inputs that reach the lines the quotes differ on: the network price per host, charged per host; the electricity price and the PUE, which together set the energy line. Growth, the busy hour and the CPU time per request reach neither total because the fleet is pinned, as the paragraph above explains. The lines the quotes argue about (host price, licences, support rate) are pinned by the quotes and have no bar on this chart; the break-even table shows where they appear. The salary and the head count reach both totals equally through the people line, which cancels. So on this pair the difference is sensitive to the quoted lines and to three shared inputs, and to nothing else.

Problem 22.2 finds one of those break-evens by hand.

Keep the old hosts, or replace them

The same subtraction answers a question teams face at every refresh: keep last generation’s hosts in service, or retire them now and buy an all-new fleet. The mixed pool model from ch10 holds both as scenarios. Keep the old hosts buys the new hosts the old ones cannot cover, with requests routed by capacity. Replace them retires the old hosts and buys the all-new fleet the web service model recommends.

The old hosts’ purchase price is already spent, so it is in neither total. Keeping them still costs energy, licences on every core, and a maintenance contract, and those are in keep’s total. Replacing buys more new hosts and pays for those hosts and for running them.

The scenarios change only decisions, so every uncertain input is drawn once and reaches all of them. The difference can be taken future by future. Each total counts the new hosts bought, energy, licences and support over the horizon. People are left out because they cancel, as this chapter showed earlier; network is left out too.

The table’s last two rows show the same comparison with requests routed equally. Keeping means buying the number of new hosts in ch10’s third column.

At the point estimateMiddle nine in ten
Keep the old hosts, buy 35 new$887,155$638,092 to $1,436,570
Replace them, buy 54 new$1,044,689$737,081 to $1,693,659
Keep minus replace, future by future−$157,534−$292,932 to −$77,800
Futures in which keeping is cheapermore than 99%
Keep minus replace, routed equally, buying 70 new+$519,579+$375,803 to +$846,309
Futures in which keeping is cheaper, routed equally0%

Source — mixed-pool, mixed_pool-reference, mixed_pool-replace and mixed_pool-keep_routed_equally · sizing.evaluate

Routing by capacity: the two totals overlap. The difference, taken future by future, stays below zero across its middle nine in ten. Keeping the old hosts is cheaper in nearly every future.

Routing equally: every host is held to the old host’s cores. Keeping then means buying more new hosts than replacing them all (ch10). The last two rows of the keep-or-replace table show keeping is then dearer in every future. When routed by capacity, keeping is cheaper in almost every future the model draws. When routed equally, it is dearer in every one.

The lines show where the capacity-routed difference comes from.

LineKeep the old hostsReplace themKeep minus replace
New hosts bought$228,842$353,071−$124,229
Energy over the horizon$158,351$137,792+$20,559
Licences over the horizon$320,000$345,600−$25,600
Support over the horizon$179,962$208,226−$28,265

Source — mixed-pool, mixed_pool-reference and mixed_pool-replace · sizing.evaluate

The purchase line is most of the difference, because keeping buys fewer new hosts. But not all of the difference comes from the purchase. Without it, keeping would still be cheaper. Support favours keeping too. Licences favour keeping even though the old hosts’ cores pay licences, because the kept pool has fewer cores in total. Energy runs the other way: an old host draws nearly as much power as a new one for half the cores.

Keeping costs less and leaves less room for processing. ch11’s table shows the kept pool into the margin at the plan with the host with the most cores down, and over if requests are routed equally. The all-new fleet is ok on both. On memory and disk, it goes the other way: the old hosts bring extra memory and much of the disk, so the kept pool has more room than the all-new fleet.

Keeping’s saving assumes the old hosts last to the horizon. If they leave earlier, the purchase ch11 shows for that day, for memory and disk as well as for cores, comes out of the saving. This model does not price it.

What a competitive comparison has to show

A comparison somebody else built arrives with one column already won. This is what it has to contain before you believe it, where the book covers each item, and how the comparison is tilted when the item is missing.

What to look forWhere it is taughtHow the comparison is tilted without it
The workload it was sized for, stated, and both designs sized by the same rule to the same margins
ch02, ch12
one design sized to the daily mean and the other to the busy hour
The same horizon and the same refresh convention on both sides
ch15a three-year quote against a five-year one
Every line on both sides, with a declared zero where a quote has no such line
this chapterhardware only on one side, fully loaded on the other
Whose number each line is, marked on both sides, the presenter’s own included
ch03
list price for the other side, the negotiated price for yours
The cost of the move, on the side that has to movethis chapter
the challenger’s vendor does not quote it, because the buyer pays for it; a plan built on the incumbent has nothing to move
The difference as an interval over shared futures, and the share of futures in which it flips
this chapter
two intervals side by side, which say nothing, or one number, which says too much
Each design’s ceilings, as how often it fails to copech11, ch21cheaper because it copes less often
The break-evens, and whether each lies inside a range you would defend
this chapter, ch19a comparison that turns on an input nobody measured
The people line held equal unless there is evidence, and marked as a claim if not
this chaptera headcount the vendor supplied
Unit costs on the same denominator and the same periodch17
per terabyte-month against per terabyte-year, the busy hour against the mean
What was left out, namedch20
a line neither total has, which favours whichever side it would have hurt
Capital, yearly running cost, one-off move cost and horizon, undiscounted, to let finance place them in years and apply its own rate
ch15, ch21a discount rate chosen to flatter the side that spends later
A file that re-runs, so the reader can change an input and watch
the introductiona bar chart, with nothing in it to change

Check the first item twice. Two quotes that were sized differently are not two prices for the same thing, and no amount of care over the lines below it repairs that.

What this cannot tell you

What either vendor would charge. Both quotes are held exactly. A quote is a number, and this chapter takes it as one. What you would pay after negotiation is a different number on both sides, and a discount that is the same percentage on both is not the same money, because the two capital lines differ.

What the move will cost. The migration line is the team’s estimate, marked as an assumption. No quote, invoice or measurement stands behind it, and nothing in the model checks it. The break-even says how wrong it can be before the ordering flips. Nothing here says how wrong it is.

Anything about performance. Both quotes share one CPU time per request, because it is the same software on different hosts. A quote for a different platform would carry a different service demand, and that number is a rig measurement (ch03) which no vendor’s benchmark replaces. The host-count break-even is the hedge. It says how much slower than the spec sheet the challenger’s hosts could be before the comparison reverses, and on this pair the answer is not much.

What the structure omits. Both totals come from one model, so a line neither quote has is a line neither total has (ch20). Rack space, the second environment, the cost of running both platforms during the move, the exit cost at the end of the horizon and the price at renewal are in neither column. A missing line favours whichever side it would have hurt, and the comparison cannot say which side that is.

Whether the futures are shared. They are here by construction, because both designs are scenarios of one model. Two quotes built as two models and joined by figures in documents lose that (ch18), and the interval on their difference comes back as wide as the independent one above.

Which side you are on. A comparison built by the party that wins it is still a comparison, and the checklist above is the same whoever built it. What the checklist cannot supply is one number: the share of futures in which the presenter’s own design loses. That share is how often the choice turns out wrong, which is the risk the buyer takes on. Only a model of both designs over shared futures produces it, so the presenter has to run one and show the result. A checklist held against a finished document cannot.

What keeping or replacing leaves out. Five costs are in neither total. Two bear on replacing: what the old hosts would fetch if sold lowers the cost, and moving the data off them raises it. Three would raise the cost of keeping: the purchase needed when the old hosts retire, the old hosts failing more often as they age, and network. The kept pool has more hosts in all than the all-new fleet, and each host needs a port.

Key takeaways

  • A comparison is about the lines that differ. What both designs pay alike drops out of the difference however large it is, so every line goes on both sides, with a declared zero where a quote has no such line.

  • Subtract futures, not intervals. The two totals share most of their uncertainty, so the difference taken future by future is far narrower than either total. Subtracting independent draws, or the ends of two intervals, says how the arithmetic was done and nothing about the decision.

  • A total is the price of a fleet that works. Two fleets that cope different amounts of the time are not the same purchase at two prices, so the comparison carries the ceilings as well as the money.

  • Find what would flip it. The break-evens say how far each line and each shared input can move before the ordering reverses. On this pair, each line on the challenger’s side ties within a few per cent of the figure the comparison uses. Growth and the people line move nothing: growth reaches neither total, and the people line is the same on both sides.

  • A comparison somebody else built arrives with one column already won. The checklist says what it has to show, and the item to check twice is whether both designs were sized by the same rule to the same margins.

Problems

Three, in tests/comparing_two_tcos/. The first two have tests. The last does not.

22.1 — Subtract futures, not intervals. The test evaluates both quotes on the same draws and hands you the two five-year totals, one entry per future. Subtract them sample by sample. Return the interval on the difference and the share of futures in which the challenger is cheaper. The test runs your function twice: once on every future, whose answer the paired table above prints, and once on a subset of the same futures, whose answer the page does not print. So a figure copied from the table does not pass.

When an answer is wrong, the test names the mistake:

tests/comparing_two_tcos/stubs.py · paired_differenceyours to edit
def paired_difference(incumbent: np.ndarray, challenger: np.ndarray) -> dict:
    """Problem 22.1 - subtract futures, not intervals.

    Two quotes for one workload, the incumbent's and the challenger's. Each has a five-year total
    with an interval on it, and the two intervals overlap. That is not the question. The question
    is what the *difference* between them looks like, future by future.

    The test evaluates both quotes on the same draws and hands you the two totals: ``incumbent``
    and ``challenger``, one five-year total per sampled future, in the same order on both sides.
    The i-th entry of one and the i-th entry of the other are the same future - the same draw of
    the electricity price, the same growth, the same salary - priced once for each design.

    Subtract the incumbent's total from the challenger's, sample by sample, and return a
    dictionary with exactly these keys:

    ``"p5"``, ``"p50"``, ``"p95"``   percentiles of the difference, challenger minus incumbent
    ``"share_challenger_cheaper"``   the fraction of futures in which the challenger costs less

    A negative difference is the challenger being cheaper.

    The test calls your function twice: on every future, and on a subset of the same futures,
    whose answer the chapter does not print. An interval much wider than it should be means two
    independent draws were subtracted - the electricity price from one future against the price
    from another - or the opposite ends of the two intervals. Both throw away the fact that both
    designs live in the same world. An interval narrower than it should be can mean one total's
    percentile minus the other's, each taken on its own. That is not a percentile of the
    difference. The test names each of these mistakes when it sees one, and it names a
    subtraction made the wrong way round.
    """
    raise NotImplementedError("problem 22.1")

The same check at a desk: python3 -m pytest tests/comparing_two_tcos/test_problem_1_paired_difference.py -m problem

22.2 — How expensive can the move be? The test hands you the difference between the two totals at the point estimate, as a function of the one-off cost of moving. Find the cost at which the difference is zero. The break-even table prints the tie for the fleet the incumbent runs. The test grades that fleet and two the page does not print, with a function for each. An answer that moves when the fleet does cannot have been copied off the page. The total is linear in the cost of the move, so two evaluations fix the line.

tests/comparing_two_tcos/stubs.py · break_even_migrationyours to edit
def break_even_migration(difference_at: Callable[[float], float]) -> float:
    """Problem 22.2 - how expensive can the move be before the challenger stops being cheaper?

    At the point estimate the challenger's quote is cheaper than the incumbent's before the cost
    of moving is counted. The move is the ``migration_cost`` input, which the incumbent holds at
    zero and the challenger's scenario overrides with the team's own estimate.

    ``difference_at(migration)`` is the model's own point evaluation. Hand it a one-off cost of
    moving and it returns the challenger's five-year total minus the incumbent's at the point
    estimate, with the incumbent on the fleet the test is grading and everything else as the two
    scenarios hold it. Return the cost of moving at which that difference is zero, to within a
    dollar: the cost at which the two five-year totals are equal.

    The fleet is the test's to choose because the chapter prints the tie for the fleet the
    incumbent runs. The test builds one ``difference_at`` for that fleet and two for fleets the
    page does not print, and an answer that moves when the fleet does cannot have been copied off
    the page.

    The total is linear in the cost of the move, so two evaluations determine the line. Bisection
    works too, and is the method to reach for when the next break-even is not linear.
    """
    raise NotImplementedError("problem 22.2")

The same check at a desk: python3 -m pytest tests/comparing_two_tcos/test_problem_2_break_even.py -m problem

22.3 — A comparison somebody showed you. No test: the comparison is theirs, and nothing here has seen it.

Take a comparison that was put in front of you, by a vendor or by a colleague, and hold it against the checklist above. Write down which items it has and which it lacks. Then repair the one that matters most and see what it does to the ordering: put the missing line on the side that lacked it, size both designs by the same rule, or hold the people line equal.

A good answer names the items the comparison failed, says which repair you judged to matter most and why, and says what the difference did once that repair was made. That judgement is falsified if a repair you ranked lower moves the difference more than the one you chose, or flips the ordering when yours did not. You find out by making the next repair too. A comparison that passes every item, or whose ordering survives every repair, is a sound comparison. The answer should say so. If the ordering flipped on the first repair, you have found what the comparison was for.

Where to go next

Kahn and Marshall [Kahn & Marshall (1953)] set out the trick this chapter rests on, in the paper that first treated Monte Carlo as a problem in experimental design: sample two things you mean to compare on the same draws, so that what they share cancels. Wright and Ramsay [Wright & Ramsay (1979)] show when it fails. The shared draws have to reach both designs the same way, and a design that responds to a draw in the opposite direction gets a wider difference, not a narrower one.

ch23 builds a comparison from the other side, as a seller who cannot see the customer’s workload, and finds the transfer assumption that ch22’s own comparison made without naming it.

ch24 is what happens after one of the two quotes is chosen, and the future that arrives is one of the ones in which it was the wrong choice.

By Chris Snow, in collaboration with Claude (Anthropic) · Prose and figures: CC BY-NC 4.0 · Code and models: Apache 2.0