Lawfare Group → Knowledge Institute → Lawfare Academy
Reproduce the worked examples
Copy the complete code below into a UTF-8 file named verify.py and run python verify.py with Python 3. It uses only the standard library and performs exact or rational synthetic calculations. It does not access a network or learner records. Assertions fail if the expected synthetic results change.
These checks verify the stated arithmetic and query behavior, not independent academic acceptance or production migration safety.
"""Original synthetic venture laboratory, Python 3 standard library only.
Separate pilot, ramp, retention, capacity and financing files are not actual outcomes.
No network, production access, filing, transaction or learner-record operation.
"""
from fractions import Fraction as F
from math import ceil
import json
checks={}
def check(name,a,b):
assert a==b,(name,a,b)
checks[name]=str(a)
check('exposed-to-paid',F(6,20),F(3,10))
check('quoted-to-paid',F(6,8),F(3,4))
check('one-period observed renewal',F(4,6),F(2,3))
check('combined pilot cost per purchaser',F(900,6),150)
variable=80+20+10;contribution=200-variable
check('variable monthly cost',variable,110)
check('customer-month contribution',contribution,90)
check('fixed-cost break-even customers',ceil(F(1800,contribution)),20)
check('changed variable125 break-even',ceil(F(1800,200-125)),24)
active=[10,15,20,25];added=[10,5,5,5]
flows=[200*n-110*n-1800-60*a for n,a in zip(active,added)]
assert flows==[-1500,-750,-300,150]
cash=12000-6000;balances=[]
for flow in flows:cash+=flow;balances.append(cash)
assert balances==[4500,3750,3450,3600]
check('minimum ramp cash',min(balances),3450)
check('extra opening cash for floor4000',4000-min(balances),550)
assert next(i+1 for i,c in enumerate(balances) if c<4000)==2
assert min(c+550 for c in balances)==4000
check('constant burn native example months',F(60000,10000),6)
retention=F(9,10)
check('undiscounted geometric lifetime contribution',F(90,1)/(1-retention),900)
check('lifetime contribution less acquisition',900-60,840)
cohort=[20*retention**i for i in range(3)]
assert cohort==[20,18,F(81,5)]
check('expected three-month customer-periods',sum(cohort),F(271,5))
check('expected three-month cohort contribution',90*sum(cohort),4878)
check('cohort after acquisition before fixed',90*sum(cohort)-20*60,3678)
check('cohort after acquisition and three-month fixed',4878-1200-3*1800,-1722)
check('annual prepayment receipts20customers',20*12*200,48000)
check('annual variable service cost',20*12*110,26400)
check('annual fixed operating cost',12*1800,21600)
check('annual before acquisition and setup result',48000-26400-21600,0)
check('annual after acquisition and setup',48000-26400-21600-1200-6000,-7200)
check('technician simplified customer ceiling',F(80,2),40)
def founder(active,new):return F(1,5)*active+F(1,2)*new
check('founder20active10new hours',founder(20,10),9)
check('founder40active10new hours',founder(40,10),13)
check('max onboardings at40active',int((12-F(1,5)*40)/F(1,2)),8)
check('max onboardings after two extra hours',int((12-2-F(1,5)*40)/F(1,2)),4)
check('support ten-customer monthly increment',10*90-600,300)
check('support five-customer monthly increment',5*90-600,-150)
check('support whole-customer break-even',ceil(F(600,90)),7)
assert 6*90<600 and 7*90>=600
balance=6000;payments=[];interest=[]
for month in range(6):
i=F(1,100)*balance;interest.append(i);payments.append(1000+i);balance-=1000
assert payments==[1060,1050,1040,1030,1020,1010] and balance==0
check('equal-principal total interest',sum(interest),210)
check('equal-principal total repayment',sum(payments),6210)
check('month-four ramp surplus less isolated loan payment',150-payments[3],-880)
check('simple identical-rights investor fraction',F(30000,120000+30000),F(1,5))
check('existing holder retained fraction',1-F(1,5),F(4,5))
print(json.dumps(dict(passed=True,checks=checks,scope='Exact rational synthetic case calculations; no actual tax rate, legal classification, financing offer or market probability is asserted.'),indent=2))
Related chapters
- Investigate a customer problem before committing to the solution
- Design a paid pilot with a decision rule and an honest denominator
- Reconcile customer contribution, cohort retention and cash timing
- Separate the business model, Florida entity and federal tax classification
- Build repeatable work before growing the customer promise
- Compare funding and growth with the founder’s actual constraints
- Venture clinic: defend demand, delivery, cash and the next commitment