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.
"""Pine-River synthetic bargaining laboratory. No real offer or agreement."""
from fractions import Fraction as F
import json
checks={}
def check(n,a,b):
assert a==b,(n,a,b)
checks[n]=str(a)
check('comparable buyer alternative',12000+400+300,12700)
check('corrected transition boundary',12000+300,12300)
check('supplier base minimum',8000+1200,9200)
check('base range width',12700-9200,3500)
check('buyer advantage at11000',12700-11000,1700)
check('supplier advantage at11000',11000-9200,1800)
check('midpoint',F(12700+9200,2),10950)
check('equal modeled shares',10950-9200,1750)
check('improved alternative width',11600-9200,2400)
check('changed buyer advantage',11600-11000,600)
assert 13000>12700
check('no-overlap gap',13000-12700,300)
check('incompatible midpoint',F(13000+12700,2),12850)
assert 12850>12700 and 12850<13000
check('flexibility supplier minimum',9200-600,8600)
check('flexibility buyer maximum',12700-200,12500)
check('flexibility width',12500-8600,3900)
check('payment-only width',(12700-120)-(9200-300),3680)
check('combined supplier minimum',9200-600-300,8300)
check('combined buyer maximum',12700-200-120,12380)
check('combined width',12380-8300,4080)
check('created value',4080-3500,580)
check('combined buyer advantage',12380-10500,1880)
check('combined supplier advantage',10500-8300,2200)
check('overlap-corrected floor',8300+100,8400)
check('overlap-corrected width',12380-8400,3980)
check('expected credit',F(1,4)*1000,250)
check('expected underlying late loss',F(1,4)*2000,500)
check('expected buyer cost',10000+500-250,10250)
check('expected supplier receipt',10000-250,9750)
check('anchor discount',15000-13000,2000)
check('worse than base alternative',13000-12700,300)
check('coordination inclusive floor',9200+400,9600)
check('coordination width',12700-9600,3100)
check('supplier net receipt at11000',11000-400,10600)
check('supplier advantage after fee',10600-9200,1400)
check('coordinated joint advantage',1700+1400,3100)
check('shared resource demand',12+6,18)
check('shared resource shortfall',18-16,2)
check('first installment',10500*F(2,5),4200)
check('second installment',10500*F(3,5),6300)
check('installment reconciliation',4200+6300,10500)
print(json.dumps(dict(passed=True,checks=checks,limits='All figures are stipulated and scenario-specific. Arithmetic establishes no actual preference, feasible alternative, authority, fairness, risk reduction, contract formation, enforceability or professional competence. Independent subject review and observed learner testing remain pending.'),indent=2))
Related chapters
- Prepare a credible alternative and a bounded negotiating mandate
- Identify the bargaining range without mistaking a model for knowledge
- Create value across issues and expose what merely transfers risk
- Respond to pressure with a better decision process
- Negotiate across real dependencies and represented interests
- Translate a proposed agreement into an implementable review plan
- Negotiation clinic: defend the alternative, package and implementation