{
  "schemaVersion": 1,
  "slug": "bandwidth-calculator",
  "category": "productivity",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "2b18fdf95fc341135cd58277d2735f18bf087d3094660193af259b98475f6130",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/bandwidth-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": "P = 2n + Σ aⱼ xⱼ; R = ⌈1.4 P ÷ 25⌉ × 25",
    "vars": [
      [
        "n",
        "People"
      ],
      [
        "xⱼ",
        "Count of each activity"
      ],
      [
        "aⱼ",
        "Activity weights: 25/5/4/50/0.5/15"
      ],
      [
        "P",
        "Peak demand, Mbps"
      ],
      [
        "R",
        "Recommended speed, Mbps"
      ]
    ],
    "note": "Weights: 4K 25, HD 5, gaming 4, downloads 50, smart devices 0.5, work-from-home 15; R rounds up to 25-Mbps tiers with 40% headroom."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const peakDemand = streaming4k*25+streamingHd*5+gaming*4+downloads*50+smartDevices*0.5+workFromHome*15+people*2; const recommended = Math.ceil(peakDemand*1.4/25)*25; return { peakDemand, recommended, perPerson: peakDemand/people, uploadNeeded: Math.ceil((workFromHome*10+gaming*3+streaming4k*5)/5)*5, note: 'Buffering is usually a peak-hour or Wi-Fi problem rather than a raw speed problem — check router placement before upgrading the plan' };",
    "inputs": [
      {
        "name": "people",
        "type": "number",
        "default": 4,
        "min": 1,
        "max": 200,
        "step": 1,
        "slider": true
      },
      {
        "name": "streaming4k",
        "type": "number",
        "default": 1,
        "min": 0,
        "max": 50,
        "step": 1,
        "slider": true
      },
      {
        "name": "streamingHd",
        "type": "number",
        "default": 2,
        "min": 0,
        "max": 100,
        "step": 1,
        "slider": true
      },
      {
        "name": "gaming",
        "type": "number",
        "default": 2,
        "min": 0,
        "max": 100,
        "step": 1,
        "slider": true
      },
      {
        "name": "downloads",
        "type": "number",
        "default": 1,
        "min": 0,
        "max": 50,
        "step": 1,
        "slider": true
      },
      {
        "name": "smartDevices",
        "type": "number",
        "default": 15,
        "min": 0,
        "max": 500,
        "step": 1,
        "slider": true
      },
      {
        "name": "workFromHome",
        "type": "number",
        "default": 1,
        "min": 0,
        "max": 100,
        "step": 1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "peakDemand",
        "precision": 1,
        "unit": "Mbps"
      },
      {
        "name": "recommended",
        "precision": 0,
        "unit": "Mbps"
      },
      {
        "name": "perPerson",
        "precision": 1,
        "unit": "Mbps"
      },
      {
        "name": "uploadNeeded",
        "precision": 0,
        "unit": "Mbps"
      },
      {
        "name": "note",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
