{"id":"sample-summary-check","version":"1.0.0","description":"Check claimed count, sum, mean, median, range, variance or SD of an exact sample; returns the first mismatching field.","supported_operations":["check claimed sample mean and variance","verify descriptive statistics claim","validate reported standard deviation against data","did the agent compute the median correctly","check sample vs population variance claim","audit summary statistics of a list of numbers","confirm sum min max range of a sample"],"unsupported_operations":["computing statistics without a claim (use a statistics compute tool)","weighted, trimmed or grouped-data statistics","skewness, kurtosis or mode","floating-point tolerance comparisons other than half-even rounding to the claimed digits"],"semantics":["Reference: NIST/SEMATECH e-Handbook of Statistical Methods (2012) 1.3.5.1 (mean, median) and 1.3.5.6 (variance, standard deviation, range); reference_version is returned with every result.","sample: 1-10000 items, each a JSON safe integer or an ASCII decimal string (no exponent or plus sign, <= 30 fractional digits, <= 40 characters); non-integer JSON numbers are rejected.","Exact rationals: mean = sum/n; median = middle order statistic or the mean of the two middle ones; range = max - min; sum_squared_deviations = sum (x - mean)^2; variance = that / (n-1) or / n; standard_deviation = sqrt(variance).","variance_denominator (\"n-1\" or \"n\") is required when variance or standard_deviation is claimed, otherwise optional and unused; \"n-1\" with n = 1 gives valid false, reason statistic_undefined.","Claims are integers, decimals or p/q fractions compared by exact value; count is a non-negative JSON integer.","match (omitted = \"exact\"): \"round_half_even_to_claim_digits\" rounds the true value half-to-even to each decimal claim's written digits; fraction claims and count stay exact.","standard_deviation: exact mode needs a rational sqrt equal to the claim; rounding mode compares the correctly rounded integer-square-root result. Irrational sqrt gives actual null and actual_rounded at the claim digits (30 for a fraction claim).","Fixed comparison order count, sum, min, max, range, mean, median, sum_squared_deviations, variance, standard_deviation; the first mismatch is returned as {field, claimed, actual, actual_rounded} with reason <field>_mismatch.","actual is canonical: integer, terminating decimal without trailing zeros, or reduced p/q."],"limits":{"max_sample_items":10000,"max_value_chars":40,"max_fraction_digits":30},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["sample","claim"],"properties":{"sample":{"type":"array","minItems":1,"maxItems":10000,"items":{"anyOf":[{"type":"integer"},{"type":"string","minLength":1,"maxLength":40,"pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$"}]}},"claim":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"count":{"type":"integer","minimum":0},"sum":{"anyOf":[{"type":"integer"},{"type":"string","minLength":1,"maxLength":40,"pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+|/[1-9][0-9]*)?$"}]},"min":{"anyOf":[{"type":"integer"},{"type":"string","minLength":1,"maxLength":40,"pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+|/[1-9][0-9]*)?$"}]},"max":{"anyOf":[{"type":"integer"},{"type":"string","minLength":1,"maxLength":40,"pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+|/[1-9][0-9]*)?$"}]},"range":{"anyOf":[{"type":"integer"},{"type":"string","minLength":1,"maxLength":40,"pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+|/[1-9][0-9]*)?$"}]},"mean":{"anyOf":[{"type":"integer"},{"type":"string","minLength":1,"maxLength":40,"pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+|/[1-9][0-9]*)?$"}]},"median":{"anyOf":[{"type":"integer"},{"type":"string","minLength":1,"maxLength":40,"pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+|/[1-9][0-9]*)?$"}]},"sum_squared_deviations":{"anyOf":[{"type":"integer"},{"type":"string","minLength":1,"maxLength":40,"pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+|/[1-9][0-9]*)?$"}]},"variance":{"anyOf":[{"type":"integer"},{"type":"string","minLength":1,"maxLength":40,"pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+|/[1-9][0-9]*)?$"}]},"standard_deviation":{"anyOf":[{"type":"integer"},{"type":"string","minLength":1,"maxLength":40,"pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+|/[1-9][0-9]*)?$"}]}}},"variance_denominator":{"type":"string","enum":["n-1","n"]},"match":{"type":"string","enum":["exact","round_half_even_to_claim_digits"]}}},"output_schema":{"type":"object","additionalProperties":false,"required":["valid","reason","first_discrepancy","checked_fields","reference_version"],"properties":{"valid":{"type":"boolean"},"reason":{"type":["string","null"],"enum":[null,"count_mismatch","sum_mismatch","min_mismatch","max_mismatch","range_mismatch","mean_mismatch","median_mismatch","sum_squared_deviations_mismatch","variance_mismatch","standard_deviation_mismatch","statistic_undefined"]},"first_discrepancy":{"type":["object","null"],"additionalProperties":false,"required":["field","claimed","actual","actual_rounded"],"properties":{"field":{"type":"string","enum":["count","sum","min","max","range","mean","median","sum_squared_deviations","variance","standard_deviation"]},"claimed":{"type":"string"},"actual":{"type":["string","null"]},"actual_rounded":{"type":["string","null"]}}},"checked_fields":{"type":"array","maxItems":10,"items":{"type":"string","enum":["count","sum","min","max","range","mean","median","sum_squared_deviations","variance","standard_deviation"]}},"reference_version":{"type":"string"}}},"examples":[{"input":{"sample":[2,4,4,4,5,5,7,9],"variance_denominator":"n","claim":{"mean":"5","variance":"4","standard_deviation":"2"}},"output":{"valid":true,"reason":null,"first_discrepancy":null,"checked_fields":["mean","variance","standard_deviation"],"reference_version":"NIST/SEMATECH e-Handbook of Statistical Methods (2012) 1.3.5.1 + 1.3.5.6; r60-sample-statistic-verifiers@1.0.0"}},{"input":{"sample":[2,4,4,4,5,5,7,9],"variance_denominator":"n-1","claim":{"variance":"4"}},"output":{"valid":false,"reason":"variance_mismatch","first_discrepancy":{"field":"variance","claimed":"4","actual":"32/7","actual_rounded":null},"checked_fields":["variance"],"reference_version":"NIST/SEMATECH e-Handbook of Statistical Methods (2012) 1.3.5.1 + 1.3.5.6; r60-sample-statistic-verifiers@1.0.0"}},{"input":{"sample":["727.7","1086.5","1091.0","1361.3","1490.5","1956.1"],"variance_denominator":"n-1","match":"round_half_even_to_claim_digits","claim":{"mean":"1285.5","standard_deviation":"420.96"}},"output":{"valid":true,"reason":null,"first_discrepancy":null,"checked_fields":["mean","standard_deviation"],"reference_version":"NIST/SEMATECH e-Handbook of Statistical Methods (2012) 1.3.5.1 + 1.3.5.6; r60-sample-statistic-verifiers@1.0.0"}}],"execute_url":"/v1/tools/sample-summary-check/versions/1.0.0/execute"}