Source: https://guthlabs.ai/docs/instruments/markov-chain-simulator/implementation/

instrument implementation / implementation-contract

# Markov Chain Simulator implementation

A source-bound implementation contract for Markov Chain Simulator; deployment and executable qualification remain separate.

Status: **VERIFIED_WITH_ERRATA**Lifecycle: **implementation-contract**

## Binding contract

This record describes what an executable surface must bind and validate. It does not claim that a public calculator, package, or production route is deployed.

**Record owner**: Guth Instruments

**Lifecycle**: verified-with-binding-errata

**Evidence ID**: t8-037

**Effect**: Computation or source lookup only

## Input and validation requirements

The undefined-result vector exposes a singular stationary solve that must be rejected or reported as non-unique. The convention probe also shows that an unspecified row-versus-column convention can produce an invalid distribution summing to 1.1 if the displayed matrix is used with the wrong multiplication orientation.

## Required corrections

````
[
  {
    "vector": 2,
    "field": "state_distribution_at_n",
    "wrong": "[1,0,0]",
    "correct": "[0,1,0]",
    "cause": "for the cyclic permutation matrix P=[[0,1,0],[0,0,1],[1,0,0]], her own working asserts '[1,0,0]·P=[1,0,0]', but row 0 of P is [0,1,0] so [1,0,0]·P=[0,1,0] — a basic matrix-vector-product error, confirmed by direct recomputation of P^4 applied to the initial distribution"
  }
]
````

## Inspectable interface fixture

The sample below is evidence for interface and validation tests, not a production implementation.

````
{
  "inputs": {
    "transition_matrix": [
      [
        0.8,
        0.2
      ],
      [
        0.3,
        0.7
      ]
    ],
    "initial_state_distribution": [
      1,
      0
    ],
    "n": 3
  },
  "expected_outputs": {
    "steady_state": [
      {
        "exact": "3/5"
      },
      {
        "exact": "2/5"
      }
    ],
    "state_distribution_at_n": [
      {
        "exact": "13/20"
      },
      {
        "exact": "7/20"
      }
    ]
  },
  "reference_data": {
    "chain_type": "irreducible and aperiodic",
    "row_convention": "mu_next=mu P"
  },
  "working": "Let π=[a,b]. From πP=π: a=0.8a+0.3b, so 0.2a=0.3b and a:b=3:2. Therefore π=[3/5,2/5]. Compute P^2=[[0.8*0.8+0.2*0.3, 0.8*0.2+0.2*0.7],[0.3*0.8+0.7*0.3, 0.3*0.2+0.7*0.7]]=[[0.70,0.30],[0.45,0.55]]. Then P^3 first row is [0.70*0.8+0.30*0.3, 0.70*0.2+0.30*0.7]=[0.65,0.35]=[13/20,7/20]. Since the initial distribution is [1,0], [1,0]P^3 is the first row of P^3."
}
````

## Other records

[01**Overview**](<https://guthlabs.ai/docs/instruments/markov-chain-simulator/>)[02**Mechanism**](<https://guthlabs.ai/docs/instruments/markov-chain-simulator/mechanism/>)[04**Qualification**](<https://guthlabs.ai/docs/instruments/markov-chain-simulator/qualification/>)

## Sources and evidence

These pointers bind the page to evidence. They do not grant authority or collapse verification into deployment.

- `VERIFIED_LEDGER.json`

- `evidence-tranche8/tranche8-results.json`

- `tranche errata record`
