Back to trackLesson 7 of 25

Startup Runway 2: Low Point and Ruin

Uses Only Free-Tier SpiceGrinder

Problem statement

Last lesson’s founder has $120k and an uncertain monthly cash flow with a mean of -$8k and a standard deviation of $12k. The balance after twelve months averages $24k, which sounds comfortable. But a founder whose account hits zero in August has a problem even if a good autumn lifts it back by December: payroll bounced, the bank called, the investors were told. The end balance doesn’t see any of that.

So the question changes. Not “where does the cash stand at month 12?” but “how low does it go during the year, and how often does it go below zero?” And if it does, in which month does that first happen?

The model

The first three nodes are lesson 2.1’s: NetFlow draws a month, Year gathers twelve of them into a row, Balance turns them into twelve running balances. Two more nodes add two columns about the year as a whole:

  • LowPoint is a Calculate and writes the lowest of the twelve balances into column 12: y[12] = min(min(min(... with min nested to cover all twelve, since min takes two numbers at a time. Its dimension="14" makes the output two columns wider than the twelve balances it receives, which is the room for the new columns 12 and 13. The twelve balances pass through unchanged, and column 13 is 0 until the next node writes into it;
  • Ruin is a Calculate and writes into column 13 a 1 if the lowest balance is below zero and a 0 if not: y[13] = x[12] < 0.

A comparison in Calculate gives 1 when it is true and 0 when it is false, so the flag is just the comparison of the low point with zero, with no further arithmetic. (In the XML file the < is written &lt;, as any attribute value requires.)

<dataset columns="balanceM1, balanceM2, balanceM3, balanceM4, balanceM5, balanceM6, balanceM7, balanceM8, balanceM9, balanceM10, balanceM11, balanceM12, lowPoint, ruin" seed="42">
  <root node="Ruin"/>
  <nodes>
    <Normal name="NetFlow" mean="-8" sigma="12"/>
    <Redimension name="Year" dimension="12">
      <input name="NetFlow"/>
    </Redimension>
    <Calculate name="Balance" expression="y[0] = 120 + x[0]; y[1] = 120 + x[0] + x[1]; ...; y[11] = 120 + x[0] + x[1] + ... + x[11]">
      <input name="Year"/>
    </Calculate>
    <Calculate name="LowPoint" dimension="14" expression="y[12] = min(min(min(min(x[0], x[1]), min(x[2], x[3])), min(min(x[4], x[5]), min(x[6], x[7]))), min(min(x[8], x[9]), min(x[10], x[11])))">
      <input name="Balance"/>
    </Calculate>
    <Calculate name="Ruin" expression="y[13] = x[12] &lt; 0">
      <input name="LowPoint"/>
    </Calculate>
  </nodes>
</dataset>

The dots stand for the terms left out here; the file samples/simulation/cash-runway.xml has them all. The output has fourteen columns: 0 to 11 are the balances after month 1 to 12, column 12 is the lowest balance of the year and column 13 is the ruin flag.

grind --count 1000000 cash-runway.xml

The first ten rows, with the model’s own seed, 42 (you get exactly these values if you leave the seed alone). Only three columns are shown: the balance after month 12, the low point and the ruin flag:

RowMonth 12Low pointRuin
022.822.80
185.885.80
289.389.30
359.158.90
491.991.90
544.644.60
6-18.2-18.21
726.121.60
858.554.10
93.73.70

Most of these founders fall steadily, so the lowest point is the end of the year, and the two columns agree. Rows 3, 7 and 8 bounced: they were lower earlier than they finished. Row 6 is a ruined year, falling from $113.4k to -$18.2k with the last month the one that breaks zero.

The year’s lowest point

Two histograms over a million rows: the balance after month 12, centered near 24 thousand dollars, and the lowest balance of the year, shifted left to a median of 21 thousand dollars with a longer left tail; the part of the lowest balance below zero is colored red

Over the million rows (seed 42), the balance after month 12 averages $23.99k. The lowest balance of the year averages $20.25k (standard error 0.04), with a median of $21.0k, a standard deviation of $39.1k, and a 5th to 95th percentile range of -$45.4k to $83.6k. A quarter of founders have a low point below -$6.0k, and another quarter never dip below $47.5k.

The two histograms are close, but not equal. The low point can’t be higher than the end balance, so the filled bars sit a little to the left, with a longer tail on that side. What matters most is the zero line. In these million rows 28.19% end below zero (281,858 rows; the normal curve from lesson 2.1 says 28.19%). 29.98% touch zero at some point, 299,760 rows, a standard error of 0.05 points. The difference, 1.79% of rows, are the founders who went below zero and were back above by month 12, like row 20 of this run: 112.2, 95.5, 91.6, 94.6, 88.0, 70.0, 54.5, 41.4, 19.5, 25.0, -5.6, 0.4.

The two figures are consistent with lesson 2.1, which measured 28.33% at month 12 and 30.10% at some month in 100,000 rows of seed 201. Three founders in ten touch zero in a year in which the average founder ends with a comfortable $24k. A founder who looks only at the average sees no reason to worry.

The first month below zero

When it goes wrong, when does that happen? Ruin says whether; the model can also say when. A variant of the model, samples/simulation/cash-runway-first-ruin.xml, changes only the last node, which now writes a second column:

<Calculate name="Ruin" dimension="15" expression="y[13] = x[12] &lt; 0; y[14] = if(x[0] &lt; 0, 1, if(x[1] &lt; 0, 2, if(x[2] &lt; 0, 3, ... if(x[11] &lt; 0, 12, 0)...)))">

dimension="15" makes the node’s output one column wider than its input, as dimension="14" did for LowPoint, so there is a column 14 to write to. if(c, a, b) gives a when c is true (not zero) and b otherwise, so the nest reads from the left: if the balance after month 1 is below zero the answer is 1; otherwise, if the balance after month 2 is below zero it is 2; and so on to 12; and if none is, 0. An if is only reached when every earlier month was at or above zero, so the month it reports is the first one below zero. The file has the whole nest, and it is still six nodes.

Everything else is unchanged: with the same seed, columns 0 to 13 of the variant are, byte for byte, the output of cash-runway.xml, and the new column 14 (call it FirstRuinMonth) is the month, 1 to 12, or 0 if the year never goes below zero. The first rows of the variant have a 0 there; row 6, the ruined year above, has a 12.

Counting that column over the same million rows is a one-line job. For example:

grind --count 1000000 cash-runway-first-ruin.xml | awk -F, '{c[int($15)]++} END {for (k = 0; k <= 12; k++) print k, c[k] + 0}'

($15 is column 14, since the fields of a row are numbered from 1.) To check the model’s nested if independently, the lesson’s script finds the first month below zero another way, from the twelve balance columns of the plain model (here $k is the balance after month k): grind --count 1000000 cash-runway.xml | awk -F, '{for (k = 1; k <= 12; k++) if ($k < 0) {c[k]++; break}} END {for (k = 1; k <= 12; k++) print k, c[k] + 0}'. The two agree in every one of the 1,000,000 rows, not only in the counts.

Bars for the chance that the first month below zero is month 4 to 12, growing from nearly nothing to 7.5 percent at month 12, with open circles for the numerical theory and a rising red line for the cumulative chance of being ruined, which reaches 30 percent

The table below is the model’s own column 14. Nothing at all happens in the first three months (no row out of a million; you would need to lose $120k in a quarter, 4.6 standard deviations from the mean, and theory expects about two rows in a million). Ruin builds slowly and late:

First month below zeroRowsShare of all rowsTheoryCumulative
41160.012%0.012%0.01%
51,3610.136%0.133%0.15%
65,9350.594%0.589%0.74%
715,6461.565%1.544%2.31%
829,0812.908%2.920%5.21%
944,5954.460%4.451%9.67%
1058,5805.858%5.850%15.53%
1169,1456.914%6.917%22.45%
1275,3017.530%7.566%29.98%
never700,24070.02%

Read the last column as “the chance of being ruined by month t”. Among the ruined founders, the average month of first ruin is 10.1; a quarter of them first go below zero in month 12 itself, and only 2.5% do so before month 7. The runway is not a cliff in month 3; it is a cash balance that drifts toward zero and gets there, for the unlucky 30%, in the last quarter of the year.

The fan of paths shows the same thing path by path:

Two hundred gray and red paths of the monthly cash balance from 120 thousand dollars; the 57 paths that go below zero in at least one month are drawn in red, mostly in the lower half of the funnel, and the mean falls in a black line to 24 thousand

The first 200 rows of the run: 57 touch zero (red), 53 end the year below zero, and 4 dipped and recovered.

Check: do the numbers match the math?

Four checks.

The columns do what they say. Over all 1,000,000 rows, LowPoint equals the smallest of the twelve balance columns in every row (zero rows where it doesn’t), and Ruin is 1 exactly when LowPoint is below zero in every row (zero exceptions). It is worth checking an expression like this one rather than trusting it, since a nest of eleven min calls is easy to get wrong by a bracket.

The ruin probability against numerical theory. There is no simple formula for the chance that a random walk with drift is below a line at some step within twelve (the continuous-time formulas don’t apply, because the balance is checked once a month). But the question can be solved numerically: put the balance on a fine grid of $0.5k, move the probability one month at a time by the Normal(-8, 12) distribution of the flow, and drop it as ruined whenever a path ends the month below zero. That gives a chance of ruin of 29.98% (0.29982; a grid of $0.25k gives 0.29981). The simulation says 29.98% (0.29976, standard error 0.00046), 0.13 standard errors from theory. Month by month, the first-ruin shares in the table above are within 1.7 standard errors of the theory in every month.

The first month below zero, in the model and outside it. In the variant’s run, column 14 equals the first month found from the balances by separate code in every one of the 1,000,000 rows (zero disagreements), it is 0 in exactly the rows where Ruin is 0, and columns 0 to 13 are identical to the plain model’s. The model computes the quantity correctly, and the table is the one counted from it.

Lesson 2.1’s part is unchanged. The mean end balance is $23.99k against 24, and the share ending below zero is 28.19% against 28.19% from the normal curve. The two new nodes only read the balances, so they shouldn’t change them.

How much cash makes ruin rare?

The model gives us a way to ask a design question: how much should the founder start with so that the chance of running out within the year is only 10%? The balance is the starting cash plus the same sum of monthly flows, so the answer is a shift. Change the 120 in the Balance expression to a different start (the result is a copy of the sample, with nothing else changed) and rerun. Each run below is 1,000,000 rows with seed 42, so every start sees the same monthly flows and the only thing that differs is where the founder starts:

Start ($k)Ruin, measuredStandard errorRuin, theoryEnds below zero
8068.5%0.0568.5%65.0%
10049.0%0.0549.0%46.2%
12030.0%0.0530.0%28.2%
14015.4%0.0415.4%14.5%
1519.84%0.039.85%9.3%
1606.5%0.036.5%6.2%
2000.65%0.010.65%0.62%
2500.011%0.0010.011%0.01%

Ruin falls fast as the start rises: a start of $140k cuts it to half of the $120k figure, and $200k makes it rare (65 founders in 10,000). Solving the numerical theory for 10% gives a start of $150.7k. The runs agree: $151k gives 9.84% measured (standard error 0.03), 9.85% in theory; $150k gives 10.27% measured, 10.29% in theory. So about $151k. The founder needs 26% more cash than the $120k to cut the chance of running out from three in ten to one in ten. That is an extra $31k, about four months of average burn. For 5% it is about $165.5k, for 1% about $193k (theory).

The companion page lets you pick the starting cash and see the low-point histogram, the chance of ruin and the first-ruin month profile move with it, each from its own million-row run. The low-point histogram only slides sideways as the start changes, since these runs share their monthly flows; what changes is how much of it is left of zero.

What the model leaves out

The model looks at the balance once a month, at month end. Cash that dips below zero on the 20th and recovers by the 30th isn’t seen, so these numbers are a floor on the real risk. And each month is a fresh Normal draw, independent of the last; a real business has months that come in clusters. Both matter for the next lessons, not this one. LowPoint as written needs eleven nested min calls and works because there are exactly twelve columns; a longer horizon would want a running minimum, and Recur (lesson 3.1) can hold one.

What this gives you: the habit of asking about the extremes of a path, not just its end; a way to build “lowest value”, “did it ever cross a line” and “when did it first cross it” columns out of dimension, min, a comparison and if; and a way to read ruin from the whole output. Three founders in ten run out of cash within the year, against 28 in 100 who end it below zero; the chance of ruin comes down to 10% only when the start goes up to about $151k.

Everything so far gives each month the same Normal(-8, 12) draw. But the real risk to a founder often comes from the rare month that is much worse than the rest: a lost customer, a bad quarter, an unexpected bill. What if the monthly flow had the same mean and the same standard deviation, but fat tails, or a regular share of stress months? Would the chance of ruin stay at 30%? The next lesson changes only the shape of the monthly draw and finds out.