{
  "schemaVersion": 1,
  "slug": "party-drink-calculator",
  "category": "party",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "dd9e7b382e503088fa4671404ccda4af7ef04b828a4bbed47599f5b7c207f7b4",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/party-drink-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "N = G (1 + 0.9 max(0, H − 1)) + 0.6 C H; cans = ceil(N s1); water = ceil(N s2); V_j = 0.35 N s3 L",
    "vars": [
      [
        "G",
        "Adult guests"
      ],
      [
        "C",
        "Children"
      ],
      [
        "H",
        "Party duration (hours)"
      ],
      [
        "N",
        "Total drink units"
      ],
      [
        "s1,s2,s3",
        "Soda/water/juice shares by mix"
      ],
      [
        "V_j",
        "Juice volume (L)"
      ]
    ],
    "note": "Adult drinks = G × (1 + 0.9 max(0,H−1)); child drinks = 0.6 × C × H. Per-person average divides by G + C."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-12",
    "sources": [
      {
        "name": "NIAAA — Standard drink amounts",
        "url": "https://www.niaaa.nih.gov/alcohols-effects-health/overview-alcohol-consumption/what-standard-drink"
      }
    ],
    "referenceRole": "context",
    "implementationHash": "dd9e7b382e503088fa4671404ccda4af7ef04b828a4bbed47599f5b7c207f7b4",
    "basis": "N = G (1 + 0.9 max(0, H − 1)) + 0.6 C H; cans = ceil(N s1); water = ceil(N s2); V_j = 0.35 N s3 L",
    "limitations": "The references provide context and limitations. They do not validate this page’s illustrative multipliers, lookup values or predictions."
  },
  "contract": {
    "compute": "const perGuest = 1 + Math.max(0, hours - 1)*0.9; const total = guests*perGuest + children*hours*0.6; const sodaShare = mix === 'soda' ? 0.6 : mix === 'water' ? 0.15 : mix === 'juice' ? 0.2 : 0.35; const waterShare = mix === 'water' ? 0.6 : 0.25; const juiceShare = mix === 'juice' ? 0.5 : 0.15; const cans = total*sodaShare; const water = total*waterShare; return { totalDrinks: Math.ceil(total), sodaCans: Math.ceil(cans), waterBottles: Math.ceil(water), juiceLiters: total*juiceShare*0.35, iceLb: guests*0.75 + children*0.25, cups: Math.ceil(total*1.2), drinksPerGuest: (guests+children) > 0 ? total/(guests+children) : 0 };",
    "inputs": [
      {
        "name": "guests",
        "type": "number",
        "default": 30,
        "min": 1,
        "max": 1000,
        "step": 1,
        "slider": true
      },
      {
        "name": "hours",
        "type": "number",
        "default": 4,
        "min": 0.5,
        "max": 16,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "children",
        "type": "number",
        "default": 5,
        "min": 0,
        "max": 500,
        "step": 1,
        "slider": true
      },
      {
        "name": "mix",
        "type": "select",
        "default": "mixed",
        "options": [
          {
            "value": "mixed"
          },
          {
            "value": "soda"
          },
          {
            "value": "water"
          },
          {
            "value": "juice"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "totalDrinks",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "sodaCans",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "waterBottles",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "juiceLiters",
        "precision": 1,
        "unit": "l"
      },
      {
        "name": "iceLb",
        "precision": 1,
        "unit": "lb"
      },
      {
        "name": "cups",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "drinksPerGuest",
        "precision": 1,
        "unit": ""
      }
    ],
    "interpret": null
  }
}
