Skip to content

Add exact-first stats/probability helper surface #4

Description

@sacchen

Add a focused stats/probability toolkit that matches phil's terminal-first, exact-by-default philosophy.

Scope Boundary

This issue is for stats and probability only.

Goal

Provide practical stats/probability helpers with explicit assumptions and stable scriptable output.

Proposed Scope

First wave

  • Counting/combinatorics helpers: nCr, nPr aliases.
  • Descriptive stats: mean, variance, stddev with explicit sample/population semantics.
  • Binomial helpers (PMF/CDF) and z-score utility.

Follow-up

  • Poisson and normal helper utilities.
  • Core inference helpers (confidence intervals and basic test utilities).

Product Constraints

  • Exact results where feasible.
  • Explicitly signal numeric approximation when exact form is not retained.
  • Keep one-shot and REPL output behavior aligned.
  • Keep JSON output stable and deterministic.

Acceptance Criteria

  • First-wave helper set is implemented and documented with examples.
  • Ambiguous semantics are avoided (sample vs population must be explicit).
  • Unit/integration/regression tests cover core workflows and error hints.

Non-Goals

  • Full statistical package parity.
  • Auto-inference with implicit assumptions.

Test Gate

  • uv run --group dev pytest
  • uv run --group dev pytest --cov=calc --cov-report=term-missing --cov-fail-under=90

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions