{
  "tool": "mcom-forensic-accounting--investigation.benford_first_digit",
  "name": "First-digit test (Benford) (CDU-BUS-FOR-900)",
  "answers": "Do the leading digits of these amounts conform to Benford’s law, and how far do they deviate?",
  "degree": {
    "id": "competency:mcom-forensic-accounting--investigation",
    "code": "CDU-BUS-FOR-900",
    "name": "MCom Forensic Accounting & Investigation",
    "version": "1.0.0"
  },
  "reference": "Nigrini (2012) Benford’s Law, ch. 5 (first-digit test, MAD conformity bands 0.006 / 0.012 / 0.015); amounts below 10 excluded",
  "endpoint": "/faculty/mcom-forensic-accounting--investigation/benford_first_digit",
  "feeSt": 1,
  "inputSchema": {
    "type": "object",
    "required": [
      "pan",
      "amounts"
    ],
    "properties": {
      "pan": {
        "type": "string",
        "description": "The student PAN — the degree must be held in one of its five slots",
        "pattern": "^[0-9 ]{16,19}$"
      },
      "amounts": {
        "type": "array",
        "description": "Transaction amounts; those below 10 are excluded, as the test prescribes",
        "items": {
          "type": "number"
        }
      }
    },
    "additionalProperties": false
  },
  "outputSchema": {
    "type": "object",
    "required": [
      "counted",
      "digitCounts",
      "mad",
      "chiSquare",
      "conformity"
    ],
    "properties": {
      "counted": {
        "type": "number",
        "description": "Amounts tested (≥ 10)"
      },
      "digitCounts": {
        "type": "array",
        "description": "Observed count of each first digit 1..9",
        "items": {
          "type": "number"
        }
      },
      "mad": {
        "type": "number",
        "description": "Mean absolute deviation from Benford"
      },
      "chiSquare": {
        "type": "number",
        "description": "Σ (O − E)² ÷ E over the nine digits (8 df)"
      },
      "conformity": {
        "type": "string",
        "description": "close, acceptable, marginal or nonconformity"
      }
    },
    "additionalProperties": false
  },
  "example": {
    "amounts": [
      1120,
      1380,
      1460,
      1975,
      1042,
      1210,
      1833,
      1598,
      1099,
      1305,
      1712,
      2150,
      2890,
      2431,
      2077,
      2666,
      3120,
      3490,
      3005,
      4210,
      4890,
      5120,
      5775,
      6340,
      7010,
      8450,
      9320,
      1188,
      1523,
      2260,
      3675,
      1407,
      2555,
      1066,
      4402,
      1960,
      2780,
      6150,
      1254,
      1839
    ]
  }
}